Skip to content
Kafka Is FunProgress

Lesson 4 of 5

Preferred Leader Election

Each partition has a 'preferred' leader — the first replica in its replica assignment list. After broker restarts, leadership can become unbalanced. Preferred leader election (PLE) moves leadership back to the original brokers, ensuring even load distribution. Kafka can do this automatically (auto.leader.rebalance.enable=true) or manually via CLI.

Key configuration

broker / client configurationproperties
auto.leader.rebalance.enable=true — automatic rebalancing
leader.imbalance.per.broker.percentage=10 — trigger threshold

Try it in the simulator

Guided scenarios for this module — the simulator opens with the exercise already running.