消费者死亡后,消费者群体还能存活多久?

huangapple go评论58阅读模式
英文:

How long would the consumer group alive after the consumers dead?

问题

  1. 消费者组会发生什么?它是否仍然存在?如果是的话,没有消费者加入消费者组的情况下它会存在多久?

  2. 我如何查看此消费者组每个分区的偏移量详情?

英文:

Let's say, I've a topic with two partitions P1, P2 and I've two consumers C1, C2 in a consumer group CG1. Now each consumer is consuming messages from one partition. Now both the consumer are dead because of some reason. In this situation,

  1. what happens to the consumer group? Would it be still alive? If yes, how long would it be alive without any consumers joining the consumer group?

  2. How can i see the offset details of each partition for this consumer group?

答案1

得分: 2

offsets.retention.minutes: 默认的保留期为7天,即10080分钟,如果消费者在7天内处于非活动状态,则该消费者组的偏移量将被移除。

Checking consumer position 您可以使用以下命令查看每个分区的消费者偏移量。

bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group

英文:

3.1 Broker Configs Default retention period is 7 days which is 10080 minutes, if the consumer is inactive for 7 days then offset of that consumer group will be removed

offsets.retention.minutes: After a consumer group loses all its consumers (i.e. becomes empty) its offsets will be kept for this retention period before getting discarded. For standalone consumers (using manual assignment), offsets will be expired after the time of last commit plus this retention period.

Type: intDefault: 10080 Valid Values: [1,...] Importance: highUpdate Mode: read-only

Checking consumer position you can view the consumer's offset for each partition by using following commands

 bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group

huangapple
  • 本文由 发表于 2020年1月6日 20:51:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612464.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定