In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about what is the LVS load balancing DR mode, which may not be well understood by many people. In order to make you understand better, the editor summarized the following content for you. I hope you can get something from this article.
Deploy a LVS_DR cluster
Analysis of LVS_DR packet flow
In order to facilitate the principle analysis, the Client0 is placed on the same network as the cluster machine, and the packet flow route is 1-2-3-4.
The 1.Client makes a request to the target VIP and the Director (load balancer) receives it. In this case, the IP header and data frame information are:
2.Director chooses RealServer_1 according to the load balancing algorithm, does not modify or encapsulate IP messages, but changes the MAC address of the data frame to the MAC address of RealServer_1, and then sends it on the local area network. The information of IP header and data frame header is as follows:
3.RealServer_1 receives the frame, unencapsulates it and finds that the target IP matches the native (RealServer binds VIP beforehand), and processes the message. The message is then re-encapsulated and sent to the local area network. In this case, the IP header and data frame header information are:
4.Client will receive a reply message. Client thinks that he can get the normal service without knowing which server handled it.
Note: if there is a cross-segment, the message is returned to the user through the router via Internet.
ARP problem in LVS_DR
In the LVS_DR load balancer cluster, both the load balancer and the node server are configured with the same VIP address
Having the same IP address in the local area network is bound to cause confusion in the ARP communication of each server.
When an ARP broadcast is sent to a LVS_DR cluster, because both the load balancer and the node server are connected to the same network, they both receive the ARP broadcast
At this time, only the load balancer at the front end should respond, and other node servers should not respond to ARP broadcasts.
Process the node server so that it does not respond to ARP requests for VIP
Use virtual interface lo:0 to host VIP addresses
Set the kernel parameter arp_ignore=1: the system only responds to ARP requests whose target IP is a local IP
When the RealServer return message (the source IP is VIP) is forwarded by the router and then re-encapsulated, you need to obtain the MAC address of the router first.
When sending an ARP request, Linux defaults to using the source IP address (that is, VIP) of the IP packet as the source IP address in the ARP request packet instead of sending the interface IP address
When the router receives the ARP request, it updates the ARP entry
The MAC address of the original VIP corresponding to Director will be updated to the MAC address of the corresponding RealServer of VIP.
At this time, the router will forward the new request message to RealServer according to the ARP entry, resulting in the invalidation of Director's VIP.
Solution method
The node server is processed. Set the kernel parameter arp_announce=2: instead of using the source address of the IP packet to set the source address of the ARP request, the system chooses the IP address of the sending interface.
The setting method to solve the two problems of ARP
Modify / etc/sysctl.conf file
Net.ipv4.conf.lo.arp_ignore=1
Net.ipv4.conf.lo.arp_announce=2
Net.ipv4.conf.all.arp_ignore=1
Net.ipv4.conf.all.arp_announce=2
After reading the above, do you have any further understanding of what is the LVS load balancing DR mode? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.