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/03 Report--
The following brings you how to deploy LVS_DR clusters, hoping to give you some help in practical application. Load balancing involves a lot of things, and there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.
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 a normal service without knowing which CVM handles 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 have to configure the same VIP address and have the same IP address in the local area network, which is bound to cause confusion in the ARP communication of each server. When an ARP broadcast is sent to the LVS_DR cluster, because the load balancer and the node server are both connected to the same network, they will both receive the ARP broadcast and only the front-end load balancer will do the corresponding. Other node servers should not respond to ARP broadcasts
The node server is processed so that it does not respond to the ARP request for VIP and uses the virtual interface lo:0 host VIP address to set the kernel parameter arp_ignore=1: the system only responds to the ARP request that the destination IP is the local IP (the source IP is VIP) and the return message is forwarded by the router, and then re-encapsulates the message, when it needs to obtain the MAC address of the router to send the ARP request By default, Linux uses 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
After receiving the ARP request, the router will update the ARP entry. The original MAC address of the VIP corresponding to the Director will be updated to the new request message corresponding to the MAC address of the VIP corresponding to the RealServer. According to the ARP entry, the router will forward the message to the RealServer, resulting in the VIP failure solution of the Director to deal with the node server. 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 is to modify / etc/sysctl.conf file net.ipv4.conf.lo.arp_ignore=1net.ipv4.conf.lo.arp_announce=2net.ipv4.conf.all.arp_ignore=1net.ipv4.conf.all.arp_announce=2
After reading the above about how to deploy LVS_DR clusters, 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 to answer, technical engineers have more than ten years of experience in the industry. Official website link www.yisu.com
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.