简体   繁体   English

更改Kafka配置max.poll.interval.ms导致一名消费者卡在(重新)加入组中

[英]Change Kafka configuration max.poll.interval.ms causes one consumer stuck at (Re-)joining group

I am using Kafka version 0.10.2.0 and I have two VMs on cloud each has one Kafka consumer. 我正在使用Kafka版本0.10.2.0,并且我在云上有两个VM,每个VM都有一个Kafka使用者。 These two consumers belong to the same consumer group. 这两个消费者属于同一个消费群体。 It works fine until I updated the Kafka consumer configuration max.poll.interval.ms to Integer.MAX_VALUE . 在我将Kafka使用者配置max.poll.interval.ms更新为Integer.MAX_VALUE之前,它工作正常。 When I restart the VMs, the VM starts first works fine. 重新启动虚拟机时,虚拟机首先启动可以正常运行。 The VM started later will always stuck at (Re-)joining group 稍后启动的VM将始终停留在(重新)加入组中

Does any one have idea what causes this? 有谁知道是什么原因造成的?

I make this change because I saw in version 0.10.2.1, the default vaule of max.poll.interval.ms is changed from 300000 to Integer.MAX_VALUE . 我有这样的变化,因为我在0.10.2.1版看到,默认vaule max.poll.interval.ms从改变300000Integer.MAX_VALUE

It doesn't seem that the problem could be induced by the 'max.poll.interval.ms' 看来问题可能不是由“ max.poll.interval.ms”引起的

Based on the Kafka documentation ( https://kafka.apache.org/documentation/ ) 基于Kafka文档( https://kafka.apache.org/documentation/

The way consumption is implemented in Kafka is by dividing up the partitions in 
the log over the consumer instances so that each instance is the exclusive 
consumer of a "fair share" of partitions at any point in time. This process of 
maintaining membership in the group is handled by the Kafka protocol 
dynamically. If new instances join the group they will take over some 
partitions from other members of the group; if an instance dies, its partitions 
will be distributed to the remaining instances.

I'd check if there are sufficient partitions to distribute into those consumers. 我会检查是否有足够的分区可分配给这些使用者。

Additionally, I'd recommend you to activate DEBUG mode in the Kafka logs. 此外,建议您在Kafka日志中激活DEBUG模式。 Normally, it is showing a lot of info about the internals of the joining process. 通常,它会显示很多有关加入过程内部的信息。

This was a change for the version 0.10.1.0: 这是对0.10.1.0版本的更改:

The new Java Consumer now supports heartbeating from a background thread. 新的Java Consumer现在支持从后台线程进行心跳。 There is a new configuration max.poll.interval.ms which controls the maximum time between poll invocations before the consumer will proactively leave the group (5 minutes by default). 有一个新的配置max.poll.interval.ms,它控制使用者主动退出组之前轮询调用之间的最长时间(默认为5分钟)。 The value of the configuration request.timeout.ms must always be larger than max.poll.interval.ms because this is the maximum time that a JoinGroup request can block on the server while the consumer is rebalancing, so we have changed its default value to just above 5 minutes. 配置request.timeout.ms的值必须始终大于max.poll.interval.ms,因为这是使用者重新平衡时JoinGroup请求可以在服务器上阻止的最长时间,因此我们更改了其默认值刚好超过5分钟

which applies to your version also 这也适用于您的版本

BTW in version 0.10.2.0 they didn't change max.poll.interval.ms for kafka consumer but for kafka streams consumer: BTW版本0.10.2.0中,对于kafka使用者,他们没有更改max.poll.interval.ms;对于kafka 使用者,它们没有更改:

The internal Kafka Streams consumer max.poll.interval.ms default value was changed from 300000 to Integer.MAX_VALUE 内部Kafka Streams使用者max.poll.interval.ms的默认值从300000更改为Integer.MAX_VALUE

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

相关问题 Spring 云 stream 卡夫卡消费者卡在长时间运行的作业和 max.poll.interval.ms 的大值 - Spring cloud stream Kafka consumer stuck with long running job and large value for max.poll.interval.ms Spring Kafka,覆盖 max.poll.interval.ms? - Spring Kafka, overriding max.poll.interval.ms? 在 Kafka 消费者配置中将 max.poll.interval.ms 设置为大于 request.timeout.ms 的负面影响是什么 - What is negative effects of setting max.poll.interval.ms larger than request.timeout.ms in Kafka consumer configs Consumer CommitFailedException - 后续调用 poll() 之间的时间长于配置的 max.poll.interval.ms - Consumer CommitFailedException - time between subsequent calls to poll() was longer than the configured max.poll.interval.ms Kafka poll 和 max.poll.interval.ms - 批处理最佳实践 - Kafka poll and max.poll.interval.ms - Batch Processing best practices 如何知道在 java kafka 应用程序客户端中是否达到了 max.poll.interval.ms? - How to know if max.poll.interval.ms is reached in java kafka application client? 为指定主题配置max.poll.interval.ms - Configure max.poll.interval.ms for a specified topic 当Kafka消费者不使用订阅方法时,是否检查session.timeout.ms或max.pool.interval.ms? - When Kafka consumer don't use subscribe method, do it check session.timeout.ms or max.pool.interval.ms? Kafka 消费者调查 - Kafka consumer poll 卡夫卡消费者永远投票 - Kafka consumer poll forever
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM