zookeeper集群搭建

2021-09-27 10:01:45 字數 1671 閱讀 2511

三颱伺服器分別為hadoop01,hadoop02,hadoop03且已經在hosts中配置

三颱伺服器網路連通

三颱伺服器都已經安裝好jdk

解壓zookeeper

配置zoo.cfg

# the number of milliseconds of each tick

ticktime=2000

# the number of ticks that the initial

# synchronization phase can take

initlimit=5

# the number of ticks that can pass between

# sending a request and getting an acknowledgement

synclimit=2

# the directory where the snapshot is stored.

# do not use /tmp for storage, /tmp here is just

# example sakes.

datadir=/home/zkdata/

# 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.

## ## 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

server.1=hadoop01:2888:3888

server.2=hadoop02:2888:3888

server.3=hadoop03:2888:3888

關閉防火牆在hadoop01,hadoop02,hadoop03分別啟動zookeeper

zkserver.sh start

檢視zookeeper狀態

zookeeper集群搭建

接觸zookeeper集群已有很長很長一段時間了,zookeeper在專案中的使用相當的頻繁,如dubb服務 amq集群 大資料領域hadoop等。zookeeper的集群建立非常簡單,一直想寫一篇文章來對集群使用的介紹,但一直沒能抽出空,今天正好閒來無事,就重新實踐一遍來整理記錄,下文是基本的集群...

zookeeper集群搭建

zookeeper環境搭建需要保證奇數臺機器,以保證演算法能選舉出乙個leader。一 環境準備 datadir dir ticktime 2000 initlimit 5 synclimit 2 clientport 2181 server.0 192.168.1.100 2888 3888 se...

zookeeper集群搭建

1.準備工作 tomcat zookeeper 最少三個結點搭乙個集群,所以複製三份 2.搭建並配置三個zookeeper例項 cd usr local solr cloud zookeeper01 進zookeeper01目錄,mkdir data 該目錄下建立data資料夾,放置zookeepe...