无法启动Apache Zookeeper

时间:2019-06-28 12:39:03

标签: apache-kafka apache-zookeeper

正在运行的Zookeeper出现此错误。 我已经从官方网站下载了zookeeper,并尝试在未进行任何更改的情况下运行它。以下是我在控制台上遇到的错误。

我正在Windows 7上运行它

C:\Kafka\Latest\apache-zookeeper-3.5.5-bin>bin\zkServer.cmd conf\zoo.cfg

C:\Kafka\Latest\apache-zookeeper-3.5.5-bin>call "C:\Program Files\Java\jdk1.8.0_211"\bin\java "-Dzookeeper.log.dir=C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\logs" "-Dzookee
per.root.logger=INFO,CONSOLE" "-Dzookeeper.log.file=zookeeper-Swapnil-server-FIDEL-W7P-D23.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /
t /f" -cp "C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\build\classes;C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\build\lib\*;C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\
bin\..\*;C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\lib\*;C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "C:\Kafka
\Latest\apache-zookeeper-3.5.5-bin\bin\..\conf\zoo.cfg" conf\zoo.cfg
2019-06-28 18:01:42,928 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2019-06-28 18:01:42,931 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2019-06-28 18:01:42,931 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2019-06-28 18:01:42,932 [myid:] - WARN  [main:QuorumPeerMain@125] - Either no config or no quorum defined in config, running  in standalone mode
2019-06-28 18:01:42,936 [myid:] - INFO  [main:ManagedUtil@46] - Log4j found with jmx enabled.
2019-06-28 18:01:43,000 [myid:] - ERROR [main:ZooKeeperServerMain@66] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\Kafka\Latest\apache-zookeeper-3.5.5-bin\bin\..\conf\zoo.cfg"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:63)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:103)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)
2019-06-28 18:01:43,002 [myid:] - INFO  [main:ZooKeeperServerMain@67] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]

将zoo.cfg称为波纹管

zoo.cfg

# 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=/tmp/zookeeper
# 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

0 个答案:

没有答案