扩容副本前:
image.png
编辑json文件increase-replication-factor.json: vi increase-replication-factor.json
{"version":1,"partitions":[{"topic":"test2","partition":0,"replicas":[0,1,2]}]}
执行命令:
./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
扩容分区后结果
image.png
网友评论