Mesos+mrathon+zookeeper Docker Management Cluster hands-on example (detail)

Source: Internet
Author: User
Tags mesosphere


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/75/F0/wKiom1ZFUyuwNphBAAJQGw--a3E430.png "title=" Image.png "width=" 730 "height=" 408 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:730px;height:408px; "alt=" Wkiom1zfuyuwnphbaajqgw--a3e430.png "/>


1: Planning (5master+3slave)

Master

    • 10.64.5.184---Master1

    • 10.64.5.185---Master2

    • 10.64.5.186---Master3

    • 10.64.5.187---master4

    • 10.64.5.188---Master5

Slave

    • 10.64.5.170---slave1

    • 10.64.5.172---slave2

    • 10.64.5.167---Slave3

2: Configure the Master node

(1) shutting down the firewall

    • Master1 master2 Master3 master4 master5

#systemctl Stop firewalld && systemctl disable FIREWALLD


(2) Add Mesos to the Yum source

    • Master1 master2 Master3 master4 master5

#sudo RPM-UVH http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm


(3) Installation Mesos,marathon,zookeeper

    • Master1 master2 Master3 master4 master5

#yum -y install mesos marathon mesosphere-zookeeper


(4) Configuration zookeeper

#设置文件 [/var/lib/zookeeper/myid] for the current Mesos master node, the Id,id must be an integer in 1-255, for example: 1

    • Master1

#echo 1 >/var/lib/zookeeper/myid
    • Master2

#echo 2 >/var/lib/zookeeper/myid
    • Master3

#echo 3 >/var/lib/zookeeper/myid
    • Master4

#echo 4 >/var/lib/zookeeper/myid
    • Master5

#echo 5 >/var/lib/zookeeper/myid


#master_node_id为master节点id同该节点 the configuration of the [/var/lib/zookeeper/myid] file, master_node_ip the IP address of the master node: server. $master _node_id= $master _node_ip:2888:3888

Where the first port 2888 is used for the information exchange of the cluster members, the second port 3888 is used specifically for election leader when leader is hung up.

    • Master1 master2 Master3 master4 master5

Add content #vim/etc/zookeeper/conf/zoo.cfg end server.1=10.64.5.184:2888:3888server.2=10.64.5.185:2888:3888server.3= 10.64.5.186:2888:3888server.4=10.64.5.187:2888:3888server.5=10.64.5.188:2888:3888
#vim/etc/mesos/zk completely replace the original content: zk:// 10.64.5.184:2181,10.64.5.185:2181,10.64.5.186:2181,10.64.5.187:2181,10.64.5.188:2181/mesos



#设置文件 [/etc/mesos-master/quorum] content is an integer greater than (the number of master nodes divided by 2).

#echo 3 >/etc/mesos-master/quorum completely replace the original content: 3



(5) Configuring Mesos and Marathon

#主机名和ip要在hosts中写入, can not use localhost, otherwise there will be slave can not be recognized, and Marathon task issued abnormal and so on.

    • Master1

# mkdir-p/etc/marathon/conf# echo 10.64.5.184 >/etc/mesos-master/hostname# echo 10.64.5.184 >/etc/marathon/conf /hostname#hostnamectl--static set-hostname master-1.com#echo "10.64.5.184 master-1 master-1.com" >/etc/hosts
    • Master2

# mkdir-p/etc/marathon/conf# echo 10.64.5.185 >/etc/mesos-master/hostname# echo 10.64.5.185 >/etc/marathon/conf /hostname#hostnamectl--static set-hostname master-2.com#echo "10.64.5.185 master-2 master-2.com" >/etc/hosts
    • Master3

# mkdir-p/etc/marathon/conf# echo 10.64.5.186 >/etc/mesos-master/hostname# echo 10.64.5.186>/etc/marathon/conf /hostname#hostnamectl--static set-hostname master-3.com#echo "10.64.5.186 master-3 master-3.com" >/etc/hosts
    • Master4

# mkdir-p/etc/marathon/conf# echo 10.64.5.187 >/etc/mesos-master/hostname# echo 10.64.5.187 >/etc/marathon/conf /hostname#hostnamectl--static set-hostname master-4.com#echo "10.64.5.187 master-4 master-4.com" >/etc/hosts
    • Master5

# mkdir-p/etc/marathon/conf# echo 10.64.5.188 >/etc/mesos-master/hostname# echo 10.64.5.188 >/etc/marathon/conf /hostname#hostnamectl--static set-hostname master-5.com#echo "10.64.5.188 master-5 master-5.com" >/etc/hosts



    • Master1 master2 Master3 master4 master5

