无法启动Mesos / Marathon集群

时间:2016-04-27 08:49:45

标签: apache-zookeeper mesos marathon

物理机:192.168.10.1(Mesos,Zookeeper,Marathon)
虚拟机:192.168.122.10(Mesos,Zookeeper)
虚拟机:192.168.122.46(Mesos,Zookeeper)

所有三台机器的操作系统都是Fedora 23 Server

默认情况下,这两个网络已经进行了路由,因为虚拟机都驻留在物理计算机上。

没有防火墙设置。

Mesos选举日志:

Master bound to loopback interface! Cannot communicate with remote schedulers or slaves. You might want to set '--ip' flag to a routable IP address.

我可以手动设置,但是我无法动态设置... --ip_discovery_command标志无法识别。

我想要做的是将下面的脚本链接到那个标志。

if [[ $(ip addr) == *enp8s0* ]]; 
then 
    ip addr show enp8s0 | awk -F'/| ' '/inet/ { print $6 }'
else 
    ip addr show eth0 | awk -F'/| ' '/inet/ { print $6 }'
fi

当我手动设置时(不是我想做的)...

IP:5050处的Mesos页面出现了......但是由于这个原因,1分钟后mesos-master失败...

F0427 17:03:27.975260  6914 master.cpp:1253] Recovery failed: Failed to recover registrar: Failed to perform fetch within 1mins
*** Check failure stack trace: ***
    @     0x7f8360fa9edd  (unknown)
    @     0x7f8360fabc50  (unknown)
    @     0x7f8360fa9ad3  (unknown)
    @     0x7f8360fac61e  (unknown)
    @     0x7f83619a85dd  (unknown)
    @     0x7f83619e7c30  (unknown)
    @     0x55a885ee3b2e  (unknown)
    @     0x7f8361a11c0e  (unknown)
    @     0x7f8361a5d75e  (unknown)
    @     0x7f8361a7077a  (unknown)
    @     0x7f83618f4aae  (unknown)
    @     0x7f8361a70768  (unknown)
    @     0x7f8361a548d0  (unknown)
    @     0x7f8361fc832c  (unknown)
    @     0x7f8361fd42a5  (unknown)
    @     0x7f8361fd472f  (unknown)
    @     0x7f8360a5e60a  start_thread
    @     0x7f835fefda4d  __clone Aborted (core dumped)

Zookeeper的设置如下:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/var/lib/zookeeper/data
dataLogDir=/var/lib/zookeeper/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1:192.168.10.1:2888:3888
server.2:192.168.122.46:2888:3888
server.3:192.168.122.10:2888:3888

并且不知道如何验证它是否正常工作......

老实说,我的绳子结束了......过去一周因为文件很差而缺乏适当的架构解释(主要是马拉松)可怕的组织日志(Mesos),拔出我的头发,系统无法正确解析bash并将输出用作变量,并且缺乏指令。

我做错了吗?我感谢我能得到的任何帮助,如果您需要我尚未提供的任何帮助,请告诉我,我会立即发布。

编辑:

我通过向VM添加两个额外的Marathon服务器来修复marathon的问题,以便它们可以形成一个法定人数。

EDIT2:

我现在遇到的问题是Mesos服务器继续迅速重新选举领导者......但是根据结果我将在稍后对此进行研究......

1 个答案:

答案 0 :(得分:2)

如果您密切关注installation docs,我认为您应该让它发挥作用。

例如你" Master绑定到loopback"问题是恕我直言与错误/不完整的设置有关。参见:

  

主机名(可选)

     

如果您无法直接解析计算机的主机名(例如,如果在其他网络上或使用VPN),请将/etc/mesos-master/hostname设置为您可以解析的值,例如,外部可访问的IP地址或DNS主机名。这将确保Mesos控制台中的所有链接都能正常工作。

     

您还需要在/etc/marathon/conf/hostname

中设置此属性

此外,我还建议您在/etc/mesos-master/ip文件中设置主IP地址。始终确保主机名可解析为非本地IP地址,即通过在每个主机上的/etc/hosts文件中添加条目。

基本上,/etc/hosts文件看起来与此类似(用实际名称替换主机名):

127.0.0.1 localhost

192.168.10.1 host1
192.168.122.10 host2
192.168.122.46 host3

如果您只想测试Mesos群集,还可以使用预先配置的Vagrant解决方案,例如tobilg/coreos-mesos-cluster

关于ZooKeeper设置,请确保在每个节点上创建了/var/lib/zookeeper/myid,其中包含您为每个节点设置的实际数字ID,例如对于192.168.10.1,文件的唯一内容必须是1

在调试主服务器之前,请检查ZooKeeper集群是否正常工作,以及是否选择了某个负责人。确保/etc/mesos/zk在每个主机上包含正确的ZooKeeper连接字符串,例如

zk://192.168.10.1:2181,192.168.122.10:2181,192.168.122.46:2181/mesos

如果ZK正常工作,请重启服务并检查Masters日志。对奴隶做同样的事。

参考文献: