在 Windows 上运行 ZooKeeper 得到信息 ZooKeeper 审核已禁用。和错误退出 JVM,代码为 2

发布于 2025-01-10 16:23:06 字数 1818 浏览 0 评论 0原文

我尝试使用以下命令在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

原谅我要高飞 2025-01-17 16:23:06

错误消息已经告诉你出了什么问题

引起:java.lang.IllegalArgumentException:org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)处缺少config\zookeeper.properties文件

它会引发错误,因为它无法加载 运行zookeeper时的zookeeper.properties文件。

适用于 Windows 的 Kafka bat 文件是嵌套在 windows 文件夹中的一个文件夹,因此您需要使用 ..\ 退出两次以指向 config 目录。
输入图片这里的描述

这应该对你有用

kafka_2.13-3.1.0\bin\windows> .\zookeeper-server-start.bat ..\..\config\zookeeper.properties

同样的事情,之后启动kafka服务器

kafka_2.13-3.1.0\bin\windows> .\kafka-server-start.bat ..\..\config\server.properties

这些命令应该指向里面的zookeeper.propertiesserver.properties配置卡夫卡的目录位于
kafka_2.13-3.1.0\config

假设您没有修改/移动Kafka的默认config目录

The error message already tell you what went wrong

Caused by: java.lang.IllegalArgumentException: config\zookeeper.properties file is missing at org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)

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.
enter image description here

This should work for you

kafka_2.13-3.1.0\bin\windows> .\zookeeper-server-start.bat ..\..\config\zookeeper.properties

And same thing, to start kafka server afterward

kafka_2.13-3.1.0\bin\windows> .\kafka-server-start.bat ..\..\config\server.properties

These commands should point to the zookeeper.properties and server.properties inside config directory of kafka at
kafka_2.13-3.1.0\config

Assuming that you didn't modify/moving the default config directory of Kafka

上课铃就是安魂曲 2025-01-17 16:23:06

这应该有效:
首先,您的目录应该位于 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

¢蛋碎的人ぎ生 2025-01-17 16:23:06

我在 Windows 上,我必须更改栏才能工作:

从:

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

到:

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

希望这对您有帮助!

Here I'm on windows, I had to change the bars to work:

from:

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

to:

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

Hope this help you!

顾冷 2025-01-17 16:23:06

这个命令在 Windows 中对我有用。

C:\kafka\bin\windows>zookeeper-server-start ../../config/zookeeper.properties

或尝试这个(我猜你设置了环境变量)

C:\kafka>zookeeper-server-start.bat config/zookeeper.properties

this cmd works for me in windows.

C:\kafka\bin\windows>zookeeper-server-start ../../config/zookeeper.properties

or try this (I guess you set your environment variable)

C:\kafka>zookeeper-server-start.bat config/zookeeper.properties
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文