【问题标题】:Cannot Start Mesos/Marathon Cluster无法启动 Mesos/Marathon 集群
【发布时间】:2016-08-21 10:53:36
【问题描述】:

物理机: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 页面出现了……但由于这个原因,mesos-master 在 1 分钟后失败了……

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

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

老实说,我已经走到尽头了.. 由于文档不足和缺乏适当的架构解释(主要是 Marathon),在过去的一周里,我在这件事上拉了我的头发。正确解析 bash 并将输出用作变量,并且周围缺少指令。

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

编辑:

我通过向虚拟机添加两个额外的 Marathon 服务器来解决 marathon 的问题,以便它们可以形成一个仲裁。

EDIT2:

我现在遇到了 Mesos 服务器不断快速重新选举领导者的问题......但根据结果,我稍后会调查......

【问题讨论】:

    标签: apache-zookeeper mesos marathon


    【解决方案1】:

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

    例如,您的“主绑定到环回”问题是恕我直言,与不正确/不完整的设置有关。见:

    主机名(可选)

    如果您无法直接解析机器的主机名(例如,如果在不同的网络上或使用 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

    在调试 master 之前,检查 ZooKeeper 集群是否正常工作,以及是否选举了领导者。确保 /etc/mesos/zk 在每个主机上包含正确的 ZooKeeper 连接字符串,例如

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

    如果 ZK 工作正常,则重新启动服务并检查 Masters 日志。对奴隶也这样做。

    参考资料:

    【讨论】:

    • 请注意@tobi:open.mesosphere.com 已被弃用,很快就会消失,可能不想将其用作参考,继续前进;)
    • @MichaelHausenblas 感谢您的提醒。如果能在页面的某处说明这一点,那就太好了。我能够使用提供的可用链接为不同的操作系统配置集群,所以它们似乎仍然是正确的(说到最新的 Mesos 版本)。
    • 我的安装没有 /etc/mesos 和 /etc/mesos-master 或 /etc/zookeeper/conf/ 目录...我也不知道它是否会读取它们...好消息是我的动物园管理员运行良好。我会尝试创建它们,看看效果如何。
    • 你是如何安装 Mesos 的?通过官方存储库?恕我直言,这些路径应该在那里......
    • 您按照文档操作是对的...我自己就快到了,但我没有在独立模式下设置马拉松(我只有一个节点),所以马拉松试图创建一个仲裁,并且不能只使用一个节点。
    猜你喜欢
    • 2015-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-13
    • 2012-12-01
    相关资源
    最近更新 更多