我有三台机器 M1、M2 和 M3。我在 M1 上部署了 mesos-master、zookeeper 和 marathon,在 M2 和 M3 上部署了 mesos-slave。然而,在 Mesos Gui 上,显示了零奴隶。然后我运行命令mesos-resolvecat /etc/mesos/zk
来检查从站是否发现了正确的主站。但是不,它错误地将 127.0.0.1:5050 发现为主服务器。以下是上述命令的日志:
2015-07-31 15:38:02,522:17271(0x7f538b7cf700):ZOO_INFO@zookeeper_init@786: Initiating client connection, host=M1_IP:2181 sessionTimeout=10000 watcher=0x7f5392b130b0 sessionId=0 sessionPasswd=<null> context=0x7f5378003960 flags=0
2015-07-31 15:38:02,525:17271(0x7f5386dba700):ZOO_INFO@check_events@1703: initiated connection to server [M1_IP:2181]
2015-07-31 15:38:02,541:17271(0x7f5386dba700):ZOO_INFO@check_events@1750: session establishment complete on server [M1_IP:2181], sessionId=0x14ee590e0ec0008, negotiated timeout=10000
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0731 15:38:02.541931 17273 group.cpp:313] Group process (group(1)@127.0.0.1:53978) connected to ZooKeeper
I0731 15:38:02.542022 17273 group.cpp:787] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
I0731 15:38:02.542045 17273 group.cpp:385] Trying to create path '/mesos' in ZooKeeper
I0731 15:38:02.545756 17273 detector.cpp:138] Detected a new leader: (id='1')
I0731 15:38:02.545891 17273 group.cpp:656] Trying to get '/mesos/info_0000000001' in ZooKeeper
W0731 15:38:02.547034 17273 detector.cpp:444] Leading master master@127.0.0.1:5050 is using a Protobuf binary format when registering with ZooKeeper (info): this will be deprecated as of Mesos 0.24 (see MESOS-2340)
I0731 15:38:02.547114 17273 detector.cpp:481] A new leading master (UPID=master@127.0.0.1:5050) is detected
如日志所示,我在 M1/zookeeper 中查找了 /mesos/info_0000000001 的节点值。原来是这样的:
!20150801-152910-16777343-5050-765???'"master@127.0.0.1:5050*
marathon-120.23.0
Mesos 主设置:cat /etc/mesos/zk
zk://M1_IP:2181/mesos
所以看起来,M1 的 mesos 主控如何不将其绝对 IP 存储在 Zookeeper 节点中。任何人都可以解释这种奇怪的行为。