rpk cluster partitions transfer-leadership
Transfer partition leadership between brokers.
You can transfer only one partition leader at a time.
Redpanda tries to balance leadership distribution across brokers by default. If the distribution of leaders becomes uneven as a result of transferring leadership across brokers, the cluster may move leadership back to the original brokers automatically. |
Examples
Transfer partition leadership:
rpk cluster partitions transfer-leadership foo --partition 0:2
The preceding example shows how to transfer leadership for the partition kafka/foo/0
to broker 2. By default, it uses the kafka
namespace, but you can specify an internal namespace using the {namespace}/
prefix.
Equivalent command using different syntax:
rpk cluster partitions transfer-leadership --partition foo/0:2
Flags
Value | Type | Description |
---|---|---|
|
string |
Output format. Possible values: |
|
- |
Help for transfer-leadership. |
|
string |
The topic partition to which to transfer leadership and specify the new leader location. Syntax |
|
string |
Redpanda or |
|
stringArray |
Override |
|
string |
Profile to use. See |
|
- |
Enable verbose logging. |