1、查询topic,进入kafka目录:
bin/kafka-topics.sh --list --zookeeper localhost:2181

2、查询topic内容:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topicName --from-beginning

查询topic
./bin/kafka-topics.sh --bootstrap-server hadoop102:9092
创建topic
./bin/kafka-topics.sh --bootstrap-server hadoop102:9092 --create --topic first --partitions 4 --replication-factor 2
查看topic 为 first的 详细信息
./bin/kafka-topics.sh --bootstrap-server hadoop102:9092 --describe --topic first
往topic 为 first 的内部生产消息
./bin/kafka-console-producer.sh --broker-list hadoop102:9092 --topic first
从topic 为first的内部消费消息
./bin/kafka-console-consumer.sh --bootstrap-server hadoop102:9092 --topic first

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2021-09-20
  • 2022-12-23
  • 2021-05-04
  • 2021-12-19
猜你喜欢
  • 2022-01-05
  • 2021-08-27
  • 2021-11-18
  • 2021-07-27
  • 2022-02-08
  • 2021-04-07
相关资源
相似解决方案