menu

Zookeeper

Zookeeper manages brokers (keep a list of them):

Zookeeper are managing kafka brokers and zookeeper is a software. Zookeeper is going to keep a list of your kafka brokers.

Zookeeper helps in performing leader election for partitions:

Zookeeper is also going to be very helpful for kafka because whenever we have a broker going down, we need to perform a leader election to choose new leader for partitions and zookeeper is going to help with this process.

Zookeeper send notifications to kafka in case of changes (eg. new topic, broker dies, broker comes up, delete topic etc.)

Zookeeper is going to send notifications to kafka brokers in case of changes.

For eg. when a new topic is created, when a kafka broker goes down or comes up, deletion of topic and so on. So, zookeeper has a lot of the kafka metadata.

Zookeeper by design operates with an odd number of servers (1,3,5,7):

Zookeeper by design is going to operate with an odd number of servers. So either you have 1 zookeeper or 3 zookeeper or 5 zookeeoer or seven zookeeper, never more than 7 usually.

Zookeeper has a leader (writes) the rest of the server are followers (read):

Zookeeper also has a concept of leaders and the rest are followers. So, one one for writes and the rest for reads.

Zookeeper does not store consumer offsets with kafka > v0.10

Kafka consumer in the old versions of kafka used to store consumer offsets on zookeeper. But now, as we know they store consumer offsets on the internal kafka topics named consumer offsets.

So, zookeeper does not hold any consumer data. Starting with kafka version 0.10.

In block diagram, we have 3 zookeeper servers, the second one is the leader and brokers are connected to zookeeper and that's how they get their metadata.

img not found