Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1656

"replica-assignment" option in "bin/kakfa-topics.sh" doesn't work with "alter"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.8.1.1
    • None
    • tools
    • all

    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

          Activity

            People

              Unassigned Unassigned
              jayden_sun jayden sun
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: