【zookeeper安裝】

我是太陽啦啦啦發表於2018-02-11

前言:

最近自己重新搭建了一遍SSM框架,期間溫習了一些軟體的安裝,今天這篇部落格我們們主要來說說zookeeper的安裝,記錄自己的實踐過程.

核心:

第一步:

下載zookeeper-3.4.6.tar.gz(前提虛擬機器上需要安裝jdk)

第二步:

把zookeeper-3.4.6.tar.gz上傳到/usr/local目錄下,並解壓(z:壓縮  x:解壓  v:過程  f:檔案)


第三步

進入zookeeper-3.4.6目錄,建立data資料夾。

第四步

進入到zookeeper-3.4.6/conf中把zoo_sample.cfg改名為zoo.cfg,然後把zoo.cfg裡邊的dataDir改成

dataDir=/usr/local/zookeeper-3.4.6/data
1
# 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=/usr/local/zookeeper-3.4.6/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

第五步

進入到zookeeper-3.4.6/bin

執行啟動命令(啟動命令之前,確保2181埠開放)

./zkServer.sh start


執行關閉命令

./zkServer.sh stop

檢視狀態命令

./zkServer.sh status


總結:

今天部落格就寫到這裡,感謝夥伴們的閱讀.

相關文章