CN116170443B - Cluster load balancing realization method and system - Google Patents

Cluster load balancing realization method and system Download PDF

Info

Publication number
CN116170443B
CN116170443B CN202310422581.7A CN202310422581A CN116170443B CN 116170443 B CN116170443 B CN 116170443B CN 202310422581 A CN202310422581 A CN 202310422581A CN 116170443 B CN116170443 B CN 116170443B
Authority
CN
China
Prior art keywords
computer instance
computer
instance
cluster
bgp
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
CN202310422581.7A
Other languages
Chinese (zh)
Other versions
CN116170443A (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.)
Anchao Cloud Software Co Ltd
Original Assignee
Anchao Cloud Software 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 Anchao Cloud Software Co Ltd filed Critical Anchao Cloud Software Co Ltd
Priority to CN202310422581.7A priority Critical patent/CN116170443B/en
Publication of CN116170443A publication Critical patent/CN116170443A/en
Application granted granted Critical
Publication of CN116170443B publication Critical patent/CN116170443B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

The application provides a cluster load balancing realization method and system, wherein the method comprises the following steps: respectively creating a first computer instance and a second computer instance in the control cluster and the service cluster; establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session; establishing BGP connection between the first computer instance and the second computer instance respectively; the number of the working nodes to which the second computer instance belongs in the service cluster is at least two. By the application, the control cluster formed by at least one first computer instance replaces a hardware router to realize load balancing among a plurality of working nodes in the service cluster in the BGP mode.

Description

