master节点

节点名称 IP地址
master1 192.168.161.128

由于硬件资源有限,这里仅安装一个master节点,会存在单点问题.在实际生产中,尽量不要这样操作.

1.安装zookeeper

https://www.cnblogs.com/gytangyao/p/10172265.html

2.安装Mesos

1)添加mesos yum源

sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
yum -y install mesos marathon

2)更改mesos的zk配置

vi /etc/mesos/zk 

写入zookeeper节点的地址,例如:zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos

zk://192.168.161.128:2181/mesos

按需更改quorum,如果zookeeper以单机模式运行则不用修改

设置 --quorum=2 的意思是:至少要有 2 台 master 节点在线,否则集群无法起来,所以至少要两台 master 一起启动。

vi /etc/mesos-master/quorum

3)配置mesos-master和marathon 的hostname和ip

hostname直接配置的本机ip,是为了防止出现dns无法解析的问题;
echo "192.168.161.128" > /etc/mesos-master/ip
echo "192.168.161.128" > /etc/mesos-master/hostname
mkdir -p /etc/marathon/conf/
echo "192.168.161.128" > /etc/marathon/conf/hostname
echo "192.168.161.128 master1" >> /etc/hosts

4)给marathon填加mesos的地址参数

vim /etc/default/marathon

MARATHON_MASTER="zk://192.168.161.128:2181/mesos"
MARATHON_ZK="zk://192.168.161.128:2181/marathon"
MARATHON_MESOS_USER="root"

5)启动服务

systemctl start  zookeeper && systemctl start mesos-master && systemctl start marathon && systemctl disable mesos-slave

6)其他配置

Marathon WebUI默认的端口是8080,修改端口的方法:

vi /etc/default/marathon

export HTTP_PORT=8181

export MARATHON_HTTP_PORT=8181

6)错误排错

Required option 'master' not found    可使用 journalctl -u marathon 查看日志
# journalctl -u marathon
-- Logs begin at Thu 2018-06-14 15:55:28 CST, end at Thu 2018-06-14 19:52:34 CST. --
Jun 14 15:55:35 dev-master-01 systemd[1]: marathon.service holdoff time over, scheduling restart.
Jun 14 15:55:35 dev-master-01 systemd[1]: Starting Scheduler for Apache Mesos...
Jun 14 15:55:35 dev-master-01 systemd[1]: Started Scheduler for Apache Mesos.
Jun 14 15:55:35 dev-master-01 marathon[7966]: No start hook file found ($HOOK_MARATHON_START). Proceeding with the start script.
Jun 14 15:55:36 dev-master-01 marathon[7966]: [scallop] Error: Required option 'master' not found
Jun 14 15:55:36 dev-master-01 systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE
Jun 14 15:55:36 dev-master-01 systemd[1]: Unit marathon.service entered failed state.
Jun 14 15:55:36 dev-master-01 systemd[1]: marathon.service failed.
Jun 14 15:56:36 dev-master-01 systemd[1]: marathon.service holdoff time over, scheduling restart.
Jun 14 15:56:36 dev-master-01 systemd[1]: Starting Scheduler for Apache Mesos...
Jun 14 15:56:36 dev-master-01 systemd[1]: Started Scheduler for Apache Mesos.
Jun 14 15:56:36 dev-master-01 marathon[8046]: No start hook file found ($HOOK_MARATHON_START). Proceeding with the start script.
Jun 14 15:56:37 dev-master-01 marathon[8046]: [scallop] Error: Required option 'master' not found
Jun 14 15:56:37 dev-master-01 systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE
Jun 14 15:56:37 dev-master-01 systemd[1]: Unit marathon.service entered failed state.
Jun 14 15:56:37 dev-master-01 systemd[1]: marathon.service failed.

如提示:java.lang.IllegalStateException: Multiple election participants have the same ID: master1:8080. This is not allowed.

则可能是多次执行了设置ip或者hostname,需要检查第三步的配置是否正确

