CN114640633B - Load balancer, realization method thereof, load balancing method and gateway system - Google Patents

Load balancer, realization method thereof, load balancing method and gateway system Download PDF

Info

Publication number
CN114640633B
CN114640633B CN202210317360.9A CN202210317360A CN114640633B CN 114640633 B CN114640633 B CN 114640633B CN 202210317360 A CN202210317360 A CN 202210317360A CN 114640633 B CN114640633 B CN 114640633B
Authority
CN
China
Prior art keywords
container
configuration
proxy
service
load balancing
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
Application number
CN202210317360.9A
Other languages
Chinese (zh)
Other versions
CN114640633A (en
Inventor
李士军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210317360.9A priority Critical patent/CN114640633B/en
Publication of CN114640633A publication Critical patent/CN114640633A/en
Priority to PCT/CN2022/124069 priority patent/WO2023184925A1/en
Application granted granted Critical
Publication of CN114640633B publication Critical patent/CN114640633B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/102Gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a load balancer, an implementation method thereof, a load balancing method and a gateway system, wherein the implementation method of the load balancer comprises the following steps: the agent controller AgentController sends a creation request including creation configuration information to a load balancing gateway agent on a target host; the target host refers to any one of a plurality of hosts; the load balancing gateway proxy creates a proxy container envoycontainer according to the creation configuration information, generates and mounts a configuration file of the proxy container envoycontainer, and starts the proxy container envoycontainer by utilizing a network of a container engine Docker; the proxy container envoycontainer pulls the latest target service configuration based on the address of the configuration service XDSserver in the configuration file, and is used for carrying out load balancing on the request of the application program.

Description

Load balancer, realization method thereof, load balancing method and gateway system
Technical Field
The present invention relates to the field of load balancing technologies, and in particular, to a load balancer, an implementation method thereof, a load balancing method, and a gateway system.
Background
Current systems typically load balance access requests in order to provide network data processing capabilities, increase throughput, increase network availability and flexibility, etc.
Currently, for pulling images from an image bin library, automatic switching of virtual IP is usually achieved by using lvs+keepaled at the front end, and 7-layer load balancing is achieved by using ng ix or HAProxy at the back end, so that load balancing of traffic and access can be performed on nodes at the back end.
However, load balancing implemented by using nginnx or HAProxy is configured based on files, so when a node is added to the back end or other convenient update exists, the configuration file must be revised or generated, and then the configuration file is reloaded to be effective, and the back end also needs to be restarted, which is very inconvenient.
Disclosure of Invention
Based on the defects of the prior art, the application provides a load balancer, an implementation method thereof, a load balancing method and a gateway system, so as to solve the problem that the prior art is excessively complicated in changing.
In order to achieve the above object, the present application provides the following technical solutions:
the first aspect of the present invention provides a method for implementing a load balancer, which is applied to a gateway system, where the gateway system at least includes a gateway control service and a plurality of hosts, the gateway control service includes an Agent Controller and a configuration service XDS server, each host is deployed with a container engine Docker and a load balancing gateway Agent, and the method for implementing a load balancer includes:
the Agent Controller sends a creation request to the load balancing gateway Agent on the target host; wherein the creation request includes creation configuration information; the target host refers to any one of the plurality of hosts;
the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, and generates and mounts a configuration file of the agent container envoy container;
the load balancing gateway proxy service starts the proxy container envoy container by using the network of the container engine Docker;
and the proxy container envoy container pulls the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program.
Optionally, in the implementation method of the load balancer, the gateway system further includes a high availability service keep, and after the Agent Controller sends a create request to the load balancing gateway Agent on the target host, the method further includes:
the load balancing gateway proxy on the target host invokes the high availability service keepalive to generate a corresponding IP for the target host and other standby hosts.
Optionally, in the implementation method of the load balancer, before the proxy service of the load balancing gateway starts the proxy container using the network of the container engine Docker, the implementation method further includes:
the container engine Docker responds to network creation operation, and creates a MACCVLAN network of the container engine Docker for the proxy container envoy container;
the load balancing gateway proxy service starts the proxy container envoy container by using a network of a container engine Docker, and comprises the following steps:
and the load balancing gateway proxy service calls the MACCVLAN network of the container engine Docker to allocate a network address for the proxy container envoy container, and starts the proxy container envoy container based on the network address.
Optionally, in the implementation method of the load balancer, the proxy container pulls the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for load balancing the request of the application program, including:
the proxy container envoy container monitors the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism; the discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery;
when the target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, the proxy container client pulls the latest target service configuration for carrying out load balancing on the request of the application program.
The second aspect of the present application provides a load balancing method, which is applied to a load balancer, wherein the load balancer is a proxy container created in a gateway system, and the load balancing method includes:
acquiring a request sent by an application program;
load balancing the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system; the target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started; when the proxy container envoy container is created by a load balancing gateway proxy on a target host according to creation configuration information in a creation request, generating and mounting the configuration file of the proxy container envoy container according to the creation configuration information; the target host refers to any one of the plurality of hosts; the creation request is sent by the Agent Controller in the gateway system; the proxy container is started by the load balancing gateway proxy service using the network of the container engine Docker in the gateway system.
A third aspect of the present application provides a gateway system, comprising:
gateway control service and multiple hosts;
the gateway control service comprises an Agent Controller and a configuration service XDS server;
each host is deployed with a container engine Docker and a load balancing gateway proxy;
the Agent Controller is used for sending a creation request to the load balancing gateway Agent on the target host; wherein the creation request includes creation configuration information; the target host refers to any one of the plurality of hosts;
the load balancing gateway proxy is used for creating a proxy container envoy container according to the creation configuration information, generating and mounting a configuration file of the proxy container envoy container, and starting the proxy container envoy container by utilizing a network of the container engine Docker; and after the proxy container is started, the latest target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program.
Optionally, in the gateway system provided above, further includes:
and the high-availability service keepaled is used for generating corresponding IP for the target host and other standby hosts.
Optionally, in the gateway system provided above, the container engine Docker is further configured to:
responding to network creation operation, and creating a MACCVLAN network of the container engine Docker for the proxy container envoy container;
when the load balancing gateway proxy service starts the proxy container envoy container by using a network of a container engine Docker, the load balancing gateway proxy service is used for:
and calling the MACCVLAN network of the container engine Docker to allocate a network address for the proxy container envoy container, and starting the proxy container envoy container based on the network address.
Optionally, in the gateway system provided above, the proxy container is configured to pull, based on an address of the configuration service XDS server in the configuration file, a latest target service configuration from the configuration service XDS server, where the proxy container is configured to load balance a request of an application program:
monitoring the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism; the discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery;
and when the target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, pulling the latest target service configuration for carrying out load balancing on the request of the application program.
A fourth aspect of the present application provides a load balancer, which is a proxy container created in a gateway system, including:
the acquisition unit is used for acquiring a request sent by the application program;
a load balancing unit, configured to load balance the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system; the target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started; when the proxy container envoy container is created by a load balancing gateway proxy on a target host according to creation configuration information in a creation request, generating and mounting the configuration file of the proxy container envoy container according to the creation configuration information; the target host refers to any one of the plurality of hosts; the creation request is sent by the Agent Controller in the gateway system; the proxy container is started by the load balancing gateway proxy service using the network of the container engine Docker in the gateway system.
The implementation method of the load balancer is applied to a gateway system, the gateway system at least comprises a gateway control service and a plurality of hosts, the gateway control service comprises an Agent Controller (Agent Controller) and a configuration service (XDS server), and each host is provided with a container engine (Docker) and a load balancing gateway Agent. When a load balancer needs to be created, the Agent Controller sends a create request to the load balancing gateway Agent on the target host. Wherein the creation request includes creation configuration information, and the target host refers to any one of the plurality of hosts. And the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, generates and mounts a configuration file of the agent container envoy container, and then starts the agent container envoy container by utilizing a network of a container engine Docker. The started proxy container is used for pulling the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program. Therefore, when a node is newly added or other changes exist, the configuration can be pulled by only carrying out dynamic configuration through the configuration service XDS server, so that the configuration is used for load balancing, and restarting is not needed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic architecture diagram of a gateway system according to an embodiment of the present application;
fig. 2 is a flowchart of an implementation method of a load balancer according to an embodiment of the present application;
fig. 3 is a flowchart of another implementation method of a load balancer according to another embodiment of the present application;
FIG. 4 is a flow chart of a method for load balancing according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a load balancer according to another embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In this application, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application provides a realization method of a load equalizer, which is applied to a gateway system, namely the load equalizer is required to be realized through the gateway system, so as to solve the problem that the prior art is excessively complicated in changing.
Optionally, in order to implement the method for implementing the load balancer provided in the embodiment of the present application, another embodiment of the present application provides a gateway system, as shown in fig. 1, including:
the gateway controls the service and multiple hosts.
The gateway control service includes a proxy Controller Agent Controller and a configuration service XDS server.
Each host is deployed with a container engine Docker and a load balancing gateway proxy.
The Agent Controller is configured to send a create request to a load balancing gateway Agent on the target host. Wherein the creation request includes creation configuration information. The target host refers to any one of a plurality of hosts.
The load balancing gateway proxy is used for creating a proxy container envoy container according to the creation configuration information, generating and mounting a configuration file of the proxy container envoy container, and starting the proxy container envoy container by utilizing a network of a container engine Docker.
After the proxy container is started, the latest target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program.
Optionally, in the gateway system provided in another embodiment of the present application, the method further includes:
and the high-availability service keepaled is used for generating corresponding IP for the target host and other standby hosts.
Optionally, in the gateway system provided in another embodiment of the present application, the container engine Docker is further configured to:
in response to the network creation operation, a MACCVLAN network of a container engine Docker is created for the proxy container envoy container.
When the load balancing gateway proxy service in the embodiment of the present application starts the proxy container by using the network of the container engine Docker, the load balancing gateway proxy service is configured to:
the MACFN of the call container engine Docker allocates a network address to the proxy container envoy container and starts the proxy container envoy container based on the network address.
Optionally, in the gateway system provided in another embodiment of the present application, the proxy container is configured to pull, based on an address of a configuration service XDS server in a configuration file, a latest target service configuration from the configuration service XDS server, where the proxy container is configured to, when load balancing a request of an application program:
and monitoring the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism. The discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery.
And when the target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, pulling the latest target service configuration for carrying out load balancing on the request of the application program.
Based on the gateway system provided in the foregoing, the embodiment of the present application provides a method for implementing a load balancer, which is specifically applied to the gateway system, according to the foregoing, the gateway system at least includes a gateway control service and a plurality of hosts, where the gateway control service includes an Agent Controller and a configuration service XDS server, and each host is deployed with a container engine Docker and a load balancing gateway Agent.
As shown in fig. 2, the implementation method of the load balancer provided in the embodiment of the present application includes the following steps:
s201, the Agent Controller sends a creation request to a load balancing gateway Agent on a target host.
Wherein the creation request includes creation configuration information. The target host refers to any one of a plurality of hosts.
Specifically, when the load balancer needs to be created, a developer can configure the creation configuration information according to the created requirement, specifically including the corresponding configuration information about the load balancer, and then send a creation request including the configuration information to a load balancing gateway Agent on a host through an Agent Controller to request the load balancing gateway Agent to create the load balancer. Thereby enabling dynamic creation of containers.
It should be noted that, in the embodiment of the present application, a proxy container is used to implement a load balancer (software gateway), so the load balancer in the embodiment of the present application is the proxy container. The Envoy agent itself supports dynamic routing rules, and dynamically starts the listening port without restarting, and also supports traffic mirroring, and routing rules, backend addresses, etc. can be dynamically updated through XDS protocol.
S202, the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, and generates and mounts a configuration file of the agent container envoy container.
Alternatively, the load balancing gateway proxy on the target host may create multiple proxy containers on multiple hosts, including the target host, according to the creation configuration information after receiving the creation request. And then generating a configuration file of the proxy container envoy container according to the creation configuration information, wherein the configuration file comprises an address of a configuration service XDS server to be monitored by the proxy container envoy container so as to facilitate the monitoring dynamic discovery, the cluster dynamic discovery, the server dynamic discovery, the routing rule dynamic discovery and the like of the proxy container envoy container, namely, the update of the target service configuration can be monitored, and the latest target service configuration can be pulled for load balancing.
Optionally, to better achieve high availability, the gateway system may further comprise a high availability service keepalive. Accordingly, in the embodiment of the present application, after performing step S201, while performing step S202, it may further include:
and the load balancing gateway proxy on the target host calls the high-availability service keepalive to generate corresponding IP for the target host and other standby hosts.
Wherein the standby host refers to a host which also creates the same proxy container envoy container as the target host. It should be noted that, the manner in which the high availability service keepalive achieves high availability belongs to the existing technology, and therefore, a description thereof is omitted here.
S203, the load balancing gateway proxy service starts a proxy container envoy container by using a network of a container engine Docker.
Specifically, a network of the Docker is dynamically created through the container engine Docker, and the network can be a three-layer network Docker MACGANS or a two-layer network Docker IPVLAN, and then the proxy container envoy container is associated with the created network, so that the proxy container envoy container is started.
S204, pulling the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file by the proxy container envoy container, and carrying out load balancing on the request of the application program.
Alternatively, after the proxy container is started for the first time, the target service configuration can be pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file. The target service configuration may include a service configuration related to the discovery of listening dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery, routing rule dynamic discovery, and the like.
Alternatively, the envoy container in the subsequent proxy container may be a target service configuration pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file periodically. Or real-time monitoring the address of the XDS server in the configuration file, and pulling the updated target service configuration when the configuration update exists under the monitored address.
Specifically, after pulling the target service configuration, the proxy container envoy container can load balance the request based on the target service configuration such as the routing rule, the load balance rule and the like when the request sent by the application program is received because the target service configuration includes the routing rule, the load balance rule and the like.
The implementation method of the load balancer is applied to a gateway system, the gateway system at least comprises a gateway control service and a plurality of hosts, the gateway control service comprises a proxy Controller Agent Controller and a configuration service XDS server, and each host is provided with a container engine Docker and a load balancing gateway Agent. When a load balancer needs to be created, the Agent Controller sends a create request to the load balancing gateway Agent on the target host. Wherein the creation request includes creation configuration information, and the target host refers to any one of the plurality of hosts. And the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, generates and mounts a configuration file of the agent container envoy container, and then starts the agent container envoy container by utilizing a network of a container engine Docker. The started proxy container is used for pulling the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program. Therefore, when a node is newly added or other changes exist, the configuration can be pulled by only carrying out dynamic configuration through the configuration service XDS server, so that the configuration is used for load balancing, and restarting is not needed.
In another embodiment of the present application, another implementation method of a load balancer is provided, which is also applied to the gateway system described above. As shown in fig. 3, the implementation method of the load balancer provided in the embodiment of the present application includes the following steps:
s301, the Agent Controller sends a creation request to a load balancing gateway Agent on a target host.
Wherein the creation request includes creation configuration information. The target host refers to any one of a plurality of hosts.
It should be noted that, in the embodiment of the present application, the specific implementation manner of step S301 may refer to the corresponding steps in the above method embodiment, which is not described herein.
S302, the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, and generates and mounts a configuration file of the agent container envoy container.
It should be noted that, in the embodiment of the present application, the specific implementation manner of step S301 may refer to the corresponding steps in the above method embodiment, which is not described herein.
S303, responding to the network creation operation by the container engine Docker, and creating the MACGANT network of the container engine Docker for the proxy container envoy container.
In the embodiment of the application, the starting of the proxy container envoy container is performed through a dynamically created MACCVLAN network of the Docker. Of course, other networks may be employed.
S304, the load balancing gateway proxy service calls a MACCVLAN network of a container engine Docker to allocate a network address for the proxy container envoy container, and starts the proxy container envoy container based on the network address.
S305, the proxy container monitors the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism.
The discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery.
In the embodiment of the application, the address of the configuration service XDS server in the configuration file is monitored through the discovery mechanism, so that when file update occurs under the configured address, the latest target service configuration can be pulled in time for load balancing.
S306, when target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, the proxy container envoy container pulls the latest target service configuration for carrying out load balancing on the request of the application program.
Another embodiment of the present application provides a load balancing method, which is applied to a load balancer implemented by the implementation method of the load balancer provided by any one of the foregoing embodiments. From the foregoing, in the embodiment of the present application, the load balancer is the proxy container created in the gateway system. As shown in fig. 4, a method for load balancing provided in an embodiment of the present application includes:
s401, acquiring a request sent by an application program.
Specifically, the user may initiate a request to the backend through the application, at this time, the proxy container, which is the load balancer, will acquire the request sent by the application, and then step S402 is performed.
S402, carrying out load balancing on the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system.
The target service configuration specifically comprises a routing rule, a load balancing rule and the like. The proxy container envoy container performs route forwarding, i.e. load balancing, based on the pulled target service configuration.
The target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started. And when the proxy container envoy container is created by the load balancing gateway proxy on the target host according to the creation configuration information in the creation request, generating and mounting the proxy container envoy container according to the creation configuration information. The target host refers to any one of a plurality of hosts. The request is sent by a proxy Controller Agent Controller in the gateway system when created. The proxy container envoy container is started by the load balancing gateway proxy service using the network of container engines Docker in the gateway system.
It should be noted that, according to a specific implementation manner, the proxy container envoy container may correspondingly refer to any one of the above method embodiments to provide an implementation method of the load balancer, which is not described herein again.
The embodiment of the application provides a load balancer, which is a proxy container created in a gateway system. As shown in fig. 5, a load balancer provided in an embodiment of the present application includes:
an obtaining unit 501, configured to obtain a request sent by an application program.
And the load balancing unit 502 is configured to load balance the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system.
The target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started. And when the proxy container envoy container is created by the load balancing gateway proxy on the target host according to the creation configuration information in the creation request, generating and mounting the proxy container envoy container according to the creation configuration information. The target host refers to any one of a plurality of hosts. The request is sent by a proxy Controller Agent Controller in the gateway system when created. The proxy container envoy container is started by the load balancing gateway proxy service using the network of container engines Docker in the gateway system.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. The implementation method of the load balancer is characterized by being applied to a gateway system, wherein the gateway system at least comprises a gateway control service and a plurality of hosts, the gateway control service comprises a proxy Controller Agent Controller and a configuration service XDS server, each host is provided with a container engine Docker and a load balancing gateway Agent, and the implementation method of the load balancer comprises the following steps:
the Agent Controller sends a creation request to the load balancing gateway Agent on the target host; wherein the creation request includes creation configuration information; the target host refers to any one of the plurality of hosts;
the load balancing gateway agent on the target host creates an agent container envoy container according to the creation configuration information, and generates and mounts a configuration file of the agent container envoy container;
the load balancing gateway proxy starts the proxy container envoy container by using the network of the container engine Docker;
and the proxy container envoy container pulls the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program.
2. The method of claim 1, wherein the gateway system further comprises a high availability service keepaled, and wherein after the Agent Controller sends a create request to the load balancing gateway Agent on a target host, further comprising:
the load balancing gateway proxy on the target host invokes the high availability service keepalive to generate a corresponding IP for the target host and other standby hosts.
3. The method of claim 1, wherein before the load balancing gateway proxy starts the proxy container envoy container using the network of container engines Docker, further comprising:
the container engine Docker responds to network creation operation, and creates a MACCVLAN network of the container engine Docker for the proxy container envoy container;
the load balancing gateway agent starts the agent container envoy container by using a network of a container engine Docker, and the load balancing gateway agent comprises:
and the load balancing gateway proxy calls a MACCVLAN network of the container engine Docker to allocate a network address for the proxy container envoy container, and starts the proxy container envoy container based on the network address.
4. The method of claim 1, wherein the proxy container pulls the latest target service configuration from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, for load balancing the application's requests, comprising:
the proxy container envoy container monitors the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism; the discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery;
when the target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, the proxy container client pulls the latest target service configuration for carrying out load balancing on the request of the application program.
5. A method of load balancing, applied to a load balancer, the load balancer being a proxy container created in a gateway system, the method of load balancing comprising:
acquiring a request sent by an application program;
load balancing the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system; the target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started; when the proxy container envoy container is created by a load balancing gateway proxy on a target host according to creation configuration information in a creation request, generating and mounting the configuration file of the proxy container envoy container according to the creation configuration information; the target host refers to any one of a plurality of hosts; the creation request is sent by an Agent Controller in the gateway system; the proxy container envoy container is started by a load balancing gateway proxy using the network of the container engine Docker in the gateway system.
6. A gateway system, comprising:
gateway control service and multiple hosts;
the gateway control service comprises an Agent Controller and a configuration service XDS server;
each host is deployed with a container engine Docker and a load balancing gateway proxy;
the Agent Controller is used for sending a creation request to the load balancing gateway Agent on the target host; wherein the creation request includes creation configuration information; the target host refers to any one of the plurality of hosts;
the load balancing gateway proxy is used for creating a proxy container envoy container according to the creation configuration information, generating and mounting a configuration file of the proxy container envoy container, and starting the proxy container envoy container by utilizing a network of the container engine Docker; and after the proxy container is started, the latest target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file, and is used for carrying out load balancing on the request of the application program.
7. The gateway system of claim 6, further comprising:
and the high-availability service keepaled is used for generating corresponding IP for the target host and other standby hosts.
8. The gateway system of claim 6, wherein the container engine Docker is further configured to:
responding to network creation operation, and creating a MACCVLAN network of the container engine Docker for the proxy container envoy container;
when the load balancing gateway proxy starts the proxy container envoy container by using the network of the container engine Docker, the load balancing gateway proxy is used for:
and calling the MACCVLAN network of the container engine Docker to allocate a network address for the proxy container envoy container, and starting the proxy container envoy container based on the network address.
9. The gateway system of claim 6, wherein the proxy container is configured to pull a latest target service configuration from the configuration service XDS server based on an address of the configuration service XDS server in the configuration file, where the proxy container is configured to load balance requests of an application program:
monitoring the address of the configuration service XDS server in the configuration file through a corresponding discovery mechanism; the discovery mechanism comprises monitoring dynamic discovery, cluster dynamic discovery, service endpoint dynamic discovery and routing rule dynamic discovery;
and when the target service configuration update in any address of the configuration service XDS server in the configuration file is monitored, pulling the latest target service configuration for carrying out load balancing on the request of the application program.
10. A load balancer for a proxy container created in a gateway system, the load balancer comprising:
the acquisition unit is used for acquiring a request sent by the application program;
the load balancing unit is used for carrying out load balancing on the request based on the latest target service configuration pulled from the configuration service XDS server of the gateway system; the target service configuration is pulled from the configuration service XDS server based on the address of the configuration service XDS server in the configuration file after the proxy container envoy container is started; when the proxy container envoy container is created by a load balancing gateway proxy on a target host according to creation configuration information in a creation request, generating and mounting the configuration file of the proxy container envoy container according to the creation configuration information; the target host refers to any one of a plurality of hosts; the creation request is sent by an Agent Controller in the gateway system; the proxy container envoy container is started by a load balancing gateway proxy using the network of the container engine Docker in the gateway system.
CN202210317360.9A 2022-03-29 2022-03-29 Load balancer, realization method thereof, load balancing method and gateway system Active CN114640633B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210317360.9A CN114640633B (en) 2022-03-29 2022-03-29 Load balancer, realization method thereof, load balancing method and gateway system
PCT/CN2022/124069 WO2023184925A1 (en) 2022-03-29 2022-10-09 Load balancer and implementation method therefor, load balancing method, and gateway system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210317360.9A CN114640633B (en) 2022-03-29 2022-03-29 Load balancer, realization method thereof, load balancing method and gateway system

Publications (2)

Publication Number Publication Date
CN114640633A CN114640633A (en) 2022-06-17
CN114640633B true CN114640633B (en) 2024-04-05

Family

ID=81952216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210317360.9A Active CN114640633B (en) 2022-03-29 2022-03-29 Load balancer, realization method thereof, load balancing method and gateway system

Country Status (2)

Country Link
CN (1) CN114640633B (en)
WO (1) WO2023184925A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114640633B (en) * 2022-03-29 2024-04-05 京东科技信息技术有限公司 Load balancer, realization method thereof, load balancing method and gateway system
CN117978611A (en) * 2024-01-19 2024-05-03 广东慧云科技股份有限公司 Operation and maintenance management system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302771A (en) * 2016-08-23 2017-01-04 浪潮电子信息产业股份有限公司 Domain name configuration method of application created based on Docker container
CN106790595A (en) * 2016-12-29 2017-05-31 上海理想信息产业(集团)有限公司 A kind of Docker containers active load balancer and method
CN107426034A (en) * 2017-08-18 2017-12-01 国网山东省电力公司信息通信公司 A kind of extensive container scheduling system and method based on cloud platform
EP3716533A1 (en) * 2019-03-29 2020-09-30 Juniper Networks, Inc. Configuring service load balancers with specified backend virtual networks
CN113067739A (en) * 2021-04-29 2021-07-02 中国工商银行股份有限公司 High-density container network deployment method and system
WO2021210801A1 (en) * 2020-04-14 2021-10-21 삼성전자 주식회사 Method and device for dynamic and efficient load balancing in mobile communication network
CN113556267A (en) * 2021-07-20 2021-10-26 全球能源互联网研究院有限公司 Terminal equipment state monitoring method and system and edge Internet of things proxy gateway
CN113835825A (en) * 2021-03-03 2021-12-24 京东科技控股股份有限公司 Dynamic adjustment method and device of virtual service host, server and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2692095B1 (en) * 2011-03-28 2019-06-05 Telefonaktiebolaget LM Ericsson (publ) Method, apparatus and computer program product for updating load balancer configuration data
CN113949707B (en) * 2021-09-30 2024-04-30 上海浦东发展银行股份有限公司 OpenResty and K8S-based container cloud service discovery and load balancing method
CN114640633B (en) * 2022-03-29 2024-04-05 京东科技信息技术有限公司 Load balancer, realization method thereof, load balancing method and gateway system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302771A (en) * 2016-08-23 2017-01-04 浪潮电子信息产业股份有限公司 Domain name configuration method of application created based on Docker container
CN106790595A (en) * 2016-12-29 2017-05-31 上海理想信息产业(集团)有限公司 A kind of Docker containers active load balancer and method
CN107426034A (en) * 2017-08-18 2017-12-01 国网山东省电力公司信息通信公司 A kind of extensive container scheduling system and method based on cloud platform
EP3716533A1 (en) * 2019-03-29 2020-09-30 Juniper Networks, Inc. Configuring service load balancers with specified backend virtual networks
WO2021210801A1 (en) * 2020-04-14 2021-10-21 삼성전자 주식회사 Method and device for dynamic and efficient load balancing in mobile communication network
CN113835825A (en) * 2021-03-03 2021-12-24 京东科技控股股份有限公司 Dynamic adjustment method and device of virtual service host, server and storage medium
CN113067739A (en) * 2021-04-29 2021-07-02 中国工商银行股份有限公司 High-density container network deployment method and system
CN113556267A (en) * 2021-07-20 2021-10-26 全球能源互联网研究院有限公司 Terminal equipment state monitoring method and system and edge Internet of things proxy gateway

Also Published As

Publication number Publication date
WO2023184925A1 (en) 2023-10-05
CN114640633A (en) 2022-06-17

Similar Documents

Publication Publication Date Title
EP3490224B1 (en) Data synchronization method and system
CN110855633B (en) DDOS attack protection method, device, system, communication equipment and storage medium
CN114640633B (en) Load balancer, realization method thereof, load balancing method and gateway system
CN111615066B (en) Distributed micro-service registration and calling method based on broadcast
US9426116B1 (en) Multiple-master DNS system
JP4897927B2 (en) Method, system, and program for failover in a host that simultaneously supports multiple virtual IP addresses across multiple adapters
US11153269B2 (en) On-node DHCP implementation for virtual machines
WO2016177056A1 (en) Data transmission method, device and system for video conference
WO2017067464A1 (en) Method and device for acquiring resource
CN115103008B (en) Service request forwarding system
US20160226963A1 (en) Load balancing using predictable state partitioning
CN114938375B (en) Container group updating equipment and container group updating method
CN113485821A (en) High-reliability video conference system, control method thereof and storage medium
JP2024529099A (en) NODE FOR RUNNING CONTAINER GROUPS, AND CONTAINER GROUP MANAGEMENT SYSTEM AND METHOD - Patent application
CN111756780B (en) Method for synchronizing connection information and load balancing system
CN115118700B (en) Communication method and communication system
US20230146880A1 (en) Management system and management method
CN114650317A (en) Micro-service system and micro-service registration, discovery and keep-alive method
CN113596119A (en) Edge capability distribution method, system, device and computer readable storage medium
JP6643123B2 (en) Management server system, system, system method and program
CN111083213B (en) Communication method and system
CN114553704B (en) Method and system for supporting multiple devices to access server simultaneously to realize capacity expansion and contraction
CN109731345B (en) Voice processing method and device, electronic equipment and storage medium
CN113839809B (en) Method, equipment and system for upgrading server
CN117201575A (en) Data transmission method, device, equipment and medium

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