Cluster load balancing realization method and system
Technical Field
The present application relates to the field of network communications technologies, and in particular, to a method and a system for implementing cluster load balancing.
Background
Calico is a set of open source network and network security schemes for network connections between containers, virtual machines, hosts, and can be used for PaaS or IaaS platforms such as Kubernetes, openShift, dockerEE, openStrack. Taking Kubernetes as an example, since the Kubernetes cluster in the Calico scenario has no load balancing function, the function is generally provided by cloud manufacturers, and is generally realized by introducing a MetalLB component.
The MetalLB component is composed of a Controller component (i.e. a Controller component) and a Speaker component (i.e. a Speaker component), wherein the Controller component is responsible for monitoring the service change in each node of the Kubernetes cluster, when the service is configured into a load balancing mode, corresponding IP addresses are given to the service from an IP address pool, corresponding broadcasting or response is initiated according to a specific protocol, and the request is responded in different modes according to the different working modes (Layer 2 mode or BGP mode). For a MetalLB component in a BGP mode, a BGP session is established between each node in the Kubernetes cluster and the hardware router by depending on the hardware router with the BGP function, the hardware router uses all next hops based on the IP address of the BGP session notification hardware router service, and load balancing is carried out among the nodes, so that the MetalLB component in the prior art realizes that the load balancing function of the Kubernetes cluster is strongly dependent on the hardware router. The hardware router is a hardware device with a routing forwarding function, at least one hardware router device needs to be deployed outside a physical machine to forward a route, for the hardware device, power connection of the hardware device needs to be ensured, and meanwhile, the hardware router also depends on network deployment, so that the cost problem and the instability problem caused by easy disconnection exist.
In view of this, there is a need for an improvement in the implementation of MetalLB load balancing in BGP mode in the prior art to solve the above-mentioned problems.
Disclosure of Invention
The application aims to solve the problems of cost and instability caused by strong dependence of a cluster load balancing function on a hardware router through a MetalLB component in a Calico scene in the prior art.
In order to achieve the above object, the present application provides a cluster load balancing implementation method, including:
respectively creating a first computer instance and a second computer instance in the control cluster and the service cluster;
establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session;
establishing BGP connection between the first computer instance and the second computer instance respectively;
the number of the working nodes to which the second computer instance belongs in the service cluster is at least two.
As a further improvement of the present application, the first computer instance in the control cluster for establishing the BGP session with the second computer instance is determined by the first computer instance corresponding to the shortest time delay carried by the reply message in XMPP format forwarded by the first computer instance to the second computer instance, where the reply message is responsive to the BGP session creation request event initiated by the second computer instance.
As a further improvement of the application, the number of the first computer instances in the control cluster is greater than or equal to three, and one second computer instance establishes BGP session with at least two first computer instances respectively.
As a further improvement of the present application, there is also included: when at least one first computer instance of at least two first computer instances establishing the BGP session with the same second computer instance fails, the BGP session established between the failed first computer instance and the second computer instance is cut off, and at least the first computer instance is redetermined from the remaining first computer instances in the control cluster based on the time delay carried by the response message, so as to establish the BGP session between the redetermined first computer instance and the second computer instance.
As a further improvement of the present application, there is also included: and establishing BGP service in the first computer instance, and selecting a virtual machine port corresponding to the working node to which the second computer instance belongs in the BGP service to establish a BGP session between the first computer instance and the second computer instance.
As a further improvement of the present application, after the BGP session is established, a BGP session connection state is detected, and when the BGP session connection state is established, the second computer instance broadcasts node information of a working node to which the second computer instance belongs to the first computer instance based on the BGP session, where the node information includes a route of the working node.
As a further improvement of the present application, the two first computer instances are respectively determined as a first host computer instance and a first standby computer instance based on a time delay;
and the service deployed by the working node to which the second computer instance belongs responds to an access request carrying a data packet, the first host computer instance establishing the BGP session with the second computer instance selects a target working node from a plurality of working nodes to which a plurality of second computer instances establishing the BGP session with the first host computer instance in the control cluster belong respectively based on a preconfigured selection policy, and forwards the data packet to the target working node.
As a further improvement of the application, the election strategy is determined by carrying out hash operation on an ECMP five-tuple carried by the data packet, wherein the ECMP five-tuple comprises a protocol number, a source IP address, a target IP address, a source port and a target port.
As a further development of the application, the working nodes comprise computing nodes or super-fusion nodes which form Kubernetes clusters.
As a further improvement of the application, the second computer instance is deployed in a working node of a service cluster;
further comprises: and issuing configuration parameters for establishing the BGP session to the first computer instance in the visual management page for controlling the cluster connection, wherein the configuration parameters are virtual machine ports.
Based on the same inventive idea, the application also discloses a cluster load balancing realization system, which comprises:
the control cluster and the service cluster are deployed in the computer cluster;
respectively creating a first computer instance and a second computer instance in the control cluster and the service cluster;
establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session;
establishing BGP connection between the first computer instance and the second computer instance respectively;
the number of the working nodes to which the second computer instance belongs in the service cluster is at least two.
Compared with the prior art, the application has the beneficial effects that:
establishing a BGP session between a second computer instance deployed in the service cluster and at least one first computer instance deployed in the control cluster, broadcasting node information of a working node to which the second computer instance belongs to the first computer instance based on the BGP session, and simultaneously respectively establishing BGP connection between the first computer instance and the second computer instance; when a working node responds to an access request which is initiated by a user and carries a data packet, a first computer instance carries out hash operation on ECMP quintuple carried by the data packet, so that a target working node is selected from a plurality of working nodes according to the result of the hash operation, and the problems of cost and instability caused by the fact that a MetalLB component in a BGP mode in the prior art depends on a hardware router with the BGP function to realize load balancing are solved, namely, the load balancing function of the MetalLB component in the BGP mode is realized in a mode of deploying software services (namely, deploying a control cluster formed by an SDN controller).
Drawings
Fig. 1 is a schematic diagram illustrating steps of a cluster load balancing implementation method according to the present application;
FIG. 2 is a topology diagram of a control cluster, a service cluster deployed on a computer cluster, independent of a UI and a user outside the computer cluster;
FIG. 3 is a topology diagram of creating a working node in a service cluster;
fig. 4 is a topology diagram of a first computer instance establishing a BGP session with a second computer instance according to a delay determination carried by a reply message forwarded by the first computer instance to the second computer instance;
fig. 5 is a topology diagram of a working node establishing BGP sessions with two SDN controllers, respectively;
fig. 6 is a topology diagram of BGP sessions established between a working node and the remaining SDN controllers in the control cluster when the SDN controllers fail.
Detailed Description
The present application will be described in detail below with reference to the embodiments shown in the drawings, but it should be understood that the embodiments are not limited to the present application, and functional, method, or structural equivalents and alternatives according to the embodiments are within the scope of protection of the present application by those skilled in the art.
It should be noted that, the "first computer instance" refers to a controller that can elect a target working node from a plurality of working nodes based on a preconfigured election policy, and in the present application, the first computer instance may be regarded as an SDN controller; "second computer instance" refers to a component deployed in a working node for responding to a service request (e.g., a node creation request, a node deletion request, a node modification request, a node migration request, etc.) initiated by a user and performing a corresponding operation (e.g., a node creation operation corresponding to the node creation request), and subsequently broadcasting node information of the working node to which the second computer instance belongs to the first computer instance (i.e., SDN controller) based on a BGP session.
Referring to fig. 1 to 6, a specific embodiment of a cluster load balancing implementation method (hereinafter referred to as "method") is disclosed, where the method may be implemented in a computing device/system, such as a computer cluster 100, that may respond to a user initiated access request carrying a data packet, and the computing device/system may be further configured as a data center, a cloud platform, etc., and in this disclosure, the computer cluster 100 is a typical example and is described with emphasis. The working nodes deployed in the service cluster 20 include computing nodes or super-converged nodes, etc. that make up the Kubernetes cluster.
Referring to fig. 1, the cluster load balancing implementation method includes the following steps S1 to S3.
Step S1, a first computer instance and a second computer instance are respectively created in a control cluster and a service cluster.
Referring to fig. 2, the computer cluster 100 deploys the control cluster 10 and the service cluster 20, the control cluster 10 deploys a first computer instance (i.e., an SDN controller), the service cluster 20 deploys a working node, and deploys a second computer instance (i.e., a speaker) in the working node, that is, as shown in fig. 2, the control cluster 10 deploys the SDN controller 11, the SDN controller 12, the SDN controller 13, etc., the service cluster 20 deploys the working node 21, the working node 22, etc., the working node 21 deploys the speaker 211 and the service 212, the working node 22 deploys the speaker 221 and the service 222, and the service 212 and the service 222 are respectively used for responding to an access request initiated by a user and carrying a data packet.
It should be noted that, the Speaker is a Speaker component, the Speaker component is created by the load balancer 201 shown in fig. 3, and the load balancer 201 is a MetalLB component. In the present application, load balancer 201 is used to allocate speakers to the working nodes (it is also understood that load balancer 201 is used to create speakers in the working nodes); the speaker is configured to broadcast node information of a working node to which the speaker belongs to the SDN controller based on a BGP session established between the speaker and the SDN controller (i.e., the speaker), and is further configured to respond to a service request initiated by a user and perform a corresponding operation, where the service request may be, for example, a node creation request, a node deletion request, a node modification request, a node migration request, and the like.
Referring to fig. 3, the speaker is used to respond to a service request initiated by a user and perform a corresponding operation, and the service request is exemplified as a node creation request. A user initiates a node creation request to a working node 21 deployed in a service cluster 20, a speaker 211 deployed in the working node 21 creates a working node 22 in the service cluster 20 in response to the node creation request, and a load balancer 201 deployed in the service cluster 20 allocates a speaker 221 to the working node 22, which can also be understood as creating the speaker 221 in the working node 22 by the load balancer 201. Similarly, the manner in which the first computer instance (i.e., the SDN controller) is created in the control cluster 10 may be referred to above, taking the example of creating the SDN controller 12 in the control cluster 10, the user sends a controller creation request to the SDN controller 11 deployed in the control cluster 10, and the SDN controller 11 creates the SDN controller 12 in the control cluster 10 in response to the controller creation request.
For the number of the first computer instances in the control cluster 10 and the number of the working nodes to which the second computer instances in the service cluster 20 belong, in the present application, the number of the working nodes to which the second computer instances belong is at least two, and the number of the first computer instances is at least one, so that the target working node is selected from at least two working nodes based on a preconfigured selection policy through the first computer instance (i.e., the SDN controller) in the following step, and load balancing among the working nodes in the service cluster 20 is further realized.
Step S2, establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of the working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session.
Referring to fig. 2, a BGP session is established between a first computer instance and a second computer instance, and if only one first computer instance is deployed in the control cluster 10, the BGP session is directly established between the first computer instance and the second computer instance; if a plurality of first computer instances are deployed in the control cluster 10, it is necessary to select one first computer instance from the plurality of first computer instances and establish a BGP session with the first computer instance. For a selection manner of selecting one first computer instance from the plurality of first computer instances, namely, the first computer instance in the control cluster 10 for establishing the BGP session with the second computer instance, a first computer instance corresponding to the shortest delay carried by an XMPP-format reply message forwarded by the first computer instance to the second computer instance is determined, and the reply message responds to a BGP session establishment request event initiated by the second computer instance.
Referring to fig. 4, an exemplary description is given of the working node 21 selecting one SDN controller from SDN controllers 11, 12, 13 to establish a BGP session. Speaker 211 deployed at working node 21 simultaneously transmits a BGP session creation request to SDN controller 11, SDN controller 12, SDN controller 13, SDN controller 11 responds to the BGP session creation request and forwards an XMPP-formatted reply message (hereinafter referred to as "first message") to speaker 211, SDN controller 12 responds to the BGP session creation request and forwards an XMPP-formatted reply message (hereinafter referred to as "second message") to speaker 211, and SDN controller 13 responds to the BGP session creation request and forwards an XMPP-formatted reply message (hereinafter referred to as "third message") to speaker 211. If the delay carried by the first packet is 0.1 seconds, the delay carried by the second packet is 0.05 seconds, the delay carried by the third packet is 0.2 seconds, 0.05 seconds < 0.1 seconds < 0.2 seconds, then the first computer instance (i.e., SDN controller 12) corresponding to the second packet is determined to be the first computer instance for establishing a BGP session with the second computer instance (i.e., speaker 211), i.e., a BGP session is established between SDN controller 12 and speaker 211.
In order to achieve the technical effects of disaster recovery and high availability, in this embodiment, the number of first computer instances in the control cluster 10 is greater than or equal to three, and one second computer instance establishes BGP sessions with at least two first computer instances respectively. When at least one first computer instance in at least two first computer instances establishing a BGP session with the same second computer instance fails, the BGP session established between the failed first computer instance and the second computer instance is cut off, and the at least one first computer instance is redetermined from the remaining first computer instances in the control cluster 10 based on the time delay carried by the response message, so as to establish the BGP session between the redetermined first computer instance and the second computer instance, thereby preventing the situation that load balance between working nodes cannot be realized through the first computer instance due to the failure of the first computer instance establishing the BGP session with the second computer instance, and further achieving the technical effects of disaster recovery and high availability by establishing the BGP session between the second computer instance and the at least two first computer instances.
Referring to fig. 6, an SDN controller 11, an SDN controller 12, an SDN controller 13, an SDN controller 14, and the like are deployed in the control cluster 10. The working node 21 establishes BGP sessions with the SDN controllers 11, 12 (i.e., the double-headed arrow (1) and the double-headed arrow (2) shown in fig. 6), respectively, and the working node 22 establishes BGP sessions with the SDN controllers 12, 13 (i.e., the double-headed arrow (3) and the double-headed arrow (4) shown in fig. 6), respectively. If the SDN controller 11 fails, a BGP session previously established between the SDN controller 11 and the working node 21 (i.e., a bi-directional arrow (1) shown in fig. 6) is cut off, and one SDN controller (i.e., the SDN controller 13 or the SDN controller 14, etc.) is redetermined from the remaining SDN controllers (the remaining SDN controllers of the SDN controller 11 and the SDN controller 12, i.e., the SDN controller 13, the SDN controller 14, etc.) based on the latency carried by the reply message, so as to establish a BGP session between the redetermined SDN controller 13 (or the SDN controller 14) and the working node 21 (i.e., a bi-directional arrow (5) or a bi-directional arrow (6) shown in fig. 6), to prevent the working node 21 from establishing a session only with the SDN controller 11 and failing to implement load balancing between the working nodes when the SDN controller 11 fails.
The establishment of BGP sessions between two second computer instances and two first computer instances is implemented by connection of a gateway and an Eth (virtual network card), and as shown in fig. 5, the Eth (virtual network card) where the working node 21 is located is connected to the gateway of the SDN controller 11 and the gateway of the SDN controller 12, and the Eth (virtual network card) where the working node 22 is located is connected to the gateway of the SDN controller 12 and the gateway where the SDN controller 13 is located. Specifically, a BGP service is established in a first computer instance (e.g., SDN controller 11), and a virtual machine port corresponding to a working node 21 to which a second computer instance (e.g., speaker 211) belongs is selected in the BGP service to establish a BGP session between the first computer instance and the second computer instance.
Detecting a BGP session connection state after the BGP session is Established, and broadcasting node information of the working node to which the second computer instance belongs to the first computer instance based on the BGP session by the second computer instance when the BGP session connection state is Established (namely, established). If a BGP session is established between a second computer instance and the plurality of first computer instances, node information of a working node to which the second computer instance belongs is broadcast to the plurality of first computer instances based on the BGP session.
Step S3, establishing BGP connection between the first computer instance and the second computer instance respectively.
BGP connections between SDN controllers deployed by control cluster 10 are established while BGP connections between speakers deployed in working nodes deployed by service cluster 20 are established, i.e., BGP connections between SDN controller 11, SDN controller 12, SDN controller 13 are established as shown in fig. 2 while BGP connections between working node 21 and working node 22 are established. When a service deployed on a working node responds to an access request carrying a data packet, the SDN controller selects a target working node from a plurality of working nodes respectively belonging to a plurality of second computer instances establishing BGP session with the SDN controller based on a preconfigured selection policy. Because the SDN controllers have established BGP connections with each other, when the SDN controllers elect a target working node from a plurality of working nodes to which a plurality of second computer instances belong respectively, the SDN controllers are not limited to electing among the working nodes to which the second computer instances that establish BGP sessions with the current SDN controller belong respectively, and may elect among the plurality of working nodes to which all second computer instances that establish BGP sessions with the SDN controllers in the entire control cluster 10 belong respectively, so as to elect a target working node, and forward a packet to the target working node based on the BGP connections established among the working nodes, thereby realizing load balancing among the working nodes deployed by the service cluster 20. If the target working node is the working node to which the service responding to the access request carrying the data packet initiated by the user belongs, the operation of forwarding the data packet to the target working node is not executed; and if the target working node is not the working node to which the service responding to the access request carrying the data packet initiated by the user belongs, executing the operation of forwarding the data packet to the target working node.
If one second computer instance establishes a BGP session with only one first computer instance, e.g., working node 21 establishes a BGP session with only SDN controller 11 and working node 22 establishes a BGP session with only SDN controller 12. When the service 212 deployed on the working node 21 responds to the access request initiated by the user and carrying the data packet, although the working node 22 does not establish the BGP session with the SDN controller 11, since the BGP connection is established between the SDN controller 11 and the SDN controller 12, the SDN controller 11 that establishes the BGP session with the working node 21 can elect a target working node from the working node 21 and the working node 22 based on a preconfigured election policy, and forwards the data packet to the target working node. If the target working node is the working node 21, the operation of forwarding the data packet to the target working node is not required to be executed; if the target worker node is worker node 22, the data packets are forwarded from worker node 21 to worker node 22 based on the BGP session established between worker node 21 and worker node 22.
If one second computer instance respectively establishes a BGP session with two first computer instances, the two first computer instances respectively determine a first host computer instance and a first standby computer instance based on the time delay of the response message, so as to determine the first computer instance corresponding to the shortest time delay as the first host computer instance, and determine the other first computer instance as the first standby computer instance. When a service deployed by a working node to which a second computer instance belongs responds to an access request carrying a data packet initiated by a user, a first host computer instance establishing a BGP session with the second computer instance selects a target working node from a plurality of working nodes to which a plurality of second computer instances establishing the BGP session with the first computer instance in the control cluster 10 respectively belong based on a preconfigured selection policy, and forwards the data packet to the target working node. If the first host computer instance fails, cutting off a previously established BGP session between the second computer instance and the failed first host computer instance, redefining the first standby computer instance as the first host computer instance, so that the redetermined first host computer instance can elect a target working node from a plurality of working nodes to which a plurality of second computer instances establishing BGP sessions with the first computer instance in the control cluster 10 belong respectively based on a preconfigured election policy, and forwarding a data packet to the target working node; at the same time, the first standby computer instance is redetermined from the remaining first computer instances in the control cluster 10 based on the delay carried by the reply message, so as to establish a BGP session between the first standby computer instance and the second computer instance.
Referring to fig. 1, for example, the working node 21 establishes BGP sessions with the SDN controllers 11 and 12, respectively, and the working node 22 establishes BGP sessions with the SDN controllers 12 and 13, respectively. When the service 212 deployed at the working node 21 responds to an access request carrying a data packet initiated by a user, the SDN controller 11 is determined to be a first host computer instance and the SDN controller 12 is determined to be a first standby computer instance based on a latency carried by the reply message. When the service 212 deployed on the working node 21 responds to the access request initiated by the user and carrying the data packet, although the working node 22 does not establish the BGP session with the SDN controller 11, since the BGP connection is already established between the SDN controller 11 and the SDN controller 12, the SDN controller 11 may elect the target working node from the working node 21 and the working node 22 based on the preconfigured election policy, and forward the data packet to the target working node based on the BGP connection established between the working nodes. It should be noted that, the election policy is determined by performing hash operation on an ECMP five-tuple carried by the data packet, where the ECMP five-tuple includes a protocol number, a source IP address, a destination IP address, a source port, and a destination port. The control cluster 10 is connected with the UI30, and may issue configuration parameters for establishing a BGP session to the first computer instance (i.e., SDN controller) in the UI30 (i.e., a lower concept of a visualization management page) connected with the control cluster 10, and may view and/or modify the configuration parameters, where the configuration parameters are virtual machine ports, which are defined by UUIDs together with virtual IP addresses configured for the virtual machines, e.g., 10ba1399-3f60-40e3-adb9-091267e7218e (179.219.51.12).
In the present application, a BGP session is established between a second computer instance deployed in the service cluster 20 and at least one first computer instance deployed in the control cluster 10, and node information of a working node to which the second computer instance belongs is broadcast to the first computer instance based on the BGP session, and BGP connections are established between the first computer instance and between the second computer instance, respectively. When the working node responds to an access request initiated by a user and carrying a data packet, a first computer instance (i.e., an SDN controller) deployed in the control cluster 10 performs hash operation on an ECMP five-tuple carried by the data packet, so as to elect a target working node from a plurality of working nodes according to the result of the hash operation, and forward the data packet to the target working node, so that the target working node executes service logic corresponding to the data packet, and further load balancing among the plurality of working nodes in the service cluster 20 is realized, so as to solve the cost problem and instability problem caused by that a MetalLB component in BGP mode depends on a hardware router with BGP function to realize load balancing in the prior art, namely, the load balancing function of the MetalLB component in BGP mode is realized by deploying software services (i.e., deploying the control cluster 10 formed by at least one SDN controller).
Based on the same inventive concept, this embodiment also discloses a cluster load balancing implementation system (hereinafter referred to as "system"), and in combination with fig. 2, the system includes: the control cluster 10 and the service cluster 20 deployed in the computer cluster 100 respectively create a first computer instance (i.e. an SDN controller) and a second computer instance (i.e. a speaker) in the control cluster 10 and the service cluster 20, establish a BGP session with the second computer instance and at least one first computer instance, broadcast node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session, and establish BGP connections between the first computer instance and the second computer instance respectively, wherein the number of working nodes to which the second computer instance belongs in the service cluster 20 is at least two.
Because the cluster load balancing implementation system and the cluster load balancing implementation method have the same inventive concept and are only protected from the aspects of the device and the method, the same technical scheme parts as described above are provided, and the description is omitted herein.
The above list of detailed descriptions is only specific to practical embodiments of the present application, and they are not intended to limit the scope of the present application, and all equivalent embodiments or modifications that do not depart from the spirit of the present application should be included in the scope of the present application.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is provided for clarity only, and that the disclosure is not limited to the embodiments described in detail below, and that the embodiments described in the examples may be combined as appropriate to form other embodiments that will be apparent to those skilled in the art.

