天天看点

Mesos + Marathon + Chronos + Docker环境安装

背景信息

组网:

OS:CentOS7

bigdata01:Mesos(master),Marathon,Chronos,ZooKeeper

bigdata02:docker mesos(slave)

JDK版本:

[[email protected] bin]# java -version

java version "1.8.0_144"

Java(TM) SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

安装过程

1、配置主机名

vi /etc/hosts

192.168.209.10 bigdata01  bigdata01.zetyun.com

192.168.209.11 bigdata02  bigdata02.zetyun.com

2、在所有机器上,安装Mesos源

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

3、在bigdata01(作为master)执行如下安装命令:

3.1 在Master上安装Mesos,Marathon,Chronos,ZooKeeper

# yum install mesos marathon chronos mesosphere-zookeeper

3.2 配置ZK

本次配置的Master是单节点环境,ZooKeeper也是单点

# vi /etc/mesos/zk

zk://bigdata01:2181/mesos

3.3配置Mesos

vi /etc/mesos-master/ip

192.168.209.10

(注意:这里需要配置为IP地址,使用主机名时导致启动失败)

3.4启动服务

# systemctl start zookeeper

# systemctl start mesos-master

# systemctl start marathon

# systemctl start chronos

4、在bigdata02(作为slave)执行如下安装命令:

4.1在Slave上安装Mesos,Docker

# yum install mesos docker

4.2配置Docker

# echo 'docker,mesos' > /etc/mesos-slave/containerizers

# echo '5mins' > /etc/mesos-slave/executor_registration_timeout

4.3配置ZK

# vi /etc/mesos/zk

zk://bigdata01:2181/mesos

4.4配置Mesos

vi /etc/mesos-master/ip

192.168.209.10

(注意:这里需要配置为IP地址,使用主机名时导致启动失败)

4.5启动服务

# systemctl start docker

# systemctl start mesos-slave

5、安装检查

5.1Mesos界面

http://bigdata01:5050/#/

Mesos + Marathon + Chronos + Docker环境安装

5.2Marathon界面

http://bigdata01:8080/ui/#/apps

Mesos + Marathon + Chronos + Docker环境安装

5.3Chronos界面

http://bigdata01:4400/

Mesos + Marathon + Chronos + Docker环境安装

故障处理:

故障描述:

marathon启动失败,报错信息如下:

[[email protected] marathon]# systemctl start marathon.service

[[email protected] marathon]# journalctl -u marathon

-- Logs begin at Sun 2017-12-03 23:00:44 PST, end at Mon 2017-12-04 01:10:51 PST. --

Dec 03 23:51:35 bigdata01.zetyun.com systemd[1]: Starting Scheduler for Apache Mesos...

Dec 03 23:51:35 bigdata01.zetyun.com systemd[1]: Started Scheduler for Apache Mesos.

Dec 03 23:51:36 bigdata01.zetyun.com marathon[12311]: No start hook file found ($HOOK_MARATHON_START). Proceeding with the start script.

Dec 03 23:51:41 bigdata01.zetyun.com marathon[12311]: [scallop] Error: Required option 'master' not found

Dec 03 23:51:41 bigdata01.zetyun.com systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE

Dec 03 23:51:41 bigdata01.zetyun.com systemd[1]: Unit marathon.service entered failed state.

Dec 03 23:51:41 bigdata01.zetyun.com systemd[1]: marathon.service failed.

Dec 03 23:52:41 bigdata01.zetyun.com systemd[1]: marathon.service holdoff time over, scheduling restart.

解决办法:

通过上述日志可以看出,是找不到master导致启动失败,根据网络上的信息做了如下配置:

创建 /etc/marathon/conf目录,并在该目录下创建如下三个文件:

[[email protected] conf]# pwd

/etc/marathon/conf

[[email protected] conf]# ls

hostname  master  zk

[[email protected] conf]# cat hostname 

192.168.209.10

[[email protected] conf]# cat master 

zk://bigdata01:2181/mesos

[[email protected] conf]# cat zk

zk://bigdata01:2181/marathon

执行上述操作后,启动时依然报相同的错误,最后根据如下办法直接带master参数启动marathon,最终成功

[[email protected] bin]# pwd

/usr/share/marathon/bin

[[email protected] bin]# ls

backup  marathon  native  restore

[ro[email protected] bin]# ./marathon --master zk://bigdata01:2181/mesos

说明:这个命令是参考http://www.genshuixue.com/wenda/6783812.html中的如下信息猜测得出的:

cd marathon_home bin/start --master zk://mesos_url_on_zk/mesos --zk zk://zk_url:2181/marathon 

安装过程参考:http://blog.csdn.net/haiyang4988/article/details/53538036

继续阅读