当前位置:   article > 正文

kafka 查看消费者组_kafka-consumer-groups.sh

kafka-consumer-groups.sh

kafka-consumer-groups.sh 命令可以查看消费者组,其中console-consumer-89657是消费的时候如果不设置消费者组自动生成的默认组

[root@mypc01 config]# kafka-consumer-groups.sh \
> --new-consumer \
> --bootstrap-server mypc01:9092,mypc02:9092,mypc03:9092 \
> --list
The [new-consumer] option is deprecated and will be removed in a future major release.The new consumer is used by default if the [bootstrap-server] option is provided.
Note: This will not show information about old Zookeeper-based consumers.
console-consumer-89657
console-consumer-25399
console-consumer-92059
console-consumer-45548
console-consumer-3458
g2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

还可以省略new-consumer 参数

kafka-consumer-groups.sh \
--bootstrap-server mypc01:9092,mypc02:9092,mypc03:9092 \
--list
  • 1
  • 2
  • 3

查看消费情况,用describe参数+ 指定消费者组,消费者组可以用上面的方法查

[root@mypc01 config]# kafka-consumer-groups.sh \
> --bootstrap-server mypc01:9092,mypc02:9092,mypc03:9092 \
> --describe \
> --group console-consumer-45548

TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID     HOST            CLIENT-ID
cat             2          79668           79668           0               -               -               -
cat             1          79686           79686           0               -               -               -
cat             0          79682           79682           0               -               -               -
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

总结

  • kafka-consumer-groups.sh命令可以查看消费者组以及消费情况
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/395981
推荐阅读
相关标签
  

闽ICP备14008679号