12月 25 12:28:08 master1 marathon[8724]: java.lang.IllegalStateException: Multiple election participants have the same ID: master1:8080. This is not allowed.
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.core.election.CuratorElectionStream$CuratorEventEmitter.emitLeader(CuratorElectionStream.scala:157)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.core.election.CuratorElectionStream$CuratorEventEmitter.$anonfun$longPollLeaderChange$1(CuratorElectionStream.scala:117)
12月 25 12:28:08 master1 marathon[8724]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
12月 25 12:28:08 master1 marathon[8724]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
12月 25 12:28:08 master1 marathon[8724]: at java.lang.Thread.run(Thread.java:748)
12月 25 12:28:08 master1 marathon[8724]: [2018-12-25 12:28:08,788] INFO  Closing leader latch (mesosphere.marathon.core.election.CuratorElectionStream$:pool-1-thread-1)
12月 25 12:28:08 master1 marathon[8724]: [2018-12-25 12:28:08,812] INFO  Shutting down services (mesosphere.marathon.MarathonApp:shutdownHook3)
12月 25 12:28:08 master1 marathon[8724]: [2018-12-25 12:28:08,819] INFO  Shutdown triggered (mesosphere.marathon.MarathonSchedulerService:shutdownHook3)
12月 25 12:28:08 master1 marathon[8724]: [2018-12-25 12:28:08,819] ERROR abdicateLeadership was called (mesosphere.marathon.core.election.ElectionServiceImpl:shutdownHook3)
12月 25 12:28:08 master1 marathon[8724]: mesosphere.marathon.Exception: abdicateLeadership
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.core.election.ElectionServiceImpl.abdicateLeadership(ElectionService.scala:151)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonSchedulerService.triggerShutdown(MarathonSchedulerService.scala:169)
12月 25 12:28:08 master1 marathon[8724]: at com.google.common.util.concurrent.AbstractExecutionThreadService$1.doStop(AbstractExecutionThreadService.java:95)
12月 25 12:28:08 master1 marathon[8724]: at com.google.common.util.concurrent.AbstractService.stopAsync(AbstractService.java:242)
12月 25 12:28:08 master1 marathon[8724]: at com.google.common.util.concurrent.AbstractExecutionThreadService.stopAsync(AbstractExecutionThreadService.java:214)
12月 25 12:28:08 master1 marathon[8724]: at com.google.common.util.concurrent.ServiceManager.stopAsync(ServiceManager.java:331)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.$anonfun$shutdown$1(Main.scala:103)
12月 25 12:28:08 master1 marathon[8724]: at scala.Option.foreach(Option.scala:257)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.shutdown(Main.scala:103)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.$anonfun$shutdownAndWait$1(Main.scala:108)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.$anonfun$shutdownAndWait$1$adapted(Main.scala:107)
12月 25 12:28:08 master1 marathon[8724]: at scala.Option.foreach(Option.scala:257)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.shutdownAndWait(Main.scala:107)
12月 25 12:28:08 master1 marathon[8724]: at mesosphere.marathon.MarathonApp.$anonfun$start$1(Main.scala:80)
12月 25 12:28:08 master1 marathon[8724]: at scala.sys.ShutdownHookThread$$anon$1.run(ShutdownHookThread.scala:34)
12月 25 12:28:08 master1 marathon[8724]: [2018-12-25 12:28:08,822] INFO  backgroundOperationsLoop exiting (org.apache.curator.framework.imps.CuratorFrameworkImpl:Curator-Framework-0)
12月 25 12:28:10 master1 systemd[1]: marathon.service: main process exited, code=exited, status=137/n/a
12月 25 12:28:10 master1 systemd[1]: Unit marathon.service entered failed state.
12月 25 12:28:10 master1 systemd[1]: marathon.service failed.

Slave节点

节点名称 IP地址
slave1 192.168.161.200
slave2 192.168.161.201
slave3 192.168.161.202

1)添加 mesos的yum源

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

2)安装mesos

yum -y install mesos

3)配置master信息

master信息需要和前面安装的master节点对应

vim /etc/mesos/zk
zk://192.168.161.128:2181/mesos

4)mesos-slave配置ip&hostname

