ZooKeeper安裝(Windows)

來源:互聯網
上載者:User

標籤:內容   tick   init   strong   ntp   介面   參考   director   target   

概述

ZooKeeper是Hadoop的正式子項目,它是一個針對大型分布式系統的可靠協調系統,提供的功能包括:配置維護、名字服務、分布式同步、組服務等。ZooKeeper的目標就是封裝好複雜易出錯的關鍵服務,將簡單易用的介面和效能高效、功能穩定的系統提供給使用者。

安裝&配置

在apache的官方網站提供了好多鏡像,然後找到對應的版本,此處用的是3.3.6

https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/

 

把下載的zookeeper的檔案解壓到指定目錄:D:\machine\zookeeper-3.3.6

 

修改conf下增加一個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 anacknowledgement

syncLimit=5

# the directory where the snapshot isstored.  //鏡像資料位元置

dataDir=D:\\data\\zookeeper

#日誌位置

dataLogDir=D:\\logs\\zookeeper

# the port at which the clients willconnect  用戶端串連的連接埠

clientPort=2181

 

進入到bin目錄,並且啟動zkServer.cmd,這個指令碼中會啟動一個Java進程

D:\machine\zookeeper-3.3.6>cd bin

D:\machine\zookeeper-3.3.6\bin>

D:\machine\zookeeper-3.3.6\bin >zkServer.cmd

 

啟動後jps可以看到QuorumPeerMain的進程

D:\machine\zookeeper-3.3.6\bin >jps

 

啟動用戶端運行查看一下

D:\machine\zookeeper-3.3.6\bin>zkCli.cmd -server 127.0.0.1:2181

這個時候zookeeper已經安裝成功了。

 

參考官方文檔:

http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html

 

一下叢集設定我沒有試,從別處拷貝而來,有興趣的可以試試:

參考單機模式、叢集和偽叢集的文章

http://sqcjy111.iteye.com/blog/1741320

 

在 一台機器上通過偽叢集運行時可以修改 zkServer.cmd 檔案在裡面加入

set ZOOCFG=..\conf\zoo1.cfg  這行,另存新檔  zkServer-1.cmd


 

如果有多個可以以此類推

 

 

 

 

還需要 在對應的

/tmp/zookeeper/1,

/tmp/zookeeper/2,

/tmp/zookeeper/3

 建立一個文字檔命名為myid,內容就為對應的zoo.cfg裡server.後數字

  

  

 

ZooKeeper安裝(Windows)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.