rpk cluster partitions move
Move partition replicas across nodes / cores.
This command changes replica assignments for given partitions. By default, it
assumes the kafka namespace, but you can specify an internal namespace using
the {namespace}/ prefix.
To move replicas, use the following syntax:
rpk cluster partitions move foo --partition 0:1,2,3 -p 1:2,3,4
Here, the command assigns new replicas for partition 0 to brokers [1, 2, 3] and
for partition 1 to brokers [2, 3, 4] for the topic foo.
You can also specify the core id with -{core_id} where the new replicas
should be placed:
rpk cluster partitions move foo -p 0:1-0,2-0,3-0
Here all new replicas [1, 2, 3] will be assigned on core 0 on the nodes.
The command does not change a core assignment unless it is explicitly
specified. When a core is not specified for a new node, the command randomly
picks a core and assign a replica on the core.
Topic arguments are optional. For more control, you can specify the topic name in the “--partition” flag:
rpk cluster partitions move -p foo/0:1,2,3 -p kafka_internal/tx/0:1-0,2-0,3-0
Examples
This section provides examples of how to use rpk cluster partitions move.
Basic replica movement
Move partition 0 to brokers 1,2,3 and partition 1 to brokers 2,3,4 for topic foo
rpk cluster partitions move foo --partition 0:1,2,3 -p 1:2,3,4
Flags
| Value | Type | Description |
|---|---|---|
|
string |
Output format ( |
|
stringArray |
Topic partitions to move and new replica locations ( |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |