>Original article, welcome to reprint. Reprint please indicate: reprint from IT people's story meeting Thank you!
>Original link address: Building the Mesos cluster environment of "advanced" docker (24)
This time, I will start to operate. First, I will install the MES. How to install the MES. Source code: https://github.com/limingios/msA-docker/mac
https://github.com/limingios/msA-docker/vagrant/Mesos
Official website
http://mesos.apache.org/ The installation itself is c++Yes, we need more c++Compile is OK, so installation is more troublesome, for installation trouble, the old fellow is the first choice. dockerhub Look inside. Do you have any docker Version.
We should use a separate master and a separate slave
Download mirroring
- Pull mirror image
server01 and server03
docker pull mesosphere/mesos-slave:1.7.0
server02
docker pull mesosphere/mesos-master:1.7.0
- hosts create zookeeper
zookeeper start
#!/bin/bash cur_dir=`pwd` docker stop zookeeper docker rm zookeeper docker run --name zookeeper --restart always -p 2181:2181 -d zookeeper:3.5
- server02 create mesos master
vi mesos.sh
#!/bin/bash docker run -d --net=host \ --hostname=192.168.66.102 \ -e MESOS_PORT=5050 \ -e MESOS_ZK=zk://192.168.100.139:2181/mesos \ -e MESOS_QUORUM=1 \ -e MESOS_REGISTRY=in_memory \ -e MESOS_LOG_DIR=/var/log/mesos \ -e MESOS_WORK_DIR=/var/tmp/mesos \ -v "$(pwd)/mesos/log/mesos:/var/log/mesos" \ -v "$(pwd)/mesos/tmp/mesos:/var/tmp/mesos" \ mesosphere/mesos-master:1.7.0 --no-hostname_lookup --ip=192.168.66.102
sh mesos.sh
The mesos master is already connected to the host zookeeper.
Test connection address: http://192.168.66.102:5050
Frames are not associated and are not currently displayed.
Show the slave below Agents
- server01
Creating a slave container
vi mesos-slave.sh
#!/bin/bash docker run -d --net=host --privileged \ --hostname=192.168.66.101 \ -e MESOS_PORT=5051 \ -e MESOS_MASTER=zk://192.168.100.139:2181/mesos \ -e MESOS_SWITCH_USER=0 \ -e MESOS_CONTAINERIZERS=docker,mesos \ -e MESOS_LOG_DIR=/var/log/mesos \ -e MESOS_WORK_DIR=/var/tmp/mesos \ -v "$(pwd)/mesos/log/mesos:/var/log/mesos" \ -v "$(pwd)/mesos/tmp/mesos:/var/tmp/mesos" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /sys:/sys \ -v /usr/bin/docker:/usr/local/bin/docker \ mesosphere/mesos-slave:1.7.0 --no-systemd_enable_support \ --no-hostname_lookup --ip=192.168.66.101
sh mesos.sh
- server03
Creating a slave container
vi mesos-slave.sh
#!/bin/bash docker run -d --net=host --privileged \ --hostname=192.168.66.103 \ -e MESOS_PORT=5051 \ -e MESOS_MASTER=zk://192.168.100.139:2181/mesos \ -e MESOS_SWITCH_USER=0 \ -e MESOS_CONTAINERIZERS=docker,mesos \ -e MESOS_LOG_DIR=/var/log/mesos \ -e MESOS_WORK_DIR=/var/tmp/mesos \ -v "$(pwd)/mesos/log/mesos:/var/log/mesos" \ -v "$(pwd)/mesos/tmp/mesos:/var/tmp/mesos" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /sys:/sys \ -v /usr/bin/docker:/usr/local/bin/docker \ mesosphere/mesos-slave:1.7.0 --no-systemd_enable_support \ --no-hostname_lookup --ip=192.168.66.103
- server02 install marathon image
https://hub.docker.com/r/mesosphere/marathon,
According to the architecture
docker pull mesosphere/marathon:v1.5.12
vi marathon
#!/bin/bash docker run -d --net=host \ mesosphere/marathon:v1.5.2 \ --master zk://192.168.100.139:2181/mesos \ --zk zk://192.168.100.139:2181/marathon
Website: http://192.168.66.102:8080
This is the problem of base path, not affected.
- Host installation marathon LB
Pull mirror image
docker pull mesosphere/marathon-lb:v1.12.3
Create a new shell file
#!/bin/bash docker stop marathon-lb docker rm marathon-lb docker run -d -p 9090:9090 \ -e PORTS=9090 \ mesosphere/marathon-lb:v1.12.3 sse \ --group external \ --marathon http://192.168.66.102:8080
Marathon LB access address: http://localhost:9090/haproxy?stats
marathon function
- New application
while [ true ];do sleep 5;echo 'hello idig8.com';done
- Automatic execution
- See the comparison between mesos and Marathon
You can see the Marathon Framework in the Framework of mesos
PS: all services have been set up. After that, the next step is to deploy the six microservices written before to our Mesos cluster!