Zookeeper cluster deployment

Table of Contents

(1) Unzip the Zookeeper installation package

1. Go to the browserApache ZooKeeper to download the zookeeper compressed package

2. Upload the zookeeper compressed package to softwares

3. Unzip to package

(2) Configure environment variables and distribute

1. Modify configuration file

2. Configure environment variables

3.?wqSave and exit

4.Use scp to copy the environment variables to the hadoop02 node

5. Use scp to copy the environment variables to the hadoop03 node

(3) Modify the configuration file

1. Switch to the ZK configuration file

2. Change the configuration file name. The zoo.cfg here is the modified one. Before the modification, it was zoo_sample.cfg.

3. Edit the zoo.cfg file

4. Parameter modification

5. Create a data file directory

?Edit 6. Create myid file

7.Set myid

(4) Distribute to other nodes

1. Use scp to copy ZK to the hadoop02 node

2. Use scp to copy ZK to the hadoop03 node

3. Modify the myid value on hadoop02

4. Modify the myid value on hadoop03

(5) Start the Zookeeper cluster

1. Switch to the bin file directory of ZK

2.hadoop01 starts ZK

3.hadoop02 starts ZK

4.hadoop03 starts ZK

5.hadoopo1 Check ZK status

6.hadoopo2 Check ZK status

7.hadoop03 Check ZK status

8. Use jps to view the hadoop02 process

9. Use jps to view the hadoop02 process

10.?Use jps to view the hadoop03 process

(6) Stop the ZK cluster

1. Stop the ZK cluster on hadoop01

2. Stop the ZK cluster on hadoop02

3. Stop the ZK cluster on hadoop03


(1) Unzip the Zookeeper installation package

1. Go to the browser Apache ZooKeeper to download the zookeeper compressed package

2. Upload the zookeeper compressed package to softwares

rz

3. Extract to pakage

tar -zxvf zookeeper-3.4.6. tar.gz -C ../pakage/

(2) Configure environment variables and distribute them

1. Modify configuration file

2. Configure environment variables

export ZK_HOME=/opt/server/zookeeper
export PATH=SPATH:SZK_HOME/bin

3.?wqSave and exit

4.Use scp to copy environment variables to hadoop02 node

scp .bash_profile root@hadoop02:.bash_profile

5. Use scp to copy environment variables to hadoop03 node

scp .bash_profile root@hadoop03:.bash_profile

(3) Modify configuration file

1. Switch to the ZK configuration file

2. Change the configuration file name, zoo.cfg here is after modification, before modification is zoo_sample.cfg

mv zoo_sample.cfg zoo.cfg

3. Edit the zoo.cfg file

vim zoo.cfg

4. Parameter modification

dataDir=/opt/pakage/zookeeper-3.4.6/zkdata
server.1=hadoop01:2888:3888
server.2=hadoop02:2888:3888
server.3=hadoop03:2888:3888

5. Create data file directory

mkdir zkdata

6. Create myid file

cd zkdata/
vimmyid

7.Set myid

1

(4) Distribute to other nodes

1. Use scp to copy ZK to hadoop02 node

scp -r zookeeper-3.4.6/ root@hadoop02:/opt/pakage/

2. Use scp to copy ZK to hadoop03 node

scp -r zookeeper-3.4.6/ root@hadoop03:/opt/pakage/

3. Modify the myid value on hadoop02

vim myid
2

4. Modify the myid value on hadoop03

vim myid
3

(5) Start Zookeeper cluster

1. Switch to the bin file directory of ZK

cd /opt/pakage/zookeeper-3.4.6/bin/

2.hadoop01 start ZK

zkServer.sh start

3.hadoop02 start ZK

zkServer.sh start

4.hadoop03 start ZK

zkServer.sh start

5.hadoopo1 check ZK status

zkServer.sh status

6.hadoopo2 check ZK status

zkServer.sh status

7.hadoop03 Check ZK status

zkServer.sh status

8. Use jps to view the hadoop02 process

jps

9.Use jps to view the hadoop02 process

10.?Use jps to view the hadoop03 process

(6) Stop ZK cluster

Stop the ZK cluster on 1.hadoop01

zkServer.sh stop

Stop the ZK cluster on 2.hadoop02

zkServer.sh stop

Stop the ZK cluster on 3.hadoop03

zkServer.sh stop

The knowledge points of the article match the official knowledge archives, and you can further learn relevant knowledge. Cloud native entry-level skills treeContinuous integration and deployment (Jenkins)Use helm to install Jenkins17053 people are learning the system