I am trying to configure the ensemble of 3 nodes following the documentation. All of them are on Linux Ubuntu. on all the three nodes configuration file looks like this :>
I had a similar issue. I have got some hints of what the problem may be from here and here. In my case, the output of the command netstat -plutn
was showing something including 127.0.0.1:3888 for the election port 3888. I have solved the problem by changing part of zoo.cfg on server n, from something like
server.1=name.of.s1:2888.3888
...
server.n=localhost:2888:3888
...
to
server.1=name.of.s1:2888.3888
...
server.n=0.0.0.0:2888:3888
...
After a ZooKeeper restart, the output of netstat -plutn includes :::3888.
Apparently this is needed for ZooKeeper to properly expose the election port, in this case 3888.