如何删除Kafka消费组
Kafka消费组可以通过Kafka客户端的命令行方式连接Kafka实例完成删除。
查询消费组
kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --list
[root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --list
Note: This will not show information about old Zookeeper-based consumers.
KMOffsetCache-zk-server-1
bbbb
KMOffsetCache-zk-server-0
查询消费组详情
kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --describe --group {消费组}
[root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --describe --group bbbb
Note: This will not show information about old Zookeeper-based consumers.
Consumer group ‘bbbb’ has no active members.
TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
test 1 336 336 0 - - -
test 0 334 334 0 - - -
test 2 334 334 0 - - -
删除消费组
kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --delete --group {消费组}
[root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --delete --group bbbb
Note: This will not show information about old Zookeeper-based consumers.
Deletion of requested consumer groups (‘bbbb’) was successful.
版权归原作者 爱折腾的小土豆 所有, 如有侵权,请联系我们删除。