# cp/etc/mesos/zk/etc/marathon/conf/master# cp/etc/mesos/zk/etc/marathon/conf/zk# sed-i ' s|mesos|marathon|g ' /etc/marathon/conf/zk

(6) Start Mesos,marathon,zookeeper

    • Master1 master2 Master3 master4 master5

# systemctl Start zookeeper && systemctl start Mesos-master && systemctl start marathon# systemctl disable Mesos-slave

(7) Check the configuration

#配置过程中出错, in order to check the comparison of the master configuration, directly execute the following command.

Cat/var/lib/zookeeper/myid && tail-6/etc/zookeeper/conf/zoo.cfg && cat/etc/mesos/zk && cat/e Tc/mesos-master/quorum && cat/etc/mesos-master/hostname&& cat/etc/marathon/conf/hostname& & CAT/ETC/MARATHON/CONF/MASTER&&CAT/ETC/MARATHON/CONF/ZK

You can also create a/etc/mesos-master/cluster file to write to the alias of the cluster.


2: Configure the slave node


(1) shutting down the firewall

    • Slave1 Slave2 Slave3

#systemctl Stop firewalld && systemctl disable FIREWALLD


(2) Add Mesos to the Yum source

    • Slave1 Slave2 Slave3

#sudo RPM-UVH http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm


(3) Installation Mesos,marathon,zookeeper

    • Slave1 Slave2 Slave3

#yum-y Install Mesos


(4) Configuring the Master information

    • Slave1

#echo 10.64.5.167 >/etc/mesos-slave/hostname#hostnamectl--static set-hostname slave-1.com#echo "10.64.5.167 slave -1 slave-1.com ">/etc/hosts


    • Slave2

#echo 10.64.5.170 >/etc/mesos-slave/hostname#hostnamectl--static set-hostname slave-2.com#echo "10.64.5.170 slave -2 slave-2.com ">/etc/hosts


    • Slave3

#echo 10.64.5.172 >/etc/mesos-slave/hostname#hostnamectl--static set-hostname slave-1.com#echo "10.64.5.172 slave -3 slave-3.com ">/etc/hosts


    • Slave1 Slave2 Slave3

#vi/etc/mesos/zk added: zk://10.64.5.184:2181,10.64.5.185:2181,10.64.5.186:2181,10.64.5.187:2181,10.64.5.188:2181/ Mesos


(5) Start slave

#systemctl start Mesos-slave && systemctl enable mesos-slave#systemctl disable Mesos-master

3: Access the Web Administration page

Visit the Administration page of Mesos. master_ip:5050

#master_ip是这5个master中的任意一个就行, after zookeeper select the main throat, will automatically jump to the leader page, Mesos leader for 187.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/75/EE/wKioL1ZFVumDRsknAACjIWMr-yE468.png "style=" width : 730px;height:286px; "title=" 1.png "width=" 730 "height=" 286 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1zfvumdrsknaacjiwmr-ye468.png "/>

Marathon is already recognized in frameworks, marathon leader is 10.64.5.186 at this time.

#mesos和marathon都是有zookeeper来选举leader, but the main process is independent of each other, that is, the leader of Mesos is 187, but the leader of Marathon is 186 ().

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/75/EE/wKioL1ZFVuqwsmDPAABwaSOx6yQ601.png "style=" width : 730px;height:230px; "title=" 2.png "width=" 730 "height=" border= "0" hspace= "0" vspace= "0" alt= " Wkiol1zfvuqwsmdpaabwasox6yq601.png "/>

has been able to identify three of slave.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/75/F0/wKiom1ZFVp_Tkg9mAABsKjOA6yU779.png "style=" width : 730px;height:209px; "title=" 3.png "width=" 730 "height=" 209 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1zfvp_ Tkg9maabskjoa6yu779.png "/>


Visit the Administration page of Marathon. master_ip:8080


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/F1/wKiom1ZFWcDD-jf1AAKttbW9qvM431.png "style=" width : 730px;height:682px; "title=" 4.png "width=" 730 "height=" 682 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1zfwcdd-jf1aakttbw9qvm431.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/75/F1/wKiom1ZFWlHwiU9_AAErT9pAYS0214.png "title=" 6.png " Width= "730" height= "869" border= "0" hspace= "0" vspace= "0" style= "WIDTH:730PX;HEIGHT:869PX;" alt= "wkiom1zfwlhwiu9_ Aaert9pays0214.png "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>


This article is from the "8931355" blog, please be sure to keep this source http://8941355.blog.51cto.com/8931355/1712426

Mesos+mrathon+zookeeper Docker Management Cluster hands-on example (detail)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.