Reputation: 854
a question troubled me a long time. I know the leader election exists in zookeeper. Suppose we have a Kafka cluster connected with Zookeeper ensemble .
So my understanding is like, there is a zookeeper leader in Ensemble, and there are some "partition leaders" in Kafka cluster as well. And Kafka partition leader are elected through Zookeeper API. Is it right ?
Another question, Is master/worker basically same as leader/follower ?
Upvotes: 6
Views: 9599
Reputation: 7091
Partition leader election in Kafka is not done through zookeeper API, actually, the first replica in alive assign replicas will be elected as the leader for each partition.
As for the master/worker things, as I know, many open sources have already replaced the old terminology with leader/replica or primary/replica, so basically, they are the same.
Upvotes: 2
Reputation: 341
unclean.leader.election.enable=true
, then the first available replica will be elected as partition leader, no matter it's in ISR or not.
So some messages maybe lost.Upvotes: 7