Description
"replica-assignment" option in "bin/kakfa-topics.sh" works only with "-create" and doesn't work with "-alter", but the config comment is somewhat confusing.
For example:
bin/kafka-topics.sh --create --zookeeper 10.0.44.137:2181 --replica-assignment 1:2,1:2 --partitions 2 --topic topic
i use the command above to create a topic with two partitions on broker 1 and 2.
and then i want to change partition count from two to four, and the newly created partition on broker 3 and 4.
So i try the command:
bin/kafka-topics.sh --alter --zookeeper 10.0.44.137:2181 --replica-assignment 3:4,3:4 --partitions 4 --topic topic
But it does not works!!! "replica-assignment" can't be used with "partitions".
What i can do is to add partitions like this:
bin/kafka-topics.sh --alter --zookeeper 10.0.44.137:2181 --partitions 4 --topic topic
and then use the partition reassignment command to change the brokers for newly partitions to 3 and 4.
So,i think "or altered" in the comment for "--replica-assignment" should be removed.
Attachments
Issue Links
- is duplicated by
-
KAFKA-1947 can't explicitly set replica-assignment when add partitions
- Resolved