CentOS下安裝zookeeper

來源:互聯網
上載者:User

標籤:

Linux下安裝Zookeeper叢集步驟

(1) 下載zookeeper安裝包

  地址:http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

(2) 解壓安裝包並放置在對應的路徑下

  解壓對應檔案到對應的路徑下,本文將zookeeper解壓到/soft/zk路徑下,並在zk路徑下建立 dataDir與dataLogDir路徑

  cd /soft/zk

  tar -xvf zookeeper-xxx.tar.gz

  mkdir dataDir

  mkdir dataLogDir

 

(3) 配置zookeeper的設定檔

  對zookeeper進行配置

  cd /soft/zk/zookeeper-xxx/conf

  cp zoo-sample.cfg zoo.cfg

  vim zoo.cfg

  

# The number of milliseconds of each tick
tickTime=2000# The number of ticks that the initial# synchronization phase can takeinitLimit=10# The number of ticks that can pass between# sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just# example sakes.dataDir=/soft/zk/dataDirdataLogDir=/soft/zk/dataLogDir# the port at which the clients will connectclientPort=2181server.1=192.168.1.111:2888:3888server.2=192.168.1.112:2888:3888server.3=192.168.1.113:2888:3888

這裡對zookeeper伺服器進行配置,這裡需要將myid與對應的伺服器編號對應

 

(4) 設定zookeeper對應的myid檔案

  cd /soft/zk/dataDir

  vim myid

  將伺服器編號放入

 

(5) 啟動zookeeper服務

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh start

  啟動服務,注意查看zookeeper.out這個日誌輸出,可以看到問題點

 

(6) 驗證zookeeper是否正常啟動

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh status

  sh zkCli.sh -server 192.168.1.111:2181

 

(7) 查詢zookeeper伺服器對應的主從關係狀態

  cd /soft/zk/zookeeper-xxx/bin

  sh zkServer.sh status

CentOS下安裝zookeeper

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.