当Kafka副本之一关闭时会发生什么 [英] What happens when one of the Kafka replicas is down
问题描述
我有一个由2个Kafka代理组成的集群,一个主题的复制因子为2.如果其中一个代理死亡,我的生产者是否能够继续向该1个节点的降级集群发送新消息?还是复制因子2需要2个活动节点并且消息将被拒绝?
I have a cluster of 2 Kafka brokers and a topic with replication factor 2. If one of the brokers dies, will my producers be able to continue sending new messages to this degraded cluster of 1 node? Or replication factor 2 requires 2 alive nodes and messaged will be refused?
推荐答案
如果为否",则不会忽略消息.活动代理的数量少于配置的副本.每当新的Kafka代理加入群集时,数据就会被复制到该节点.
Messages will not be ignored if the no. of alive brokers is lesser than the configured replicas. Whenever a new Kafka broker joins the cluster, the data gets replicated to that node.
您可以通过将复制因子配置为3或更大并仅启动一个代理来重现这种情况.
You can reproduce this scenario by configuring the replication factor as 3 or more and start only one broker.
这篇关于当Kafka副本之一关闭时会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!