嘿,我试图使用Zookeeper,但当我特灵连接到服务器,我得到这个日志
D:\apache-zookeeper-3.6.1\bin>call "C:\Program Files\Java\jdk-14.0.2"\bin\java "-Dzookeeper.log.dir=D:\apache-zookeeper-3.6.1\bin\..\logs" "-Dzookeeper.root.logger=INFO,CONSOLE" "-Dzookeeper.log.file=zookeeper-krnim-server-LAPTOP-44Q1S1KH.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp "D:\apache-zookeeper-3.6.1\bin\..\build\classes;D:\apache-zookeeper-3.6.1\bin\..\build\lib\*;D:\apache-zookeeper-3.6.1\bin\..\*;D:\apache-zookeeper-3.6.1\bin\..\lib\*;D:\apache-zookeeper-3.6.1\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\apache-zookeeper-3.6.1\bin\..\conf\zoo.cfg" start
2020-08-13 09:12:12,507 [myid:] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2020-08-13 09:12:12,509 [myid:] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2020-08-13 09:12:12,510 [myid:] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2020-08-13 09:12:12,513 [myid:] - WARN [main:QuorumPeerMain@138] - Either no config or no quorum defined in config, running in standalone mode
2020-08-13 09:12:12,516 [myid:] - INFO [main:ManagedUtil@44] - Log4j 1.2 jmx support found and enabled.
2020-08-13 09:12:12,585 [myid:] - ERROR [main:ZooKeeperServerMain@69] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "D:\apache-zookeeper-3.6.1\bin\..\conf\zoo.cfg"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:78)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:109)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:67)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:140)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
2020-08-13 09:12:12,587 [myid:] - INFO [main:ZooKeeperServerMain@70] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
2020-08-13 09:12:12,591 [myid:] - INFO [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
2020-08-13 09:12:12,592 [myid:] - ERROR [main:ServiceUtils@42] - Exiting JVM with code 2
D:\apache-zookeeper-3.6.1\bin>endlocal
这是我的配置文件:
The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=D:\apache-zookeeper-3.6.1-bin\logs
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
问题是什么?我搜索了一下,但没有找到解决方案。我正在使用windows。我在使用cli时也有问题。我是一个初学者,所以很难理解。
1条答案
按热度按时间roqulrg31#
我遇到了同样问题我对dataDir做了以下更改,错误得到了解决
dataDir=路径\到\数据\目录\
这可能会解决您的错误。