Command to determine whether ZooKeeper Server is Leader or Follower

Posted by utrecht on Server Fault See other posts from Server Fault or by utrecht
Published on 2014-06-03T09:07:52Z Indexed on 2014/06/03 9:26 UTC
Read the original article Hit count: 212

Filed under:
|

Introduction

A ZooKeeper Quorum consisting of three ZooKeeper servers has been created.

The zoo.cfg located on all three ZooKeeper servers looks as follows:

maxClientCnxns=50
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181

server.1=ip1:2888:3888
server.2=ip2:2888:3888
server.3=ip3:2888:3888

It is clear that one of the three ZooKeeper servers will become the Leader and the others Followers. If the Leader ZooKeeper server has been shutdown the Leader election will start again. The aim is to check if another ZooKeeper server will become the Leader if the Leader server has been shut down.

Question

Which command needs to be issued to check whether a ZooKeeper server is a Leader or a Follower?

© Server Fault or respective owner

Related posts about linux

Related posts about zookeeper