gpt4 book ai didi

apache-kafka - min insync replicas属性是否影响kafka中的消费者

转载 作者:行者123 更新时间:2023-12-04 15:42:42 25 4
gpt4 key购买 nike

我的 3 节点集群有配置 min.insync.replicas=2default.replication.factor=3。如果我尝试在只有一个经纪人启动时进行生产,那么它会像我预期的那样失败。但是如果我在只有 1 个代理可用时尝试消费,消费者仍然能够消费消息。似乎 min.insync.replicas=2 对消费者不起作用。它知道行为还是我遗漏了什么?

最佳答案

min.insync.replicas 指定必须确认写入才能将此写入视为成功的最小副本数,因此,它对负责写。此配置参数对消费者端没有任何直接影响,这就是它不影响消费者的原因,即使事件代理的数量小于 min.insync.replicas 的值。

根据documentation ,

When a producer sets acks to "all" (or "-1"), min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend). When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.

关于apache-kafka - min insync replicas属性是否影响kafka中的消费者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57231185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com