removing a kafka consumer group in zookeeper

后端 未结 4 952
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 10:51

I\'m using kafka_2.9.2-0.8.1.1 with zookeeper 3.4.6.

Is there a utility that can automatically remove a consumer group from zookeeper? Or can I just remove everythin

4条回答
  •  长情又很酷
    2020-12-01 11:05

    For new consumers (which use a kafka topic to manage offsets instead of zookeeper) you cannot delete the group information using kafka's built in tools.

    Here is an example of trying to delete the group information for a new style consumer using the kafka-consumer-groups.sh script:

    bin/kafka-consumer-groups.sh --bootstrap-server "kafka:9092" --delete --group "indexer" --topic "cleaned-logs"
    Option '[delete]' is only valid with '[zookeeper]'. Note that there's no need to delete group metadata for the new consumer as the group is deleted when the last committed offset for that group expires.
    

    Here's the important part of that response:

    Note that there's no need to delete group metadata for the new consumer as the group is deleted when the last committed offset for that group expires.

    This is kind of annoying from a monitoring perspective (esp. when tracking offsets via something like burrow) because it means that if you change consumer group names in your code you'll keep seeing that old groups are behind on their offsets until those offsets expire.

    Hypothetically you could write a tombstone to that topic manually (which is what happens during offset expiration) but I haven't found any tools that make this easy.

提交回复
热议问题