Deploy the Mesos cluster through the Docker

[Editor's Note] The Apache Mesos system is a set of resource management scheduling cluster system that can be used to manage the Docker cluster, another way. This article describes how to deploy a single node and multi-node Mesos cluster through the Docker container. The whole process is very simple, Only seven commands can be completed, the entire process of the author also recorded to the GitHub, recommended learning.

This article will teach you how to use the Docker container to deploy a single node Mesos cluster, the entire deployment process is very simple, only seven commands. Before deploying you need to prepare a Docker environment, this is very simple, I do not repeat. We need to start a total of four containers, namely:

  • ZooKeeper
  • Meso Master
  • Marathon
  • Mesos Slave Container

As mentioned above, we only need a Docker Server that can be run. You can get Docker from any way you like, such as installing Docker in your local Vagrant , using Boot2Docker , using CoreOS, or installing it in AWS. The whole deployment process I put on the GitHub , including all the container to build the Dockerfile file, you can local to build these images, or from the Docker Hub has been built to build a good mirror. What we are using is the mirror on the Docker Hub:

  • ZooKeeper
  • Meso Master
  • Marathon

Deployment steps

The first step: get Docker Server IP, and assigned to the HOST_IP variable, in the next step we will use.

  Root @ docker-server: / # HOST_IP = 

Step 2: Start the ZooKeeper container.

  Docker run -d \ 
-p 2181: 2181 \
-p 2888: 2888 \
-p 3888: 3888 \
Garland / zookeeper

Step 3: Start Mesos Master.

  Docker run --net = "host" \ 
-p 5050: 5050 \
-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

Step 4: Start Marathon.

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

Step 5: Start the 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" \
Garland / mesosphere-docker-mesos-master: latest

Step 6: Visit the Mesos page.
The Mesos Web page address is:

  Http: // $ {HOST_IP}: 5050 

Step 7: Start a job via Marathon's Web page. Marathon Web page address is: http: // $ {HOST_IP}: 8080.

Marathon allows you to deploy long-running jobs to the Mesos Slave container, which can help you to check if your cluster is up and running, and when you open the above address you will see the following page:
Click on the upper right corner of the "New App" button to create a new Job / Task, we just here to output a "hello" to the file "/tmp/output.txt" inside, and then we can go to the container to see whether the file is created, and Check that the job is not always running.

Step 8: Check Job / Task is not running Then let us check the Job / Task is not always run on the Mesos Slave.
Run the following command on the Docker Server, which will let you go to the Mesos Slave container and then use the tail command to view the contents of the /tmp/output.txt file.

  Docker exec -it mesos_slave_1 / bin / bash 
Root @ ca83bf0ea76a: / # tail -f /tmp/output.txt

You will see every second "hello" will be added to this file.

Note: Please refer to the multi-node Mesos environment deployment steps.

Source: Deploy a Mesos Cluster with 7 Commands Using Docker (translation: Zuo Wei proofreading: Li Yingjie)

    Heads up! This alert needs your attention, but it's not super important.