溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

zookeeper3.3.6怎么安裝

發(fā)布時(shí)間:2021-11-12 14:03:45 來(lái)源:億速云 閱讀:121 作者:小新 欄目:云計(jì)算

這篇文章給大家分享的是有關(guān)zookeeper3.3.6怎么安裝的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。

下載: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開(kāi)始,zookeeper提供了自動(dòng)清理snapshot和事務(wù)日志的功能
autopurge.purgeInterval=1 //頻率小時(shí),默認(rèn)為0表示不清理 
autopurge.snapRetainCount=1 //保留的文件數(shù)目,默認(rèn)為3

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

如果不加這一步,在分布式的情況下,斷網(wǎng)會(huì)導(dǎo)致zookepper服務(wù)異常退出。

QuorumPeerMain

啟動(dòng)

cd ../bin
./zkServer.sh start

停止

 ./zkServer.sh stop

查看zookeeper狀態(tài)

 ./zkServer.sh status

zookeeper客戶(hù)端操作命令

./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

感謝各位的閱讀!關(guān)于“zookeeper3.3.6怎么安裝”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI