Zookeeper and kafka relationship
Kafka uses Zookeeper for the following:
Source : Quora
- Electing a controller. The controller is one of the brokers and is responsible for maintaining the leader/follower relationship for all the partitions. When a node shuts down, it is the controller that tells other replicas to become partition leaders to replace the partition leaders on the node that is going away. Zookeeper is used to elect a controller, make sure there is only one and elect a new one it if it crashes.
- Cluster membership - which brokers are alive and part of the cluster? this is also managed through ZooKeeper.
- Topic configuration - which topics exist, how many partitions each has, where are the replicas, who is the preferred leader, what configuration overrides are set for each topic
- (0.9.0) - Quotas - how much data is each client allowed to read and write
- (0.9.0) - ACLs - who is allowed to read and write to which topic
- (old high level consumer) - Which consumer groups exist, who are their members and what is the latest offset each group got from each partition
Zookeeper maintains, all in tree like strycture, all brokers(if controller), its topics, its partitions (if leader)...
Q) What is the actual role of ZooKeeper in Kafka?
A) Zookeeper is mainly used to track status of nodes present in Kafka cluster and also to keep track of Kafka topics, messages, etc.
Q) What benefits will I miss if I not used zookeeper and kafka together?
A) You cannot avoid using Zookeeper (ZK). Kafka is dependent of Zookeeper, there's no escape from ZK.
Comments
Post a Comment