CN116319570A - Multi-cluster distributed load balancing method, system, device, equipment and medium - Google Patents

Multi-cluster distributed load balancing method, system, device, equipment and medium Download PDF

Info

Publication number
CN116319570A
CN116319570A CN202310281770.7A CN202310281770A CN116319570A CN 116319570 A CN116319570 A CN 116319570A CN 202310281770 A CN202310281770 A CN 202310281770A CN 116319570 A CN116319570 A CN 116319570A
Authority
CN
China
Prior art keywords
load balancing
service
node
call service
calling
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.)
Pending
Application number
CN202310281770.7A
Other languages
Chinese (zh)
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.)
Tongdun Technology Co ltd
Original Assignee
Tongdun 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 Tongdun Technology Co ltd filed Critical Tongdun Technology Co ltd
Priority to CN202310281770.7A priority Critical patent/CN116319570A/en
Publication of CN116319570A publication Critical patent/CN116319570A/en
Pending legal-status Critical Current

Links

Images

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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5054Automatic deployment of services triggered by the service manager, e.g. service implementation by automatic configuration of network components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • H04L47/783Distributed allocation of resources, e.g. bandwidth brokers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a distributed load balancing method, system, device, equipment and medium for multiple clusters, and relates to the technical field of computers. The method comprises the steps of sending a calling request through a client, transmitting the calling service request to a corresponding node according to a preset corresponding relation between a calling service name and a server node, enabling the server node to determine a target load balancing rule corresponding to the calling service request based on the corresponding relation between the preset calling service name and the load balancing rule, and calling a plurality of containers to process the calling service request based on the target load balancing rule. The load balance of the flow in the multiple clusters is realized, and the calculation efficiency of the container is improved.

Description

