Zookeeper 集群的安装部署

  |   0 评论   |   0 浏览

Zookeeper 是一个分布式应用程序协调服务,大多数分布式应用都需要 Zookeeper 的支持。Zookeeper 安装部署主要有两种模式: 一种是单节点模式,另一种是分布式集群模式

下载Zookeeper

https://zookeeper.apache.org/releases.html#download

配置 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=/home/hadoop/data/zookeeper/zkdata
dataLogDir=/home/hadoop/data/zookeeper/zkdatalog
# 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
server.1=hadoop1:2888:3888
server.2=hadoop2:2888:3888
server.3=hadoop3:2888:3888

Zookeeper 安装目录同步到集群其他节点

将 hadoop1 节点的 Zookeeper 安装目录,整体分发到集群的 hadoop2 和 hadoop3节点,具体操作如下所示

scp -r zookeeper-3.4.6 hadoop@hadoop2:/home/hadoop/

启动 Zookeeper 集群

在各个节点分别启动 Zookeeper 服务,具体操作如图 3-5 所示。

Zookeeper 集群启动之后,可以通过 jps 命令查看 Zookeeper 服务进程,具体操作如图 3-6 所示。


标题:Zookeeper 集群的安装部署
作者:zh847707713
地址:http://lovehao.cn/articles/2021/11/12/1636705871424.html