This is my first time trying out ZooKeeper and while I could easily set it up for running in a single machine, getting it to run in a cluster of two machines is not working at all. I think it might be something wrong with my configuration, but doesn’t look like I can find it.
Here are the logs for server 1
Here are the logs for server 2
And my configuration is as follows for both servers:
# 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
Any ideas on what the issue could be?
I’m running ZooKeeper 3.4.5 in an Ubuntu Linux box running OpenJDK 7. Tried to run on OpenJDK 6 but still got the same issue.
And the issue was that I had an even number of nodes, you need an odd number of nodes to be able to run an election (obviously). The documentation should be updated to cover that, since the basic example shows exactly 2 servers being configured.