sunshine-blog

通过原生kafka,查看对应的topic是否有数据

./kafka-server-start.sh ../config/server.properties 1>/dev/null 2>&1 &     # kafka-server-start.sh 脚本在 kafka_2.12-2.2.0/bin路径下
  • 查看已创建的topic列表:
 ./kafka-topics.sh --list --zookeeper localhost:2181
  • 查看对应topic的描述信息: 
./kafka-topics.sh --describe --zookeeper xx.x.xxx.xxx:2181 --topic xxxxx.xx.xxxxx.xxx     # --zookeeper为zookeeperIP, --topic为topic名称 
  • 消费消息:
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic xxxxx.xx.xxxxx.xxx --from-beginning    # 若没有任何返回或没有响应,则该topic中没有数据内容;否则有

 

 
 
 

分类:

技术点:

相关文章:

  • 2021-07-07
  • 2021-04-02
  • 2022-01-25
  • 2021-08-08
  • 2021-08-15
  • 2022-01-05
  • 2021-11-20
  • 2021-05-04
猜你喜欢
  • 2021-04-07
  • 2021-08-08
  • 2021-11-28
  • 2021-12-31
  • 2021-08-15
相关资源
相似解决方案