ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护、名字服务、分布式同步、组服务等。ZooKeeper的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效、功能稳定的系统提供给用户。
管网:https://zookeeper.apache.org/
下载地址:https://mirrors.cnnic.cn/apache/zookeeper/
下载:
通过上面提供的下载地址,选择相应的版本,选择下载的版本为:zookeeper-3.4.10.
下载到相应的文件之后,并进行解压。
增加配置文件:
在解压目录下conf中创建配置文件(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 anacknowledgement
syncLimit=5
# the directory where the snapshot isstored. //镜像数据位置
dataDir=D:\\data\\zookeeper
#日志位置
dataLogDir=D:\\logs\\zookeeper
# the port at which the clients willconnect 客户端连接的端口
clientPort=2181
启动:
完成配置文件编写之后,通过windows运行输入cmd,进入命令行模式,执行解压目录bin目录下的zkserver.cmd文件
D:\21_Project\80_SpringBoot\zookeeper-3.4.10\bin>zkServer.cmd

查看启动状态:
D:\21_Project\80_SpringBoot\zookeeper-3.4.10\bin>zkCli.cmd -server 127.0.0.1:2181
通过上面命令可以进入zookeeper client端,在此可以查看状态,以及已经注册了哪些服务
本文介绍了ZooKeeper的基本概念及其作为可靠协调系统在大型分布式系统中的应用。提供了详细的安装步骤,包括从官方源下载指定版本(zookeeper-3.4.10)、配置过程(如设置心跳间隔、客户端连接端口等参数)以及启动服务的方法。

3191

被折叠的 条评论
为什么被折叠?



