Quickly build Zookeeper+Mesos+Marathon in Docker environment

Hardware Environment: MAC 10.12.3

Mesos and Marathon will not be introduced here, if you want to know more, please go to http://mesos.apache.org/

Deployment steps:

1. Obtain Zookeeper, Mesos, and Marathon images. The commands are as follows:

docker pull garland/zookeeper

docker pull garland/mesosphere-docker-mesos-master

docker pull garland/mesosphere-docker-marathon

It is recommended to use Aliyun's mirror warehouse https://dev.aliyun.com/search.html , the download speed feels good

2. Set the service IP environment variable, the command is as follows:

export HOST_IP=xxx.xx.xx.xx (note here that 127.0.0.1 cannot be used as the IP address)

3. Start the zookeeper container with the following command:

docker run -d  -p 2181:2181  garland/zookeeper

4. Start the Mesos-Master container with the following command:

docker run --net=host \
--name mesos-master \
-e "MESOS_HOSTNAME=${HOST_IP}" \
-e "MESOS_IP=${HOST_IP}" \
-e "MESOS_ZK=zk://${HOST_IP}:2181/mesos" \
-e "MESOS_PORT=5050" \
-e "MONTHS_LOG_DIR = / var / log / months" \
-e "MESOS_QUORUM=1" \
-e "MESOS_REGISTRY=in_memory" \
-e "MONTHS_WORK_DIR = / var / lib / months" \
-d \
garland/mesosphere-docker-mesos-master

Note here: Do not use -P 5050:5050 for port mapping, because using the --net=host mode will cause the port to be occupied all the time

5. Start the Marathon container with the following command:

docker run -d \
-p 8080:8080 \
garland/mesosphere-docker-marathon --master zk://${HOST_IP}:2181/mesos \
--zk zk://${HOST_IP}:2181/marathon

6. Start the Mesos Slave container with the following command:

docker run -d \
--name mesos-slave \
--entrypoint="mesos-slave" \
-e "MESOS_MASTER=zk://${HOST_IP}:2181/mesos" \
-e "MONTHS_LOG_DIR = / var / log / months" \
-e "MESOS_LOGGING_LEVEL=INFO" \
garland/mesosphere-docker-mesos-master

7. Visit the Mesos page: http://${HOST_IP}:5050

If the address cannot be accessed, there may be the following reasons:

1. Maybe the msos-master container is not running, use docker ps to check whether the mesos-master container is running normally, use docker logs mesos-master to check the startup log, and see if the mesos-master starts successfully;

2. It may be that the forwarding function is not enabled for ipv4. The check method is as follows:

My computer is a mac, and the command is as follows: sysctl net.inet.ip.forwarding , if net.inet.ip.forwarding=1, it means forwarding is enabled, otherwise, use sysctl -w net.inet.ip.forwarding=1 to enable Forward

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939511&siteId=291194637