Claims (11)

1. The cluster load balancing implementation method is characterized by comprising the following steps:
respectively creating a first computer instance and a second computer instance in the control cluster and the service cluster;
establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session;
establishing BGP connection between the first computer instance and the second computer instance respectively;
the number of working nodes to which a second computer instance belongs in the service cluster is at least two, the first computer instance is an SDN controller, and the second computer instance is a loudspeaker assembly;
when the working node responds to an access request which is initiated by a user and carries a data packet, the first computer instance carries out hash operation on the ECMP quintuple carried by the data packet so as to elect a target working node from a plurality of working nodes according to the result of the hash operation.
2. The method according to claim 1, wherein the first computer instance in the control cluster that establishes the BGP session with the second computer instance is determined by the first computer instance corresponding to a shortest delay carried by an XMPP-format reply message forwarded by the first computer instance to the second computer instance, where the reply message is responsive to a BGP session creation request event initiated by the second computer instance.
3. The method for implementing cluster load balancing according to claim 2, wherein the number of first computer instances in the control cluster is greater than or equal to three, and one second computer instance establishes BGP sessions with at least two first computer instances, respectively.
4. The cluster load balancing implementation method according to claim 3, further comprising: when at least one first computer instance of at least two first computer instances establishing the BGP session with the same second computer instance fails, the BGP session established between the failed first computer instance and the second computer instance is cut off, and at least the first computer instance is redetermined from the remaining first computer instances in the control cluster based on the time delay carried by the response message, so as to establish the BGP session between the redetermined first computer instance and the second computer instance.
5. The cluster load balancing implementation method according to claim 1, further comprising: and establishing BGP service in the first computer instance, and selecting a virtual machine port corresponding to the working node to which the second computer instance belongs in the BGP service to establish a BGP session between the first computer instance and the second computer instance.
6. The method according to claim 5, wherein after the BGP session is established, detecting a BGP session connection state, and broadcasting, by the second computer instance, node information of a working node to which the second computer instance belongs to, to the first computer instance based on the BGP session when the BGP session connection state is established, the node information including a route of the working node.
7. The cluster load balancing implementation method according to claim 3, wherein the two first computer instances are respectively determined as a first host computer instance and a first standby computer instance based on time delay;
and the service deployed by the working node to which the second computer instance belongs responds to an access request carrying a data packet, the first host computer instance establishing the BGP session with the second computer instance selects a target working node from a plurality of working nodes to which a plurality of second computer instances establishing the BGP session with the first host computer instance in the control cluster belong respectively based on a preconfigured selection policy, and forwards the data packet to the target working node.
8. The method of claim 7, wherein the election policy is determined by hashing an ECMP five-tuple carried by the data packet, the ECMP five-tuple including a protocol number, a source IP address, a destination IP address, a source port, and a destination port.
9. The cluster load balancing implementation method according to any of claims 1 to 8, wherein the working nodes comprise computing nodes or super-fusion nodes that constitute Kubernetes clusters.
10. The cluster load balancing implementation method according to claim 9, wherein the second computer instance is deployed in a working node of a service cluster;
further comprises: and issuing configuration parameters for establishing the BGP session to the first computer instance in the visual management page for controlling the cluster connection, wherein the configuration parameters are virtual machine ports.
11. A system for implementing cluster load balancing, comprising:
the control cluster and the service cluster are deployed in the computer cluster;
respectively creating a first computer instance and a second computer instance in the control cluster and the service cluster;
establishing a BGP session between the second computer instance and at least one first computer instance, and broadcasting node information of a working node to which the second computer instance belongs to the first computer instance by the second computer instance based on the BGP session;
establishing BGP connection between the first computer instance and the second computer instance respectively;
the number of working nodes to which a second computer instance belongs in the service cluster is at least two, the first computer instance is an SDN controller, and the second computer instance is a loudspeaker assembly;
when the working node responds to an access request which is initiated by a user and carries a data packet, the first computer instance carries out hash operation on the ECMP quintuple carried by the data packet so as to elect a target working node from a plurality of working nodes according to the result of the hash operation.
CN202310422581.7A 2023-04-20 2023-04-20 Cluster load balancing realization method and system Active CN116170443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310422581.7A CN116170443B (en) 2023-04-20 2023-04-20 Cluster load balancing realization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310422581.7A CN116170443B (en) 2023-04-20 2023-04-20 Cluster load balancing realization method and system

