首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >改变Kafka配置max.poll.interval.ms导致一个消费者陷入(重新)加入组。

改变Kafka配置max.poll.interval.ms导致一个消费者陷入(重新)加入组。
EN

Stack Overflow用户
提问于 2018-11-28 07:02:08
回答 2查看 6K关注 0票数 0

我使用的是Kafka版本0.10.2.0,云上有两个VM,每个VM都有一个Kafka消费者。这两个消费者属于同一个消费者群体。它可以正常工作,直到我将Kafka消费者配置max.poll.interval.ms更新为Integer.MAX_VALUE。当我重新启动VM时,VM首先启动正常。稍后启动的VM将始终停留在(重新)加入组中。

有人知道是什么原因造成的吗?

我之所以这样做,是因为我在0.10.2.1版中看到,max.poll.interval.ms的默认值从300000更改为Integer.MAX_VALUE

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-11-28 08:19:43

这是对0.10.1.0版本的更改:

新的Java使用者现在支持后台线程的心跳。有一个新的配置max.poll.interval.ms,它控制在使用者主动离开组之前轮询调用之间的最大时间(默认情况下为5分钟)。配置request.timeout.ms的值必须始终大于max.poll.interval.ms,因为这是用户重新平衡时JoinGroup请求在服务器上阻塞的最长时间,因此我们将其默认值更改为略高于5分钟。

也适用于您的版本。

顺便说一下,在0.10.2.0版本中,他们没有为kafka消费者更改max.poll.interval.ms,而是为kafka streams使用者:

内部Kafka流消费者max.poll.interval.ms默认值从300000改为Integer.MAX_VALUE。

票数 0
EN

Stack Overflow用户

发布于 2018-11-28 07:21:14

似乎这个问题不可能是由“max.poll.interval.ms”引起的

基于卡夫卡文档(https://kafka.apache.org/documentation/)

代码语言:javascript
运行
复制
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.

我会检查是否有足够的分区分发到这些使用者。

此外,我建议您在Kafka日志中激活调试模式。正常情况下,它显示了很多关于连接过程的内部信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53513863

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档