【发布时间】:2020-07-27 00:26:37
【问题描述】:
kafka 1.1版
--list可以获取消费者组
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list --command-config config/client_security.properties
Note: This will not show information about old Zookeeper-based consumers.
spark-kafka-source-fd469ba1-6ffa-43cb-8919-06c45ae56fd6--724816166-driver-0
console-consumer-23379
console-consumer-44846
console-consumer-75221
console-consumer-57833
yizhisec-traffic
console-consumer-91940
group1
无法获取任何信息。 此消费者组 id 由 spark 生成。
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group spark-kafka-source-fd469ba1-6ffa-43cb-8919-06c45ae56fd6--724816166-driver-0 --command-config config/client_security.properties
一无所获
Note: This will not show information about old Zookeeper-based consumers.
但测试其他消费者的工作。
更新更多细节
当我使用 zookeeper 查询时出现错误
bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group spark-kafka-source-fd469ba1-6ffa-43cb-8919-06c45ae56fd6--724816166-driver-0 --command-config config/client_security.properties
得到错误
Note: This will only show information about consumers that use ZooKeeper (not those using the Java consumer API).
Error: The consumer group 'spark-kafka-source-fd469ba1-6ffa-43cb-8919-06c45ae56fd6--724816166-driver-0' does not exist.
【问题讨论】:
-
您使用的是什么版本的 spark-streaming-kafka-*?,旧的 kafka 客户端版本(低于 0.9)似乎在 Zookeeper 上存储了 kafka 偏移量,并且不显示在此。
-
另外,请尝试复制粘贴您的命令/输出,而不是共享屏幕截图。
-
@TuyenLuong 我更新了我的帖子
-
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --list --command-config config/client_security.properties的输出是什么?注意--new-consumer标志。 -
@GiorgosMyrianthous 与没有相同
标签: apache-spark apache-kafka spark-streaming kafka-consumer-api spark-streaming-kafka