CentOS7.1 install Mesosphere

Source: Internet
Author: User

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 %#slave

172.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 Installation

Yum 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 Repositories

rpm-Uvhhttp://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmInstallyum-yinstallmesosphere-zookeeperyum-yinstallmesosmarathon

ConfigurationZooKeeper

① First, label zookeeper on each machine:

echo1>/etc/zookeeper/conf/myid

Note: 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:3888

Explain 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)

systemctlstartzookeeper

MesosZooKeeper

Configure 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/mesosQuorum

I'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/quorumHostname

Here, 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/hostname

Then 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.service

Restart mesos

systemctlrestartmesos-slave.serviceMarathon

First, create the path of his configuration file (not created after yum is installed)

mkdir-p/etc/marathon/confHostname

Just copy mesos directly.

cp/etc/mesos-master/hostname/etc/marathon/confZooKeeper

Here 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/marathon

Then restart marathon.

systemctlrestartmarathon.service

Master is OK!

Mesos access address:

172.18.2.94:5050

Marathon 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-yinstallmesosConfigurationMesos

First, you must turn off the master

systemctlstopmesos-master.servicesystemctldisablemesos-master.serviceZooKeeper

Configure 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/mesosHostname

Similarly, it is/etc/mesos-slave/hostname.

Start Servicessystemctlrestartmesos-slave.service

Then, go to the mesos management terminal to view the slave registration information.

Starting Services on Mesos and Marathon

Here we do not make a complex demonstration, just simple.

WEB UI

Master1: 5050


Starting a Service through the API

First, 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/apps

It'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

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.