【kafka系列教程37】kafka增加副本

本文介绍了如何在Kafka中增加分区的副本。通过创建一个定制的副本重新分配JSON文件,然后使用`--execute`选项执行,可以将topic foo分区0的复制因子从1增加到3。该过程涉及在broker 6和7上添加额外的副本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

增加副本

 

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值