1、重置offest、LAG: 先kill 停掉业务微服务
2、查询当前消费者组的LAG值,client id这列为‘-’,才可以执行重置命令
sh kafka-consumer-groups.sh --bootstrap-server ******** --command-config ../config/consumer.properties --describe --group clusterBackup-consumer-group
3、执行重置offest为未消费状态
sh kafka-consumer-groups.sh --bootstrap-server ******* --group clusterBackup-consumer-group --command-config ../config/consumer.properties --reset-offsets --to-offset 0 --all-topics --execute
4、执行完再次查询消费者组,状态变为未消费,可以作为消息丢失未消费规避
5、执行LAG重置为0的操作
sh kafka-consumer-groups.sh --bootstrap-server ****** --group clusterBackup-consumer-group --command-config ../config/consumer.properties --reset-offsets --to-latest --all-topics --execute
6、执行完再次查询消费者组,LAG值变为0