停止的ZooKeeper當我試着用命令「zkServer stop
」停止動物園管理員,我得到了以下結果:不能在Windows
C:\zookeeper-3.4.10>call "C:\Program Files\Java\jdk1.8.0_121"\bin\java "-Dzookeeper.log.dir=C:\zookeeper-3.4.10\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "C:\zookeeper-3.4.10\bi
n\..\build\classes;C:\zookeeper-3.4.10\bin\..\build\lib\*;C:\zookeeper-3.4.10\bin\..\*;C:\zookeeper-3.4.10\bin\..\lib\*;C:\zookeeper-3.4.10\bin\..\conf" org.apache.zookeeper.server.quoru
m.QuorumPeerMain "C:\zookeeper-3.4.10\bin\..\conf\zoo.cfg" stop
2017-09-01 13:55:22,070 [myid:] - INFO [main:[email protected]] - autopurge.snapRetainCount set to 3
2017-09-01 13:55:22,072 [myid:] - INFO [main:[email protected]] - autopurge.purgeInterval set to 0
2017-09-01 13:55:22,072 [myid:] - INFO [main:[email protected]] - Purge task is not scheduled.
2017-09-01 13:55:22,072 [myid:] - WARN [main:[email protected]] - Either no config or no quorum defined in config, running in standalone mode
2017-09-01 13:55:22,145 [myid:] - ERROR [main:[email protected]] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\zookeeper-3.4.10\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:59)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:84)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:53)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
2017-09-01 13:55:22,148 [myid:] - INFO [main:[email protected]] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
我相信我已經開始了動物園管理員,因爲當我試圖啓動一個新的一,它顯示「java.net.BindException: Address already in use: bind
」
另一個奇怪的問題是,我無法在Windows服務列表中找到Zookeeper。然而,當我試圖通過netstat -and
顯示在Windows PowerShell中的所有端口的使用,我發現2181是使用:
Proto Local Address Foreign Address State
TCP 0.0.0.0:2181 0.0.0.0:0 LISTENING
[java.exe]
TCP [::1]:2181 [::1]:62268 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62279 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62280 ESTABLISHED
[java.exe]
TCP [::1]:2181 [::1]:62281 ESTABLISHED
[java.exe]
什麼是命令,你」已經用它來啓動它? – user10089632
@ user10089632只是「。\ bin \ zkServer」,但我也試過「。\ bin \ zkServer.conf \ zoo.cfg」 – Spider
很好,然後試着以管理員身份「kill」它 – user10089632