安装Zookeeper3.4.10
目录
安装Zookeeper
1.安装
1.上传安装包
zookeeper-3.4.10.tar.gz
2.解压安装包
-
[root@hadoop01 software]# tar -zxvf zookeeper-3.4.10.tar.gz -C /opt/module/
-
[root@hadoop01 software]# cd /opt/module/
-
[root@hadoop01 module]# mv zookeeper-3.4.10/ zookeeper
-
[root@hadoop01 conf]# cd /opt/module/zookeeper/conf
2.配置文件
1.修改zoo_sample.cfg名称
[root@hadoop01 conf]# mv zoo_sample.cfg zoo.cfg
2.创建一个存放zk数据的目录:
[root@hadoop01 zookeeper]# mkdir /opt/module/zookeeper/data
3.配置zoo.cfg
-
[root@hadoop01 zookeeper]# vim 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/module/zookeeper/data
-
# 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=hadoop01:2888:3888
-
server.2=hadoop02:2888:3888
-
server.3=hadoop03:2888:3888
4.测试
-
[root@hadoop01 data]# cd /opt/module/zookeeper/data/
-
[root@hadoop01 data]# touch myid
-
[root@hadoop01 data]# echo 1 > myid
-
[root@hadoop01 data]# cat myid
-
1
3.把集群文件同步到其它机器
1.同步文件
[root@hadoop01 zookeeper]# /root/bin/xsync /opt/module/zookeeper
2.写入
-
[root@hadoop01 zookeeper]# cd /opt/module/zookeeper/data/
-
[root@hadoop01 data]# cat myid
-
1
-
[root@hadoop02 data]# echo 2 > myid
-
[root@hadoop02 data]# cat myid
-
2
-
[root@hadoop03 module]# cd /opt/module/zookeeper/data/
-
[root@hadoop03 data]# echo 3 > myid
-
[root@hadoop03 data]# cat myid
-
3
4.集群的启动与关闭
-
[root@hadoop01 data]# cd /opt/module/zookeeper/
-
[root@hadoop02 data]# cd /opt/module/zookeeper/
-
[root@hadoop03 data]# cd /opt/module/zookeeper/
-
在三台机器中执行命令:
-
# bin/zkServer.sh start ---启动命令
-
# bin/zkServer.sh stop ---停止命令
-
# bin/zkServer.sh status ---查看状态命令
5.检查集群启动的状态
-
[root@hadoop01 zookeeper]# bin/zkServer.sh status
-
ZooKeeper JMX enabled by default
-
Using config: /opt/module/zookeeper/bin/../conf/zoo.cfg
-
Mode: follower
-
-
[root@hadoop02 zookeeper]# bin/zkServer.sh status
-
ZooKeeper JMX enabled by default
-
Using config: /opt/module/zookeeper/bin/../conf/zoo.cfg
-
Mode: leader
-
-
[root@hadoop03 zookeeper]# bin/zkServer.sh status
-
ZooKeeper JMX enabled by default
-
Using config: /opt/module/zookeeper/bin/../conf/zoo.cfg
-
Mode: follower
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhgabcak
系列文章
更多
同类精品
更多
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01