在 Windows 上运行 ZooKeeper 得到信息 ZooKeeper 审核已禁用。和错误退出 JVM,代码为 2
我尝试使用以下命令在Windows上运行zookeeper
:zookeeper-server-start.bat config\zookeeper.properties
,但出现此错误
INFO Reading configuration from: config\zookeeper.properties
(org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-03-01 00:06:37,850] WARN config\zookeeper.properties is relative. Prepend .\ to
indicate that you're sure! (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-03-01 00:06:37,850] ERROR 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:198)
at
org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:124)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
Caused by: java.lang.IllegalArgumentException: config\zookeeper.properties file is missing
at
org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)
at
org.apache.zookeeper.server.util.VerifyingFileFactory.validate(VerifyingFileFactory.java:47)
at
org.apache.zookeeper.server.util.VerifyingFileFactory.create(VerifyingFileFactory.java:39)
at
org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:180)
... 2 more
Invalid config, exiting abnormally
[2022-03-01 00:06:37,853] INFO ZooKeeper audit is disabled.
(org.apache.zookeeper.audit.ZKAuditProvider)
[2022-03-01 00:06:37,855] ERROR Exiting JVM with code 2
(org.apache.zookeeper.util.ServiceUtils)
i tried to run zookeeper on windows using the following command
zookeeper-server-start.bat config\zookeeper.properties
and i got this error
INFO Reading configuration from: config\zookeeper.properties
(org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-03-01 00:06:37,850] WARN config\zookeeper.properties is relative. Prepend .\ to
indicate that you're sure! (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-03-01 00:06:37,850] ERROR 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:198)
at
org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:124)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
Caused by: java.lang.IllegalArgumentException: config\zookeeper.properties file is missing
at
org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)
at
org.apache.zookeeper.server.util.VerifyingFileFactory.validate(VerifyingFileFactory.java:47)
at
org.apache.zookeeper.server.util.VerifyingFileFactory.create(VerifyingFileFactory.java:39)
at
org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:180)
... 2 more
Invalid config, exiting abnormally
[2022-03-01 00:06:37,853] INFO ZooKeeper audit is disabled.
(org.apache.zookeeper.audit.ZKAuditProvider)
[2022-03-01 00:06:37,855] ERROR Exiting JVM with code 2
(org.apache.zookeeper.util.ServiceUtils)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
错误消息已经告诉你出了什么问题
它会引发错误,因为它无法加载
运行zookeeper时的zookeeper.properties
文件。适用于 Windows 的 Kafka bat 文件是嵌套在
windows
文件夹中的一个文件夹,因此您需要使用..\
退出两次以指向 config 目录。这应该对你有用
同样的事情,之后启动kafka服务器
这些命令应该指向里面的
zookeeper.properties
和server.properties
配置卡夫卡的目录位于kafka_2.13-3.1.0\config
假设您没有修改/移动Kafka的默认config目录
The error message already tell you what went wrong
It's raising error because it cannot load the
zookeeper.properties
file when running zookeeper.Kafka bat files for Windows is one folder nested inside
windows
folder, so you need to step out twice with..\
to point to the config directory.This should work for you
And same thing, to start kafka server afterward
These commands should point to the
zookeeper.properties
andserver.properties
inside config directory of kafka atkafka_2.13-3.1.0\config
Assuming that you didn't modify/moving the default config directory of Kafka
这应该有效:
首先,您的目录应该位于 Kafka 文件夹中,就在两个步骤中的 bin 目录之前:
启动 Zookeeper:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
启动 kafka 服务器:
。 \bin\windows\kafka-server-start.bat .\config\server.properties
This should work:
First, your directory should be on the Kafka folder just before the bin directory on both steps:
To start zookeeper:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
To start the kafka server:
.\bin\windows\kafka-server-start.bat .\config\server.properties
我在 Windows 上,我必须更改栏才能工作:
从:
到:
希望这对您有帮助!
Here I'm on windows, I had to change the bars to work:
from:
to:
Hope this help you!
这个命令在 Windows 中对我有用。
或尝试这个(我猜你设置了环境变量)
this cmd works for me in windows.
or try this (I guess you set your environment variable)