Primary Knowledge Data Center Mesos

Source: Internet
Author: User
Tags mesosphere

The rapid development of Docker has no need to say, how to manage Docker, the layout of Docker also has the most enough tools, but always feel that there is no pain point, so there is the need for data center Mesos, then Mesos is what, and what Mesos can do, Will be briefly described in this article.

Here first put one's own understanding of the mesos and use of ideas, such as biased also look.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/79/53/wKioL1aORQnRyyf3AABYUWzHWko735.png "title=" Image 3.png "alt=" Wkiol1aorqnryyf3aabyuwzhwko735.png "/>

According to, we put the physics machine all into Mesos This release system inside, this is a our hands of the physical machine resources are all abstracted together, so we do not have to worry about CPU, memory, the use of hard disk, because to an application needs more resources, we can directly dynamically add, I think this alone is enough for us to get excited about, and more importantly we don't need to purchase a hardware-configured server.

In front of this content of course not enough to say what Mesos is, what to do, in the author's opinion, want to understand the same thing on paper is absolutely impossible, so let us first set up the environment, use up, so I want to more profound understanding of mesos.


Installation:

System Environment: Centos7

Mesos Cluster

172.16.51.72 Mesos-master

172.16.51.72 Mesos-slaver

172.16.51.71 Mesos-slaver

172.16.51.73 Mesos-slaver

Zookeeper cluster

172.16.51.72 1

172.16.51.71 2

172.16.51.73 3

Note: Iptables,selinux or something, of course, is off.

installation mode RPM package

RPM Source

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


Install Mesos,marathon,zookeeper

Yum-yinstall Mesos Marathonyum-yinstall Mesosphere-zookeeper


配置zookeeper集群

the myID of 72,71,73 is configured in order to be a . myID file does not exist by default

Cat/var/lib/zookeeper/myid1


then configure the Zookeeper configuration file

Add the following three lines to each zookeeper node

cat/etc/zookeeper/conf/zoo.cfgserver.1=172.16.51.72:2888:3888server.2=172.16.51.71:2888:3888server.3= 172.16.51.73:2888:3888


and then start in turn Zookeeper

systemctlstart zookeeper

See if listening

lsof-i:2181

Configure Zookeeper information for Mesos ( both master and slaver)

Zk://172.161.51.72:2181,172.16.51.71:2181,172.16.51.73:2181/mesos


then start the master side

Service Mesos-master Restart

start The slaver side

Service Mesos-slave Restart


It's simple, there's wood.

then verify mesos,Marathon is installed successfully

Access the 5050 and 8080 ports of the Mesos-master host , such as


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/54/wKiom1aOSd_CUofOAAGU6HSq7qA063.png "style=" float: none; "title=" Image 6.png "alt=" Wkiom1aosd_cuofoaagu6hsq7qa063.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/79/54/wKiom1aOSeDBalItAAEwt0FFlck685.png "style=" float: none; "title=" Image 5.png "alt=" Wkiom1aosedbalitaaewt0fflck685.png "/>

Note: If the first installation is complete, the corresponding Web page should not have any tasks, such as the above test


There might be a question here, and then what?

First look at the architecture of Mesos.

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/79/54/wKiom1aOS0_yAhKkAALDqEUfMH4013.jpg "style=" float: none; "title=" architecture3.jpg "alt=" Wkiom1aos0_yahkkaaldqeufmh4013.jpg "/>

Based on the above and combined with our installed environment, we have established three mesos-slaver nodes, a mesos-master end node (in fact, Mesos-master can also do a cluster)

To the above Hadoop,mpi Scheduler we put aside first.

Zookeeper is used for service discovery (here we make cluster mode, is for high availability), so either the Mesos-slaver or Mesos-master nodes need to set the zookeeper configuration information, through the zookeeper, Mesos-master will ask Mesos-slaver which hosts and what information it is related to and vice versa.

Then Mesos-master will only mesos-slaver what they need to do, how to know what Mesos-slaver can do?

Let's see.



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/79/55/wKiom1aOS1GCooYjAAJv9KmHzik432.jpg "style=" float: none; "title=" architecture-example.jpg "alt=" Wkiom1aos1gcooyjaajv9kmhzik432.jpg "/>

According to, Mesos-slaver will tell the mesos-master side how many resources, such as how much CPU, memory, and then master-slaver decide how to allocate resources, how to assign tasks, then how do we give mesos to ask for resources and release tasks, Then we need to know what the framework is, and the following two main frameworks are explained, Marathon,chronos.

