zookeeper分布式部署方案

2021-07-11 20:24:11 字數 3059 閱讀 5691

版本:

環境:debian 7/8

說明:最低配置3臺

步驟:2.配置zookeeper-3.4.8

2.1單機偽分布式部署

注意:部署在同一臺電腦時,特別注意不能共用相同的埠號,包括clientport,server.1-3的埠號

(1)zookeeper-3.4.8-1

位置:/var/local/zookeeper-3.4.8-1

sudo mkdir -p /var/local/zookeeper-3.4.8-1/data

sudo mkdir -p /var/local/zookeeper-3.4.8-1/data/log

echo 1 > /var/local/zookeeper-3.4.8-1/data/myid

(若無許可權:sudo vi /var/local/zookeeper-3.4.8-1/data/myid

,即值為1)

cd /var/local/zookeeper-3.4.8-1/conf/ &&sudo mv zoo_sample.cfg zoo.cfg &&sudo vi zoo.cfg

(2)zookeeper-3.4.8-2

位置:/var/local/zookeeper-3.4.8-2

sudo cp -p /var/local/zookeeper-3.4.8-1 /var/local/zookeeper-3.4.8-2

sudo vi /var/local/zookeeper-3.4.8-2/data/myid

sudo vi /var/local/zookeeper-3.4.8-2/conf/zoo.cfg

(3)zookeeper-3.4.8-3

位置:/var/local/zookeeper-3.4.8-3

sudo cp -p /var/local/zookeeper-3.4.8-1 /var/local/zookeeper-3.4.8-3

sudo vi /var/local/zookeeper-3.4.8-3/data/myid

sudo vi /var/local/zookeeper-3.4.8-3/conf/zoo.cfg

2.2分布式部署

(1)zookeeper-3.4.8

位置:node1:/var/local/zookeeper-3.4.8

sudo mkdir -p /var/local/zookeeper-3.4.8/data

sudo mkdir -p /var/local/zookeeper-3.4.8/data/log

echo 1 > /var/local/zookeeper-3.4.8/data/myid

(若無許可權:sudo vi /var/local/zookeeper-3.4.8/data/myid

,即值為1)

cd /var/local/zookeeper-3.4.8/conf/ &&sudo mv zoo_sample.cfg zoo.cfg &&sudo vi zoo.cfg

(2)位置:node2:/var/local/zookeeper-3.4.8

scp -r node1:/var/local/zookeeper-3.4.8 node2:/var/local/zookeeper-3.4.8

echo 1 > /var/local/zookeeper-3.4.8/data/myid

(若無許可權:sudo vi /var/local/zookeeper-3.4.8/data/myid

,即值為2)

(3)位置:node3:/var/local/zookeeper-3.4.8

scp -r node1:/var/local/zookeeper-3.4.8 node2:/var/local/zookeeper-3.4.8

echo 1 > /var/local/zookeeper-3.4.8/data/myid

(若無許可權:sudo vi /var/local/zookeeper-3.4.8/data/myid

,即值為3)

3.啟動及監控

分別啟動每台zookeeper即可

3.1單機偽分布式部署

啟動:sudo /var/local/zookeeper-3.4.8-1/bin/zkserver.sh start

sudo /var/local/zookeeper-3.4.8-2/bin/zkserver.sh start

sudo /var/local/zookeeper-3.4.8-3/bin/zkserver.sh start

檢視狀態:

sudo /var/local/zookeeper-3.4.8-1/bin/zkserver.sh status

sudo /var/local/zookeeper-3.4.8-2/bin/zkserver.sh status

sudo /var/local/zookeeper-3.4.8-3/bin/zkserver.sh status

zookeeper jmx enabled by default

using config: /var/local/zookeeper-3.4.8-1/bin/../conf/zoo.cfg

mode: follower

zookeeper jmx enabled by default

using config: /var/local/zookeeper-3.4.8-2/bin/../conf/zoo.cfg

mode: leader

zookeeper jmx enabled by default

using config: /var/local/zookeeper-3.4.8-3/bin/../conf/zoo.cfg

mode: follower

sudo jps

16930 quorumpeermain

16859 bootstrap

16898 bootstrap

16830 bootstrap

17010 quorumpeermain

16963 quorumpeermain

17260 jps

3.2分布式部署啟動

同上,不再贅述

Zookeeper分布式安裝部署

在 hadoop151 hadoop152 以及 hadoop 153 這三個節點上部署 zookeeper。1 解壓 zookeeper 安裝包到 opt module 目錄下 test hadoop151 software tar zxvf zookeeper 3.4.10.tar.gz c o...

Zookeeper之分布式安裝部署

1 集群規劃 在hadoop102 hadoop103和hadoop104三個節點上部署zookeeper。2 解壓安裝 1 解壓zookeeper安裝包到 opt module 目錄下 atguigu hadoop102 software tar zxvf zookeeper 3.4.10.tar...

Zookeeper分布式安裝部署使用

集群規劃 在hadoop102 hadoop103和hadoop104三個節點上部署zookeeper。chmod u x zookeeper 3.4.10.tar.gz 1 解壓zookeeper安裝包到 opt module 目錄下 liucw hadoop102 software tar zx...