Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zookeeper unable to listen on port 3888

I've got 3 servers on aws. each with open jdk 7 and zookeeper 3.4.6 all have unique elastic ip's. each conf/zoo.cfg has

  • clientPort=2181
  • server.1=server1:2888:3888
  • server.2=server2:2888:3888
  • server.3=server3:2888:3888

then i start it with ./zkServer.sh start (says STARTED) and the zookeeper.out says

2015-01-14 09:27:55,919 [myid:1] - INFO  [Thread-1:QuorumCnxManager$Listener@504] - My election bind port: /server1ipaddress:3888
2015-01-14 09:27:55,920 [myid:1] - ERROR [/server1ipaddress:3888:QuorumCnxManager$Listener@517] - Exception while listening
    java.net.BindException: Cannot assign requested address
            at java.net.PlainSocketImpl.socketBind(Native Method)
            at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
            at java.net.ServerSocket.bind(ServerSocket.java:376)
            at java.net.ServerSocket.bind(ServerSocket.java:330)
            at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:507)

So it cant open the port. i've eventually opened all ports on aws security to rule that out.

  • telnet into 2181 with ruok gets imok.
  • telnet into 2888 cannot connect. connection refused.
  • telnet into 3888 cannot connect. connection refused.

netstat shows that nothing is blocking 2888 and 3888

i've even tried this with all 3 servers having zookeeper started. whats going on? how do i get those ports open for use.

like image 912
Mithun Kalan Avatar asked Jan 14 '15 09:01

Mithun Kalan


People also ask

What is syncLimit in ZooKeeper?

The entry syncLimit limits how far out of date a server can be from a leader. With both of these timeouts, you specify the unit of time using tickTime. In this example, the timeout for initLimit is 5 ticks at 2000 milleseconds a tick, or 10 seconds.

What is tickTime in ZooKeeper?

tickTime : the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime. dataDir : the location to store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.

What are the essential configuration for ZooKeeper?

ZooKeeper runs in Java, release 1.6 or greater (JDK 6 or greater). It runs as an ensemble of ZooKeeper servers. Three ZooKeeper servers is the minimum recommended size for an ensemble, and we also recommend that they run on separate machines.


2 Answers

Cross verify myid's on all the nodes based on the zoo.cfg. The same issue happened to me, upon looking myid pattern got changed on 2 of the nodes.

like image 175
Rohit Avatar answered Sep 19 '22 19:09

Rohit


Your problem is answered here.

In a few words: on each ZooKeeper machine, at your conf/zoo.cfg, you have to set the current server's IP to 0.0.0.0. For example: if you are currently on server1, the config should contain the following lines:

server.1=0.0.0.0:2888:3888
server.2=server2:2888:3888
server.3=server3:2888:3888

This step solved the problem in my case.

like image 31
Irek Nazmiev Avatar answered Sep 16 '22 19:09

Irek Nazmiev