zookeeper之windows安裝

安裝zookeeper作爲dubbo的註冊中心

官網鏈接 https://www.apache.org/dyn/closer.cgi/zookeeper/
清華鏡像的下載頁面連接
https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/

一、3.4的版本

連接https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/
1.下載
2.解壓 tar -zxvf win10的也可以這麼用
3.配置文件

複製 zoo_sample.cfg 改名爲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=/tmp/zookeeper
# 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=../data
dataLogDir=../log

4.啓動 進入bin目錄,運行zkServer.cmd

至此windows版本的本地zookeeper就可以運行的

二、5.6版本的

下載頁面

先分享我的一次操作經歷

首先下載apache-zookeeper-3.5.6.tar.gz 解壓

然後發現裏面和3.4的目錄結構不一樣
在這裏插入圖片描述
才發現這是源碼,於是
mvn clean
mvn install -Dmaven.test.skip=true
然後進去bin目錄運行zkServer.cmd發現少了一些jar包,就是3.4版本的lib目錄下面的日誌jar包的等,坑的一筆啊!

操作
1.下載 選擇帶有bin的 apache-zookeeper-3.5.6-bin.tar.gz
2.解壓 tar -zxvf win10的也可以這麼用
3.配置文件同上
在上面的配置基礎之上還要注意一點
這個版本的zookeeper默認端口爲8080,這就坑了,和tomcat衝突
在上面基礎上加上一句,修改端口

admin.serverPort=8888

4.啓動 進入bin目錄,運行zkServer.cmd

安裝完畢,等到整合dubbo的時候又是坑

本文爲作者原創,轉載請註明出處!

發佈了44 篇原創文章 · 獲贊 13 · 訪問量 9675
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章