我正确设置了JAVA_HOME。我现在收到这个错误。
C:\projects\zookeeper\zk\bin>call "C:\Program Files\Java\jdk-9"\bin\java "-Dzookeeper.log.dir=C:\projects\zookeeper\zk\bin\..\logs" "-Dzookeeper.root.logger=INFO,CONSOLE" "-Dzookeeper.log.file=zookeeper-User-server-HUNTER-PC.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp "C:\projects\zookeeper\zk\bin\..\build\classes;C:\projects\zookeeper\zk\bin\..\build\lib\*;C:\projects\zookeeper\zk\bin\..\*;C:\projects\zookeeper\zk\bin\..\lib\*;C:\projects\zookeeper\zk\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "C:\projects\zookeeper\zk\bin\..\conf\zoo.cfg" start
2017-09-29 10:44:10,183 [myid:] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2017-09-29 10:44:10,183 [myid:] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2017-09-29 10:44:10,183 [myid:] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2017-09-29 10:44:10,183 [myid:] - WARN [main:QuorumPeerMain@122] - Either no config or no quorum defined in config, running in standalone mode
2017-09-29 10:44:10,183 [myid:] - INFO [main:ManagedUtil@46] - Log4j found with jmx enabled.
2017-09-29 10:44:10,330 [myid:] - ERROR [main:ZooKeeperServerMain@64] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\projects\zookeeper\zk\bin\..\conf\zoo.cfg"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
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:61)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:101)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:62)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
2017-09-29 10:44:10,330 [myid:] - INFO [main:ZooKeeperServerMain@65] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
C:\projects\zookeeper\zk\bin>endlocal
这是我的配置文件:zoo.cfg
tickTime=2000
dataDir=c:/projects/zookeeper/zk/
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888
我已经将dataDir重复更改为C:/ tmp到/ usr / 并确保目录实际上在那里。我很茫然。我在Windows 10上运行它。我安装了最新的JDK 9并且路径准确。
答案 0 :(得分:1)
好的,所以我想出了自己的答案。一切都安装正确。但即使从管理员模式命令提示符运行,zookeeper也无法运行。我必须右键单击bin文件夹中的zkServer.cmd,然后以管理员身份运行。我之前使用SigWebTablet软件遇到过这个问题。我认为这是运行Windows10开发人员的问题。办公室周围的其他人在Windows上遇到了这个问题。希望这会帮助其他人。
答案 1 :(得分:0)
假设您已将 conf \ zoo_sample.cfg 文件重命名为 conf \ zoo.cfg 并正确设置了 dataDir 属性,您已经完成了;使用以下命令启动Zookeeper服务器
C:\zookeeper-3.4.12\bin>.\zkServer.cmd
以下内容
C:\zookeeper-3.4.12\bin>.\zkServer.cmd start
答案 2 :(得分:0)
就我而言,以管理员身份运行无法正常工作。我需要一种方法来告诉Zookeeper根据3个配置文件设置三个实例。起作用的是编辑zkServer.cmd
文件,并从"%ZOOCFG%"
开始的行中删除call
参数。现在,我可以在三个命令提示符窗口中运行bin\zkServer.cmd conf\zoo.cfg
,bin\zkServer.cmd conf\zoo2.cfg
和bin\zkServer.cmd conf\zoo3.cfg
,并启动集群并运行:)