Publications (2)

Publication Number Publication Date
CN116170443A CN116170443A (en) 2023-05-26
CN116170443B true CN116170443B (en) 2023-08-22

Family

ID=86416578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310422581.7A Active CN116170443B (en) 2023-04-20 2023-04-20 Cluster load balancing realization method and system

Country Status (1)

Country Link
CN (1) CN116170443B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411735A (en) * 2016-10-18 2017-02-15 杭州华三通信技术有限公司 Routing configuration method and device
CN111866053A (en) * 2019-04-26 2020-10-30 瞻博网络公司 Software defined network controller, method and computer readable storage medium
US11074091B1 (en) * 2018-09-27 2021-07-27 Juniper Networks, Inc. Deployment of microservices-based network controller
CN115941457A (en) * 2021-10-04 2023-04-07 瞻博网络公司 Cloud-local software-defined network architecture for multiple clusters

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411735A (en) * 2016-10-18 2017-02-15 杭州华三通信技术有限公司 Routing configuration method and device
US11074091B1 (en) * 2018-09-27 2021-07-27 Juniper Networks, Inc. Deployment of microservices-based network controller
CN111866053A (en) * 2019-04-26 2020-10-30 瞻博网络公司 Software defined network controller, method and computer readable storage medium
CN115941457A (en) * 2021-10-04 2023-04-07 瞻博网络公司 Cloud-local software-defined network architecture for multiple clusters

