温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

zookeeper3.3.6怎么安装

发布时间:2021-11-12 14:03:45 来源:亿速云 阅读:112 作者:小新 栏目:云计算

这篇文章给大家分享的是有关zookeeper3.3.6怎么安装的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

下载:zookeeper-3.3.6.tar.gz

解压扔到/opt目录下

[~]$ cd /opt/zookeeper-3.3.6/conf
[conf]$ mv zoo_sample.cfg zoo.cfg
[conf]$ vi 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.
dataDir=/opt/zookeeper-3.3.6/tmp/data
#日志位置
dataLogDir=/opt/zookeeper-3.3.6/tmp/logs
# the port at which the clients will connect
clientPort=2181

# 从3.4.0开始,zookeeper提供了自动清理snapshot和事务日志的功能
autopurge.purgeInterval=1 //频率小时,默认为0表示不清理 
autopurge.snapRetainCount=1 //保留的文件数目,默认为3

server.1=172-25-3-27:2888:3888
cd /opt/zookeeper-3.3.6/tmp/data
vi myid
1

如果不加这一步,在分布式的情况下,断网会导致zookepper服务异常退出。

QuorumPeerMain

启动

cd ../bin
./zkServer.sh start

停止

 ./zkServer.sh stop

查看zookeeper状态

 ./zkServer.sh status

zookeeper客户端操作命令

./zkCli.sh -server 192.168.0.102:2181
[zk: 192.168.0.102:2181(CONNECTED) 0] ls /
create /zk "myData"
get /zk
set /zk "zsl"
delete /zk
create /zk/node1 "node1"
ls /zk

感谢各位的阅读!关于“zookeeper3.3.6怎么安装”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI