kafka-consumer-groups 命令行工具使用手册该手册原文出自 $KAFKA_HOME\bin\windows\kafka-consumer-groups.bat --help
命令的输出结果,并由 Redisant 提供翻译和测试用例 。
--all-groups
Apply to all consumer groups.指定所有的消费者组 。和
--describe
, --delete
, --reset-offsets
, --delete-offsets
配合使用--all-topics
Consider all topics assigned to a group in the指定所有的消费者组 。和reset-offsets
process.
--reset-offsets
配合使用--bootstrap-server
REQUIRED: The server(s) to connect to.必填项,Kafka服务器的地址和端口 。
--by-duration
Reset offsets to offset by duration from current timestamp. Format: 'PnDTnHnMnS'
--command-config
Property file containing configs to be passed to Admin Client and Consumer.
--delete
Pass in groups to delete topic partition offsets and ownership information over the entire consumer group. For instance --group g1 --group g2删除整个消费者组(包括已保存的偏移量信息和所有权信息),在执行该操作之前,必须关闭所有的消费者 。
- 删除所有的消费者组
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 CountryCounter --deleteDeletion of requested consumer groups ('CountryCounter', 'OrderCounter') was successful.
- 删除指定的消费者组
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 --deleteDeletion of requested consumer groups ('CountryCounter') was successful.
--delete-offsets
Delete offsets of consumer group. Supports one consumer group at the time, and multiple topics.删除消费者组的偏移量 。例如:
PS C:\Users\chenjing\kafka_2.12-3.3.1> .\bin\windows\kafka-consumer-groups.bat --bootstrap-server 192.168.31.253:9092 --delete-offsets --group CountryCounter --topic t1
--describe
Describe consumer group and list offset lag (number of messages not yet processed) related to given group.列出消费者组里所有主题的信息和每个分区的偏移量 。例如:
- 查看指定的消费者组:
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 --describeGROUPTOPICPARTITIONCURRENT-OFFSETLOG-END-OFFSETLAGCONSUMER-IDHOSTCLIENT-IDCountryCounteruser_card02142140chenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_clientCountryCountert101891890chenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_client
- 查看所有的消费者组:
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 --describeGROUPTOPICPARTITIONCURRENT-OFFSETLOG-END-OFFSETLAGCONSUMER-IDHOSTCLIENT-IDCountryCounteruser_card02142140chenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_clientCountryCountert101891890chenjing_client-42cc37c6-695f-4c47-b844-764a3d2169d3 /111.18.132.232 chenjing_clientGROUPTOPICPARTITIONCURRENT-OFFSETLOG-END-OFFSETLAGCONSUMER-IDHOSTCLIENT-IDOrderCountert101891890client_2-26992db5-d5ab-4252-a219-995bdbe37388 /111.18.132.232 client_2OrderCountert20125712570client_2-26992db5-d5ab-4252-a219-995bdbe37388 /111.18.132.232 client_2
--group
经验总结扩展阅读
- JavaScript常用工具函数
- 2 onps栈使用说明——ping、域名解析等网络工具测试
- 安卓手机怎么截屏和截图(手机最强的截图工具)
- JVM调优工具使用手册
- 要写文档了,emmm,先写个文档工具吧——DocMarkdown
- chrome工具调试
- 怎么破解DLL文件(dll文件反编译工具)
- 重新整理 .net core 实践篇 ———— linux上排查问题实用工具 [外篇]
- 海边退潮捡海螺技巧
- TensorFlow?PyTorch?Paddle?AI工具库生态之争:ONNX将一统天下