zookeeper服务器错误:我的id 4不在对等列表中

时间:2013-09-06 07:44:25

标签: apache-zookeeper

我正在尝试以分布式模式安装zookeeper和HBase但是当我启动zookeeper仲裁的最后一个节点时,我得到的除外:

2013-09-05 12:02:09,230 - ERROR [main:QuorumPeer@171] - Setting LearnerType to   PARTICIPANT but 4 not in QuorumPeers. 
2013-09-05 12:02:09,246 - INFO  [main:QuorumPeer@444] - acceptedEpoch not found!  Creating with a reasonable default of 0. This should only happen when you are upgrading   your installation
2013-09-05 12:02:09,250 - ERROR [main:QuorumPeerMain@89] - Unexpected exception, exiting abnormally
java.lang.RuntimeException: My id 4 not in the peer list
at  org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer.java:479)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:411)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:151)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

我将zookeeper仲裁设置为3 - 包含来自hadoop的master + 2data节点。 zoo.cfg列出所有这些机器。并且它们将myid设置为1表示主机,3表示第一数据模式,4表示第二数据节点。主数据节点和第一个数据节点运行正常。

2 个答案:

答案 0 :(得分:12)

似乎它是由myid和zoo.cfg的内容之间的不一致引起的 - 当我统一服务器时。在myid文件中,它没有问题。

答案 1 :(得分:1)

如果您在Kafka安装的情况下遇到此问题,请转至zookeeper.properties文件并检查myid的值是什么。

server.<<myid>> = hostname:2181

myid的相同值必须位于动物园活动的myid中的datadir文件中, 在我的情况下是:

/tmp/zookeeper/myid