以下需要按照情况各自配置

slave1:

echo "192.168.161.200" > /etc/mesos-slave/ip
echo "192.168.161.200" > /etc/mesos-slave/hostname

#修改hosts
echo "192.168.161.200 slave1" >> /etc/hosts

slave2:

echo "192.168.161.201" > /etc/mesos-slave/ip
echo "192.168.161.201" > /etc/mesos-slave/hostname

#修改hosts
echo "192.168.161.201 slave2" >> /etc/hosts

slave3:

echo "192.168.161.202" > /etc/mesos-slave/ip
echo "192.168.161.202" > /etc/mesos-slave/hostname

#修改hosts
echo "192.168.161.202 slave3" >> /etc/hosts

5)启动mesos-slave

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

6)错误排查

如遇到slave连接不上master的情况,如果没有对mesos的日志存放目录进行特殊修改

请在 /var/log/mesos/  下查看日志

日志信息如下:

[root@slave2 ~]# cd /var/log/mesos/
[root@slave2 mesos]# ls
mesos-slave.ERROR                                               mesos-slave.slave2.invalid-user.log.INFO.20181225-141244.8972  mesos-slave.slave2.invalid-user.log.INFO.20181225-181648.8959     mesos-slave.slave2.invalid-user.log.WARNING.20181225-180358.8998
mesos-slave.INFO                                                mesos-slave.slave2.invalid-user.log.INFO.20181225-141514.8965  mesos-slave.slave2.invalid-user.log.WARNING.20181225-115141.9449  mesos-slave.slave2.invalid-user.log.WARNING.20181225-180823.8952
mesos-slave.slave2.invalid-user.log.ERROR.20181225-145851.8960  mesos-slave.slave2.invalid-user.log.INFO.20181225-141841.8986  mesos-slave.slave2.invalid-user.log.WARNING.20181225-115709.8954  mesos-slave.slave2.invalid-user.log.WARNING.20181225-181649.8959
mesos-slave.slave2.invalid-user.log.ERROR.20181225-155517.8987  mesos-slave.slave2.invalid-user.log.INFO.20181225-145406.8960  mesos-slave.slave2.invalid-user.log.WARNING.20181225-141254.8972  mesos-slave.WARNING
mesos-slave.slave2.invalid-user.log.ERROR.20181225-180825.8952  mesos-slave.slave2.invalid-user.log.INFO.20181225-155333.8987  mesos-slave.slave2.invalid-user.log.WARNING.20181225-141852.8986
mesos-slave.slave2.invalid-user.log.INFO.20181225-115131.9449   mesos-slave.slave2.invalid-user.log.INFO.20181225-180357.8998  mesos-slave.slave2.invalid-user.log.WARNING.20181225-145851.8960
mesos-slave.slave2.invalid-user.log.INFO.20181225-115659.8954   mesos-slave.slave2.invalid-user.log.INFO.20181225-180823.8952  mesos-slave.slave2.invalid-user.log.WARNING.20181225-155334.8987
[root@slave2 mesos]# 

