Upload
julia-mateo
View
311
Download
1
Embed Size (px)
Citation preview
DEPLOYING A DOCKERIZED DISTRIBUTED APPLICATION TO MESOS
Julia Mateo
DEPLOYING A DOCKERIZED DISTRIBUTED APPLICATION IN MESOS
Julia Mateo
1
Who am I
• Java developer and tech lead at Hortis GRC (Geneva, Switzerland)
• Team jDuchess Swiss
@juliamateodc@duchessswiss http://jduchess.ch/
2
Summary
• Mesos… what is it?
• Docker
• A Mesos framework : Marathon
• Deploying a distributed app in Mesos
• Service Discovery
• Load balancing
3
Mesos... what is it?
• Deployment system :
• Mesos : smart deployment system
• Ansible, Chef, Puppet… static configuration
• Mesos dynamically allocates resources depending on cluster load (or other external factors)
5
Mesos... what is it?
• Execution platform
• Hosting high level applications
• More flexibility :
• If one slave crashes, app is deployed in new instance (Marathon)
• HAProxy for load balancing
• Alternative to paying third party Paas solutions (Heroku, Azure, Openshift…)
6
Mesos... what is it?
• Abstraction of cluster resources
• Share resources across multiple frameworks (versions of the same framework)
• Resource fair sharing : alternative to static partitioning
• Data locality
7
ZKMaster Master
Executor
ExecutorSlaves
Executor Executor
Executor Executor
Executor Executor Executor
Mesos
8
http://mesos.apache.org/documentation/latest/mesos-architecture/
Mesos
9
From https://www.docker.com/whatisdocker/
• Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.
DOCKER
10
ServerHost OS
Hypervisor
GuestOS
Guest OS
Guest OS
Guest OS
Libs/ Libs/ Libs/
App 1 App 2 App 3 App 4
Libs/
ServerHost OS
Docker Engine
Libs/Bins Libs/
App 1 App 2 App 3 App 4c1 c2 c3 c4
VM1VM2VM3VM4
Docker
11
Docker Images Docker
Images
libcontainer, Union Filesystem
Centos Ubuntu
Jetty
add App.war
Container 1
OracleDB
Container 2
Read only
WritableWritable
Read only
Containers and images
12
• Marathon is a Mesos framework written in Scala
• Provides easy deployment of Docker containers
• Management of long running apps
• Rest API for developers
Marathon
13
ZKMaster Master
Executor
ExecutorSlaves
Executor Executor
Executor Executor
Executor Executor Executor
Mesos
14
ZKMaster Master
Executor
ExecutorSlaves
Executor Executor
Executor Executor
Executor Executor Executor
Mesos
Marathon
15
The infrastructure
Io
Europa
Ganymede
Callisto
JupiterMesos master
Mesos slave
Mesos slave
Mesos slave
Mesos slave
17
Service discovery with MesosDNS
https://github.com/mesosphere/mesos-dns
23
lb-marathon
• Tool for managing HAProxy
• It subscribes to Marathon’s event bus
• Updates the HAProxy configuration in real time
• Health checking
• SSL support
25
MesosDNS : Service discoveryDOES NOT IDENTIFY SERVICE PORTS :
NEED SRV LOOKUP
QUERY MIGHT BE CACHED
AND NOT CORRECTLY LOADED
NO HEALTH CHECKING
DOES NOT HAVE FAST FAILOVER
27
Alternative : lb-marathon for service discovery
cm-voting
cm-voting
lb-marathon
lb-marathon
Marathon
Mongolb-marathon
28
Feedback from developer perspective
• Quite young tools : lots of changes in a short time
• Service discovery and load balancing troubleshooting
30
Future<MESOS>
• Multitenant workloads : not enough isolation -> app performance affected (multiple apps running in the same machine)
• Support for databases (Cassandra, HDFS, Kafka…) Until now mesos -> computed oriented tasks. Disk management.
32