windows中kafka使用方法
1.启动zookeeper
bin\windows\zookeeper-server-start.bat config\zookeeper.properties
2.启动kafka
bin\windows\kafka-server-start.bat config\server.properties
3.创建topic
bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
4.查看topic
bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
5.启动producer
bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic demo
6.启动customer
bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic demo --from-beginning
转载于:https://my.oschina.net/871120/blog/3036582