擴容副本前:
image.png
編輯json文件increase-replication-factor.json: vi increase-replication-factor.json
{"version":1,"partitions":[{"topic":"test2","partition":0,"replicas":[0,1,2]}]}
執(zhí)行命令:
./bin/kafka-reassign-partitions.sh --zookeeper node1:2181 --reassignment-json-file increase-replication-factor.json --execute
image.png
校驗:
./bin/kafka-reassign-partitions.sh --zookeeper node1:2181 --reassignment-json-file increase-replication-factor.json --verify
image.png
擴容分區(qū)后結(jié)果
image.png