【ZooKeeper】Windows安装教程

目录

  • 下载
  • 重命名配置文件zoo_sample.cfg
  • 启动
  • 启动报错
  • ZooInspector客户端下载

下载

  • 官网: https://zookeeper.apache.org/
  • 下载页面: https://zookeeper.apache.org/releases.html
  • 3.8.1版本下载页面: https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1-bin.tar.gz
  • 3.8.1版本下载地址: https://dlcdn.apache.org/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1-bin.tar.gz

重命名配置文件zoo_sample.cfg

  • zoo_sample.cfg重命名为zoo.cfg
  • 增加配置
# Jetty管理端口
admin.serverPort=12181

在使用zookeeper 3.6之后的版本,开启服务器,zk会自动占用8080端口,而后端服务器大部分都需要使用8080端口,因此需要zk的配置文件即可

启动

zkServer.cmd

启动报错

报错信息

2023-07-10 18:47:15,297 [myid:] - ERROR [main:o.a.z.s.ZooKeeperServerMain@70] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "D:\ProgramFiles\apache-zookeeper-3.8.1\bin\..\conf\zoo.cfg"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
        at java.base/java.lang.Integer.parseInt(Integer.java:668)
        at java.base/java.lang.Integer.parseInt(Integer.java:786)
        at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:78)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:110)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:68)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:141)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)

解决方案,启动命令去掉start,执行: zkServer.cmd即可

ZooInspector客户端下载

  • ZooInspector: https://issues.apache.org/jira/secure/attachment/12436620/ZooInspector.zip

你可能感兴趣的:(常用工具,zookeeper,windows,分布式,ZooInspector)