-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_mesos.sh
executable file
·30 lines (21 loc) · 2.94 KB
/
docker_mesos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
HOST_IP=$(host `hostname` | awk '{print $NF}')
# HOST_IP=10.0.2.15
# HOST_IP_1 = $(host mesos_master_1 | awk '{print $NF}')
# HOST_IP_2 = $(host mesos_master_2 | awk '{print $NF}')
# zookeeper
docker run -d --name zookeeper -p 2181:2181 -p 2888:2888 -p 3888:3888 garland/zookeeper:latest
#docker run -d --name zookeeper_1 --net="host" -e SERVER_ID=1 -e ADDITIONAL_ZOOKEEPER_1=server.1=${HOST_IP_1}:2888:3888 -e ADDITIONAL_ZOOKEEPER_2=server.2=${HOST_IP_2}:2888:3888 -p 2181:2181 -p 2888:2888 -p 3888:3888 garland/zookeeper:latest
#docker run -d --name zookeeper_2 --net="host" -e SERVER_ID=2 -e ADDITIONAL_ZOOKEEPER_1=server.1=${HOST_IP_1}:2888:3888 -e ADDITIONAL_ZOOKEEPER_2=server.2=${HOST_IP_2}:2888:3888 -p 2181:2181 -p 2888:2888 -p 3888:3888 garland/zookeeper:latest
# mesos master
# mesos: http://${HOST_IP}:5050
docker run -d --name mesos_master --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" garland/mesosphere-docker-mesos-master:latest
#docker run -d --name mesos_master --net="host" -p 5050:5050 -e "MESOS_HOSTNAME=${HOST_IP_1}" -e "MESOS_IP=${HOST_IP_1}" -e "MESOS_ZK=zk://${HOST_IP_1}:2181,${HOST_IP_2}: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" garland/mesosphere-docker-mesos-master:latest
#docker run -d --name mesos_master --net="host" -p 5050:5050 -e "MESOS_HOSTNAME=${HOST_IP_2}" -e "MESOS_IP=${HOST_IP_2}" -e "MESOS_ZK=zk://${HOST_IP_1}:2181,${HOST_IP_2}: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" garland/mesosphere-docker-mesos-master:latest
# marathon: http://${HOST_IP}:8080
docker run -d --name marathon -p 8080:8080 garland/mesosphere-docker-marathon:latest --master zk://${HOST_IP}:2181/mesos --zk zk://${HOST_IP}:2181/marathon
#docker run -d --name marathon -p 8080:8080 garland/mesosphere-docker-marathon:latest --master zk://${HOST_IP_1}:2181,${HOST_IP_2}:2181/mesos --zk zk://${HOST_IP_1}:2181,${HOST_IP_2}:2181/marathon
# mesos slave
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
#docker run -d --name mesos_slave_1 --entrypoint="mesos-slave" -e "MESOS_MASTER=zk://${HOST_IP_1}:2181,${HOST_IP_2}:2181/mesos" -e "MESOS_LOG_DIR=/var/log/mesos" -e "MESOS_LOGGING_LEVEL=INFO" garland/mesosphere-docker-mesos-master:latest
#docker run -d --name mesos_slave_2 --entrypoint="mesos-slave" -e "MESOS_MASTER=zk://${HOST_IP_1}:2181,${HOST_IP_2}:2181/mesos" -e "MESOS_LOG_DIR=/var/log/mesos" -e "MESOS_LOGGING_LEVEL=INFO" garland/mesosphere-docker-mesos-master:latest