zookeeper下载安装、zookeeper-3.4.6下载安装、Windows启动zookeeper、zookeeper启动闪退解决、zookeeper找不到zoo.cfg配置:\..\conf\
zookeeper下载链接:
官网:https://zookeeper.apache.org/releases.html
历史版本:https://archive.apache.org/dist/zookeeper/
zookeeper-3.4.6云盘:https://pan.baidu.com/s/1-YNJW0oSf4vowPtSe-w5Lg?pwd=euxp
zookeeper-3.4.6云盘修改版本,变更内容加压后详见readme:https://pan.baidu.com/s/1vQshAPN0iBp9hlUrWknICw?pwd=bnjd
zookeeper下载
官网下载ZooKeeper安装包
官网下载ZooKeeper安装包:https://zookeeper.apache.org/releases.html
官网历史版本下载
官网历史版本下载链接:https://archive.apache.org/dist/zookeeper/
如果想要下载之前一点的版本
选择对应tar包下载即可
Windows启动zookeeper
1.解压
下载完成后进行解压,解压目录结构如下图
2.修改conf文件夹中的zoo_sample.cfg文件名为zoo.cfg
zookeeper启动寻找配置文件的目录对应zkEnv前缀文件的相对路径:…\conf\zoo.cfg,需要先将conf文件夹中的zoo_sample.cfg文件名为zoo.cfg
3.在zoo.cfg设置dataDir目录
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
# dataDir=/tmp/zookeeper
# 数据目录改为zookeeper解压目录
dataDir=C:\Users\Administrator\Desktop\zookeeper-3.4.6\data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
4.启动zookeeper
zookeeper启动异常解决方案
zookeeper启动闪退解决
有的时候会出现双击闪退的情况。针对闪退,可按照一下步骤进行解决:
- 编辑zkServer.cmd文件末尾添加pause 。这样运行出错就不会退出,会提示错误信息,方便找到原因。
@echo off
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements. See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
setlocal
call "%~dp0zkEnv.cmd"
set ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain
echo on
java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %*
pause
endlocal
- 重新双击运行zkServer.cmd查看错误异常
zookeeper找不到zoo.cfg配置:…\conf\zoo.cfg file is missing
错误原因 ,找不到zoo.cfg配置文件
-
编辑zkEnv.cmd
-
寻找配置文件的目录对应zkEnv前缀文件的相对路径:…\conf\zoo.cfg,需要先将conf文件夹中的zoo_sample.cfg文件名为zoo.cfg
-
重新双击zkServer.cmd启动
至此,Zookeeper正常启动!
修改版本下载
zookeeper-3.4.6云盘修改版本,变更内容加压后详见readme:https://pan.baidu.com/s/1vQshAPN0iBp9hlUrWknICw?pwd=bnjd
解压后将最内层zookeeper-3.4.6复制到D盘即可用,或者自行修改。
zookeeper-3.4.6版本已修改变更的内容说明
1.修改conf文件夹中的zoo_sample.cfg文件名为zoo.cfg
2.zoo.cfg设置dataDir目录:dataDir=D:\zookeeper-3.4.6\data
3.zkServer.cmd文件末尾添加pause
解决的相关问题:
zookeeper启动闪退解决:zkServer.cmd文件末尾添加pause 。这样运行出错就不会退出,会提示错误信息,方便找到原因
zookeeper找不到zoo.cfg配置:…\conf\zoo.cfg file is missing:将conf文件夹中的zoo_sample.cfg文件名为zoo.cfg
修改