This ZooKeeper instance is not currently serving requests

When one of your zookeeper nodes is sending you this message, that means that your Zookeeper cluster hasn’t started in the right order.
 
Solution: Restart your cluster (node per node), starting from node 1 (as stated in zoo.conf)
 
This problem is easy to diagnose. When the order was wrong you will get this output:

[myserver:myuser] ~: echo stat | nc localhost 2181
This ZooKeeper instance is not currently serving requests

 
After you’ve restarted all nodes (in the correct order), you will get this output:

[myserver:myuser] ~: echo stat | nc localhost 2181 |grep Mode
Mode: follower
[myserver:myuser] ~: echo stat | nc localhost 2181 |grep Mode
Mode: leader

 
 
Hope this will help you out!

4 Replies to “This ZooKeeper instance is not currently serving requests”

    1. Hi Rahul, I saw this in a virtualized environment. Don’t think it’s restricted to any environment. I think it has to do with the order in which the nodes are started.

  1. OMG, you think the error message could be clearer? I’ve been fighting this for two days and couldn’t imagine the zookeeper architecture to be so… fragile.
    Thank you for posting this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.