是指手動寫擴充replicas的配置文件,然后使用工具進行操作。
參考官網site:http://kafka.apache.org/documentation.html#basic_ops_automigrate
1.首先創建一個三分區一副本的topic,並查看詳細信息:

2.修改配置文件
將原有replicas為[0]擴充為[0,1], [1]擴充為[1,2],[2]擴充為[2,0,1]
> cat partitions-to-move.json

3.執行操作,並檢查修改情況
> bin/kafka-reassign-partitions.sh --zookeeper h1:2181 --reassignment-json-file partitions-to-move.json --execute
> bin/kafka-topics.sh --describe --zookeeper h1:2181 --topic test-add-replication-topic

由於太長,只截取了部分信息
