├── .mesos.json ├── README.md ├── launch.sh ├── nginx-bridge.json ├── redis-constraint.json ├── redis-unique.json ├── redis.json ├── simple-docker.json ├── simple.json └── tomcat-remote.json /.mesos.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": { 3 | "log_level": "warning", 4 | "log_file": null, 5 | "master": "10.67.63.236:5050" 6 | }, 7 | "profile": "default" 8 | } 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-mesos-marathon-screencast 2 | =============================== 3 | 4 | The scripts used in the [*Docker Clustering on Mesos with Marathon*](http://www.youtube.com/watch?v=hZNGST2vIds&feature=youtu.be) screencast. 5 | 6 | ## Getting Started 7 | 8 | If you are looking to duplicate the demos for yourself. The scripts are included in this repo. You will need: 9 | 10 | * Install [Mesos CLI](https://github.com/mesosphere/mesos-cli) 11 | * Update `launch.sh` with the IP address of your master 12 | * Update `.mesos.json` with the IP address of your master 13 | * curl installed 14 | 15 | ## Docker's Clustering Video 16 | 17 | * [https://www.youtube.com/watch?v=vtnSL79rZ6o](https://www.youtube.com/watch?v=vtnSL79rZ6o) 18 | 19 | ## Marathon Docs 20 | 21 | * [More on Docker](https://mesosphere.github.io/marathon/docs/native-docker.html) 22 | * [More on Constraints](https://mesosphere.github.io/marathon/docs/constraints.html) 23 | * [More on REST Endpoint](https://mesosphere.github.io/marathon/docs/rest-api.html) 24 | 25 | ## URLS 26 | 27 | * https://google.mesosphere.com/ 28 | * https://digitalocean.mesosphere.com/ 29 | * https://github.com/apache/mesos 30 | 31 | -------------------------------------------------------------------------------- /launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ne 1 ]; then 4 | echo "script takes json file as an argument" 5 | exit 1; 6 | fi 7 | 8 | curl -X POST -H "Content-Type: application/json" 10.74.209.40:8080/v2/apps -d@"$@" 9 | -------------------------------------------------------------------------------- /nginx-bridge.json: -------------------------------------------------------------------------------- 1 | { 2 | "container": { 3 | "type": "DOCKER", 4 | "docker": { 5 | "image": "nginx", 6 | "network": "BRIDGE", 7 | "portMappings": [ 8 | { "containerPort": 80, "hostPort": 0, "servicePort": 80, "protocol": "tcp" } 9 | ] 10 | } 11 | }, 12 | "id": "nginx", 13 | "instances": 1, 14 | "cpus": 0.25, 15 | "mem": 256, 16 | "uris": [] 17 | } 18 | 19 | -------------------------------------------------------------------------------- /redis-constraint.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "redis-constraint", 3 | "container": { 4 | "type": "DOCKER", 5 | "docker": { 6 | "image": "redis", 7 | "network": "BRIDGE" 8 | } 9 | }, 10 | "id": "redis", 11 | "instances": 1, 12 | "cpus": 0.25, 13 | "mem": 256, 14 | "uris": [], 15 | "constraints": [["rack", "CLUSTER", "rack-2"]] 16 | } 17 | -------------------------------------------------------------------------------- /redis-unique.json: -------------------------------------------------------------------------------- 1 | { 2 | "container": { 3 | "type": "DOCKER", 4 | "docker": { 5 | "image": "redis" 6 | } 7 | }, 8 | "id": "redis", 9 | "instances": 1, 10 | "cpus": 0.25, 11 | "mem": 256, 12 | "uris": [], 13 | "constraints": [["hostname", "UNIQUE"]] 14 | } 15 | -------------------------------------------------------------------------------- /redis.json: -------------------------------------------------------------------------------- 1 | { 2 | "container": { 3 | "type": "DOCKER", 4 | "docker": { 5 | "image": "redis" 6 | } 7 | }, 8 | "id": "redis", 9 | "instances": 1, 10 | "cpus": 0.25, 11 | "mem": 256, 12 | "uris": [] 13 | } 14 | -------------------------------------------------------------------------------- /simple-docker.json: -------------------------------------------------------------------------------- 1 | { 2 | "container": { 3 | "type": "DOCKER", 4 | "docker": { 5 | "image": "libmesos/ubuntu" 6 | } 7 | }, 8 | "id": "ubuntu", 9 | "instances": 1, 10 | "cpus": 0.25, 11 | "mem": 256, 12 | "uris": [], 13 | "cmd": "while sleep 10; do date -u +%T; done" 14 | } 15 | -------------------------------------------------------------------------------- /simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "simple", 3 | "cmd": "while sleep 10; do date -u +%T; done", 4 | "mem": 16, 5 | "cpus": 0.1, 6 | "instances": 1, 7 | "uris": [] 8 | } 9 | -------------------------------------------------------------------------------- /tomcat-remote.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "tomcat", 3 | "cmd": "mv *.war apache-tomcat-*/webapps && cd apache-tomcat-* && sed \"s/8080/$PORT/g\" < ./conf/server.xml > ./conf/server-mesos.xml && ./bin/catalina.sh run -config ./conf/server-mesos.xml", 4 | "mem": 512, 5 | "cpus": 0.5, 6 | "instances": 1, 7 | "uris": [ 8 | "http://www.gtlib.gatech.edu/pub/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz", 9 | "https://gwt-examples.googlecode.com/files/Calendar.war" 10 | ], 11 | "constraints": [["hostname", "UNIQUE"]] 12 | } 13 | --------------------------------------------------------------------------------