2.centos7 安装Mesos和marathon的更多相关文章

  1. Mesos+Zookeeper+Marathon的Docker管理平台部署记录(1)

    随着"互联网+"时代的业务增长.变化速度及大规模计算的需求,廉价的.高可扩展的分布式x86集群已成为标准解决方案,如Google已经在几千万台服务器上部署分布式系统.Docker及 ...

  2. Mesos+Zookeeper+Marathon+Docker环境搭建

    相关理论请参考:https://www.cnblogs.com/Bourbon-tian/p/7155054.html,本文基于https://www.cnblogs.com/Bourbon-tian ...

  3. Mesos+Zookeeper+Marathon+Docker分布式集群管理最佳实践

    参考赵班长的unixhot以及马亮blog 笔者QQ:572891887 Linux架构交流群:471443208 1.1Mesos简介 Mesos是Apache下的开源分布式资源管理框架,它被称为分 ...

  4. docker集群——搭建Mesos+Zookeeper+Marathon的Docker管理平台

    服务器架构 机器信息: 这里部属的机器为3个Master控制节点,3个slave运行节点,其中: zookeeper.Mesos-master.marathon运行在Master端:Mesos-sla ...

  5. Mesos以及Marathon安装总结

    安装了将近一周的环境了,终于把Mesos以及Marathon给安装上了,我指的离线安装. 策略1: 严格的按照官网的流程: http://mesos.apache.org/gettingstarted ...

  6. HP服务器 hp 360g5 centos7安装问题

    HP服务器  hp 360g5 centos7安装问题 一 :启动盘无法识别硬盘 1.进入安装光盘,用上下键选择安装centos--Install Centos7(注意不可按Enter键),如图: 2 ...

  7. CentOS7 安装Mono及Jexus

    CentOS7安装Mono及Juxes 1 安装Mono 1.1 安装yum-utils 因为安装要用到yum-config-manager,默认是没有安装的,所以要先安装yum-utils包.命令如 ...

  8. CentOS7安装mysql提示“No package mysql-server available.”

    针对centos7安装mysql,提示"No package mysql-server available."错误,解决方法如下: Centos 7 comes with Mari ...

  9. CentOS7安装Oracle 11gR2 安装

    概述 Oracle 在Linux和window上的安装不太一样,公司又是Linux系统上的Oracle,实在没辙,研究下Linux下Oracle的使用,oracle默认不支持CentOS系统安装,所以 ...

随机推荐

  1. cmake中设置ELF文件加载动态库的位置

    1. 三个文件 1. world.c #include<stdio.h> void world(void) { printf("world.\n"); } 2. hel ...

  2. C语言-郝斌笔记-004判断是否为回文数

    判断是否为回文数 # include <stdio.h> int main(void) { int val; //存放待判断的数字 int m; ; printf("请输入您需要 ...

  3. Evil Book -- CodeChef

    传送门 分析 对于这道题,我们首先思考一个贪心策略,即对于所有我们要打败的厨师我们肯定可以先打败需使用帮助次数少的厨师再打败需使用帮助次数多的厨师 ,因为这样可以使得能支付得起帮助费用的可能性尽可能的 ...

  4. HTML5应用程序缓存Application Cache.RP

    什么是Application Cache HTML5引入了应用程序缓存技术,意味着web应用可进行缓存,并在没有网络的情况下使用,通过创建cache manifest文件,可以轻松的创建离线应用. A ...

  5. Algorithms - Insertion sort

    印象 图1 插入排序过程 思想 插入排序(Insertion Sort)的主要思想是不断地将待排序的元素插入到有序序列中,是有序序列不断地扩大,直至所有元素都被插入到有序序列中. 分析 时间复杂度: ...

  6. 怎样创建XML文档

    在程序中,我们怎样创建一个XML文档.下面演示中,Insus.NET在程序创建一个和http://www.cnblogs.com/insus/p/3274220.html 一模一样的XML文档. 可以 ...

  7. GitHub下载代码到本地

    1.git  clone git@github.com:Sehunwy/test.git(加粗的是下载的地址) 2.下载完成,此时本地是这样的: 参考:https://blog.csdn.net/qq ...

  8. 利用BIND搭建自己的私有根及授权域

    这篇文章是对之前博客写的DNS的再深一层的搭建,其中包括搭建私有根,还有顶级域以及授权子域,转发域,反向解析等等 上一篇DNS的博客链接:http://www.cnblogs.com/hjc4025/ ...

  9. 小程序开发笔记【二】,抽奖结果json数据拼装bug解决

    抽奖结果数据json格式数据拼接bug,如下图,只发布了两个奖项,每个奖项设置2个奖品,但最后拼接数据的时候出现3个奖项 json数据格式如下 "luckyResult":[ { ...

  10. Alyona and towers CodeForces - 739C (线段树)

    大意: 给定序列, 要求实现区间加, 询问整个序列最长的先增后减的区间. 线段树维护左右两端递增,递减,先增后减的长度即可, 要注意严格递增, 合并时要注意相等的情况, 要注意相加会爆int. #in ...