简体   繁体   English

卡夫卡主题在经纪人之间的分布

[英]Kafka Topic Distribution among brokers

When creating topics, can we determine which broker will be the leader for the topic? 创建主题时,我们可以确定哪个经纪人将成为主题的领导者吗? Are topics balanced across brokers in Kafka? 卡夫卡的经纪人之间的话题是否均衡? (Considering the topics have just one partition) (考虑到主题只有一个分区)

Kafka does manage this internally and you don't need to worry about this in general: http://kafka.apache.org/documentation/#basic_ops_leader_balancing Kafka确实在内部进行管理,因此您一般不必担心: http : //kafka.apache.org/documentation/#basic_ops_leader_balancing

If you create a new topic, Kafka will select a broker based on load. 如果您创建一个新主题,Kafka将根据负载选择一个代理。 If a topic has only one partitions, it will only be hosted on a single broker (plus followers if you have multiple replicas), because a partitions cannot be split over multiple brokers in Kafka. 如果一个主题只有一个分区,则该主题将仅托管在一个代理上(如果您有多个副本,则托管在一个跟随者上),因为不能在Kafka中将分区划分为多个代理。

Nevertheless, you can get the information which broker host what topic and you can also "move" topics and partitions: http://kafka.apache.org/documentation/#basic_ops_cluster_expansion 但是,您可以获得由哪个代理托管哪个主题的信息,还可以“移动”主题和分区: http : //kafka.apache.org/documentation/#basic_ops_cluster_expansion

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

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