zookeeper在Windows底下的安装和使用

参考文章:zookeeper安装和使用 windows环境

(1)、第一步:进入zookeeper的下载地址,zookeeper下载地址,如下图所示:(2)、第二步:选择最新版本,zookeeper-3.5.4-beta这个版本,点击进去有个tar.gz的压缩包,下载到本地之后,解压到对应的目录底下D:\zookeeper-3.5.4-beta,修改解压目录底下conf的一个zoo_simple.cfg为zoo.cfg文件,否则后面启动服务的话会报找不到zoo.cfg这个配置文件,启动zookeeper服务会失败,需注意这一点,然后修改这个zookeeper的数据文件存放目录和日志文件存放的目录,具体配置如下:

# 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=D:\\zookeeper\\data  
dataLogDir=D:\\zookeeper\\log
# 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

(3)、启动zookeeper服务,打开cmd命令行,进入对应目录,命令如下:


(4)、启动后jps列出存在JVM底下的进程就有QuorumPeerMain进程,对应相关的zookeeper路径:

(5)、启动服务端的时候就跟上面参考的文章有点区别,不知道是不是版本问题:

输入下面命令:


后面给我来个这个:


把上面命令改为:zKCli.cmd connect 127.0.0.1:2181 这个即可,这样就安装成功了。

猜你喜欢

转载自blog.csdn.net/u012561176/article/details/80418771