啓動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