我正在尝试以分布式模式安装 zookeeper 和 HBase,但是当我启动 zookeeper quorum 的最后一个节点时,我得到了异常:
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 quorum 设置为 3 - 包含来自 hadoop 的 master + 2data 节点。zoo.cfg 列出所有这些机器。他们将 myid 设置为 1 表示主节点,3 表示第一个数据模式,4 表示第二个数据节点。主节点和第一个数据节点运行得很好。