- 重置所有消费组的所有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 --all-groups --dry-run --all-topicsGROUPTOPICPARTITIONNEW-OFFSETOrderCountert220OrderCountert100OrderCountert210OrderCountert200CountryCounteruser_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 --all-groups --dry-run --topic t1GROUPTOPICPARTITIONNEW-OFFSETOrderCountert100CountryCountert100
--shift-by <Long: number-of-offsets>
Reset offsets shifting current offset by 'n', where 'n' can be positive or negative.
--state [String]
When specified with '--describe', includes the state of the group. Example: --bootstrap-server localhost:9092 --describe --group group1 --state和
--describe
配合使用,列出消费者组的状态 。例如:- 列出指定消费者组的状态
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 --stateGROUPCOORDINATOR (ID)ASSIGNMENT-STRATEGYSTATE#MEMBERSCountryCounter192.168.31.253:9092 (0)rangeStable1
- 列出所有消费者组的状态
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 --stateGROUPCOORDINATOR (ID)ASSIGNMENT-STRATEGYSTATE#MEMBERSCountryCounter192.168.31.253:9092 (0)rangeStable1GROUPCOORDINATOR (ID)ASSIGNMENT-STRATEGYSTATE#MEMBERSOrderCounter192.168.31.253:9092 (0)rangeStable1
--timeout <Long: timeout (ms)>
The timeout that can be set for some use cases. For example, it can be used when describing the group to specify the maximum amount of time in milliseconds to wait before the group stabilizes (when the group is just created, or is going through some changes). (default: 5000)可以为某些用例设置的超时 。例如,在显示消费者组的详情时,可以使用它来指定在组稳定之前等待的最长时间(以毫秒为单位)(当组刚刚创建或正在经历一些更改时),默认值:5000
--topic
The topic whose consumer group information should be deleted or topic whose should be included in the reset offset process. In配合其他命令指定主题名reset-offsets
case, partitions can be specified using this format:topic1:0,1,2
, where 0,1,2 are the partition to be included in the process. Reset-offsets also supports multiple topic inputs.
--verbose
Provide additional information, if any, when describing the group. This option may be used with '--offsets'/'--members'/'--state' and '--bootstrap-server' options only.
Example: --bootstrap-server localhost:9092 --describe --group group1 --members --verbose在描述组时提供其他信息(如果有的话) 。此选项只能与
--offsets
--members
--state
--bootstrap-server
选项一起使用 。--version
Display Kafka version.打印Kafka版本号
【kafka-consumer-groups 命令行工具使用手册】
经验总结扩展阅读
- JavaScript常用工具函数
- 2 onps栈使用说明——ping、域名解析等网络工具测试
- 安卓手机怎么截屏和截图(手机最强的截图工具)
- JVM调优工具使用手册
- 要写文档了,emmm,先写个文档工具吧——DocMarkdown
- chrome工具调试
- 怎么破解DLL文件(dll文件反编译工具)
- 重新整理 .net core 实践篇 ———— linux上排查问题实用工具 [外篇]
- 海边退潮捡海螺技巧
- TensorFlow?PyTorch?Paddle?AI工具库生态之争:ONNX将一统天下