'Zookeeper Znode count is different from use command that getAllChildrenNumber of zkcli.sh

How do I find the missing znodes?

I use Zookeeper version: 3.7.0 in the docker engine.

Method 1: When I use ZooKeeper Commands - srvr to find znode number, it shows 5 znode count.

# echo srvr | nc localhost 2181
Zookeeper version: 3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC
Latency min/avg/max: 0/0.1812/12
Received: 2709
Sent: 2708
Connections: 1
Outstanding: 0
Zxid: 0x1a
Mode: standalone
Node count: 5

Method 2: When I use ZooKeeper tool - zkcli.sh to find znode number, it shows 3 znode count.

  1. use command zkcli.sh
# pwd
/apache-zookeeper-3.7.0-bin/bin
# ./zkCli.sh
  1. use
[zk: localhost:2181(CONNECTED) 0] ls -R /
/
/zookeeper
/zookeeper/config
/zookeeper/quota

[zk: localhost:2181(CONNECTED) 2] getAllChildrenNumber /
3


[zk: localhost:2181(CONNECTED) 3] get -s /

cZxid = 0x0
ctime = Thu Jan 01 00:00:00 UTC 1970
mZxid = 0x0
mtime = Thu Jan 01 00:00:00 UTC 1970
pZxid = 0x19
cversion = 1
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 1

[zk: localhost:2181(CONNECTED) 4] get -s /zookeeper

cZxid = 0x0
ctime = Thu Jan 01 00:00:00 UTC 1970
mZxid = 0x0
mtime = Thu Jan 01 00:00:00 UTC 1970
pZxid = 0x0
cversion = -2
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 2

Use 'Method 2- zkcli.sh' we can All Znode is only 3 (/zookeeper,/zookeeper/config,/zookeeper/quota),but 'Method 1- srvr' is 5,This situation is inconsistent on both methods. How do I find the two missing znodes?

  1. ZooKeeper-cli: the ZooKeeper command line interface
  2. ZooKeeper Commands: The Four Letter Words
  3. ref:zookeeper znode count
  4. zookeeper znode introdution
  5. Alerting with Prometheus-znode_count


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source