Windows Kafka 配置 -> 启动教程

Windows Kafka 启动教程

修改 boker.id 和 log.dirs

进入kafka目录下,新建文件夹 kafka-logs 与文件夹 zk-dir,进入config目录下,打开server.propertiesgit

broker.id=1
log.dirs=../kafka-logs

修改 zookeeper.properties

找到 dataDirs,改成shell

dataDir=../zk-dir

启动 ZooKeeper

使用 powerShell 或 cmd 或 git Bash 打开到安装 kafka 的目录下,黏贴一下命令,执行即可bootstrap

bin/windows/zookeeper-server-start.bat config/zookeeper.properties

启动 Kafka

从新打开一个 powerShell 或 cmd 或 git Bash,一样 cd 到 kafka 的安装目录下。输入一下命令。windows

bin/windows/kafka-server-start.bat    config/server.properties

启动完成code

建立 topic

建立 test 的 topicserver

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

人若无名,专心练剑! 喜欢的朋友能够留下你的赞!教程

相关文章
相关标签/搜索