Kafka reassignment of __consumer_offsets incorrect?

﹥>﹥吖頭↗ 提交于 2019-12-02 00:40:16
amethystic

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!