这是我第一次尝试ZooKeeper,虽然我可以轻松地将它设置为在单台机器上运行,但让它在两台机器的集群中运行并不是一切工作。我认为这可能是我的配置有问题,但看起来不像我能找到它。ZooKeeper集群无法正常工作,没有发生选举
Here are the logs for server 1
Here are the logs for server 2
而且我的配置是两个服务器如下:
# 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.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181
server.1=redis1:2888:3888
server.2=redis2:2888:3888
什么问题可能是任何想法?
我在运行OpenJDK 7的Ubuntu Linux中运行ZooKeeper 3.4.5。试图在OpenJDK 6上运行,但仍然遇到同样的问题。
你应该能够有偶数个节点的一次大选。有了2个节点,两个节点都必须选举完成。 – sbridges
由于日志显示,两个节点都已启动并正在运行,而选举从未发生过。一旦我得到第三个节点,选举就发生了,现在我的群集运行良好。 –
如果你杀死了当前的领导者,那么其他节点是否就新的领导者达成一致? – sbridges