进入kafka目录下,新建文件夹 kafka-logs 与文件夹 zk-dir,进入config目录下,打开server.propertiesgit
broker.id=1 log.dirs=../kafka-logs
找到 dataDirs,改成shell
dataDir=../zk-dir
使用 powerShell 或 cmd 或 git Bash 打开到安装 kafka 的目录下,黏贴一下命令,执行即可bootstrap
bin/windows/zookeeper-server-start.bat config/zookeeper.properties
从新打开一个 powerShell 或 cmd 或 git Bash,一样 cd 到 kafka 的安装目录下。输入一下命令。windows
bin/windows/kafka-server-start.bat config/server.properties
启动完成code
建立 test 的 topicserver
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic merchants-template
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
人若无名,专心练剑! 喜欢的朋友能够留下你的赞!教程