执行 zookeeper 运行命令apache
D:\kafka_2.12-2.3.0\bin\windows\zookeeper-server-start.bat D:\kafka_2.12-2.3.0\config\zookeeper.properties
执行结果
bootstrap
默认端口号是 2181
windows
打开新的命令行,执行:命令行
D:\kafka_2.12-2.3.0\bin\windows\kafka-server-start.bat D:\kafka_2.12-2.3.0\config\server.properties
执行结果:code
建立一个名为 topic_test
的主题,包含一个分区,只有一个副本server
D:\kafka_2.12-2.3.0\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic_test
D:\kafka_2.12-2.3.0\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic topic_test
D:\kafka_2.12-2.3.0\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic topic_test --from-beginning