Skip to content

Commit 23bb72c

Browse files
kbatuigasFeediver1
andauthored
Fix syntax description in rpk cluster partitions transfer-leadership (#1125)
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
1 parent 0e711d0 commit 23bb72c

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

modules/reference/pages/rpk/rpk-cluster/rpk-cluster-partitions-transfer-leadership.adoc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
= rpk cluster partitions transfer-leadership
22

3-
Transfer partition leadership between brokers.
3+
Transfer partition leadership between brokers. This command supports transferring only one partition leader at a time.
44

5-
You can transfer only one partition leader at a time.
6-
7-
WARNING: 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.
5+
NOTE: Redpanda tries to balance leadership distribution across brokers by default.
6+
If the distribution of leaders becomes uneven as a result of transferring leadership
7+
across brokers, the cluster may move leadership back to the original
8+
brokers automatically.
89

910
== Usage
1011

@@ -15,20 +16,22 @@ rpk cluster partitions transfer-leadership [flags]
1516

1617
== Examples
1718

18-
Transfer partition leadership:
19+
To transfer partition leadership for a partition `0` to a broker ID `2`, run:
1920

2021
```bash
2122
rpk cluster partitions transfer-leadership foo --partition 0:2
2223
```
2324

24-
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.
25-
26-
Equivalent command using different syntax:
25+
The `--partition` flag accepts a value `<A>:<B>`, where `A` is a topic-partition and `B` is the ID of the broker to which you want to transfer leadership. To specify a topic-partition, you can use just the partition ID (`0`) or also use the topic name together with the partition using the following syntax:
2726

2827
```bash
29-
rpk cluster partitions transfer-leadership --partition foo/0:2
28+
rpk cluster partitions transfer-leadership --partition test-topic/0:2
3029
```
3130

31+
In this case, the name of the topic is `test-topic` and the partition ID is `0`.
32+
33+
The preceding examples transfer leadership for the partition `kafka/test-topic/0`. The command behavior is based on the assumption that the default namespace is `kafka`, but you can also specify an internal namespace using the `+{namespace}/+` prefix.
34+
3235
== Flags
3336

3437
[cols="1m,1a,2a"]
@@ -39,7 +42,7 @@ rpk cluster partitions transfer-leadership --partition foo/0:2
3942

4043
|-h, --help |- |Help for transfer-leadership.
4144

42-
|-p, --partition |string |The topic partition to which to transfer leadership and specify the new leader location. Syntax `-p A:B` where A is the partition leader and B will be the new leader. See <<examples>> for how to use it.
45+
|-p, --partition |string |Specify the topic-partition's leadership to transfer and the location of the new leader. Use the syntax `-p <topic-partition>:<new-leader-broker-ID>`.
4346

4447
|--config |string |Redpanda or `rpk` config file; default search paths are `/var/lib/redpanda/.config/rpk/rpk.yaml`, `$PWD/redpanda.yaml`, and `/etc/redpanda/redpanda.yaml`.
4548

0 commit comments

Comments
 (0)