1

Now I want to get the watch count of the specified znode in ZooKeeper. I have read the official tutorial and known the mntr command. But it's for the whole QuorumServer.

So does ZooKeeper provide the API to get the number of watches of the specified znode? I'm also using kazoo and how can we get this data?

tobe
  • 1,671
  • 2
  • 23
  • 38

1 Answers1

2

Just found this question, and you probably already figured this out but to get the total number of active watches you can run the following command:

Command

echo wchs | nc localhost 2181

Output

68 connections watching 114 paths
Total watches:197

You can find a slew of commands in the zookeeper admin page. http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html

MatthewJ
  • 3,127
  • 2
  • 27
  • 34
  • Documentation link no longer works. Here's the current link: https://zookeeper.apache.org/doc/current/zookeeperAdmin – Stuart Mclean Apr 26 '18 at 12:50
  • For some reason, the output of that command isn't accurate for me ! I'm seeing two watches for two ephemeral nodes while I'm actually having more than 10 watches ! – Muhammad Gelbana Nov 02 '19 at 22:01