In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, Xiaobian will bring you about how to build a configuration cluster mode in zookeeper. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.
1. Install jdk1.8, if you don't know this, you can Baidu it is very simple
2. Official download address https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/
3. After decompression, configure the bin directory to the environment variable PATH (similar to java environment variable), and the configuration will take effect through source /etc/profile.
4. copy zoo_sample.cfg zoo.cfg, Generally modify the dataDir directory
End, let's start the cluster installation deployment
Step 1: Node Type Assignment
In order to achieve the effect, 1 leader, 1 follower, 1 observer are assigned (first configure 2 followers, and then change one of them to follower)
leader 192.168.134.137
follower 192.168.134.138
observer 192.168.134.139
Note: In order to facilitate testing, three firewalls were turned off in advance (systemctl stop firewall), and you can handle your own firewall according to the situation.
Step 2: Start configuring the leader node
1. Modify zoo.cfg to add (port 2181 used by zookeeper by default, refer to port configured by stand-alone)
#server.id=host:port:portserver.1=192.168.134.137:2182:3181server.2=192.168.134.138:2182:3181server.3=192.168.134.139:2182:3181
Description:
id value range: 1~255; id is used to identify the machine serial number in the cluster.
2181 is the port where zookeeper provides services;2182 is the communication interface between leader and follower; 3181 represents the port where leader elects
2. Create myid
Create a myid file under the dataDir directory of each server. The file contains one line of data. The data content is the number of server ID corresponding to each machine.
Step 3: Configure the follower, same as step 1, note that myid is different, then start the three nodes in turn, check the startup status through zkServer.sh status
At this point, complete 1 leader and 2 followers, then change one follower to observer, in the case of increasing the load does not affect the writing effect (observer purpose)
Modify the zoo.cfg configuration file
Add peerType=observer
server.3=192.168.134.139:2182:3181:observer
Modify three machines in turn, and then restart. Dynamic configuration modification is supported after 3.5.
The above is how to build a configuration cluster mode in zookeeper shared by everyone. If there is a similar doubt, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.
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.