Window环境安装Zookeeper

开发环境

  • 操作系统:window10
  • JDK:1.8
  • zookeeper:zookeeper-3.4.13

安装步骤

一、单机模式安装

  1. 下载zookeeper
    zookeeper官网下载链接地址

  2. 将下载得到的压缩包解压到对应的目录下

  3. 进入conf文件夹,修改zookeeper的配置

  • 将zoo_sample.cfg重命名为zoo.cfg;

  • 修改zoo.cfg,修改的地方为下方配置文件的中文说明(只修改两个地方);

# 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配置,该目录为zookeeper保存数据的目录
dataDir=E:\\Software\\zookeeper-3.4.13\\data
#新增dataLogDir配置,该目录为zookeeper保存日志文件的目录
dataLogDir=E:\\Software\\zookeeper-3.4.13\\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

  1. 进入bin文件夹,点击zkServer.cmd,不关闭当前窗口;

  2. cmd出新的窗口,输入netstat -na,查看服务是否启动成功;


    查看是否有21811端口
  3. 如果服务列表中有检测到2181端口,则说明zookeeper的单机模式安装成功;

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容