integrating docker with mesos and marathon

17
Rishabh Chaudhary Integrating Docker with Mesos and Marathon

Upload: rishabh-chaudhary

Post on 23-Jan-2018

674 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: Integrating Docker with Mesos and Marathon

Rishabh Chaudhary

Integrating Docker with Mesos

and Marathon

Page 2: Integrating Docker with Mesos and Marathon

2

Introduction to Mesos

Distributed System's Kernel

Cluster Manager

Master-slave architecture

Page 3: Integrating Docker with Mesos and Marathon

3

Features of Mesos:

Scalability

Fault tolerance

Multi resource scheduling

GUI

Fine grained resource sharing

Supports docker containers

Page 4: Integrating Docker with Mesos and Marathon

4

Architecture

MASTER 3

SLAVE 1 SLAVE 2 SLAVE 3 SLAVE 4

MASTER 1 MASTER 2

ZOOKEEPER

Page 5: Integrating Docker with Mesos and Marathon

5

Introduction to Marathon

Application Scheduler

Cluster wide process supervisor

Scaling

Long running applications

Tolerant towards application failover

Page 6: Integrating Docker with Mesos and Marathon

6

How do they work together?

Page 7: Integrating Docker with Mesos and Marathon

7

Multi system environment:

Page 8: Integrating Docker with Mesos and Marathon

8

Marathon: Features

HA: how?

Run multiple instances

Automatic selection of leader

Requests to non-leader gets redirected to the leader

Run other frameworks through Marathon

REST API and GUI

Page 9: Integrating Docker with Mesos and Marathon

9

Architecture : Revised 1

MASTER 3

SLAVE 1 SLAVE 2 SLAVE 3 SLAVE 4

MASTER 1 MASTER 2

ZOOKEEPERMARATHON

SCHEDULER 2

Page 10: Integrating Docker with Mesos and Marathon

10

Architecture : Revised 2

MASTER 3

SLAVE 1 SLAVE 2 SLAVE 3 SLAVE 4

MASTER 1 MASTER 2

ZOOKEEPERMARATHON

SCHEDULER 1

MARATHON

SCHEDULER 2

Page 11: Integrating Docker with Mesos and Marathon

11

The list goes on..

Page 12: Integrating Docker with Mesos and Marathon

12

Docker with Mesos and Marathon

Mesos supports containers:

Mesos Containers

Docker Containers

Long Running Tasks on Marathon

JSON Scripts

Marathon’s REST API

Page 13: Integrating Docker with Mesos and Marathon

13

Points to note:

Not all tasks must be containerized

Non containerized tasks are also supported in Marathon

Tasks that should be run within a docker container must be configured to do so:

Use JSON scripts for task configuration

Use Marathon’s REST API to post the containerized application

Page 14: Integrating Docker with Mesos and Marathon

14

Sample JSON:

{

"container": {

"type": "DOCKER",

"docker": {

"image": "autoscale",

"network": "BRIDGE"

}

},

"id": "relay",

"instances": 1,

"cpus": 0.5,

"mem": 512,

"uris": []

}

Page 15: Integrating Docker with Mesos and Marathon

15

Sample JSON 2:{

"container": {

"type": "DOCKER",

"docker": {

"image": "loadcheck",

"network": "BRIDGE",

"portMappings": [

{ "containerPort":8080, "hostPort":0}

]

}

},

"env": {

"HOST_IP":"172.16.12.247:3306"

},

"id": "webapp",

"instances": 1,

"cpus": 0.5,

"mem": 512,

"cmd": "./bin/startup.sh && tail -f ./logs/catalina.out"

}

Page 16: Integrating Docker with Mesos and Marathon

16

Tomcat

Server 1

Tomcat

Server 2

Tomcat

Server N

Load

BalancerDatabaseClient

Deployment example:

Page 17: Integrating Docker with Mesos and Marathon

17

Questions?