kafka基本命令

啓動zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties &

啓動kafka
bin/kafka-server-start.sh config/server.properties &

停止kafka
bin/kafka-server-stop.sh

停止zookeeper
bin/zookeeper-server-stop.sh
創建topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

展示topic
bin/kafka-topics.sh --list --zookeeper localhost:2181
生產者:
/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic demo

消費者:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic demo

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章