Kafka Zookeeper Deep Dive

Consider main root kafka znode as /kafka

/kafka

After this main root level znode there are below child nodes for for kafka znode

/cluster /controller /controller_epoch /brokers /admin /isr_change_notification /consumers /config

Now lets discuss each znode in the detail

/cluster

cluster znode contains id

ls /kafka/cluster
[id]
get /kafka/cluster/id
{"version":"1","id":"IOejp_IKSbWbySJc0sRrKw"}

/controller

Controller znode does not contain any child node that znode contains information of active controller broker id

get /kafka/controller
{"version":1,"brokerid":1001,"timestamp":"1571666282268"}

/controller_epoch

This contains epoch value of controller

get /kafka/controller_epoch
1

/brokers

brokers znode contains information about brokers like their ids and host information

ls /kafka/brokers
[ids, topics, seqid]

/brokers/ids

ids znode will show all the broker ids in there

ls /kafka/brokers/ids
[1003, 1002, 1001]

Each id of broker will further contain information about that particular broker

get /kafka/brokers/ids/1003
{"jmx_port":-1,"timestamp":"1571666399659","endpoints":["PLAINTEXT://c1198-node4.squadron.support.hortonworks.com:6667"],"host":"c1198-node4.squadron.support.hortonworks.com","version":3,"port":6667,"rack":"/default-rack"}
get /kafka/brokers/ids/1002
{"jmx_port":-1,"timestamp":"1571666282414","endpoints":["PLAINTEXT://c1198-node2.squadron.support.hortonworks.com:6667"],"host":"c1198-node2.squadron.support.hortonworks.com","version":3,"port":6667,"rack":"/default-rack"}
get /kafka/brokers/ids/1001
{"jmx_port":-1,"timestamp":"1571666282388","endpoints":["PLAINTEXT://c1198-node3.squadron.support.hortonworks.com:6667"],"host":"c1198-node3.squadron.support.hortonworks.com","version":3,"port":6667,"rack":"/default-rack"}

/brokers/topics

This znode shows all the topics which are created there on the kafka cluster

ls /kafka/brokers/topics
[ambari_kafka_service_check, benchmark]
ls /kafka/brokers/topics/benchmark
 [partitions]
ls /kafka/brokers/topics/benchmark/partitions
 [0, 1, 2]
ls /kafka/brokers/topics/benchmark/partitions/0
 [state]
get /kafka/brokers/topics/benchmark/partitions/0/state
 {"controller_epoch":8,"leader":1001,"version":1,"leader_epoch":0,"isr":[1001,1003,1002]}

/brokers/seqid

This is child znode which does not contain any information in it

/admin

ls /kafka/admin
 [delete_topics]
ls /kafka/admin/delete_topics
[]

/isr_change_notification

Leave a Comment