Kafka reassignment of __consumer_offsets incorrect?

后端 未结 2 763
执笔经年
执笔经年 2021-01-22 10:07

I am confused with how kafka-reassignment-paritions works for __consumer_offsets topic?

I start with 1 zk and 1 kafka broker, create a test topic with replication=1, par

2条回答
  •  抹茶落季
    2021-01-22 10:16

    If you want to increase the replication factor for a topic, follow steps below:

    1. Create a json file containing the reassignment plan. In your case, the file might look like:

      {"version":1, "partitions":[
        {"topic":"__consumer_offsets","partition":0,"replicas":[101,102]}, 
        {"topic":"__consumer_offsets","partition":1,"replicas":[102,101]},
        {"topic":"__consumer_offsets","partition":2,"replicas":[101,102]},
        {"topic":"__consumer_offsets","partition":3,"replicas":[102,101]},
        ...
        {"topic":"__consumer_offsets","partition":49,"replicas":[101,102]}
      ]}
      
    2. Run command below to increase RF for this internal topic:

      bin/kafka-reassign-partitions.sh --zookeeper localhost:2181 --reassignment-json-file reassign.json --execute
      

    Then run kafka-topics.sh --describe to see if replication factor is bumped up to 2.

提交回复
热议问题