使用bin中的脚本 zkServer.cmd 启动zookeeper,输入命令
D:\WORK\Project-Test\zookeeper-3.4.11\bin>zkServer.cmd start
发现无法启动,出现如下错误
2018-01-29 19:37:33,793 [myid:] - ERROR [main:ZooKeeperServerMain@57] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "D:\WORK\Project-Test\zookeeper-3.4.11\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:61)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:55)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:119)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:81)
原因: 用法不对,start是在linux下用.sh脚本时的命令,在win下直接打脚本名就好
D:\WORK\Project-Test\zookeeper-3.4.11\bin>zkServer.cmd
来源:CSDN
作者:snowfield_june
链接:https://blog.csdn.net/snowfield_june/article/details/79199330