ZooKeeper安装

0)下载地址https://zookeeper.apache.org/releases.html
1) 解压安装包
[root@master soft]# tar xvf apache-zookeeper-3.6.3-bin.tar.gz -C /opt/moudel/
2)修改解压后的文件名称:
[root@master moudel]#mv apache-zookeeper-3.6.3-bin  zookeeper-3.6.3
3)进入/opt/moudel/zookeeper-3.6.3/conf目录下修改文件名称
[root@master conf]#mv zoo_sample.cfg  zoo.cfg

4)新建两个文件夹
 mkdir /opt/moudel/zookeeper-3.6.3/zkdata
mkdir /opt/moudel/zookeeper-3.6.3/zklogs

5)修改/opt/moudel/zookeeper-3.6.3/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 an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/opt/moudel/zookeeper-3.6.3/zkdata
dataLogDir=/opt/moudel/zookeeper-3.6.3/zklogs
# 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

## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888

6) 进入到/opt/moudel/zookeeper-3.6.3/zkdata目录下创建文件myid
vim myid
输入1

7)将zookeeper-3.6.3包复到其它两台机子上
scp -r zookeeper-3.6.3 root@slave1:/opt/moudel/
scp -r zookeeper-3.6.3 root@slave2:/opt/moudel/

8)修改其它两台机子上的myid分别输入2和3

9)设置环境变量
#ZOOKEEPER_HOME
export ZOOKEEPER_HOME=/opt/moudel/zookeeper-3.6.3
export PATH=$PATH:$ZOOKEEPER_HOME/bin

source /etc/profile

10)启动
bin/zkServer.sh start
bin/zkServer.sh start

11)查看结点状态
bin/zkServer.sh status
12)关闭结点
bin/zkServer.sh stop

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值