The partition reassignment tool, kafka-reassign-partitions.sh, moves topic partitions and replicas among brokers. It is most useful for complex reassignment plans spanning multiple topics or for redistributing broker load. section 3.1.2 section 3.3
Use the tool when the reassignment needs more flexibility than a topic-level operation provides:
- Change a topic’s replication factor by assigning replicas to different brokers; the replication factor cannot exceed the broker count. section 3.1.2
- Redistribute partitions among brokers to balance load while preserving Kafka’s partition-ordering model. section 3.1.2 section 3.3
- Perform intricate reassignment plans across multiple topics, including automatic redistribution of assignments. section 3.1.2
Balancing replicas across brokers
Suppose several topics need their partitions redistributed because broker load is uneven, or their replication factors must change. Use kafka-reassign-partitions.sh for the multi-topic reassignment rather than relying only on kafka-topics.sh, which may be sufficient for a single topic. section 3.1.2 section 3.3
