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
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.
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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With