kafka主题分区的最大复制因子是多少 [英] What is the maximum replication factor for a partition of kafka topic

查看:59
本文介绍了kafka主题分区的最大复制因子是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个经纪人和几个主题,每个主题有5个分区,拥有kafka集群.现在,我想为分区设置复制因子.

I hava kafka cluster having 3 brokers and a couple of topics with each having 5 partitions. Now i want to set the replication factor for the partitions.

我可以为kafka主题分区设置的最大复制因子是什么?

What is the maximum replication factor which i can set for a partition of kafka topic?

推荐答案

复制因子确定每个分区具有的复制数量,这使Kafka能够自动故障转移到这些副本当群集中的服务器发生故障,以便消息仍然可用时万一失败

Replication factor determines the number of replications each partition have, this allows Kafka to automatically failover to these replicas when a server in the cluster fails so that messages remain available in case of failures

分区副本分布在各个代理中,一个代理应保留一个副本,这意味着我们的副本不能超过代理的数量

Partition replicas are distributed across brokers and one broker should keep one replica that means we can't have more replicas than the number of brokers

最大复制因子< =经纪人数量.

这也意味着确定 min.insync.replicas ,这意味着它将始终小于或等于复制因子

This is also meant to determine min.insync.replicas, that means it will always be less than or equal to replication-factor

最小同步复制数表示< =复制因子

min.insync.replicas 是您愿意随时在线以继续运行的数据的最小副本数并接受新的传入消息.

min.insync.replicas is the minimum number of copies of the data that you are willing to be online at any time to continue running and accepting new incoming messages.

如上所述,

理想的复制因子3 很好,但是,根据用例,您可以将复制因子调整为小于2(意味着高风险),而同时将复制因子调整为大于3则可以提供更好的可用性但需要更多的开销和更大的尺寸.

Ideally replication factor 3 is good as mentioned above, however, based on the use case you can tune replication factor less than 2 (means high risk) and the same time more than 3 provide better availability but more overhead and more size required.

在确定复制因子时,还应考虑以下几点:

A):代理大小复制因子直接影响整个代理磁盘大小

A): Broker Size Replication factor directly impacts the overall broker disk size

因此,高复制因子需要更大的磁盘大小

So a high replication factor requires more disk size

B)大量分区复制:在大量分区复制的情况下,会增加额外的延迟.

B)Large Number of Partition replication: In case of a large number of partitions replication extra latency is added.

这篇关于kafka主题分区的最大复制因子是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