首页 > 解决方案 > ZooKeeper gives exiting JVM with error code 2 error

问题描述

I have openjdk16.0.1, zookeper and kafka in my machine.

When I use the command "zkServer.cmd start" it gives me the error below.

ERROR [main:QuorumPeerMain@99] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing C:\Users\****\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
        at java.base/java.util.Properties.loadConvert(Properties.java:672)
        at java.base/java.util.Properties.load0(Properties.java:456)
        at java.base/java.util.Properties.load(Properties.java:408)
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:185)
        ... 2 more
Invalid config, exiting abnormally
2021-04-30 17:25:17,422 [myid:] - INFO  [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
2021-04-30 17:25:17,428 [myid:] - ERROR [main:ServiceUtils@42] - Exiting JVM with code 2

Is there any solution for this?

tickTime=2000 
initLimit=10 
syncLimit=5 
dataDir=C:\Users\myUserName\Desktop\apache-zookeeper-3.7.0-bin\data clientPort=2181

Now I changed the place of the zookeper folder. it is now under C:
dataDir=C:\apache-zookeeper-3.7.0-bin\data However, there is still and error. This time:

ERROR [main:ZooKeeperServerMain@70] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
        at java.base/java.lang.Integer.parseInt(Integer.java:660)
        at java.base/java.lang.Integer.parseInt(Integer.java:778)
        at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:78)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:110)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:68)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:141)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)

标签: jvmapache-zookeeper

解决方案


推荐阅读