Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to set up zookeeper in replicated mode

I am trying to set up zookeeper in replicated node with 3 server.

my config file is like this

tickTime=2000 
dataDir=/var/lib/zookeeper/ 
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888

I am getting following exception

QuorumPeer:/0:0:0:0:0:0:0:0:2181:FastLeaderElection@642] - Adding vote 

2009-09-23 15:30:28,099 - WARN  [WorkerSender Thread:QuorumCnxManager@336] - 
Cannot open channel to 3 at election address zoo1/172.21.31.159:3888 
java.net.ConnectException: Connection refused at sun.nio.ch.Net.connect(Native Method)> at 
sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507) 
at java.nio.channels.SocketChannel.open(SocketChannel.java:146) 
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:

All ports are open and ssh, telnet are also working.

Thanks

like image 526
nat Avatar asked Feb 23 '23 16:02

nat


1 Answers

Here is a quick checklist:

  • Do you have a /var/lib/zookeeper/myid file?
  • Are ids defined in that file in sync with machine names/IPs defined in config (zoo1 having id 1, etc...)?
like image 176
Slartibartfast Avatar answered Mar 18 '23 18:03

Slartibartfast