Is there a cli or some command-line, that I can use to find the zookeeper cluster status. Basically I want to know how to member in cluster or which nodes is acting as a leader.
Any pointers will be helpful.
Saw this question in stackoverflow: https://stackoverflow.com/questions/16669104/how-to-get-current-zookeeper-clusters-member-server-list, but wasn't helpful
Best Answer
You can determine which node is acting as a leader by enter the following command:
You will get the response if the node is acting as a leader:
If it is a follower, you will see:
Alternatively, you can use the zkServer.sh located in /opt/zookeeper/bin:
The output of which would be:
You can obtain even more information using:
The output of which is:
If the node is a leader, you will also see:
The following will not be present on Windows platforms:
Using the information above, you can determine the health of your Zookeeper ensemble.