[英]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
从改变300000
到Integer.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.