The consumer group we wish to act on.配合其他命令执行消费者组
--helpPrint usage information.打印帮助手册
--listList all consumer groups.列出所有的消费者组 。例如:
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --listOrderCounterCountryCounter--membersDescribe members of the group. This option may be used with '--describe' and '--bootstrap-server' options only. Example: --bootstrap-server localhost:9092 --describe --group group1 --members查看消费者组里有哪些成员,该选项只能和
--describe 和 --bootstrap-server 一起使用 。例如:- 查看指定的消费者组里有哪些成员
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --group CountryCounter --describe --membersGROUPCONSUMER-IDHOSTCLIENT-ID#PARTITIONSCountryCounterchenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_client 2- 查看所有的消费者组里有哪些成员
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --all-groups --describe --membersGROUPCONSUMER-IDHOSTCLIENT-ID#PARTITIONSCountryCounterchenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_client 2GROUPCONSUMER-IDHOSTCLIENT-ID#PARTITIONSOrderCounterclient_2-26992db5-d5ab-4252-a219-995bdbe37388 /111.18.132.232 client_22--reset-offsetsReset offsets of consumer group. Supports one consumer group at the time, and instances should be inactive.
Has 2 execution options: --dry-run (the default) to plan which offsets to reset, and --execute to update the offsets. Additionally, the --export option is used to export the results to a CSV format.
You must choose one of the following reset specifications: --to-datetime, --by-duration, --to-earliest, --to-latest, --shift-by, --from-file, --to-current, --to-offset.
To define the scope use --all-topics or --topic. One scope must be specified unless you use '--from-file'.重置消费者组的偏移量 。如果执行消费者组,一次只能指定一个消费组(需要提前关闭相关的消费者和生产者) 。有两个执行参数:
--dry-run(默认值)用于打印计划要重置的偏移量,以及 --execute 以更新偏移量 。此外,--export 选项用于将结果导出为 CSV 格式 。必须选择以下重置类型之一(关于这些重置类型的更多参考请查看 官方文档):--to-datetime, --by-duration, --to-earliest, --to-latest, --shift-by, --from-file, --to-current, --to-offset 。例如(以下所有命令均使用
--dry-run 参数打印执行计划,如果执行计划符合你的期望,请把 --dry-run 替换为 --execute 以真正更新偏移量):- 重置指定消费组的所有Topic的偏移量
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --reset-offsets --to-earliest --group CountryCounter --dry-run --all-topicsGROUPTOPICPARTITIONNEW-OFFSETCountryCounteruser_card10CountryCounteruser_card0521CountryCounteruser_card20CountryCountert100- 重置指定消费组的指定Topic的偏移量
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --reset-offsets --to-earliest --group CountryCounter --dry-run --topic t1GROUPTOPICPARTITIONNEW-OFFSETCountryCountert100
		  	
经验总结扩展阅读
           - 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- 
              
              
            
- JavaScript常用工具函数 
- 2 onps栈使用说明——ping、域名解析等网络工具测试 
- 安卓手机怎么截屏和截图(手机最强的截图工具) 
- JVM调优工具使用手册 
- 要写文档了,emmm,先写个文档工具吧——DocMarkdown 
- chrome工具调试 
- 怎么破解DLL文件(dll文件反编译工具) 
- 重新整理 .net core 实践篇 ———— linux上排查问题实用工具 [外篇] 
- 海边退潮捡海螺技巧 
- TensorFlow?PyTorch?Paddle?AI工具库生态之争:ONNX将一统天下 

 
   
   
   
   
   
   
   
   
   
   
   
  