kafka java linux shell 命令

kafka linux shell 命令

#列出当前的所有 topic(主题)
bin/kafka-topics.sh --list --zookeeper localhost:2181

#创建一个test1 topic(主题) 1个备份 3个分区
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic test1

#查看test1 topic(主题)的详情
#注意:不指定 topic,列出所有topic的详情
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test1

#删除test1 topic(主题)
bin/kafka-run-class.sh kafka.admin.TopicCommand --delete --topic test1 --zookeeper localhost:2181

#shell 进入生产者
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test1

#shell 进入消费之
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test1 --from-beginning





猜你喜欢

转载自blog.csdn.net/qq_18600061/article/details/79194504