What is a framework? is to ask for the source, look at the specific instances, you will have a certain understanding.

Marathonis built onMesoson the privatePaaSplatform. It can self -Moving PlaceHardware orSoftfailure,and indeedProtect eachshould beprograms are"Yongfarin theLine(for example, if you set a three instance of an application in marathon, then one of them hangs, Marathon will immediately start an instance, maintaining three instances), personally feel that withkubernetessomewhat overlapping meaning, of course, kubernetes is more powerful, because the ability to orchestrate more strong.

Default listening port: 8080

main functions: Create resident tasks, task extensions, etc. ( such as an increase in the number of instances )

Create JOB

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/79/54/wKioL1aOUGuCd4WlAAJDWm8lDdk155.png "title=" Image 7.png "alt=" Wkiol1aougucd4wlaajdwm8lddk155.png "/> For example, we create a task with ID test and allocate 0.1 CPU (default), 16MB memory (default), OMB hard disk (default), one instance (default), then the command executed by this instance python-m simplehttpserver, then click "Create" to create a successful, Mesos-master is randomly letting mesos-slaver just create an instance.

For the convenience of verification, we can select the number of instances as 3 and see if we are listening.

and then verify.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/79/54/wKioL1aOUgOjRDQKAAAVL0inutM126.png "title=" Image 8.png "alt=" Wkiol1aougojrdqkaaavl0inutm126.png "/>


Note: The name is arbitrary, but not with the existing ID name conflicts can


Then take a look at the basic settings

ID Set

the name is arbitrary, not with the existing ID name conflicts can

CPU , memory, hard disk, number of instances (custom)



CPU , memory, hard disk, number of instances (custom)

performed by Command

like with Python to start a simple Web Service

Python-m Simplehttpserver

Docker container-Related Settings

Network, data volumes, etc.

Environment variables such as

java_home= xxx

Label

Custom labels for classification

Health monitoring

have a Command , http , TCP three ways of Detection

  

Other Options (Optional settings)

such as Port

There's one last limit . constraint

such as restricting which node to start the task

Create success, click on specific tasks, have relevant information, such as host port, etc.

Mesos-master end also has a corresponding Job Information

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/79/54/wKioL1aOUnrQqDs6AABwxtHdfoI878.png "title=" Image 9.png "alt=" Wkiol1aounrqqds6aabwxthdfoi878.png "/>

  

Below is Marathon the relevant information

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/79/55/wKiom1aOUojSNaDYAADe0ZWcNq4406.png "title=" Image 10.png "alt=" Wkiom1aouojsnadyaade0zwcnq4406.png "/>

then the main three actions, respectively, are the expansion ( e.g. one instance to three instances ) , restart, hang, destroy

Note: Because the inside Test task, write the command is python-m Simplehttpserver so the default listener is 8000 port, because there are only three nodes, so up to three instances, although you can Scale ( size ) Set as 3 The above but will continue to start new instances, and then continue to fail, and always start.

Therefore, more than three instances should be guaranteed to occupy a different port

such as a random port

Python-m Simplehttpserver $PORT

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/79/55/wKiom1aOUr-SgQ21AADTdGJLvms000.png "title=" Image 11.png "alt=" Wkiom1aour-sgq21aadtdgjlvms000.png "/>


Since the creation of the task is to support Docker, we might as well imagine that we can directly use the image in an existing Docker environment.


Chronos is a distributed tuning program that supports complex structures . It can be used as a cron alternative.
Products, to provide better capacity wrong sex.

Chronos It's a planning mission, but it's distributed.

Installation

yum -y install chronos

servicechronos start

 

默认监听4400

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M02/79/55/wKiom1aOU7jgSpQnAAH7CpciNog566.png" title="Image 13.png" alt="wKiom1aOU7jgSpQnAAH7CpciNog566.png" />

 

比如

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/79/54/wKioL1aOVAaxb68KAAJ9f7auVq8399.png" title="Image 14.png" alt="wKioL1aOVAaxb68KAAJ9f7auVq8399.png" />

Cat/tmp/test2.txtsat Dec26 17:08:10 CST 2015

 

结语:既然是初始,那么久先到这里吧,笔者也还在研究中。

This article is from the "Ear Notebook" blog, please make sure to keep this source http://youerning.blog.51cto.com/10513771/1732682

Primary Knowledge Data Center Mesos

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.