简体   繁体   English

Kafka分区分布在一个消费者组中跨消费者

[英]Kafka partition distribution across consumers in a consumer group

Am I right that, at every moment of time, partition distribution across consumers in a consumer group follows the Dirichlet box principle, if number of consumers is smaller than number of partitions?我是对的,在任何时候,如果消费者数量小于分区数量,消费者组中消费者之间的分区分布遵循 Dirichlet 盒原则? Ie if the consumer group has N consumers and a topic has M partitions and N < M, N-1 consumers got by one partition assigned to each, and the N-th consumer got M - N + 1 partitions.也就是说,如果消费者组有 N 个消费者,一个主题有 M 个分区,并且 N < M,则 N-1 个消费者通过分配给每个消费者的一个分区获得,而第 N 个消费者获得 M - N + 1 个分区。

Some consumer will have multiple assigned partitions, yes.一些消费者会有多个分配的分区,是的。 It's not guaranteed to be the Nth-1 consumer that's started, or consecutive partitions assigned.不能保证是启动的第 N-1 个消费者,或分配的连续分区。

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

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