In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The following brings you how to configure the four-tier load balancing LVS/DR mode, hoping to give you some help in practical application. Load balancing involves more things, there are not many theories, and there are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.
1. Environmental preparation
Prepare 3 pure virtual machines, two web cloud servers, and turn off all firewalls and selinux
2. Deployment instructions:
The network uses NAT mode
DR mode requires that Director DIP and all RealServer RIP must be in the same network segment and broadcast domain
All node gateways specify real gateways
3. LVS-server installs lvs management software
Yum-y install ipvsadm
4. The ipvsadm file needs to be generated manually or the startup will report an error.
[root@vm-2 ~] # ipvsadm-- save > / etc/sysconfig/ipvsadm launch: [root@vm-2 ~] # systemctl start ipvsadm
5. Configure ipvsadm:
[root@vm-2 ~] # ip addr add dev ens33 10.30.161.200 VIP 32 set up VIP [root@vm-2 ~] # ipvsadm-A-t 10.30.161.200 ipvsadm 80-s rr-An add a VIP,-t using the tcp protocol -s rr uses rotational training algorithm to add ip forwarded to the real realserverip server: [root@vm-2 ~] # ipvsadm-a-t 10.30.161.200 ip 80-r 10.30.161.214 ipvsadm 80-g [root@vm-2 ~] # ipvsadm-a-t 10.30.161.200 ip 80-r 10.30.161.241 ip 80-g save: [root@vm-2 ~] # ipvsadm-S > / etc / sysconfig/ipvsadm View: [root@vm-2 ~] # ipvsadm-ln [root@vm-2 ~] # ipvsadm-ln-- stats displays statistics
6. Configure RS real server
[root@real-server1 ~] # yum install-y nginx [root@real-server1 ~] # echo "real-server1" > > / usr/share/nginx/html/index.html both machines are installed Add different hostnames in order to distinguish [root@vm-4 ~] # ip addr add dev lo 10.30.161.200 echo 32 # bind VIP [root@vm-4 ~] # echo 1 > / proc/sys/net/ipv4/conf/all/arp_ignore arp_ignore to the lo interface, which means that when someone else's ip request comes, if the receiving device does not have this ip, it will not respond (the ip is on the lo). Lo is not an import of receiving equipment) [root@vm-4 ~] # echo 2 > / proc/sys/net/ipv4/conf/all/arp_announce # match exact ip address return packet [root@vm-4 ~] # systemctl start nginx [root@vm-4 ~] # systemctl enable nginx
7. Testing
Curl 10.30.161.200 [root@localhost ~] # curl 10.30.161.200 server1 [root@localhost ~] # curl 10.30.161.200
Successful implementation of server2 load balancing
After reading the above about how to configure the layer-4 load balancer LVS/DR mode, if there is anything else you need to know, you can find out what you are interested in in the industry information or find our professional and technical engineers for answers. Technical engineers have more than ten years of experience in the industry.
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.