kafka参数配置问题

匿名 发表于: 2017-08-02   最后更新时间: 2017-08-02 18:22:33   4,192 游览

日志中一直打印如下信息:
Auto offset commit failed ,Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records.

我的参数是这样配置的:
bootstrap.servers=192.168.1.1:9092,192.168.1.2:9092
group.id=test
auto.commit.interval.ms=1000
key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
max.poll.interval.ms=300
max.poll.records=100
session.timeout.ms=30000
heartbeat.interval.ms=1000
auto.offset.reset=earliest
request.timeout.ms=40000
fetch.min.bytes=1
fetch.wait.max.ms=1000

代码中
ConsumerRecords records = consumer.poll(100);
出现以上问题是我的参数设置不合理还是怎么回事?

发表于 2017-08-02
添加评论

你处理的时间太长,导致没有调用poll(),就重新分配了,调整max.poll.interval.ms

你的答案

查看kafka相关的其他问题或提一个您自己的问题