简体   繁体   English

没有活跃成员的 kafka 消费者组的 CURRENT-OFFSET 和 LAG

[英]CURRENT-OFFSET and LAG of kafka consumer group that has no active members

How are these two set?这两个怎么设置? Behaviour that I observe with kafka-consumer-groups.sh is that when new message is appended to a certain partition, it increments at first its LOG-END-OFFSET and LAG columns, and after some time, CURRENT-OFFSET column gets incremented and LAG column gets decremented, although no offset was actually commited by any consumer, as there are no active consumers.我在 kafka-consumer-groups.sh 中观察到的行为是,当新消息附加到某个分区时,它首先会增加其 LOG-END-OFFSET 和 LAG 列,一段时间后,CURRENT-OFFSET 列会增加并且LAG 列递减,尽管没有任何消费者实际提交偏移量,因为没有活动消费者。 Am I right, and is this always happening with consumer groups that have no active members, or is there a possibility to turn off the second stage, that simulates commiting offsets by non-existing consumers?我是对的,这是否总是发生在没有活跃成员的消费者群体中,或者是否有可能关闭第二阶段,模拟不存在的消费者提交的抵消? This is actually confusing, you have to take into account the information that there are no active members in a consumer group, in order to have the right perspective of what the CURRENT-OFFSET and LAG columns actually mean (not much in that case).这实际上令人困惑,您必须考虑消费者组中没有活动成员的信息,以便正确了解 CURRENT-OFFSET 和 LAG 列的实际含义(在这种情况下不多)。

OK, it seems that the consumer actually does continuously connect and poll the messages and commits the offsets, but in a volatile fashion (disconnecting each time) so that kafka-consumer-groups.sh always reports as if there are no active members in a group.好的,似乎消费者实际上确实不断地连接和轮询消息并提交偏移量,但是以不稳定的方式(每次断开连接),因此 kafka-consumer-groups.sh 总是报告好像没有活动成员团体。 This is a flink job that acts this way.这是一个以这种方式运行的 flink 作业。 Is that possible?那可能吗?

If the retention policy kicks in, and deletes old messages, the lag could decrease (if published logs are less than deleted ones), since the CURRENT-OFFSET positions itself at the earliest avaliable log.如果保留策略启动并删除旧消息,则延迟可能会减少(如果发布的日志少于删除的日志),因为CURRENT-OFFSET将自身定位在最早的可用日志中。

I'd check what's the retention policy for your topic, since this may be due to deleted messages: The lag doesn't care about purgued messages, only active ones.我会检查您的主题的保留政策是什么,因为这可能是由于已删除的消息:滞后不关心被清除的消息,只关心活跃的消息。

This has nothing to do with connecting to and disconnecting from the kafka cluster, that would be way to slow and ineffective.这与连接和断开 kafka 集群无关,这将是一种缓慢且无效的方式。 It has to do with the way that flink kafka consumer is implemented, which is described here: Flink Kafka Connector它与 flink kafka consumer 的实现方式有关,此处描述: Flink Kafka Connector

The committed offsets are only a means to expose the consumer's progress for monitoring purposes.提交的偏移量只是为了监控目的而公开消费者进度的一种手段。

What it basically does, it does not subscribe to topics as standard consumers that use consumer groups and their standard coordinators and leader mechanisms, but it directly assigns partitions, and only commits offsets to a consumer group for monitoring purposes, although it has methods of using these offsets for continuation too, see here , but anyway, that is why these groups appear to kafka as non having active members, and still getting offsets commited.它的基本作用是,它不以标准消费者的身份订阅主题,使用消费者组及其标准协调者和领导者机制,而是直接分配分区,并且仅向消费者组提交偏移量以用于监控目的,尽管它有使用方法这些偏移量也可以继续使用,请参见此处,但无论如何,这就是为什么这些组在 kafka 看来没有活跃成员,并且仍然得到提交的偏移量。

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

相关问题 kafka-consumer-groups 命令不显示火花结构化流应用程序(消费者)的 LAG 和 CURRENT-OFFSET - kafka-consumer-groups command doesnt show LAG and CURRENT-OFFSET for spark structured streaming applications(consumers) 消费者组没有活跃成员 - Kafka - Consumer group has no active members - Kafka 为给定主题的新消费者群体设置初始的“当前偏移”和“滞后” - Setting an initial “current-offset” and “lag” for new consumer groups for a given topic Kafka消费者:抵消消费者和生产者之间的滞后 - Kafka consumer : offset lag between consumer and poducer Kafka Consumer Offset 滞后导致Kafka Down - Kafka Consumer Offset Lag Causes Kafka Down 在 Kafka-python 中的消费者组中重置 kafka LAG(更改偏移量) - Reset kafka LAG (change offset) within consumer group in Kafka-python 卡夫卡:描述消费者群体抵消 - Kafka: Describe Consumer Group Offset 卡夫卡偏移卡在消费者组中 - Kafka offset is stuck in consumer group 如何使用 Kafka .NET 客户端 API 列出每个分区和消费者组的 Kafka 消费者滞后和最新偏移量? - How can I list the Kafka consumer lag and latest offset per partition and consumer group using the Kafka .NET client API? Kafka 消费者组抵消保留 - Kafka consumer group offset retention
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM