gpt4 book ai didi

java - 无法在 Apache Kafka 中启动 Zookeeper 服务器

转载 作者:行者123 更新时间:2023-11-29 08:35:39 24 4
gpt4 key购买 nike

我在 kafka_home/bin/windows(按照建议 here )。然后我遇到与 here 相同的问题,它建议从 kafka 主页启动该程序。从 Windows 文件夹启动时出现此错误:

INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2014-08-21 11:53:55,748] FATAL Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/zookeeper.properties
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:110)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:99)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:76)
Caused by: java.lang.IllegalArgumentException: config/zookeeper.properties file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:94)
... 2 more
Invalid config, exiting abnormally

有人知道怎么解决吗?

最佳答案

配置文件的默认位置是用相对路径指定的,config/zookeeper.properties

Kafka 的目录树看起来有点像这样:

bin/
|
+-- zookeeper-server-start.sh
|
+-- windows/
|
+-- zookeeper-server-start.bat
config/
|
+-- zookeeper.properties

因此,如果您确实在 bin/windows/ 目录中,然后从那里运行 zookeeper-server-start.bat,ZK 启动脚本将有效地寻找它的配置位于 bin/windows/config/zookeeper.properties,但不存在。

查看启动 ZK 启动脚本的正确命令的现有答案 ( Apache Kafka error on windows - Couldnot find or load main class QuorumPeerMain ),其中示例命令行明确定义了在哪里可以找到配置文件:

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

# The below will NOT work (explanation is above)
$ cd bin/windows
$ zookeeper-server-start.bat

关于java - 无法在 Apache Kafka 中启动 Zookeeper 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44263348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com