Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

Kafka 1.0.x Delete consumer group

I am trying to delete an unused consumer group. Since I'm using version 1.0.x, based on the official docs

When using the new consumer API (where the broker handles coordination of partition handling and rebalance), the group is deleted when the last committed offset for that group expires.

the configuration properties prescribing this behavior in my case are

#set offset retention to 2 weeks
offsets.retention.minutes=20160

I could only find these in the server.properties. There's no mention of them in the Consumer Config logged upon the startup of the application

Trying to re-configure the group so that offsets.retention.minutes=0, I could not find a definitive answer. I'm quite surprised that one cannot change this using kafka-consumer-groups on a group level... Can this be so involved?

I know that there is a deleteConsumerGroups API but this as introduced in version 1.1.x. Is the only way to delete this group to just wait for the offsets to expire?

question from:https://stackoverflow.com/questions/65846611/kafka-1-0-x-delete-consumer-group

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The only way to cleanup groups is changing the retention time for the __consumer_offsets topic. You cannot target individual groups (or records in that topic)

I believe the deleteConsumerGroups call pushes a null value for the the group name into that topic, and you still need to wait for the topic to be compacted for a group to actually be removed


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...