变更日志/分区主题的复制因子应该是什么 [英] What should be the replication factor of changelog/repartition topics
问题描述
我知道可以为kafka流配置这些内部主题的复制因子,我们的应用程序使用具有复制因子3的常规应用程序主题,但是直到现在我还没有为changelog/repartition主题配置复制因子假设是一个经纪人去世(或因某种原因更换领导者),kafka流应用程序将自动重新平衡至新的领导者.
I know it is possible to configure replication factor these internal topics for the kafka streams, our application uses for normal application topics with replication factor 3 but until now I didn't configured the replication factor for the changelog/repartition topics while my assumption was if one broker dies (or for some reason leader changes) kafka stream application will automatically rebalance to new leader.
现在,如果内部主题不使用复制因子,我不确定正在运行的Kafka Stream应用程序是否可以重新平衡为新的领导者.
Now I am not so sure about a running Kafka Stream application can rebalance to new leader if the internal topics does not use replication factor.
对于这些内部主题,我们还应该使用复制因子3吗?
Should we also use replication factor 3 for these internal topics?
寻求答案....
推荐答案
是的,您将要为changelog/repartition主题使用与应用程序主题相同的复制因子.
Yes, you'll want to use the same replication factor of your application topics for your changelog/repartition topics.
您可以通过以下方式为您的变更日志/分区主题指定复制因子:
You can specify the replication factor your changelog/repartition topics via
properties.put(StreamsConfig.REPLICATION_FACTOR_CONFIG, 3)
HTH, 比尔
这篇关于变更日志/分区主题的复制因子应该是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!