Kafka cluster ZooKeeper integration¶
Apache Kafka relies on ZooKeeper for distributed coordination and management of cluster metadata^[kafka-01.md].
Connection Configuration¶
The integration is defined in the Kafka server.properties configuration file using the zookeeper.connect property^[kafka-01.md].
This value must be provided as a comma-separated list of host:port pairs, corresponding to each server in the ZooKeeper ensemble^[kafka-01.md].
Example configuration:
zookeeper.connect=localhost:2181,localhost1:2181,localhost2:2181
Optionally, a chroot string may be appended to the URLs to specify a root directory for all Kafka znodes^[kafka-01.md].
Cluster Identification¶
To form a Kafka cluster, each broker must be assigned a unique integer identifier via the broker.id property^[kafka-01.md]. This ensures that every node within the ZooKeeper-managed cluster can be distinctly addressed.
Consumer Dependencies¶
Console consumers interact directly with ZooKeeper to fetch topic metadata and offsets^[kafka-01.md].
Example command:
bin/kafka-console-consumer.sh --zookeeper hadoop101:2181 --topic first
This direct dependency indicates that ZooKeeper serves as the central source of truth for consumer state within the cluster's integration architecture^[kafka-01.md].
Sources¶
^[kafka-01.md]