且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows 上的 Apache Kafka 错误 - 无法找到或加载主类 QuorumPeerMain

更新时间:2022-06-09 08:28:15

从 Kafka 根文件夹运行这些命令:

Run these commands from your Kafka root folder:

cd bin\windows

然后运行 ​​Zookeper 服务器:

Then run Zookeper server:

zookeeper-server-start.bat ..\..\config\zookeeper.properties

然后运行Kafka服务器:

Then run Kafka server:

kafka-server-start.bat ..\..\config\server.properties

这里的问题是运行 /bin/windows 文件夹中的 .bat 文件,因此在您按照上述步骤运行服务器并想要跟进之后使用本教程,请确保您正在运行正确的批处理文件来创建主题等,例如:

The gotcha here is to run the .bat files from the /bin/windows folder, so after you run your servers with the steps above and want to follow up with the tutorial, make sure you are running the correct batch files to create topics and whatnot, e.g.:

创建主题:

kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

列出主题:

kafka-topics.bat --list --zookeeper localhost:2181