kafka-----Windows下的使用

windows 环境

(PHP(laravel):composer require nmred/kafka-php)
1.zookeeper  启动命令	(**注意:因我的config在bin同级目录,故../../**)
bin/windows/zookeeper-server-start.bat ../../config/zookeeper.properties &
2.kafka 启动命令					(**注意:因我的config在bin同级目录,故../../**)
bin/windows/kafka-server-start.bat ../../config/server.properties &
3.创建 topic:
bin/windows/kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
.4.查看创建的topic
bin/windows/kafka-topics.bat --list --bootstrap-server localhost:9092
5. 启动生产者producer
bin/windows/kafka-console-producer.bat --broker-list localhost:9092 --topic test
6.启动消费者  customer
bin/windows/kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning

猜你喜欢

转载自blog.csdn.net/zhouqi1427/article/details/114768917
今日推荐