[0064] Example three
[0065] See Figure 4 Based on the above-mentioned embodiment, the third embodiment provides a load balancing method, which includes:
[0066] 301. Acquire characteristic information in a user data stream, where the characteristic information includes one or more of an IP address and a port number.
[0067] 302. When the characteristic information conforms to the predetermined first load balancing strategy, forward the received data message in the user data stream to the multiple server units connected to the network switch according to the first load balancing strategy In order to achieve low-level load balancing, the first load balancing strategy defines a strategy for forwarding data messages with specific characteristic information to a specific server unit.
[0068] Specifically, the external interfaces of the multiple server units in the blade server are configured as a unified IP address and port. When a user requests to access the unified IP address and port, the user data stream generated when the user requests is The second characteristic information of the user data stream is compared with the first load balancing strategy, and when the second characteristic information conforms to the predetermined first load balancing strategy, the data packets in the user data stream are classified according to the first load The balancing strategy is forwarded to multiple server units connected to the network switch to achieve low-level load balancing.
[0069] Generally, network switches can be configured with source MAC, destination MAC, source IP, destination IP, source TCP/UDP port, destination TCP/UDP port, protocol type, etc., as keywords for the hash calculation of aggregation and sharing.
[0070] For example, the 4 server units in the blade server need to be load balanced. They are WEB servers and the external IP service address is 60.0.0.1. Then, configure them on the port of each server in the blade server connected to the network switch. The interface address is 60.0.0.1. Configure the corresponding port of each server on the network switch as an aggregation group or as an equal-cost routing group, and the sharing algorithm selects the sharing algorithm based on the source IP and the destination IP, so as to ensure that the same user access will be shared To the same server.
[0071] For proxy services, the server is a WEB proxy (web proxy) server, and the proxy server address is 10.0.0.1, and the port address of each server in the blade server connected to the network switch is configured to be 10.0.0.1, Configure the corresponding port of each server on the network switch as an aggregation group or as an equal-cost routing group sharing algorithm. Select an algorithm for sharing based on the source IP and destination IP, so as to ensure that the same user access will be shared to the same On the server.
[0072] 303. When the characteristic information conforms to the predetermined second load balancing policy, send the received data message to the load balancing device, so that the load balancing device receives the data message according to the data message in the data message. The high-level information and the high-level load balancing strategy in the load balancing device determine the forwarding strategy for the received data message, wherein the second load balancing strategy defines the forwarding of the data message with specific characteristic information to the Strategies for load balancing equipment.
[0073] 304. Forward the data packet to multiple server units connected to the network switch according to the forwarding strategy determined by the load balancing device to achieve high-level load balancing.
[0074] In this embodiment, the first load balancing strategy includes: forwarding data packets with feature information with large bandwidth characteristics to a specific server unit, and the second load balancing strategy includes: transferring data packets with feature information with small bandwidth characteristics The data message is forwarded to the load balancing device 12, the data message with the feature information of the large bandwidth feature is a user data message, and the data message with the feature information of the small bandwidth feature is a control message. Specifically, the control messages are messages used to describe user data characteristics, control user data behavior attributes, etc., and the user data messages are all messages except control messages.
[0075] The load balancing method provided in this embodiment further includes: sending a detection data packet to each server unit in real time, and detecting the health status of each server unit by determining whether each server unit feedbacks a correct response after receiving the detection data packet, and Delete the corresponding port in the network switch of the server unit that cannot feedback the correct response.
[0076] Specifically, for example, four server units in a blade server need to perform health checks, and the external IP service address is 60.0.0.1. When the corresponding port of each server on the network switch is configured as an aggregation group, four IPs are randomly selected Address, such as 10.0.0.1-4, is used as the communication IP address for health check with the corresponding 4 servers. The load balancing device sends detection packets to the server corresponding to the communication IP address through the communication IP address to detect the working status of the server. If a server is detected to work abnormally, the server is corresponding to the aggregation group or the equivalent routing group Delete or deactivate the port, so that subsequent packets will no longer be shared to the server. After the server is normal, activate or add the port to the aggregation group or equal-cost routing group.
[0077] In particular, for a Web server, the best detection message is a hypertext transfer protocol HTTP request message.
[0078] The load balancing system, device and method provided in the embodiments of the present invention enable the network switch to forward data to the corresponding server unit by configuring corresponding strategies to achieve low-level load balancing, and the load balancing equipment is used to achieve high-level load balancing, thereby Some of the functions implemented by the load balancing equipment are shared by the network switch to reduce the requirements on the capabilities of the load balancing equipment. Especially considering that in many practical applications, there are not many data that require high-level load balancing in large-bandwidth data. Therefore, the low-level load balancing of network switches can basically meet the requirements of large-bandwidth data, and a small part of the data that needs high-level load balancing It is implemented by a load balancing device. In this way, a load balancing device with not very strong processing capability can be selected for implementation, thereby greatly reducing the complexity of implementing the load balancing module and the hardware cost.
[0079] The load balancing device and system provided in the embodiments of the present invention can implement the method embodiments provided above. For specific function implementation, please refer to the descriptions in the method embodiments, which will not be repeated here. The load balancing system, device, and method provided by the embodiments of the present invention can be applied to the field of network management systems, but are not limited thereto.
[0080] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing relevant hardware through a computer program. The program can be stored in a computer readable storage medium. During execution, it may include the procedures of the above-mentioned method embodiments. Wherein, the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.