简体   繁体   English

我可以为 replication.factor 和 min.insync.replicas 设置相同的编号吗?

[英]Can i have same number for replication.factor and min.insync.replicas?

I'm trying to understand the broker config - min.insync.replicas and here is my question.我正在尝试了解代理配置 - min.insync.replicas,这是我的问题。

Question 1: If i set my replication.factor = 2 and min.insync.replicas =2, how many copies would i have for my message?问题 1:如果我设置我的 replication.factor = 2 和 min.insync.replicas =2,我的消息会有多少份?

Question 2: Can i set replication.factor = 2 and min.insync.replicas =2?问题 2:我可以设置 replication.factor = 2 和 min.insync.replicas =2 吗?

Question 1: If i set my replication.factor = 2 and min.insync.replicas = 2 , how many copies would i have for my message?问题 1:如果我设置我的replication.factor = 2min.insync.replicas = 2 ,我的消息会有多少份?

The copies (replicas) of the data within a topic are dependent on the configuration replication.factor .主题中数据的副本(副本)取决于配置replication.factor If you set it to 2, you will have 2 copies.如果将其设置为 2,您将拥有 2 个副本。

Question 2: Can i set replication.factor = 2 and min.insync.replicas = 2 ?问题 2:我可以设置replication.factor = 2min.insync.replicas = 2吗?

Yes, you can set both values to 2. The min.insync.replicas should be less or equal to the replication.factor.是的,您可以将两个值都设置为min.insync.replicas应该小于或等于 replication.factor。 However, the min.insync.replicas configuration plays a more important role when producing data to the topic.但是,在为主题生成数据时, min.insync.replicas配置起着更重要的作用。 When a producer sets acks to "all" (or "-1"), this configuration specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful.当生产者将确认设置为“all”(或“-1”)时,此配置指定必须确认写入才能被视为成功的最小副本数。 If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend ).如果无法满足此最小值,则生产者将引发异常( NotEnoughReplicasNotEnoughReplicasAfterAppend )。

The full details of those configuration are given in the section Topic-Level Configs of the Kafka docs.这些配置的完整详细信息在 Kafka 文档的主题级别配置部分中给出。

Yes, we can very well do that.是的,我们可以很好地做到这一点。 Infact ISR <= RF.事实上 ISR <= RF。 Here ISR referes to In-sync replicas and RF refers to the Replication Factor.这里 ISR 指的是同步副本,RF 指的是复制因子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM