Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build zookeeper Cluster

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

The editor will share with you how to build a zookeeper cluster. I hope you will get something after reading this article. Let's discuss it together.

1 set up the cluster of zookeeper

1.1 zookeeper cluster requires at least 3 nodes (hadoop0,hadoop1,hadoop2) (Chapter 27 hadoop cluster construction), and the number is odd, and the time between nodes should be synchronized.

1.2 copy zookeeper.tar.gz on hadoop0, extract, rename, and set environment variables.

(1) copy zookeeper-3.4.tar.gz to the / usr/local directory, and then enter it

(2) execute the command tar-zxvf zookeeper-3.4.tar.gz to decompress

(3) rename mv zookeeper-3.4 zookeeper

1.3 enter zookeeper's conf directory on hadoop0

Mv zoo_sample.cfg zoo.cfg

1.4 go to the / usr/local/zookeeper/conf directory on hadoop0 and edit the file zoo.cfg

Change dataDir=/tmp/zookeeper to data=/usr/local/zookeeper/data

Add the following three lines:

Server.0=hadoop0:2888:3888

Server.1=hadoop1:2888:3888

Server.2=hadoop2:2888:3888

Create a folder on hadoop0 and execute the command mkdir-p / usr/local/zookeeper/data

1.5 under the data directory of hadoop0, create the file myid with a content of 0

Copy the zookeeper folder and / etc/profile on hadoop0 to the hadoop1,hadoop2 node.

1.7 execute source / etc/profile on hadoop1 and change the value of myid to 1

Execute source / etc/profile on hadoop2 and change the value of myid to 2

1.8 ssh to three nodes and execute the command zkServer.sh start on the three nodes

1. 9 Verification: execute jps on each node and find that one more java process is QuorumPeerMain.

After reading this article, I believe you have a certain understanding of "how to build a zookeeper cluster". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report