Also Published As

Publication number Publication date
CN116170443A (en) 2023-05-26

Similar Documents

Publication Publication Date Title
EP3525405B1 (en) Packet sending method and network device
EP3588876B1 (en) Method, device and system for forwarding data messages
EP2157746B1 (en) Routing control system for L3VPN service network
WO2018054156A1 (en) Vxlan message forwarding method, device and system
EP2993838B1 (en) Methods for setting a member identity of gateway device and corresponding management gateway devices
EP3691185B1 (en) Method for processing message, device, and system
US7505401B2 (en) Method, apparatus and program storage device for providing mutual failover and load-balancing between interfaces in a network
CN109660441B (en) Method and device for multicast replication in Overlay network
KR101691759B1 (en) Virtual chassis system control protocols
GB2485024A (en) Providing failover for a Point to Point tunnel for Wireless Local Area Network (WLAN) split-plane environments
JP2004032758A (en) Router interface backup execution method by vrrp (virtual router redundancy protocol)
WO2012000234A1 (en) Method, apparatus and system for fast switching between links
CN103124240B (en) Gateway configuration method, gateway device and network system
CN116915371A (en) Computer networking method and software defined network SDN system
JP2018536345A (en) Firewall cluster
CN101562576B (en) Route distribution method and equipment thereof
US20160205033A1 (en) Pool element status information synchronization method, pool register, and pool element
WO2017114363A1 (en) Packet processing method, bng and bng cluster system
JP7389091B2 (en) METHODS, APPARATUS AND SYSTEM FOR CONTROLLING TRAFFIC FORWARDING
CN113315699B (en) Multi-master multi-standby fast rerouting system and method for distinguishing priority
US10666558B2 (en) Automatic alignment of roles of routers in networks
US9525624B2 (en) Virtual router redundancy protocol for scalable distributed default routing gateway
CN112995027B (en) Route publishing method and VTEP node
CN116170443B (en) Cluster load balancing realization method and system
WO2024001359A1 (en) Communication state switching method, port configuration method, and communication system 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