DmitrySemenov
DmitrySemenov

Reputation: 10365

ZooKeeper node counter?

I have a cluster of ZooKeeper with just 2 nodes, each zoo.conf has the following

# Servers
server.1=10.138.0.8:2888:3888
server.2=10.138.0.9:2888:3888

the same two lines are present in both configs

[root@zk1-prod supervisor.d]# echo mntr | nc  10.138.0.8 2181
zk_version      3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
zk_avg_latency  0
zk_max_latency  0
zk_min_latency  0
zk_packets_received     5
zk_packets_sent 4
zk_num_alive_connections        1
zk_outstanding_requests 0
zk_server_state follower
zk_znode_count  4
zk_watch_count  0
zk_ephemerals_count     0
zk_approximate_data_size        27
zk_open_file_descriptor_count   28
zk_max_file_descriptor_count    4096

[root@zk1-prod supervisor.d]# echo mntr | nc  10.138.0.9 2181
zk_version      3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
zk_avg_latency  0
zk_max_latency  0
zk_min_latency  0
zk_packets_received     3
zk_packets_sent 2
zk_num_alive_connections        1
zk_outstanding_requests 0
zk_server_state leader
zk_znode_count  4
zk_watch_count  0
zk_ephemerals_count     0
zk_approximate_data_size        27
zk_open_file_descriptor_count   29
zk_max_file_descriptor_count    4096
zk_followers    1
zk_synced_followers     1
zk_pending_syncs        0

so why zk_znode_count == 4 ?

Upvotes: 1

Views: 1451

Answers (1)

franklinsijo
franklinsijo

Reputation: 18290

Znodes are not Zookeeper servers.

From Hadoop Definitive Guide:

Zookeeper doesn’t have files and directories, but a unified concept of a node, called a znode, which acts both as a container of data (like a file) and a container of other znodes (like a directory).

zk_znode_count refers to number of znodes available in that Zookeeper server. In your ZK ensemble, each server has four znodes.

Upvotes: 3

Related Questions