CentOS7.1 install Mesosphere
Introduction
Mesosphere
Mesos
Marathon
Zookeeper:
It is the mesos/marathon configuration file of the master, which makes the master more lightweight.
For these concepts, we can find that basically all of them know what they are doing. It is not nonsense here. If you are not familiar with it, you can make up your own brain.
Environment:
HostnameFunctionIP Addressmaster1Mesos master172.18.2.94master2Mesos master172.18.2.95master3Mesos master172.18.2.96slave1Mesos slave172.18.2.97slave2Mesos %#slave172.18.2.100
Description:
First, the master node manages the configuration of the zookeeper cluster (mesos/marathon/zookeeper) for three machines, and then the three master nodes implement high availability and Marathon.
Work in advance
① Disable selinux
Setenforece0 (the configuration file is modified by yourself)② Disable firewalld
systemctldisablefirewalld.service③ Clear the Firewall
iptables-F Master Nodes SetupPackage InstallationYum will be used for installation in order to make it simple. Of course, you can compile it yourself, with the same effect. Others are installed directly in the docker repository. There are many methods. Check your environment.
Setup Repositoriesrpm-Uvhhttp://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmInstallyum-yinstallmesosphere-zookeeperyum-yinstallmesosmarathonConfigurationZooKeeper① First, label zookeeper on each machine:
echo1>/etc/zookeeper/conf/myidNote: different machines in myid correspond to server. $ NUM in the following configuration file.
Add the following content to the/etc/zookeeper/conf/zoo. cfg configuration file:
server.1=172.18.2.94:2888:3888server.2=172.18.2.95:2888:3888server.3=172.18.2.96:2888:3888Explain the following $ IP, $ PORT1, $ PORT2
IP not explained$ PORT1 because three of them are highly available, there must be a master. This port is from the master;$ PORT2 checks each other to see who is used for master checks.Then you can restart the zookeeper Service (Port 2181)
systemctlstartzookeeperMesosZooKeeperConfigure the zookeeper address on each node, as shown in/etc/mesos/zk.
zk://172.18.2.94:2181,172.18.2.95:2181,172.18.2.96:2181/mesosQuorumI'm not sure if this is a BUG, because this official request parameter, in the case of three masters, this configuration should be 2, but when you set it to 2, the three masters are always competing for leader, so the slave node cannot be registered.
echo1>/etc/mesos-master/quorumHostnameHere, we will write the host name master $ num into the hosts resolution, and then write the respective host names into this file.
echo$master>/etc/marathon/conf/hostnameThen mesos's configuration will be okay here, but you need to pay attention to some of his own things for processing.
systemctlstopmesos-slave.servicesystemctldisablemesos-slave.serviceRestart mesos
systemctlrestartmesos-slave.serviceMarathonFirst, create the path of his configuration file (not created after yum is installed)
mkdir-p/etc/marathon/confHostnameJust copy mesos directly.
cp/etc/mesos-master/hostname/etc/marathon/confZooKeeperHere there are two points: ① configure marathon's own zk, and also connect mesos's own, because he wants to schedule tasks in the past.
cp/etc/mesos/zk/etc/marathon/conf/mastercp/etc/marathon/conf/master/etc/marathon/conf/zkvim/etc/marathon/conf/zkContent: zk://172.18.2.94:2181,172.18.2.95:2181,172.18.2.96:2181/marathonThen restart marathon.
systemctlrestartmarathon.serviceMaster is OK!Mesos access address:
172.18.2.94:5050Marathon access address:
172.18.2.94:8080 Slave Node SetupPackage InstallationSetup Repositoriesrpm-Uvhhttp://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmInstall from packageyum-yinstallmesosConfigurationMesosFirst, you must turn off the master
systemctlstopmesos-master.servicesystemctldisablemesos-master.serviceZooKeeperConfigure the zookeeper address, because they said they will register with zookeeper, configure the same as master/etc/mesos/zk
zk://172.18.2.94:2181,172.18.2.95:2181,172.18.2.96:2181/mesosHostnameSimilarly, it is/etc/mesos-slave/hostname.
Start Servicessystemctlrestartmesos-slave.serviceThen, go to the mesos management terminal to view the slave registration information.
Starting Services on Mesos and MarathonHere we do not make a complex demonstration, just simple.
WEB UI
Master1: 5050
Starting a Service through the APIFirst, prepare a json file (hello2.json)
{"id":"hello2","cmd":"echohello;sleep10","mem":16,"cpus":0.1,"instances":1,"disk":0.0,"ports":[0]}Then call the api
curl-i-H'Content-Type:application/json'-d@hello2.jsonmaster1:8080/v2/appsIt's just here. I haven't written it for too long and I can't find it.
Pay attention to the details.
This article is from the blog of "bean bag", please be sure to keep this source http://407711169.blog.51cto.com/6616996/1661185