You can use jmx to to find such information. Also you can just do this
Echo stat | nc localhost clientport
To get status from the zookeeper servers. This is all documented in the
forrest docs at
Hope this helps.
> Ensemble : object representing a zookeeper ensemble
> Long Ensemble.getLastTxid()
> ZKServer Ensemble.getCurrentLeader()
> ZKServer Ensemble.getPastLeaders()
> ZKServer Ensemble.getConnectedServers()
> ZKServer Ensemble.getDisConnectedServers()
> Boolean doWeHaveAQuorum()
> ZKServer : object representing a zookeeper server
> Client ZKServer.getClients()
> Client ZKServer.getDisconnectedClients()
> Boolean isLeader()
> Boolean isAbleToBeLeader()
> int get|set VotingWeight()
> Group get|set GroupMembership()
Most of this is available via the stat/jmx.
> It would be cool if...
> 1. The ensemble could trigger nagios type alerts if it no longer had a
> 2. The ensemble could dynamically bring up new zk servers in the event
> that enough severs have died to prevent a quorum
> 3. The ensemble/server api could allow analysis of problem servers
> (servers that keep dropping connections and/or clients)
Nice idea... But we do not have anything like this as of now.