CPC H04W 28/0842 (2020.05) [H04L 61/2596 (2013.01); H04W 72/02 (2013.01); H04W 72/52 (2023.01); H04W 80/02 (2013.01)] | 2 Claims |
1. A load balance method, comprising:
receiving, by a load balance node, a first service request packet from a service request end, wherein the first service request packet comprises address information of the service request end, address information of a to-be-processed load balance instance, and a media access control (MAC) address of the load balance node, and the to-be-processed load balance instance is a load balance instance from among a plurality of load balance instances configured on the load balance node, and wherein the address information of the service request end comprises an IP address and a port identifier, and the address information of the to-be-processed load balance instance comprises an IP address and a port identifier;
determining, by the load balance node, a to-be-processed service member based on the address information of the to-be-processed load balance instance, wherein the to-be-processed service member is configured to process the first service request packet;
modifying, by the load balance node, the MAC address of the load balance node in the first service request packet to a MAC address of the to-be-processed service member, to obtain a second service request packet, wherein the second service request packet comprises the address information of the service request end, the address information of the to-be-processed load balance instance, and the MAC address of the to-be-processed service member; and
sending, by the load balance node, the second service request packet to a computing node to which the to-be-processed service member belongs,
wherein the determining, by the load balance node, the to-be-processed service member based on the address information of the to-be-processed load balance instance comprises:
querying, by the load balance node based on the IP address and the port identifier of the to-be-processed load balance instance, a resource pool corresponding to the to-be-processed load balance instance; and
determining, by the load balance node, the to-be-processed service member from the resource pool according to a load balance algorithm corresponding to the resource pool; and
wherein the querying, by the load balance node based on the IP address and the port identifier of the to-be-processed load balance instance, the resource pool corresponding to the to-be-processed load balance instance comprises:
determining, by the load balance node, the to-be-processed load balance instance based on the IP address of the to-be-processed load balance instance;
querying, by the load balance node based on the port identifier of the to-be-processed load balance instance, a listener associated with the to-be-processed load balance instance; and
querying, by the load balance node, a resource pool bound to the listener, and determining the resource pool as the resource pool corresponding to the to-be-processed load balance instance.
|