我正在配置三个mesos主人,现在正在设置zookeeper。 zoo.cfg:
server.1=cersei-master1:2888:3888
server.2=tywin-master2:2888:3888
server.3=jaime-master3:2888:3888
maxClientCnxns=50
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/lib/zookeeper
clientPort=2181

zookeeper登录cersei-master1:
2016-03-25 06:09:59,547 [myid:1] - WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 2 at election address tywin-master2:3888
java.net.UnknownHostException: tywin-master2
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)
2016-03-25 06:09:59,548 [myid:1] - WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 3 at election address jaime-master3:3888
java.net.UnknownHostException: jaime-master3
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)
2016-03-25 06:09:59,548 [myid:1] - INFO [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@774] - Notification time out: 60000

我的主机名位于/ etc / hosts
127.0.0.1 cersei-master1 localhost localhost.localdomain localhost4 localhost4.localdomain4

我还为zoo.cfg设置了ip' s和0.0.0.0为当前节点。空空如也。我做错了什么?
提前致谢
答案 0 :(得分:1)
当我尝试在群集模式下运行zookeeper时遇到了同样的问题。我正在使用centos 7 OS。如果您使用相同的。尝试刷新Iptables
iptables -F
并重新启动zookeeper。它将开始。