Installation and configuration of Mesos and Marathon on Centos7

  • 2020-06-19 12:32:26
  • OfStack

The official installation documents for Mesos and Marathon have detailed installation instructions, but in English. I refer to official document installation (https: / / open. mesosphere. com/getting - started install /), under the test environment rigged up 1, here to sort out the installation configuration steps.

The test environment

服务器IP 说明
192.168.0.101 Master节点
192.168.0.102 Master节点
192.168.0.103 Master节点
192.168.0.104 Slave节点
192.168.0.105 Slave节点
192.168.0.106 Slave节点

We typically use multiple master nodes and multiple slave nodes for high availability. Three master nodes are used for the high availability configuration, with ES21en-ES22en, marathon and the zookeeper service providing the optional master mechanism running on each master node. The ES26en-ES27en service only needs to be run on the slave node, which can be easily added later if the slave node needs to be added. For simplicity, the yum installation is straightforward (in addition, you can use a compile installation).

Experimental environment

Server: Jingdong Cloud, 1core 2G System: centos7.3 64bit

Install docker

Turn off the firewall


systemctl stop firewalld.service 
systemctl disable firewalld.service

Close the selinux


setenforce 0

Modify SELINUX=XXX for the /etc/selinux/config file


vi /etc/selinux/config
SELINUX=disabled

Install docker


yum install epel-release -y
yum install -y docker
systemctl enable docker

Start the


systemctl start docker.service

Install zookeeper

First execute the following command to install


rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-mesosphere
yum install mesosphere-zookeeper -y

Configuration zookeeper


#  Change to your own Intranet ip
HOST_IP=192.168.1.105
echo 1 > /var/lib/zookeeper/myid
echo "server.1=${HOST_IP}:2888:3888" >> /etc/zookeeper/conf/zoo.cfg

Start the zookeeper


systemctl start zookeeper

Configuration mesos master

The installation


rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-mesosphere
yum install mesos -y

configuration


#  Change to your own zookeeper the ip
HOST_IP=192.168.1.105
echo "zk://${HOST_IP}:2181/mesos" > /etc/mesos/zk
echo "${HOST_IP}" > /etc/mesos-master/hostname

Start the


setenforce 0
0

Configuration mesos slave

The installation


setenforce 0
1

configuration


setenforce 0
2

Start the


systemctl start mesos-slave

Configuration marathon

The installation


setenforce 0
4

configuration

Install the master node on mesos

Start the


setenforce 0
5

marthon applies binding domain names

Install marathon - lb


docker run -d --restart=always --name marathon-lb --privileged -e PORTS=9090 --net=host ccr.ccs.tencentyun.com/mesos/marathon-lb:v1.11.1 sse -m http://192.168.0.105:8080   --group external

Add two label to create the application


setenforce 0
6

Pay attention to

Open http:// Your IP:5050 to see the web version of the mesos console

Open http:// Your IP:8080 to see the web version of marthon console

Because this configuration is password-free, it cannot be put directly into production


Related articles: