In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "the detailed installation process of zookeeper". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The user is hadoop and the installation directory is under / opt/app
Upload the installation file to / opt
Root user decompression
[root@master opt] $tar-zxvf zookeeper-3.4.7.tar.gz-C / opt/app/
Modify users and affiliate groups
[root@master opt] # chown-R hadoop:hadoop zookeeper-3.4.7
Create a data folder and modify the attribute group (and also on slave01 and slave02)
Mkdir / home/hadoop/app/zookeeper-3.4.7/tmp
Chown-R hadoop:hadoop / home/hadoop/app/zookeeper-3.4.7/tmp
Switch users and modify the file zoo.cfg
Su-hadoop
Mv zoo_sample.cfg zoo.cfg
# modify data folder customization
DataDir=/home/hadoop/app/zookeeper-3.4.7/tmp
# add Server
Server.1=master:2888:3888
Server.2=slave01:2889:3889
Server.3=slave02:2890:3890
Note: in pseudo distribution mode, the ports on the same machine should be distinguished.
It is best to configure all the ports at the back of the cluster.
Server.1=master:2888:3888
Server.2=slave01:2888:3888
Server.3=slave02:2888:3888
The only thing to note in the last few lines is that the number server.X corresponds to the number in data/myid. If you write 1Jing 2 server 3 in the myid files of 3 server, then each zoo.cfg in server is matched with server.1,server.2,server.3 OK. Because on the same machine, the two ports and three server connected behind should not be the same, otherwise the ports will conflict. The first port is used for the exchange of information among cluster members, and the second port is specially used for electing leader when the leader is hung up.
/ / server.X=A:B:C
Where X is a number, indicating which number this is server.
An is the IP address where the server is located.
B configure the port that the server uses to exchange messages with the leader in the cluster.
C configure the port used when electing leader
Enter the data folder to create a myid of 1
Cd / home/hadoop/app/zookeeper-3.4.7/tmp/
Echo 1 > / home/hadoop/app/zookeeper-3.4.7/tmp/myid (corresponding to X 1:1 server above)
Copy the configured zookeeper to another computer (slave01,slave02)
Scp-r zookeeper-3.4.7 hadoop@slave01:/opt/app (- r means recursion)
Scp-r zookeeper-3.4.7 hadoop@slave02:/opt/app
Modify an attribute group
[root@master opt] # chown-R hadoop:hadoop zookeeper-3.4.7
Note: modify the corresponding / home/hadoop/app/zookeeper-3.4.7/tmp/myid contents of slave01 and slave02
Slave01:
Echo 2 > / home/hadoop/app/zookeeper-3.4.7/tmp/myid
Slave02:
Echo 3 > / home/hadoop/app/zookeeper-3.4.7/tmp/myid
Configure environment variables
Sudo vi / etc/profile
Export ZOOKEEPER_HOME=/opt/app/zookeeper-3.4.7
Export PATH=$PATH:$ZOOKEEPER_HOME/bin
(the same operation is also done on master and slave02 nodes)
Start, execute on three machines
Bin/zkServer.sh start bin/zkServer.sh stop (off)
Judge whether the startup is successful or not
Jps
Or check the process-# start successfully if you have information
Ps-aux | grep 'zookeeper'
It's best to check the log # to see if the error is reported.
Tail-f-n 500 zookeeper.out
This is the end of the "detailed installation process of zookeeper". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.