Get the App
SLTechnology News&Howtos  ›  Servers  › 

The Construction of Mesos Cluster Environment of docker (24)

Shulou Source: shulou.com Published: 2022-06-02 14:39:12 10月01日 Update

Original articles, welcome to reprint. Reprint please indicate: reproduced from IT Story Association, thank you!

Original link address: "Advanced articles" Mesos Cluster Environment Construction of docker (24)

This time to start hands-on operation, the first is the installation of Mesos, how to install Mesos. Source code: https://github.com/limingios/msA-docker/mac

Https://github.com/limingios/msA-docker/vagrant/Mesos

Official website

Http://mesos.apache.org/ itself is the installation of C++, but also need C++ to compile, so the installation feels more troublesome, for the installation of trouble, the first choice is to think of what old iron, go to dockerhub inside to see if there is no version of docker.

Https://hub.docker.com/u/mesosphere/

We should use separate master and separate slave

Download image and pull image

Server01 and server03

Docker pull mesosphere/mesos-slave:1.7.0

Server02

Docker pull mesosphere/mesos-master:1.7.0

Hosts creates zookeeper

Zookeeper start

#! / bin/bashcur_dir= `pwd`docker stop zookeeperdocker rm zookeeperdocker run-- name zookeeper-- restart always-p 2181-d zookeeper:3.5

Server02 creates mesos-mastervi mesos.shemaking bindocker 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.102sh mesos.sh

Mesos-master is already connected to the host zookeeper.

Test connection address: http://192.168.66.102:5050

Frameworks is not associated and is not displayed yet.

Display of slave under Agents

Server01

Creation of slave container

Vi mesosmurf slave.shangxinxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 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

Creation of slave container

Vi mesosmurf slave.shangxinxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 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 installs marathon image

Https://hub.docker.com/r/mesosphere/marathon

According to the architecture diagram

Docker pull mesosphere/marathon:v1.5.12

Vi marathon shipping banks Binbank bashdocker 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

Web site: http://192.168.66.102:8080

This is a problem with the base path, which does not affect it.

Host install marathon-lb

Pull the image

Docker pull mesosphere/marathon-lb:v1.12.3

Create a new shell file

#! / bin/bashdocker stop marathon-lbdocker rm marathon-lbdocker run-d-p 9090 PORTS=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

New applicationwhile [true] for marathon function; do sleep 5X echo 'hello idig8.com';done

Automatic execution

Check the comparison between mesos and Marathon

You can see Marathon's Framework in mesos's Framework.

PS: all the services have been set up, and the next step is to deploy the six microservices written earlier to our Mesos cluster. Haha!

Tags: Image address cluster container trouble censor advanced environment host function original article original text feeling story story file article architecture source code version Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information macOS Docker Shulou Tech Info