WindowsKafka配置>启动教程

broker.id=1log.dirs=../kafka-logs
修改 zookeeper.properties
找到 dataDirs,改为
dataDir=../zk-dir启动 ZooKeeper
使用 powerShell 或 cmd 或 git Bash 打开到安装 kafka 的目录下,黏贴一下命令,执行便可
bin/windows/zookeeper-server-start.bat config/zookeeper.properties启动 Kafka
重新打开一个 powerShell 或 cmd 或 git Bash,同样 cd 到 kafka 的安装目录下。输入一下命令。
bin/windows/kafka-server-start.bat config/server.properties启动完成
创建 topic
创建 test 的 topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic merchants-template查看 topic
bin/windows/kafka-topics.bat --list --zookeeper localhost:2181启动生产者
bin/windows/kafka-console-producer.bat --broker-list localhost:9092 --topic merchants-template创建消费者
bin/windows/kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic merchants-template --from-beginning人若无名,专心练剑!
喜欢的朋友可以留下你的赞!
以上是 WindowsKafka配置>启动教程 的全部内容, 来源链接: utcz.com/z/513494.html
