Windows(win 10)下安裝ZooKeeper

1,下載ZooKeeper包
http://mirrors.hust.edu.cn/apache/zookeeper/
我這里下載的是zookeeper-3.4.13/

2,將壓縮包解壓到指定盤, 我的是在D盤, 重命名文件夾為zookeeper

3,進入zookeeper\conf\ , 將zoo_sample.cfg重命名為zoo.cfg

4,用記事本打開zoo.cfg修改為如下內(nèi)容

# 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=D:\\zookeeper\\data
dataLogDir=D:\\zookeeper\\log
# 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

其中
dataDir=D:\zookeeper\data
dataLogDir=D:\zookeeper\log
data存放數(shù)據(jù) log存放日志, 啟動時會自動建立

5,打開cmd

圖片.png

圖片.png

6,查看是否啟動(方式有多種)
netstat -ano|findstr "2181" 命令查看


圖片.png

客戶端查看


圖片.png

jps(有待了解此命令)


圖片.png

正常情況下會啟動成功 ,但是我的系統(tǒng)是win10 時出現(xiàn)如下錯誤

Error: JAVA_HOME is not set.

解決方法:
1,用記事本打開D:\zookeeper\bin\zkEnv.cmd
2,找到你的java jdk路勁,然后set路勁, 設(shè)置java環(huán)境變量

set JAVA=C:\Program Files\Java\jdk1.8.0_131\bin\java
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容