zookeeper服务器启动抛出异常:错误:配置无效,异常退出

0ve6wy6x  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(587)

I just installed Kafka using brew install kafka and it was successful. Now when I try to start zookeeper I get the following error:

 ~/ zookeeper-server-start /opt/homebrew/etc/kafka/server.properties
[2022-08-17 12:03:46,961] INFO Reading configuration from: /opt/homebrew/etc/kafka/server.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-08-17 12:03:46,964] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /opt/homebrew/etc/kafka/server.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: dataDir is not set
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:444)
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:194)
    ... 2 more
Invalid config, exiting abnormally
[2022-08-17 12:03:46,965] INFO ZooKeeper audit is disabled. (org.apache.zookeeper.audit.ZKAuditProvider)
[2022-08-17 12:03:46,966] ERROR Exiting JVM with code 2 (org.apache.zookeeper.util.ServiceUtils)
 ~/

The server.properties file exists:

-rw-r--r--  1 atael  admin  6912 Aug 17 11:51 /opt/homebrew/etc/kafka/server.properties

My environment is a M1 Mac if that matters.
Anyone seems this before and can help?
Thanks Andy

qpgpyjmq

qpgpyjmq1#

发现问题。正确的命令应该是zookeeper-server-start /opt/homebrew/etc/kafka/zookeeper.properties

相关问题