zookeeper安装( windows环境)
生活随笔
收集整理的這篇文章主要介紹了
zookeeper安装( windows环境)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.下載
Apache官方最新版本為:3.4.8
下載地址:http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
下載后并解壓到你指定的磁盤位置
2.將conf下的zoo_sample.cfg改名為zoo.cfg
之所以要這么做,是因為zookeeper默認的配置文件名就叫zoo.cfg
3.自定義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=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=11、tickTime:這個時間是作為 Zookeeper 服務器之間或客戶端與服務器之間維持心跳的時間間隔,也就是每個 tickTime 時間就會發送一個心跳。
2、dataDir:顧名思義就是 Zookeeper 保存數據的目錄,默認情況下,Zookeeper 將寫數據的日志文件也保存在這個目錄里。
3、dataLogDir:顧名思義就是 Zookeeper 保存日志文件的目錄
4、clientPort:這個端口就是客戶端連接 Zookeeper 服務器的端口,Zookeeper 會監聽這個端口,接受客戶端的訪問請求。
4.查看bin目錄下的zkEvn.cmd里的JAVA_HOME名字對不對
set JAVA="%JAVA_HOME%"\bin\java如果這個名字與你之前安裝JDK配置的環境變量的名字不對,那么就會因為找到JDK而報錯
5.啟動
需要注意的是,windows環境下需要啟動的是windows命令腳 本,而不是shell命令腳本
雙擊zkServer.cmd,會啟動一個java進程,即服務端
雙擊zkCli.cmd,會啟動一個客戶端
總結
以上是生活随笔為你收集整理的zookeeper安装( windows环境)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Java设计模式与实践》——工厂模式
- 下一篇: java信息管理系统总结_java实现科