CN114020466B - Method and device for balancing double active loads, electronic equipment and storage medium - Google Patents
Method and device for balancing double active loads, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114020466B CN114020466B CN202111315602.2A CN202111315602A CN114020466B CN 114020466 B CN114020466 B CN 114020466B CN 202111315602 A CN202111315602 A CN 202111315602A CN 114020466 B CN114020466 B CN 114020466B
- Authority
- CN
- China
- Prior art keywords
- load balancer
- arp
- backup
- client
- vip
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a device for balancing double live loads, electronic equipment and a storage medium, wherein the method comprises the following steps: the main load balancer and the backup load balancer are simultaneously provided with a VIP module and an ARP-proxy module; judging whether the client and the VIP are in the same subnet; if yes, a load balancer matched with a first ARP broadcast message sent by the client receives the service request; and if not, the main load balancer and the backup load balancer receive the service request forwarded by the gateway. The method can realize the simultaneous working and interactive backup of a plurality of load balancers by deploying the same VIP on the load balancers and adding the ARP-proxy module, thereby improving the resource utilization rate of the load balancers.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for balancing dual live loads, an electronic device, and a storage medium.
Background
Load Balance (Load Balance) is to share a plurality of operation units to execute, such as a Web server, an FTP server, an enterprise key application server, and other key task servers, so as to collectively complete work tasks.
Load balancing is built on the original network structure, and the method provides a transparent, cheap and effective method for expanding the bandwidth of the server and the network equipment, enhancing the network data processing capacity, increasing the throughput and improving the availability and flexibility of the network.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art that is already known to a person skilled in the art.
Disclosure of Invention
The invention aims to provide a method and a device for balancing double live loads, electronic equipment and a storage medium, which can realize the simultaneous work and interactive backup of a plurality of load balancers and improve the resource utilization rate of the load balancers by deploying the same VIP on the load balancers and adding an ARP-proxy module.
To achieve the above object, an embodiment of the present invention provides a method for balancing dual live loads.
In one or more embodiments of the invention, the method comprises: the main load balancer and the backup load balancer are simultaneously provided with a VIP module and an ARP-proxy module; judging whether the client and the VIP are in the same subnet; if yes, a load balancer matched with a first ARP broadcast message sent by the client receives the service request; and if not, the main load balancer and the backup load balancer receive the service request forwarded by the gateway.
In one or more embodiments of the present invention, the receiving, by the load balancer matched to the first ARP broadcast packet sent by the client, a service request includes: the ARP-proxy module acquires the MAC address of the main load balancer or the backup load balancer according to the first ARP broadcast message; and the client sends the service request to a corresponding load balancer according to the MAC address, and the load balancer sends the service to a server.
In one or more embodiments of the present invention, the acquiring, by the ARP-proxy module, the MAC addresses of the main load balancer and the backup load balancer according to the first ARP broadcast packet includes: ARP-proxy modules of the main load balancer and the backup load balancer receive a first ARP broadcast message sent by a client; the ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP addresses of the client; if the HASH value is 0, replying the request of the first ARP broadcast message according to the MAC address of the main load balancer; and if the HASH value is 1, replying the request of the first ARP broadcast message according to the MAC address of the backup load balancer.
In one or more embodiments of the invention, the method further comprises: when one of the main load balancer and the standby load balancer breaks down, the other load balancer which does not break down receives a second ARP broadcast message sent by the client; the load balancer which does not fail requests the MAC address of the VIP of the load balancer according to the second ARP broadcast message, and receives a service request; and the ARP-proxy module of the non-failed load balancer stops HASH calculation and replies ARP requests of all clients to the VIP.
In one or more embodiments of the present invention, the receiving a service request includes: and the client updates the ARP cache table of the client according to the MAC address of the VIP requested in the second ARP broadcast message, and the non-failure load balancer receives all service requests of the client.
In one or more embodiments of the invention, the method further comprises: when the fault of the fault load balancer is recovered, the ARP-proxy modules of the main load balancer and the backup load balancer carry out HASH calculation again.
In one or more embodiments of the present invention, before the receiving, by the primary load balancer and the backup load balancer, a service request forwarded by a gateway, the method further includes: and configuring a static route through the gateway, and detecting the health states of the main load balancer and the backup load balancer according to the equivalent static route.
In one or more embodiments of the invention, the method further comprises: and when the main load balancer or the backup load balancer breaks down, carrying out fault detection and load balancer switching through the gateway.
In another aspect of the present invention, an apparatus for dual active load balancing is provided, which includes a deployment module, a determination module, and a reception module.
And the deployment module is used for simultaneously configuring the VIP module and the ARP-proxy module by the main load balancer and the backup load balancer.
And the judging module is used for judging whether the client side and the VIP are in the same subnet.
The receiving module is used for receiving a service request by a load balancer matched with a first ARP broadcast message sent by a client; or, the main load balancer and the backup load balancer receive the service request forwarded by the gateway.
In one or more embodiments of the present invention, the receiving module is further configured to: the ARP-proxy module acquires the MAC address of the main load balancer or the backup load balancer according to the first ARP broadcast message; and the client sends the service request to a corresponding load balancer according to the MAC address, and the load balancer sends the service to a server.
In one or more embodiments of the present invention, the receiving module is further configured to: ARP-proxy modules of the main load balancer and the backup load balancer receive a first ARP broadcast message sent by a client; the ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP addresses of the client; if the HASH value is 0, replying the request of the first ARP broadcast message according to the MAC address of the main load balancer; and if the HASH value is 1, replying the request of the first ARP broadcast message according to the MAC address of the backup load balancer.
In one or more embodiments of the present invention, the receiving module is further configured to: when one of the main and standby load balancers fails, the other load balancer which does not fail receives a second ARP broadcast message sent by the client; the non-failed load balancer requests the MAC address of the VIP of the non-failed load balancer according to the second ARP broadcast message and receives a service request; and the ARP-proxy module of the non-failed load balancer stops HASH calculation and replies ARP requests of all clients to the VIP.
In one or more embodiments of the present invention, the receiving module is further configured to: and the client updates the ARP cache table of the client according to the MAC address of the VIP requested in the second ARP broadcast message, and the backup load balancer receives all service requests of the client.
In one or more embodiments of the present invention, the receiving module is further configured to: when the main load balancer is recovered from the fault, the ARP-proxy modules of the main load balancer and the backup load balancer carry out HASH calculation again.
In one or more embodiments of the present invention, the determining module is further configured to: and configuring a static route through the gateway, and detecting the health states of the main load balancer and the backup load balancer according to the equivalent static route.
In one or more embodiments of the present invention, the receiving module is further configured to: and when the main load balancer or the backup load balancer breaks down, carrying out fault detection and load balancer switching through the gateway.
In another aspect of the present invention, there is provided an electronic device including: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of dual live load balancing as described above.
In another aspect of the present invention, a computer-readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, performs the steps of the method of dual live load balancing as described.
Compared with the prior art, according to the method and the device for balancing the live double load, the electronic equipment and the storage medium, the live double load balancing can be realized by deploying the same VIP on the main load balancer and the backup load balancer and adding the ARP-proxy module, a proper load balancer is selected according to the requirement of the client to forward the service to the corresponding server, the main load balancer and the backup load balancer can work at the same time, and the resource utilization rate of the load balancer is improved.
Drawings
FIG. 1 is a flow diagram of a method of dual live load balancing according to an embodiment of the present invention;
FIG. 2 is a block diagram of a method of dual active load balancing according to an embodiment of the present invention;
FIG. 3 is a flow diagram of a failure recovery method of dual active load balancing according to an embodiment of the present invention;
FIG. 4 is a gateway flow diagram of a method of dual active load balancing according to an embodiment of the present invention;
FIG. 5 is a gateway architecture diagram of a method of dual active load balancing according to an embodiment of the present invention;
FIG. 6 is a block diagram of an apparatus for dual active load balancing according to an embodiment of the present invention;
FIG. 7 is a hardware block diagram of a computing device for dual workload balancing, according to an embodiment of the invention.
Detailed Description
Specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but it should be understood that the scope of the present invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the word "comprise", or variations such as "comprises" or "comprising", will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.
The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Example 1
Referring to fig. 1 to 2, a method for balancing dual live loads according to an embodiment of the present invention is described, which includes the following steps.
In step S101, the primary load balancer and the backup load balancer configure the VIP and ARP-proxy modules simultaneously.
In the prior art, the VIP is deployed on only one load balancer, and in this embodiment, since the VIP is a proxy address used by the client to access the server, the VIP is configured on the primary load balancer and the backup load balancer at the same time, and both the primary load balancer and the backup load balancer can be used by the client to access the server.
The principle of proxy ARP is that when a cross-network-segment ARP request occurs, the load balancer returns the MAC address of the load balancer to a sender sending an ARP broadcast message request, MAC address proxy is achieved, and finally a host can communicate.
In step S102, it is determined whether the client and VIP are on the same subnet.
When the client and the VIP are in the same subnet, the host is not configured with a default gateway address, and the client sends an ARP broadcast message (requesting the MAC address of a target host), so that the load balancer with the ARP-proxy function can use the MAC address of the load balancer as the response of the ARP request after receiving the request and confirming that the request address is accessible, and the hosts in the same network segment of different physical networks can normally communicate with each other.
When the client and the VIP are not in the same subnet, the host is configured with a default gateway address to realize communication, so that the service request can be sent to the corresponding load balancer through the gateway without the operation of an ARP-proxy module, and the service is forwarded to the server by the corresponding load balancer.
In step S103, the load balancer matching the first ARP broadcast packet sent by the client receives the service request.
The client side sends a first ARP broadcast message used for requesting the MAC address of the VIP, the main load balancer and the backup load balancer receive the first ARP broadcast message, and the first ARP broadcast message is sent to the ARP-proxy module so as to select the load balancer providing the service.
And the ARP-proxy modules of the main load balancer and the backup load balancer carry out the same HASH value calculation according to the IP address of the client in the first ARP broadcast message, wherein the HASH value can be 0 or 1. If the HASH value is 0, replying a request of a first ARP broadcast message according to the MAC address of the main load balancer; and if the HASH value is 1, replying a request of the first ARP broadcast message according to the MAC address of the backup load balancer. Since the primary load balancer and the backup load balancer use the same HASH algorithm (no random parameter is introduced), the computed HASH values result consistently.
When the client receives a first ARP broadcast message reply sent by the VIP, the service request is sent to a main load balancer or a backup load balancer which replies the first ARP broadcast message according to the MAC address of a sender (namely the load balancer) in the first ARP broadcast message, and the main load balancer or the backup load balancer sends the service request to the server.
Example 2
Referring to fig. 3, a method for dual live load balancing in accordance with another embodiment of the present invention is described, which includes the following steps.
In step S201, the primary load balancer and the backup load balancer configure the VIP and ARP-proxy modules at the same time.
The same VIP and ARP-proxy modules are simultaneously configured on the main load balancer and the backup load balancer, so that different load balancers can be selected by the client according to different service requirements, and when a service request is sent to multiple clients, the main load balancer and the backup load balancer can simultaneously work and forward services to corresponding servers.
In step S202, it is determined whether the client and VIP are on the same subnet.
When the client and the VIP are in the same subnet, the host is not configured with a default gateway address, and the client sends an ARP broadcast message (requesting the MAC address of a target host), so that after the load balancer with an ARP-proxy function receives the request and confirms that the request address can be reached, the MAC address of the load balancer can be used as the response of the ARP request, and the hosts in the same network segment of different physical networks can normally communicate.
When the client and the VIP are not in the same subnet, the host is configured with a default gateway address to realize communication, so that the service request can be sent to the corresponding load balancer through the gateway without the operation of an ARP-proxy module, and the service is forwarded to the server by the corresponding load balancer.
In step S203, the ARP-proxy module obtains the MAC address of the VIP according to the first ARP broadcast packet.
ARP-proxy modules of the main load balancer and the backup load balancer receive a first ARP broadcast message sent by the client.
The ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP addresses of the clients; if the HASH value is 0, replying a request of a first ARP broadcast message according to the MAC address of the main load balancer; and if the HASH value is 1, replying the request of the first ARP broadcast message according to the MAC address of the backup load balancer.
In step S204, the service request is sent to the corresponding load balancer according to the MAC address, and the load balancer sends the service to the server.
And sending the service request to the corresponding load balancer according to the MAC address of the load balancer in the first ARP broadcast message, and sending the service request to the server by the corresponding load balancer.
In step S205, when the primary load balancer fails, the backup load balancer receives a second ARP broadcast packet sent by the client.
When the heartbeat line between the main load balancer and the backup load balancer is disconnected, the main load balancer or the backup load balancer is detected to be in failure.
In this embodiment, when the main load balancer fails, the backup load balancer detects that the heartbeat line is disconnected, and the backup load balancer sends a second ARP broadcast message to the VIP, where the second ARP broadcast message is an MAC address used by the backup load balancer to request a VIP address of the backup load balancer.
And the client updates the ARP cache table of the client according to the MAC address of the VIP requested in the second ARP broadcast message, and sends all the service requests to the backup load balancer. And meanwhile, the ARP-proxy module of the backup load balancer stops HASH calculation and replies ARP requests of all clients to the VIP.
In step S206, when the failure of the main load balancer is recovered, the ARP-proxy modules of the main load balancer and the backup load balancer re-perform HASH calculation.
In this embodiment, when the failure of the main load balancer is recovered, the heartbeat line between the main load balancer and the backup load balancer is recovered to be normal, the main load balancer and the backup load balancer perform HASH calculation again according to the ARP broadcast message sent by the client, and select the corresponding load balancer to send the service request to the server.
Similarly, in step S205, when the backup load balancer fails, the primary load balancer receives the second ARP broadcast packet sent by the client.
When the backup load balancer breaks down, the main load balancer detects that the heartbeat line is disconnected, the main load balancer sends a second ARP broadcast message aiming at the VIP, and the second ARP broadcast message is an MAC address used by the main load balancer to request the VIP address of the main load balancer.
And the client updates the ARP cache table of the client according to the MAC address of the VIP requested in the second ARP broadcast message, and sends all the service requests to the main load balancer. And meanwhile, the ARP-proxy module of the main load balancer stops HASH calculation and replies ARP requests of all clients to the VIP.
In step S206, when the failure of the main load balancer is recovered, the ARP-proxy modules of the main load balancer and the backup load balancer re-perform HASH calculation.
In this embodiment, when the failure of the main load balancer is recovered, the heartbeat line between the main load balancer and the backup load balancer is recovered to normal, the main load balancer and the backup load balancer perform HASH calculation again according to the ARP broadcast message sent by the client, and select the corresponding load balancer to send the service request to the server.
Similarly, in step S206, when the backup load balancer that has failed recovers from the failure, the heartbeat line between the main load balancer and the backup load balancer recovers to normal, the main load balancer and the backup load balancer perform HASH calculation again according to the ARP broadcast message sent by the client, and select the corresponding load balancer to send the service request to the server.
Therefore, in the embodiment, for the active and standby load balancers which are active and active, no matter which one of the active and standby load balancers fails, the overall service is not affected, the system automatically sends the service to the load balancer which does not fail, and meanwhile, HASH calculation is stopped, after the failure is recovered, the active and standby load balancers are recovered to the starting state, the service is distributed in a balanced manner through the HASH calculation, an overall balanced operation state is achieved, and the utilization rate of resources and the overall reliability are improved.
Example 3
Referring to fig. 4 to 5, a method for balancing dual live loads according to another embodiment of the present invention is described, which includes the following steps.
In step S301, the primary load balancer and the backup load balancer configure the VIP and ARP-proxy modules simultaneously.
The same VIP is configured on the main load balancer and the backup load balancer at the same time, so that the gateway can uniformly send the service request of the client to the main load balancer and the backup load balancer, the double load balancers can work at the same time, and the resource utilization rate of the load balancers is improved.
In step S302, it is determined whether the client and VIP are on the same subnet.
When the client and the VIP are in the same subnet, the host is not configured with a default gateway address, and the client sends an ARP broadcast message (requesting the MAC address of a target host), so that the load balancer with the ARP-proxy function can use the MAC address of the load balancer as the response of the ARP request after receiving the request and confirming that the request address is accessible, and the hosts in the same network segment of different physical networks can normally communicate with each other.
When the client and the VIP are not in the same subnet, the host is configured with a default gateway address to realize communication, so that the ARP-proxy module is not needed to work, the service request can be sent to the corresponding load balancer through the gateway, and the corresponding load balancer forwards the service to the server.
In step S303, the primary load balancer and the backup load balancer receive the service request forwarded by the gateway.
When a client needs to access a server, if the client and the VIP are not in the same subnet, request traffic sent by the client is firstly sent to a gateway, and static ECMP routes are configured on the gateway, for example, Route VIP (1.1.1.1/32) nexthop IP1 and Route VIP (1.1.1.1/32) nexthop IP 2. Meanwhile, the health states of the main load balancer and the backup load balancer are detected according to the static ECMP route, and the gateway can uniformly send service requests of the client to the main load balancer and the backup load balancer, so that the double load balancers can work simultaneously, and the resource utilization rate of the load balancers is improved.
In step S304, when the primary load balancer or the backup load balancer fails, failure detection and load balancer switching are performed by the gateway.
When the main load balancer or the backup load balancer fails, the gateway can detect the failure of the main load balancer or the backup load balancer according to the static ECMP route, and switch the service request on the failed load balancer to the normally working load balancer.
In this embodiment, because the heartbeat line detection exists between the main load balancer and the backup load balancer, and the main load balancer and the backup load balancer have the same VIP, when the main load balancer goes down due to a failure, the backup load balancer can directly take over the work of the main load balancer to provide a service to the outside.
Referring to fig. 6, an apparatus for dual live load balancing according to an embodiment of the present invention is described.
In the embodiment of the present invention, the apparatus for balancing dual live loads includes a deployment module 601, a determination module 602, and a receiving module 603.
The deployment module 601 is used for configuring the VIP module and the ARP-proxy module by the main load balancer and the backup load balancer at the same time.
A determining module 602, configured to determine whether the client and the VIP are in the same subnet.
A receiving module 603, configured to receive a service request by using a load balancer matching the first ARP broadcast packet sent by the client; or, the main load balancer and the backup load balancer receive the service request forwarded by the gateway.
The receiving module 603 is further configured to: the ARP-proxy module acquires the MAC address of the main load balancer or the backup load balancer according to the first ARP broadcast message; and the client sends the service request to the corresponding load balancer according to the MAC address, and the load balancer sends the service to the server.
The receiving module 603 is further configured to: ARP-proxy modules of the main load balancer and the backup load balancer receive a first ARP broadcast message sent by a client; the ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP address of the client; if the HASH value is 0, replying a request of a first ARP broadcast message according to the MAC address of the main load balancer; and if the HASH value is 1, replying a request of the first ARP broadcast message according to the MAC address of the backup load balancer.
The receiving module 603 is further configured to: when one of the main load balancer and the standby load balancer breaks down, the other load balancer which does not break down receives a second ARP broadcast message sent by the client; the load balancer which does not fail requests the MAC address of the VIP of the load balancer according to the second ARP broadcast message, and receives a service request; and the ARP-proxy module of the non-failed load balancer stops HASH calculation and replies ARP requests of all clients to the VIP.
The receiving module 603 is further configured to: the client updates the ARP cache table of the client according to the MAC address of the VIP requested in the second ARP broadcast message, and the backup load balancer receives all service requests of the client.
The receiving module 603 is further configured to: when the main load balancer is recovered from the fault, the ARP-proxy modules of the main load balancer and the backup load balancer carry out HASH calculation again.
The determining module 602 is further configured to: and configuring a static route through the gateway, and detecting the health states of the main load balancer and the backup load balancer according to the equivalent static route.
The receiving module 603 is further configured to: and when the main load balancer or the backup load balancer breaks down, carrying out fault detection and load balancer switching through the gateway.
Fig. 7 illustrates a hardware block diagram of a computing device 70 for dual live load balancing, according to embodiments of the present description. As shown in fig. 7, the computing device 70 may include at least one processor 701, storage 702 (e.g., non-volatile storage), memory 703, and a communication interface 704, and the at least one processor 701, storage 702, memory 703, and communication interface 704 are connected together via a bus 705. The at least one processor 701 executes at least one computer readable instruction stored or encoded in the memory 702.
It should be appreciated that the computer-executable instructions stored in the memory 702, when executed, cause the at least one processor 701 to perform the various operations and functions described above in connection with fig. 1-7 in the various embodiments of the present description.
In embodiments of the present description, computing device 70 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, Personal Digital Assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronics, and so forth.
According to one embodiment, a program product, such as a machine-readable medium, is provided. A machine-readable medium may have instructions (i.e., elements described above as being implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in connection with fig. 1-7 in the various embodiments of the present specification. Specifically, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functions of any of the above embodiments is stored, and causes a computer or processor of the system or apparatus to read out and execute instructions stored in the readable storage medium.
According to the method and the device for balancing live load, the electronic equipment and the storage medium, the same VIP is deployed on the main load balancer and the backup load balancer, the ARP-proxy module is additionally arranged, the live load balancing is achieved, the appropriate load balancer is selected according to the requirements of the client side to forward service to the corresponding server, the main load balancer and the backup load balancer work simultaneously, and the resource utilization rate of the load balancer is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of specific exemplary embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.
Claims (9)
1. A method of dual live load balancing, the method comprising:
the main load balancer and the backup load balancer are simultaneously provided with a VIP module and an ARP-proxy module;
judging whether the client and the VIP are in the same subnet; if so,
ARP-proxy modules of the main load balancer and the backup load balancer receive a first ARP broadcast message sent by a client;
the ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP address of the client;
if the HASH value is 0, replying the request of the first ARP broadcast message according to the MAC address of the main load balancer;
if the HASH value is 1, replying the request of the first ARP broadcast message according to the MAC address of the backup load balancer;
the client sends a service request to a corresponding load balancer according to the MAC address, and the load balancer sends the service to a server; if the number of the user terminal is not the same as the preset number,
and the main load balancer and the backup load balancer receive the service request forwarded by the gateway.
2. The method of dual live load balancing according to claim 1, further comprising:
when one of the main and standby load balancers fails, the other load balancer which does not fail receives a second ARP broadcast message sent by the client;
the non-failed load balancer requests the MAC address of the VIP of the non-failed load balancer according to the second ARP broadcast message and receives a service request; and
the ARP-proxy module of the non-failed load balancer stops HASH computation and replies to ARP requests of all clients to the VIP.
3. The method of dual live load balancing according to claim 2, wherein said receiving a service request comprises:
the client updates its own ARP cache table according to the MAC address of the VIP requested in the second ARP broadcast message, and
and the non-failed load balancer receives all service requests of the client.
4. The method of double live load balancing according to claim 2, wherein the method further comprises:
when the fault of the fault load balancer is recovered, the ARP-proxy modules of the main load balancer and the backup load balancer carry out HASH calculation again.
5. The method for dual active load balancing according to claim 1, wherein before the primary load balancer and the backup load balancer receive the service request forwarded by the gateway, the method further comprises:
configuring a static route through the gateway, and detecting the health states of the main load balancer and the backup load balancer according to the static route.
6. The method of double live load balancing according to claim 5, wherein the method further comprises:
and when the main load balancer or the backup load balancer breaks down, carrying out fault detection and load balancer switching through the gateway.
7. An apparatus for dual active load balancing, the apparatus comprising:
the deployment module is used for simultaneously configuring the VIP module and the ARP-proxy module for the main load balancer and the backup load balancer;
the judging module is used for judging whether the client and the VIP are in the same subnet; and
the receiving module is used for the ARP-proxy modules of the main load balancer and the backup load balancer to receive a first ARP broadcast message sent by a client;
the ARP-proxy modules of the main load balancer and the backup load balancer perform the same HASH calculation according to the IP addresses of the client;
if the HASH value is 0, replying the request of the first ARP broadcast message according to the MAC address of the main load balancer;
if the HASH value is 1, replying the request of the first ARP broadcast message according to the MAC address of the backup load balancer;
the client sends a service request to a corresponding load balancer according to the MAC address, and the load balancer sends the service to a server; or the like, or, alternatively,
and the main load balancer and the backup load balancer receive the service request forwarded by the gateway.
8. An electronic device, comprising:
at least one processor; and
a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of dual live load balancing of any one of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of dual live load balancing according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111315602.2A CN114020466B (en) | 2021-11-08 | 2021-11-08 | Method and device for balancing double active loads, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111315602.2A CN114020466B (en) | 2021-11-08 | 2021-11-08 | Method and device for balancing double active loads, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114020466A CN114020466A (en) | 2022-02-08 |
CN114020466B true CN114020466B (en) | 2022-07-19 |
Family
ID=80062498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111315602.2A Active CN114020466B (en) | 2021-11-08 | 2021-11-08 | Method and device for balancing double active loads, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114020466B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115665049B (en) * | 2022-10-11 | 2024-09-27 | 浪潮云信息技术股份公司 | Method for distributing weights by cloud platform aiming at multi-activity load balancing |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442493A (en) * | 2008-12-26 | 2009-05-27 | 华为技术有限公司 | Method for distributing IP message, cluster system and load equalizer |
US9825902B1 (en) * | 2015-04-22 | 2017-11-21 | Cisco Technology, Inc. | Route advertisement for native hardware-based virtual IP address (“VIP”) on layer 2/layer 3 switch |
CN108259372A (en) * | 2016-12-28 | 2018-07-06 | 天津岩石科技有限公司 | A kind of multi-link load balance system and method |
CN109639589A (en) * | 2018-12-27 | 2019-04-16 | 杭州迪普科技股份有限公司 | A kind of load-balancing method and device |
CN111034160A (en) * | 2017-08-31 | 2020-04-17 | 微软技术许可有限责任公司 | non-DSR distributed load balancer with virtual VIP and source agent over load balancing connection |
CN111314098A (en) * | 2018-12-11 | 2020-06-19 | 杭州海康威视系统技术有限公司 | Method and device for realizing VIP address drift in HA system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101184039B (en) * | 2007-11-30 | 2010-06-09 | 北京大学 | Ethernet load balancing method |
CN101651706A (en) * | 2008-08-14 | 2010-02-17 | 华为技术有限公司 | Method, system and device for sending and receiving data |
-
2021
- 2021-11-08 CN CN202111315602.2A patent/CN114020466B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442493A (en) * | 2008-12-26 | 2009-05-27 | 华为技术有限公司 | Method for distributing IP message, cluster system and load equalizer |
US9825902B1 (en) * | 2015-04-22 | 2017-11-21 | Cisco Technology, Inc. | Route advertisement for native hardware-based virtual IP address (“VIP”) on layer 2/layer 3 switch |
CN108259372A (en) * | 2016-12-28 | 2018-07-06 | 天津岩石科技有限公司 | A kind of multi-link load balance system and method |
CN111034160A (en) * | 2017-08-31 | 2020-04-17 | 微软技术许可有限责任公司 | non-DSR distributed load balancer with virtual VIP and source agent over load balancing connection |
CN111314098A (en) * | 2018-12-11 | 2020-06-19 | 杭州海康威视系统技术有限公司 | Method and device for realizing VIP address drift in HA system |
CN109639589A (en) * | 2018-12-27 | 2019-04-16 | 杭州迪普科技股份有限公司 | A kind of load-balancing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN114020466A (en) | 2022-02-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107078969B (en) | Realize computer equipment, the system and method for load balancing | |
EP3367638B1 (en) | Load balancing method, device and system | |
CN107231221B (en) | Method, device and system for controlling service flow among data centers | |
CN109274707B (en) | Load scheduling method and device | |
CN113783922A (en) | Load balancing method, system and device | |
CN110234140B (en) | Communication method, device, entity and storage medium | |
US9825805B2 (en) | Multi-homing internet service provider switchover system | |
CN110474802B (en) | Equipment switching method and device and service system | |
Yang et al. | Algorithms for fault-tolerant placement of stateful virtualized network functions | |
US9154367B1 (en) | Load balancing and content preservation | |
CN110771097B (en) | Connectivity monitoring for data tunneling between network device and application server | |
JP7348983B2 (en) | Load balancing systems, methods, devices, electronic devices and storage media | |
CN104468304B (en) | A kind of method of pond elementary state synchronizing information, pond Register and pond element | |
CN114020466B (en) | Method and device for balancing double active loads, electronic equipment and storage medium | |
CN115174674A (en) | Flow forwarding method | |
CN115242700B (en) | Communication transmission method, device and system | |
CN110391987B (en) | Method, apparatus and computer readable medium for selecting a designated forwarder from a carrier edge device set | |
CN113242299A (en) | Disaster recovery system, method, computer device and medium for multiple data centers | |
CN116094923B (en) | Gateway updating method and device after cloud instance migration and electronic equipment | |
CN109347743B (en) | Special line communication method, computer readable storage medium and terminal equipment | |
CN111416851A (en) | Method for session synchronization among multiple load balancers and load balancer | |
CN101227378B (en) | Communication service establishing method based on network storage and storage device thereof | |
CN114024971A (en) | Service data processing method, Kubernetes cluster and medium | |
US11757987B2 (en) | Load balancing systems and methods | |
CN111416852A (en) | Method for session synchronization among multiple load balancers and load balancer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |