卡夫卡融合群集中的组my_group_id的自动偏移量提交失败

时间:2018-07-10 08:26:06

标签: apache-kafka kafka-python

我有一个具有3个节点的 Confluent Kafka 集群,我使用kafka-python连接到Kafka并进行消费。

我的index.py文件:

cid = "_" + str(randint(1, 99999999))

consumer = KafkaConsumer('test', bootstrap_servers=['109.XXX.XXX.XXX:9092', '5.XXX.XXX.XXX:9092', '88.XXX.XXX.XXX:9092'], group_id='my_group_id', client_id=cid, auto_offset_reset='earliest')
for msg in consumer:
    logger.warning(msg.value)

我运行了index.py文件3次,因此我有3个消费者使用的消费者组,每个消费者都在分区中接收到消息,一切正常。

Topic中的消息完成后, 2 消费者遇到此警告,并且只有一个消费者被连接到主题。

警告消息:

[2018-07-10 12:32:38] (kafka.coordinator.consumer) WARNING : Auto offset commit failed for group my_group_id: CommitFailedError: 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 rebalance timeout with max_poll_interval_ms,
        or by reducing the maximum size of batches returned in poll()
        with max_poll_records.

为什么出现此消息? 我更改了max_poll_interval_ms‍,但问题仍未解决。

0 个答案:

没有答案