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-partitions

Related terms

Taught in

References

Certification courses