Multi-cluster distributed load balancing method, system, device, equipment and medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method, a system, a device, equipment and a medium for distributed load balancing of multiple clusters.
Background
With the development of internet technology, users have higher requirements on applications, and current applications need to support a large number of users, so that in order to support a large number of users, the current applications need to have a relatively strong computing capability. In order to meet the demands of users, cloud computing technology is rapidly developed.
The cloud computing technology deploys the application to the cloud end in a containerization manner, so that the configuration of hardware or software of the application in the field is avoided. In the prior art, a container is generally deployed in a cluster mode, however, the deployment of the container in the cluster mode easily causes unbalanced flow distribution among containers, so that the utilization rate of the current container is low, and the calculation efficiency of the container is reduced.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure provides a distributed load balancing method, a system, a device, equipment and a medium for multiple clusters, which at least overcome the problem of unbalanced flow distribution of containers in the current multiple clusters in the related technology to a certain extent, and are beneficial to improving the utilization rate of the containers so as to improve the computing efficiency.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to one aspect of the present disclosure, there is provided a distributed load balancing method for multiple clusters, including:
Sending a service calling request through a client, wherein the service calling request comprises a service calling name;
transmitting a call service request to a corresponding service node according to a preset corresponding relation between a call service name and the service node, so that the service node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the call service name and the load balancing rule, calls a plurality of containers based on the target load balancing rule to process the call service request, and sends an obtained processing result to the client, wherein the service node comprises at least one node in a cluster, and the service node comprises at least one service container.
In one embodiment of the present disclosure, the method further comprises:
acquiring a call service name of the new addition and/or the new subtraction;
and updating the corresponding relation between the calling service names and the server nodes based on the newly added and/or newly subtracted calling service names and the server nodes corresponding to the newly added and/or newly subtracted calling service names.
In one embodiment of the present disclosure, the method further comprises:
acquiring change data in a server node;
and updating and calling the corresponding relation between the service name and the service end node based on the change data in the container in the service end node.
In one embodiment of the present disclosure, the method further comprises:
and sending the corresponding relation between the updated calling service name and the service end node to a load balancing device configured on the node, so that the load balancing device updates the target load balancing rule based on the corresponding relation between the updated calling service name and the service end node.
According to another aspect of the present disclosure, there is provided a distributed load balancing system of a plurality of clusters, including:
client, cluster and load balancing device;
the client is used for sending a call service request, wherein the call service request comprises a call service name;
the cluster is used for transmitting the call service request to the corresponding service end node in the cluster according to the preset corresponding relation between the call service name and the service end node so that the service end node can determine a target load balancing rule corresponding to the call service request based on the corresponding relation between the call service name and the load balancing rule, and call a plurality of containers to process the call service request based on the target load balancing rule, and the obtained processing result is sent to the client;
and the load balancing device is used for generating the corresponding relation between the calling service name and the load balancing rule based on the corresponding relation between the calling service name and the server node, and sending the corresponding relation between the calling service name and the load balancing rule to the cluster.
In one embodiment of the present disclosure, the load balancing apparatus is further configured to: and acquiring the newly added and/or newly subtracted call service names, and updating the corresponding relation between the call service names and the load balancing rules based on the newly added and/or newly subtracted call service names and the service end nodes corresponding to the newly added and/or newly subtracted call service names.
In one embodiment of the present disclosure, the load balancing apparatus is further configured to: and acquiring the change data in the server node, and updating and calling the corresponding relation between the service name and the load balancing rule based on the change data in the server node.
According to yet another aspect of the present disclosure, there is provided a distributed load balancing apparatus for multiple clusters, including:
the first control module is used for sending a service calling request through the client, wherein the service calling request comprises a service calling name;
the second control module is used for transmitting the calling service request to the corresponding service end node according to the preset corresponding relation between the calling service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the calling service request based on the corresponding relation between the preset calling service name and the load balancing rule, calls a plurality of containers to process the calling service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in the cluster, and the service end node comprises at least one service end container.
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
the first acquisition module is used for acquiring the call service names which are newly added and/or subtracted;
a first updating module, configured to update a correspondence between a calling service name and a server node based on the newly added and/or subtracted calling service name and the server node corresponding to the newly added and/or subtracted calling service name
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
the second acquisition module is used for acquiring the change data in the server node;
and the second updating module is used for updating and calling the corresponding relation between the service name and the service end node based on the change data in the service end node.
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
and the sending module is used for sending the corresponding relation between the updated calling service name and the server node to a load balancing device configured on the node so that the load balancing device updates the target load balancing rule based on the corresponding relation between the updated calling service name and the server node.
According to still another aspect of the present disclosure, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-described multi-cluster distributed load balancing method via execution of the executable instructions.
According to yet another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described multi-cluster distributed load balancing method.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call request is sent through a client, then the call service request is transmitted to a corresponding node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Therefore, load balancing of flow in multiple clusters is achieved, and calculation efficiency of the container is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 illustrates a block diagram of a multi-clustered distributed load system in accordance with one embodiment of the present disclosure;
FIG. 2 is a diagram of an example of a multi-cluster distributed load balancing system in accordance with a second embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a method of distributed load balancing for multiple clusters in accordance with a third embodiment of the present disclosure;
FIG. 4 is a flow chart of a multi-cluster distributed load balancing method according to a fourth embodiment of the present disclosure;
FIG. 5 is a flow chart of a method for distributed load balancing of multiple clusters in a fifth embodiment of the disclosure;
FIG. 6 is a flow chart of a distributed load balancing method for multiple clusters in a sixth embodiment of the disclosure;
FIG. 7 is a flow chart illustrating a method of distributed load balancing for multiple clusters in a seventh embodiment of the present disclosure;
FIG. 8 is a diagram illustrating a multi-cluster distributed load balancing apparatus according to an eighth embodiment of the present disclosure;
fig. 9 shows a block diagram of a computer device in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
In order to solve the above problems, embodiments of the present disclosure provide a method, a system, an apparatus, a device, and a medium for distributed load balancing of multiple clusters.
To facilitate understanding, the terms involved in this disclosure are first explained.
A container: is a lightweight, portable, self-contained software packaging technology that allows applications to run in the same manner almost anywhere.
Kubernetes: often referred to as K8S for short, is an open source system for automatically deploying, expanding and managing "containerized applications".
Service: is a resource type in the Kubernetes system that discloses an application running on a set of pois as an abstract method of web services.
Endpoint: is a resource object in Kubernetes cluster, stored in etcd, and used to record access addresses of all pod corresponding to a Service.
VIP: virtual IP, i.e. Virtual IP.
DaemonSet: is a resource object in the Kubernetes cluster that ensures that a copy of one Pod is run on all or some of the nodes. When nodes join the cluster, a Pod is added to them.
IPVS: is constructed on the Netfilter upper layer and is used as a part of the Linux kernel to realize the load balancing of the transmission layer.
It should be noted that, in the embodiments of the present disclosure, the cluster refers to a container cluster, and generally, the container cluster is a cluster of multiple containers. Multiple containers may be set as servers in a container cluster. The container set as the server is called a server container.
For ease of understanding, the disclosed embodiments first describe a multi-cluster distributed load balancing system.
Fig. 1 illustrates a block diagram of a multi-clustered distributed load system according to a first embodiment of the present disclosure.
As shown in fig. 1. The multi-cluster distributed load system may include:
client 101, cluster 102, and load balancing device 103;
a client 101, configured to send a call service request, where the call service request includes a call service name;
the cluster 102 is configured to transmit a call service request to a corresponding service node in the cluster according to a preset corresponding relation between a call service name and a service node, so that the service node determines a target load balancing rule corresponding to the call service request based on a corresponding relation between the call service name and a load balancing rule stored in advance, call a plurality of containers to process the call service request based on the target load balancing rule, and send an obtained processing result to the client;
The load balancing device 103 is configured to generate a corresponding relationship between the calling service name and the load balancing rule based on the corresponding relationship between the calling service name and the server node, and send the corresponding relationship between the calling service name and the load balancing rule to the cluster.
In one embodiment, the client may include a client disposed on a container in the cluster, or may be a client disposed on a user terminal device, where the client may access a server disposed in the container of the cluster through a wired network or a wireless network, and the server disposed in the container of the cluster provides a computing service for the client.
In one embodiment, the nodes in the cluster may be the basic units of the cluster, with the containers typically provided on the nodes. The server node may be at least one node in a cluster. By way of example, the clusters may include Kubernetes clusters.
In one embodiment, the call Service name may include Service or VIP, and it should be noted that Service is a resource type in the Kubernetes system that exposes an application running on a set of Pods as an abstract method of web services. Specifically, service aggregates multiple clusters or containers that provide the same Service and provides a unified portal address. By accessing the portal address of Service, the following cluster or container Service can be accessed. The VIP in embodiments of the present disclosure may also include virtual addresses of multiple clusters or containers that provide the same service.
In one embodiment, invoking the correspondence of the Service name to the server node may include automatically generating a VIP of Service or a Service name within the cluster
In one embodiment, the correspondence of the call service name to the server node may be set by a controller-manager component in the cluster.
In one embodiment, a user may invoke computing resources in a server set up in a container directly through Service while using an application set up in a client.
In one embodiment, the load balancing device may be deployed on all cluster nodes in the form of Daemonset, and containers on each node may be forwarded through the local load balancer preferentially to improve the availability of the load balancer.
In one embodiment, an Endpoint control component may connect with a cluster to obtain Service change data corresponding to the cluster, where the Service change data may include, for example, pruning of nodes corresponding to the Service and pruning of the Service.
In one embodiment, an Endpoint control component is coupled to a load balancing device. The load balancing device may set a load balancing rule based on node information after acquiring the node corresponding to the application based on the Endpoint control component. When the client calls the node, the node distributes traffic based on the load balancing rule, so that unbalanced traffic distribution is avoided.
In one embodiment, the load balancing device may further include an IP virtual server (IP Virtual Server, IPVS), and the IP virtual server indicates VIP as a Service container VIP in the rule by adding or updating a corresponding IPVS rule, and the back-end real proxy IP is a container IP in an Endpoint IP list, so that when a client container deployed in Kubernetes accesses a Service end through VIP, an IPVS controller in a linux kernel automatically forwards balanced traffic to Service end containers of all Kubernetes clusters. The load balancing rules may include ipvs rules, among others.
Fig. 2 illustrates an exemplary diagram of a multi-cluster distributed load balancing system in accordance with a second embodiment of the present disclosure.
As shown in FIG. 2, in the Kubernetes cluster, endpoint forms a control component, and the load balancing device comprises a load balancing module and an IPVS, IP change information in the Endpoint control component is acquired by the load balancing module and then transmitted to the IPVS, so that the IPVS designates a load balancing rule.
In one embodiment, the load balancing apparatus is further configured to: and acquiring the newly added and/or newly subtracted call service names, and updating the corresponding relation between the call service names and the service end nodes based on the newly added and/or newly subtracted call service names and the service end nodes corresponding to the newly added and/or newly subtracted call service names.
In one embodiment, the load balancing apparatus is further configured to: and acquiring the change data in the server node, and updating and calling the corresponding relation between the service name and the server node based on the change data in the server node.
It should be noted that, after determining that the call service name is changed or the service end node corresponding to the call service name is changed, the load balancing device may determine the corresponding relationship between the new call service name and the load balancing rule based on the corresponding relationship between the new call service name and the service end node.
Illustratively, after Service or a node corresponding to Service changes, the Endpoint control component may synchronize the information to the load balancing device in time, and then determine the load balancing for each node by the load balancing device based on the information.
Alternatively, the wireless network or wired network described above uses standard communication techniques and/or protocols. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible MarkupLanguage, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet ProtocolSecurity, IPsec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
According to the multi-cluster distributed load balancing system provided by the embodiment of the disclosure, a call request is sent through a client, then the call service request is transmitted to a corresponding node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Therefore, load balancing of flow in multiple clusters is achieved, and calculation efficiency of the container is improved.
Embodiments of the present disclosure provide a method for distributed load balancing of multiple clusters, which may be performed by any electronic device with computing processing capabilities.
Fig. 3 shows a flowchart of a multi-cluster distributed load balancing method in a third embodiment of the present disclosure, where, as shown in fig. 3, the multi-cluster distributed load balancing method provided in the embodiment of the present disclosure includes the following steps:
s302, sending a call service request through the client, wherein the call service request comprises a call service name.
In one embodiment, the method for distributed load balancing of multiple clusters described above may be applied to clusters.
In one embodiment, the call service name may include an identification of the server node.
S304, transmitting the call service request to the corresponding service end node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
In one embodiment, the correspondence of the calling Service name to the server node may include a VIP of Service or a Service name within the cluster.
In one embodiment, the correspondence of the calling service name to the server node may be generated by the cluster.
In one embodiment, after the correspondence between the calling service name and the service node is generated, when the client calls the service node, the client-called service node may be determined directly based on the correspondence.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call request is sent through a client, then the call service request is transmitted to a corresponding node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Therefore, load balancing of flow in multiple clusters is achieved, and calculation efficiency of the container is improved.
Fig. 4 shows a flowchart of a multi-cluster distributed load balancing method in an embodiment of the present disclosure, and as shown in fig. 4, the multi-cluster distributed load balancing method provided in a fourth embodiment of the present disclosure includes the following steps:
s402, sending a call service request through the client, wherein the call service request comprises a call service name.
S404, obtaining the name of the newly added and/or newly subtracted calling service.
In one embodiment, an Endpoint control component in the Kubernetes cluster may obtain a new added and/or new subtracted call service name, and then determine a service end node corresponding to the call service name based on the new added and/or new subtracted call service name.
S406, updating the corresponding relation between the calling service names and the server nodes based on the newly added and/or subtracted calling service names and the server nodes corresponding to the newly added and/or subtracted calling service names.
In one embodiment, after determining the correspondence between the calling service name and the server node, the correspondence between the calling service name and the server node may be transmitted to the distributed load balancing device.
S408, transmitting the call service request to the corresponding service end node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call service request is sent through a client, then according to the preset corresponding relation between a call service name and a service end node, after the call service name is changed, the corresponding relation between the call service name and the service end node is changed based on the changed call service name, the call service request is transmitted to the corresponding node based on the changed corresponding relation between the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the prestored corresponding relation between the call service name and the load balancing rule, and then a plurality of containers are called based on the target load balancing rule to process the call service request. Timely synchronizing the change of the corresponding relation between the calling service name and the service end node, and configuring updated load balancing rules for the node based on the changed corresponding relation between the calling service name and the service end node, so that the problem of unbalanced load of the service end node caused by change of calling service or service end node data is avoided, and the service capability of the service end node is improved.
Fig. 5 shows a flowchart of a multi-cluster distributed load balancing method in a fifth embodiment of the present disclosure, where, as shown in fig. 5, the multi-cluster distributed load balancing method provided in the embodiment of the present disclosure includes the following steps:
s502, sending a call service request through the client, wherein the call service request comprises a call service name.
S504, obtaining the change data in the server node.
In one embodiment, the Endpoint control component in the Kubernetes cluster may obtain the change data in the server node container, and then determine the server node corresponding to the calling service name based on the change data in the server node container.
In one embodiment, the change data in the containers in the server node may include increase or decrease data corresponding to containers in at least one server node in the same calling service name.
S506, updating and calling the corresponding relation between the service name and the service end node based on the change data in the service end node.
In one embodiment, after determining the correspondence between the updated calling service name and the server node, the correspondence between the calling service name and the server node may be transmitted to the distributed load balancing device.
S508, transmitting the call service request to the corresponding service end node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call request is sent through a client, then after the container in a server node is changed according to the preset corresponding relation between a call service name and the server node, the corresponding relation between the call service name and the server node is changed based on the changed corresponding relation between the call service name and the server node in the server node, the call service request is transmitted to the corresponding node based on the changed corresponding relation between the server node, so that the server node determines a target load balancing rule corresponding to the call service request based on the prestored corresponding relation between the call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Timely synchronizing the change of the corresponding relation between the calling service name and the service end node, and configuring updated load balancing rules for the node based on the changed corresponding relation between the calling service name and the service end node, so that the problem of unbalanced load of the service end node caused by change of calling service or service end node data is avoided, and the service capability of the service end node is improved.
Fig. 6 shows a flowchart of a multi-cluster distributed load balancing method in a sixth embodiment of the present disclosure, as shown in fig. 6, where the multi-cluster distributed load balancing method provided in the embodiment of the present disclosure includes the following steps:
s602, sending a call service request through the client, wherein the call service request comprises a call service name.
S604, transmitting the call service request to the corresponding service end node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
S606, obtaining the name of the newly added and/or newly subtracted calling service.
S608, updating the corresponding relation between the calling service names and the server nodes based on the newly added and/or subtracted calling service names and the server nodes corresponding to the newly added and/or subtracted calling service names.
And S610, sending the corresponding relation between the updated calling service name and the server node to a load balancing device configured on the node, so that the load balancing device updates the target load balancing rule based on the corresponding relation between the updated calling service name and the server node.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call request is sent through a client, then according to the preset corresponding relation between a call service name and a service end node, after the call service name is changed, the corresponding relation between the call service name and the service end node is changed based on the changed call service name, the call service request is transmitted to the corresponding node based on the changed corresponding relation between the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the prestored corresponding relation between the call service name and the load balancing rule, and then a plurality of containers are called based on the target load balancing rule to process the call service request. Timely synchronizing the change of the corresponding relation between the calling service name and the service end node, and configuring updated load balancing rules for the node based on the changed corresponding relation between the calling service name and the service end node, so that the problem of unbalanced load of the service end node caused by change of calling service or service end node data is avoided, and the service capability of the service end node is improved.
Fig. 7 shows a flowchart of a multi-cluster distributed load balancing method in a seventh embodiment of the present disclosure, where, as shown in fig. 7, the multi-cluster distributed load balancing method provided in the embodiment of the present disclosure includes the following steps:
s702, sending a call service request through the client, wherein the call service request comprises a call service name.
S704, transmitting the call service request to the corresponding service end node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
S706, obtaining the change data in the server node.
S708, updating and calling the corresponding relation between the service name and the service end node based on the change data in the service end node.
S710, the corresponding relation between the updated calling service name and the server node is sent to a load balancing device configured on the node, so that the load balancing device updates the target load balancing rule based on the corresponding relation between the updated calling service name and the server node.
According to the multi-cluster distributed load balancing method provided by the embodiment of the disclosure, a call request is sent through a client, then after the container in a server node is changed according to the preset corresponding relation between a call service name and the server node, the corresponding relation between the call service name and the server node is changed based on the changed corresponding relation between the call service name and the server node in the server node, the call service request is transmitted to the corresponding node based on the changed corresponding relation between the server node, so that the server node determines a target load balancing rule corresponding to the call service request based on the prestored corresponding relation between the call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Timely synchronizing the change of the corresponding relation between the calling service name and the service end node, and configuring updated load balancing rules for the node based on the changed corresponding relation between the calling service name and the service end node, so that the problem of unbalanced load of the service end node caused by change of calling service or service end node data is avoided, and the service capability of the service end node is improved.
Based on the same inventive concept, the embodiments of the present disclosure also provide a multi-cluster distributed load balancing device, as follows. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 8 is a diagram illustrating a structure of a multi-cluster distributed load balancing apparatus according to an eighth embodiment of the present disclosure, and as shown in fig. 8, a multi-cluster distributed load balancing apparatus 800 provided in an embodiment of the present disclosure includes:
a first control module 802, configured to send, through a client, a call service request, where the call service request includes a call service name;
the second control module 804 is configured to transmit a call service request to a corresponding service node according to a preset correspondence between a call service name and the service node, so that the service node determines a target load balancing rule corresponding to the call service request based on a correspondence between a pre-stored call service name and a load balancing rule, calls a plurality of containers based on the target load balancing rule to process the call service request, and sends an obtained processing result to the client, where the service node includes at least one node in a cluster, and the service node includes at least one service container.
According to the multi-cluster distributed load balancing device provided by the embodiment of the disclosure, a call request is sent through a client, then the call service request is transmitted to a corresponding node according to the preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the pre-stored call service name and the load balancing rule, and then a plurality of containers are called to process the call service request based on the target load balancing rule. Therefore, load balancing of traffic in multiple clusters is realized, and the processing capacity of the multiple clusters is improved.
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
the first acquisition module is used for acquiring the call service names which are newly added and/or subtracted;
a first updating module, configured to update a correspondence between a calling service name and a server node based on the newly added and/or subtracted calling service name and the server node corresponding to the newly added and/or subtracted calling service name
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
The second acquisition module is used for acquiring the change data in the server node;
and the second updating module is used for updating and calling the corresponding relation between the service name and the service end node based on the change data in the service end node.
In one embodiment of the present disclosure, the multi-cluster distributed load balancing apparatus further includes:
and the sending module is used for sending the corresponding relation between the updated calling service name and the server node to a load balancing device configured on the node so that the load balancing device updates the target load balancing rule based on the corresponding relation between the updated calling service name and the server node.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to such an embodiment of the present disclosure is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, and a bus 930 connecting the different system components (including the storage unit 920 and the processing unit 910).
Wherein the storage unit stores program code that is executable by the processing unit 910 such that the processing unit 910 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 910 may perform the following steps of the method embodiment described above:
sending a service calling request through a client, wherein the service calling request comprises a service calling name;
transmitting a call service request to a corresponding service node according to a preset corresponding relation between a call service name and the service node, so that the service node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the call service name and the load balancing rule, calls a plurality of containers based on the target load balancing rule to process the call service request, and sends an obtained processing result to the client, wherein the service node comprises at least one node in a cluster, and the service node comprises at least one service container.
The storage unit 920 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 9201 and/or cache memory 9202, and may further include Read Only Memory (ROM) 9203.
The storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus 930 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 900, and/or any devices (e.g., routers, modems, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 950. Also, electronic device 900 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 over the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 900, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium, which may be a readable signal medium or a readable storage medium, is also provided. On which a program product is stored which enables the implementation of the method described above of the present disclosure. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
More specific examples of the computer readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, the program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, the program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the description of the above embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for distributed load balancing of multiple clusters, comprising:
sending a service calling request through a client, wherein the service calling request comprises a service calling name;
transmitting the call service request to a corresponding service end node according to a preset corresponding relation between the call service name and the service end node, so that the service end node determines a target load balancing rule corresponding to the call service request based on the corresponding relation between the call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and transmits the obtained processing result to the client, wherein the service end node comprises at least one node in a cluster, and the service end node comprises at least one service end container.
2. The multi-cluster distributed load balancing method of claim 1, further comprising:
acquiring a call service name of the new addition and/or the new subtraction;
and updating the corresponding relation between the calling service names and the server nodes based on the newly added and/or newly subtracted calling service names and the server nodes corresponding to the newly added and/or newly subtracted calling service names.
3. The multi-cluster distributed load balancing method of claim 1, further comprising:
acquiring change data in a server node;
and updating the corresponding relation between the calling service name and the service end node based on the change data in the service end node.
4. A method of distributed load balancing of multiple clusters according to claim 2 or 3, characterized in that the method further comprises:
and sending the updated corresponding relation between the calling service name and the server node to a load balancing device configured on the node, so that the load balancing device updates the target load balancing rule based on the updated corresponding relation between the calling service name and the server node.
5. A multi-cluster distributed load balancing system, comprising: client, cluster and load balancing device;
the client is used for sending a call service request, wherein the call service request comprises a call service name;
the cluster is used for transmitting the call service request to a corresponding service end node in the cluster according to a preset corresponding relation between a call service name and the service end node so that the service end node determines a target load balancing rule corresponding to the call service request based on a corresponding relation between the call service name and the load balancing rule, calls a plurality of containers to process the call service request based on the target load balancing rule, and sends an obtained processing result to the client;
The load balancing device is used for generating the corresponding relation between the calling service name and the load balancing rule based on the corresponding relation between the calling service name and the service end node, and sending the corresponding relation between the calling service name and the load balancing rule to the cluster.
6. The multi-cluster distributed load balancing system of claim 5, wherein the load balancing means is further configured to: and acquiring a new added and/or new subtracted call service name, and updating the corresponding relation between the call service name and the load balancing rule based on the new added and/or new subtracted call service name and a service end node corresponding to the new added and/or new subtracted call service name.
7. The multi-cluster distributed load balancing system of claim 5, wherein the load balancing means is further configured to: and acquiring the change data in the server node, and updating the corresponding relation between the calling service name and the load balancing rule based on the change data in the server node.
8. A multi-cluster distributed load balancing apparatus, comprising:
the first control module is used for sending a call service request through the client, wherein the call service request comprises a call service name;
The second control module is configured to transmit the call service request to a corresponding service node according to a preset corresponding relationship between a call service name and the service node, so that the service node determines a target load balancing rule corresponding to the call service request based on a corresponding relationship between a pre-stored call service name and a load balancing rule, invokes a plurality of containers to process the call service request based on the target load balancing rule, and sends an obtained processing result to the client, where the service node includes at least one node in a cluster, and the service node includes at least one service container.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the multi-clustered distributed load balancing method of any one of claims 1 to 4 via execution of the executable instructions.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the multi-clustered distributed load balancing method of any of claims 1-4.
CN202310281770.7A 2023-03-17 2023-03-17 Multi-cluster distributed load balancing method, system, device, equipment and medium Pending CN116319570A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310281770.7A CN116319570A (en) 2023-03-17 2023-03-17 Multi-cluster distributed load balancing method, system, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310281770.7A CN116319570A (en) 2023-03-17 2023-03-17 Multi-cluster distributed load balancing method, system, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116319570A true CN116319570A (en) 2023-06-23

Family

ID=86830279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310281770.7A Pending CN116319570A (en) 2023-03-17 2023-03-17 Multi-cluster distributed load balancing method, system, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116319570A (en)

Similar Documents

Publication Publication Date Title
US20210152487A1 (en) Virtual network interface objects
CN108200165B (en) Request Transmission system, method, apparatus and storage medium
US11388261B2 (en) Cross-domain brokering protocol cloud proxy
CN110489192B (en) Remote communication method and device and electronic equipment
CN108833251B (en) Method and apparatus for controlling network interconnection
JP7418996B2 (en) Network management system, computer-implemented method for servicing remote procedure call requests, and optical communication system
CN115379010B (en) Container network construction method, device, equipment and storage medium
CN113821352A (en) Remote service calling method and device
CN114422350B (en) Public cloud container instance creation method
CN116319570A (en) Multi-cluster distributed load balancing method, system, device, equipment and medium
CN115604226A (en) Domain name query method and device based on ECS protocol, storage medium and equipment
CN115516842A (en) Orchestration broker service
CN115348310B (en) Reverse proxy method, device, system, electronic equipment and storage medium
WO2022188509A1 (en) Method and apparatus for task processing in distributed environment, and electronic device and medium
CN116566911A (en) Load balancing method, load balancing device, electronic equipment and computer readable storage medium
CN112988385A (en) Request processing method, device, system, storage medium and electronic equipment
CN117519728A (en) Container mirror image deployment method, system, device, equipment and storage medium
CN116208544A (en) Message sending method, system, device, equipment and storage medium
CN116546019A (en) Traffic management method, device, equipment and medium based on service grid
CN116319951A (en) Data processing method and device
CN114466011A (en) Metadata service request method, device, equipment and medium
CN114979026A (en) Resource allocation method, device, electronic equipment and medium
CN117914821A (en) Domain name resolution method, device, system, electronic equipment and storage medium
JP2020058011A (en) Gateway device, network system, control method and program
CN117676522A (en) Network node equipment coding and registering method, topology generating method and related equipment

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