Skip to content

Instantly share code, notes, and snippets.

@justlaputa
Created December 8, 2015 10:37
Show Gist options
  • Save justlaputa/174e903e19c4755f053f to your computer and use it in GitHub Desktop.
Save justlaputa/174e903e19c4755f053f to your computer and use it in GitHub Desktop.
setup single node mesos cluster by using docker
#!/bin/bash
HOST_IP=`ip -4 addr show eno1 | grep inet | awk -F'[ /]' '{print $6}'`
docker run -d \
-p 2181:2181 \
-p 2888:2888 \
-p 3888:3888 \
garland/zookeeper
docker run --net="host" \
-p 5050:5050 \
-e "MESOS_HOSTNAME=${HOST_IP}" \
-e "MESOS_IP=${HOST_IP}" \
-e "MESOS_ZK=zk://${HOST_IP}:2181/mesos" \
-e "MESOS_PORT=5050" \
-e "MESOS_LOG_DIR=/var/log/mesos" \
-e "MESOS_QUORUM=1" \
-e "MESOS_REGISTRY=in_memory" \
-e "MESOS_WORK_DIR=/var/lib/mesos" \
-d \
garland/mesosphere-docker-mesos-master
docker run \
-d \
-p 8080:8080 \
garland/mesosphere-docker-marathon --master zk://${HOST_IP}:2181/mesos --zk zk://${HOST_IP}:2181/marathon
docker run -d \
--name mesos_slave_1 \
--entrypoint="mesos-slave" \
-e "MESOS_MASTER=zk://${HOST_IP}:2181/mesos" \
-e "MESOS_LOG_DIR=/var/log/mesos" \
-e "MESOS_LOGGING_LEVEL=INFO" \
garland/mesosphere-docker-mesos-master:latest
xdg-open "http://$HOST_IP:5050"
xdg-open "http://$HOST_IP:8080"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment