zookeeper安装在windows 10上不起作用

btqmn9zl  于 2021-06-07  发布在  Kafka
关注(0)|答案(3)|浏览(491)

好吧,我有我的 java 家庭设置正确。我现在得到了这个错误。

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/,并确保目录确实存在。我不知所措。我在Windows10上运行这个。我有最新的jdk9安装和路径是准确的。

lb3vh1jj

lb3vh1jj1#

好吧,所以我找到了自己的答案。一切都安装正确。但即使在管理员模式下运行命令提示符,zookeeper也无法工作。我必须右键单击bin文件夹中的zkserver.cmd并说“以管理员身份运行”。我以前在使用sigwebtablet软件时遇到过这个问题。我认为运行windows10 developer是个问题。办公室里的其他人也有这个问题。希望这能帮助别人。

ee7vknir

ee7vknir2#

就我而言,以管理员身份运行是行不通的。我需要一种方法告诉zookeeper根据3个配置文件设置3个示例。它起作用的是编辑 zkServer.cmd 文件并删除 "%ZOOCFG%" 从wil开始的行的参数 call . 现在我可以跑了 bin\zkServer.cmd conf\zoo.cfg , bin\zkServer.cmd conf\zoo2.cfg ,和 bin\zkServer.cmd conf\zoo3.cfg 在三个命令提示符窗口中,启动并运行我的群集:)

vngu2lb8

vngu2lb83#

假设您已经将conf\zoo\u sample.cfg文件重命名为conf\zoo.cfg并正确设置datadir属性,您已经这样做了;使用以下命令启动zookeeper服务器

C:\zookeeper-3.4.12\bin>.\zkServer.cmd

不是下面的

C:\zookeeper-3.4.12\bin>.\zkServer.cmd start

相关问题