增加副本
Increasing the replication factor of an existing partition is easy. Just specify the extra replicas in the custom reassignment json file and use it with the --execute option to increase the replication factor of the specified partitions.
在现有分区增加副本是很容易的,只要指定自定义的重新分配的json文件脚本,并用 --execute 选项去执行这个脚本。
For instance, the following example increases the replication factor of partition 0 of topic foo from 1 to 3. Before increasing the replication factor, the partition's only replica existed on broker 5. As part of increasing the replication factor, we will add more replicas on brokers 6 and 7.
增加副本之前,分区已存在的副本在broker5上,它也作为增加副本的一部分,我们将副本添加到broker6和7上。
The first step is to hand craft the custom reassignment plan in a json file-
第一步手工写一个自定义的分配的json脚本 -
> cat increase-replication-factor.json
{"version":1,
"partitions":[{"topic":"foo","partition":0,"r