preferred leader election
Moving a partition's leadership back to the first replica in its assignment.
In more detail
After a broker restarts, the partitions it led are led elsewhere and the load is uneven. Kafka moves leadership back automatically when auto.leader.rebalance.enable is on, or kafka-leader-election with the preferred election type does it on demand.
Example
kafka-leader-election --election-type PREFERRED --all-topic-partitionsRelated terms
- partition leader — The replica of a partition that handles all reads and writes for it; the other replicas copy from it.
- leader election — The process by which the members of a distributed system choose one of themselves to act as leader.
- broker — A server that receives messages from producers, stores them and delivers them to consumers, such as RabbitMQ or Apache Kafka.
Taught in
- Acknowledged Is Not Always Safe — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- The New Broker That Did Nothing — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Forty One Under-Replicated Partitions — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep