CN112256425B - Load balancing method and system, computer cluster, information editing method and terminal - Google Patents

Load balancing method and system, computer cluster, information editing method and terminal Download PDF

Info

Publication number
CN112256425B
CN112256425B CN202011116697.0A CN202011116697A CN112256425B CN 112256425 B CN112256425 B CN 112256425B CN 202011116697 A CN202011116697 A CN 202011116697A CN 112256425 B CN112256425 B CN 112256425B
Authority
CN
China
Prior art keywords
target
service
load balancing
computer cluster
kubernetes
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
CN202011116697.0A
Other languages
Chinese (zh)
Other versions
CN112256425A (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.)
Juhaokan Technology Co Ltd
Original Assignee
Juhaokan 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 Juhaokan Technology Co Ltd filed Critical Juhaokan Technology Co Ltd
Priority to CN202011116697.0A priority Critical patent/CN112256425B/en
Priority to PCT/CN2020/130183 priority patent/WO2021120976A2/en
Publication of CN112256425A publication Critical patent/CN112256425A/en
Application granted granted Critical
Publication of CN112256425B publication Critical patent/CN112256425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

The application discloses a load balancing method and system, a computer cluster, an information editing method and a terminal, and belongs to the technical field of networks. The method comprises the following steps: receiving a service setting request sent by a terminal, wherein the service setting request is used for requesting to operate a target service of a computer cluster; updating the load balancing rule according to the service setting request and a target load balancing algorithm corresponding to the target service carried in the service setting request; and carrying out load balancing according to the load balancing rule. The application solves the problem of lower flexibility of load balancing of the computer cluster. The application is used for load balancing.

Description

Load balancing method and system, computer cluster, information editing method and terminal
Technical Field
The present application relates to the field of network technologies, and in particular, to a load balancing method and system, a computer cluster, an information editing method, and a terminal.
Background
With the development of network technology, cloud services realized by computer clusters are favored.
The computer cluster can provide multiple services (English: service), the computer cluster comprises a management node and a plurality of computing nodes (such as servers), the computer cluster shares the received service requests through the computing nodes, and the management node needs to perform load balancing on the computing nodes aiming at different services so as to ensure that the computing nodes can efficiently provide different services. In the related art, for different services, the management node adopts the default load balancing algorithm to perform load balancing.
Therefore, load balancing in a computer cluster is less flexible.
Disclosure of Invention
The application provides a load balancing method and system, a computer cluster, an information editing method and a terminal, which can solve the problem of poor flexibility of load balancing in the computer cluster. The technical scheme is as follows:
in one aspect, a load balancing method is provided, the method comprising:
receiving a service setting request sent by a terminal, wherein the service setting request is used for requesting to operate a target service of the computer cluster;
updating a load balancing rule according to the service setting request and a target load balancing algorithm corresponding to the target service carried in the service setting request;
and carrying out load balancing according to the load balancing rule.
In another aspect, there is provided an information editing method, the method including:
when an information editing instruction is received, displaying an information editing page;
receiving a target load balancing algorithm corresponding to the target service input in the information editing page;
and sending a service setting request to the computer cluster, wherein the service setting request is used for requesting to operate the target service of the computer cluster, and the service setting request carries a target load balancing algorithm corresponding to the target service.
In yet another aspect, a computer cluster is provided, the computer cluster comprising:
an interface node, configured to receive a service setting request sent by a terminal, where the service setting request is used to request to operate a target service of the computer cluster;
the load balancing node is used for updating the load balancing rule according to the service setting request and a target load balancing algorithm corresponding to the target service carried in the service setting request; and carrying out load balancing according to the load balancing rule.
In yet another aspect, there is provided a terminal including:
the communication interface is used for communicating with the computer cluster;
the display screen is used for displaying an information editing page when receiving an information editing instruction;
the processor is used for receiving a target load balancing algorithm corresponding to the target service input in the information editing page; and sending a service setting request to the computer cluster through the communication interface, wherein the service setting request carries a target load balancing algorithm corresponding to the target service.
The technical scheme provided by the application has the beneficial effects that at least:
according to the load balancing method provided by the application, the computer cluster can update the load balancing rule according to the target load balancing algorithm corresponding to the target service carried by the service setting request, so that when load balancing is performed based on the load balancing rule, the corresponding load balancing algorithm can be adopted for different services, for example, the load balancing algorithm is adopted for the target service, and the flexibility of the computer cluster in load balancing is improved.
And the service setting request carries the target load balancing algorithm, so that the computer cluster can update the load balancing rule directly according to the service setting request, thereby saving the number of requests and reducing the network overhead.
Drawings
Fig. 1 is a schematic diagram of a load balancing system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the relationship of a service, container node, and endpoint object;
fig. 3 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 4 is a block diagram of a terminal according to an embodiment of the present application;
fig. 5 is a flowchart of a load balancing method according to an embodiment of the present application;
FIG. 6 is a flowchart of an information editing method according to an embodiment of the present application;
FIG. 7 is a flowchart of another load balancing method according to an embodiment of the present application;
fig. 8 is a schematic diagram of packet flow when load balancing is performed in a computer cluster according to an embodiment of the present application;
fig. 9 is a flowchart of still another load balancing method according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
With the development of network technology, demands for network services are increasing, demands for efficient provision of services are also increasing, and then cloud platforms for implementing cloud services based on computer clusters are becoming widely used. As shown in fig. 1, a computer cluster 10 may include a management node 101 and a plurality of computing nodes 102, each of which management node 101 or computing node 102 may be a separate server; or the management node and the computing node may be deployed in multiple servers, and are composed of different modules in multiple servers, which is not limited by the embodiment of the present application. The deployment of containers may be performed in a computer cluster, which may include a plurality of containers, which are one standardized unit of software. The container may contain information required at the time of program execution, such as code, runtime, system tools, system libraries, settings, etc. Alternatively, the computer cluster may be a Kubernetes (K8 s for short) based cluster, which may be referred to as a Kubernetes cluster. Kubernetes is an open source application for managing containerization on multiple hosts (e.g., servers) in a cloud platform, and provides a mechanism for application deployment, planning, updating, and maintenance that can make containerization deployment of applications in a cluster simpler and more efficient.
The management nodes in the Kubernetes cluster can be called masters, and can also be called cluster control nodes; each computing Node may be referred to as a Node, or as a load worker Node. Each Node is assigned some workload (such as container) by a Master, and a plurality of container nodes (English: pod) can be deployed on each Node. Pod is the smallest unit which can be created and deployed in the Kubernetes cluster, is an application instance in the Kubernetes cluster, contains one or more containers and also contains resources shared by the containers. It should be noted that, each Pod has a corresponding tag (english: label) for indicating an application to which the Pod corresponds. A group of Pod with the same tag can be abstracted into a Service, that is, service can provide a unified entry for the group of Pod, and each process related to the application inside and outside the cluster can communicate through Service. The management node may manage individual services in the Kubernetes cluster. After creating Service containing label in kubernetes cluster, an endpoint (english) object with the same name is created in the cluster, so as to store the internet protocol (Internet Protocol, IP) address of Pod under the Service. FIG. 2 is a schematic diagram of the relationship of a service, container node, and endpoint object. As shown in fig. 2, the service named "my-service" has a corresponding selector (english: selector) corresponding to one parameter information of the service, for indicating a tag of the service, such as "app=myapp" for the service "in fig. 2; the port (English: port) corresponding to the service is identified as '9376- > 80'. The service is an abstraction of three pod with the names "my-pod-1", "my-pod-2" and "my-pod-3", respectively, the labels of the three pods being identical, all being "app=myapp", and the IP addresses of the three pods being "10.1.2.3", "10.1.4.5" and "10.1.3.8", respectively. The name of the endpoint object corresponding to the service is also "my-service", the endpoint object shown in fig. 2 may be an endpoint object corresponding to the service before the third pod is created, the IP address of the pod under the service, that is, "10.1.2.3" and "10.1.4.5", is recorded in the endpoint object, and the identification of the port of the service is also recorded in the endpoint object.
Service implements its communication and load balancing mechanisms through proxy components, which include proxy processes running on each node in the cluster. The proxy process is responsible for monitoring service and endpoint changes in the cluster, maintaining forwarding rules on each Node, and can realize the network proxy of Pod on the Node by using the proxy process as a specific realization carrier of the service. The Proxy component is a component for setting a load balancing rule in the Kubernetes cluster, wherein the load balancing rule can comprise a load balancing algorithm based on which load balancing is required, and the routing and forwarding rules among the processes can be determined based on the algorithm. When the Kubernetes cluster performs load balancing, a specific load balancing mode needs to be determined based on the load balancing algorithm by a management node. The load balancing rules may include iptables rules or IP virtual server (IP Virtual Server, IPVS) rules. Kubernetes clusters may support a variety of load balancing algorithms, where static load balancing algorithms may include: a Round Robin (RR) method, a Weighted RR (WRR) method, a source address Hash (SH) method, a Destination Hash (DH) method, and the like. The dynamic load balancing algorithm includes: minimum connectivity (least connections, LC) method, weighted minimum connectivity (Weighted Least Connection, WLC) method, and the like.
The following embodiments of the present application provide a load balancing method and system, which can improve the flexibility of load balancing of a computer cluster. With continued reference to fig. 1, the load balancing system may include: a computer cluster 10, and a terminal 20 connected to the computer cluster 10. The terminal 20 may be used to manage the computer cluster 10. For example, a client for managing the computer cluster 10 may be running in the terminal 20, and the terminal 20 may send a management request to the computer cluster 10, so that the computer cluster 10 performs corresponding operations based on the management request, thereby implementing management of the computer cluster 10 by the terminal 20. The terminal 20 may also request that the computer cluster provide services thereto. For example, the terminal 20 may communicate with the management node 101 in the computer cluster, such as sending a service request to the management node 101, and then the management node 101 allocates a corresponding pod to process the request based on the service request, where the computer cluster needs to perform load balancing. The terminal 20 may be a computer, or may be a smart phone, a tablet computer, a notebook computer, or other electronic devices that may perform load balancing with a computing node, which is not limited in the embodiment of the present application. Fig. 1 shows only one terminal 20 in the load balancing system 10, alternatively the load balancing system 10 may comprise a plurality of terminals, such as 3, 5 or even more. Alternatively, the computer cluster 10 and the terminal 20 may be connected through a wired network or a wireless network, where the wired network may include, but is not limited to: universal serial bus (english: universal Serial Bus; simply USB), wireless networks may include, but are not limited to: wireless fidelity (english: wireless Fidelity; abbreviated as WIFI), bluetooth, infrared, zigbee (english: zigbee), and data networks.
Fig. 3 is a schematic structural diagram of a server according to an embodiment of the present application. The server may be the computer cluster 10 described above, or may be a computing node or a management node in a computer cluster. The server includes a Central Processing Unit (CPU) 301, a system memory 304 including a Random Access Memory (RAM) 302 and a Read Only Memory (ROM) 303, and a system bus 305 connecting the system memory 304 and the central processing unit 301. The server also includes a basic input/output system (I/O system) 306, which facilitates the transfer of information between the various devices within the computer, and a mass storage device 307 for storing an operating system 313, application programs 314, and other program modules 315.
The basic input/output system 306 includes a display 308 for displaying information and an input device 309, such as a mouse, keyboard, etc., for a user to input information. Wherein the display 308 and the input device 309 are connected to the central processing unit 301 via an input output controller 310 connected to the system bus 305. The basic input/output system 306 may also include an input/output controller 310 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 310 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 307 is connected to the central processing unit 301 through a mass storage controller (not shown) connected to the system bus 305. The mass storage device 307 and its associated computer-readable media provide non-volatile storage for servers. That is, the mass storage device 307 may include a computer readable medium (not shown) such as a hard disk or CD-ROM drive.
The computer readable medium may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 304 and mass storage device 307 described above may be collectively referred to as memory.
The server may also operate in accordance with various embodiments of the application, through a network, such as the internet, connected to a remote computer on the network. I.e. the server may be connected to the network 312 via a network interface unit 311 connected to the system bus 305, or alternatively, the network interface unit 311 may be used to connect to other types of networks or remote computer systems (not shown).
The memory also includes one or more programs stored in the memory that are executed by the central processor 501.
Fig. 4 is a block diagram of a terminal according to an embodiment of the present application. The terminal 20 includes: a processor 1301, and a memory 1302.
Processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. Processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). Processor 1301 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit, image processor) for taking care of rendering and rendering of content that the display screen needs to display. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1302 may include one or more computer-readable storage media, which may be non-transitory. Memory 1302 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1302 is used to store at least one instruction for execution by processor 1301 to implement the information editing method provided by the method embodiments of the present application.
In some embodiments, the terminal 20 may further optionally include: a peripheral interface 1303 and at least one peripheral. The processor 1301, the memory 1302, and the peripheral interface 1303 may be connected by a bus or signal lines. The respective peripheral devices may be connected to the peripheral device interface 1303 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1304, a display screen 1305, a camera assembly 1306, audio circuitry 1307, a positioning assembly 1308, and a power supply 1309.
A peripheral interface 1303 may be used to connect I/O (Input/Output) related at least one peripheral to the processor 1301 and the memory 1302. In some embodiments, processor 1301, memory 1302, and peripheral interface 1303 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 1301, the memory 1302, and the peripheral interface 1303 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1304 may act as a communication interface for the terminal to ensure that the terminal communicates with the communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1304 converts an electrical signal to an electromagnetic signal for transmission, or converts a received electromagnetic signal to an electrical signal. Optionally, the radio frequency circuit 1304 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 1304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuit 1304 may also include NFC (Near Field Communication ) related circuits, which the present application is not limited to.
The display screen 1305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1305 is a touch display, the display 1305 also has the ability to capture touch signals at or above the surface of the display 1305. The touch signal may be input to the processor 1301 as a control signal for processing. At this point, the display 1305 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 1305 may be one and disposed on the front panel of the terminal 20; in other embodiments, the display 1305 may be at least two, disposed on different surfaces of the terminal 20 or in a folded configuration; in other embodiments, the display 1305 may be a flexible display disposed on a curved surface or a folded surface of the terminal 20. Even more, the display screen 1305 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display screen 1305 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 1306 is used to capture images or video. Optionally, camera assembly 1306 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1306 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 1307 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 1301 for processing, or inputting the electric signals to the radio frequency circuit 1304 for voice communication. For stereo acquisition or noise reduction purposes, a plurality of microphones may be provided at different portions of the terminal 20, respectively. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is then used to convert electrical signals from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 1307 may also comprise a headphone jack.
The location component 1308 is used to locate the current geographic location of the terminal 20 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 1308 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, or the Galileo system of Russia.
A power supply 1309 is used to power the various components in the terminal 20. The power supply 1309 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1309 comprises a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 20 further includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: acceleration sensor 1311, gyroscope sensor 1312, pressure sensor 1313, fingerprint sensor 1314, optical sensor 1315, and proximity sensor 1316.
The acceleration sensor 1311 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 20. For example, the acceleration sensor 1311 may be used to detect components of gravitational acceleration in three coordinate axes. Processor 1301 may control display screen 1305 to display a user interface in either a landscape view or a portrait view based on gravitational acceleration signals acquired by acceleration sensor 1311. The acceleration sensor 1311 may also be used for the acquisition of motion data of a game or user.
The gyro sensor 1312 may detect a body direction and a rotation angle of the terminal 20, and the gyro sensor 1312 may collect a 3D motion of the user on the terminal 20 in cooperation with the acceleration sensor 1311. Processor 1301 can implement the following functions based on the data collected by gyro sensor 1312: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 1313 may be disposed on a side frame of the terminal 20 and/or below the display screen 1305. When the pressure sensor 1313 is disposed on the side frame of the terminal 20, a grip signal of the terminal 20 by the user may be detected, and the processor 1301 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 1313. When the pressure sensor 1313 is disposed at the lower layer of the display screen 1305, the processor 1301 realizes control of the operability control on the UI interface according to the pressure operation of the user on the display screen 1305. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 1314 is used to collect a fingerprint of the user, and the processor 1301 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 1314, or the fingerprint sensor 1314 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by processor 1301 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 1314 may be disposed on the front, back, or side of the terminal 20. When a physical key or vendor Logo is provided on the terminal 20, the fingerprint sensor 1314 may be integrated with the physical key or vendor Logo.
The optical sensor 1315 is used to collect ambient light intensity. In one embodiment, processor 1301 may control the display brightness of display screen 1305 based on the intensity of ambient light collected by optical sensor 1315. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 1305 is turned up; when the ambient light intensity is low, the display brightness of the display screen 1305 is turned down. In another embodiment, processor 1301 may also dynamically adjust the shooting parameters of camera assembly 1306 based on the intensity of ambient light collected by optical sensor 1315.
A proximity sensor 1316, also known as a distance sensor, is typically provided on the front panel of the terminal 20. The proximity sensor 1316 is used to collect the distance between the user and the front face of the terminal 20. In one embodiment, when the proximity sensor 1316 detects a gradual decrease in the distance between the user and the front face of the terminal 20, the processor 1301 controls the display screen 1305 to switch from the on-screen state to the off-screen state; when the proximity sensor 1316 detects that the distance between the user and the front surface of the terminal 20 gradually increases, the processor 1301 controls the display screen 1305 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 4 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
Fig. 5 is a flowchart of a load balancing method according to an embodiment of the present application, which may be used for the computer cluster 10 in fig. 1. As shown in fig. 5, the method may include:
step 501, a service setting request sent by a terminal is received, where the service setting request is used to request to operate a target service of a computer cluster.
Step 502, updating a load balancing rule according to the service setting request and a target load balancing algorithm corresponding to the target service carried in the service setting request.
And 503, carrying out load balancing according to the load balancing rule.
In summary, in the load balancing method provided by the embodiment of the application, the computer cluster can update the load balancing rule according to the target load balancing algorithm corresponding to the target service carried by the service setting request, so that when load balancing is performed based on the load balancing rule, the corresponding load balancing algorithm can be adopted for different services, for example, the load balancing algorithm is adopted for the target service, and the flexibility of the computer cluster in load balancing is improved.
And the service setting request carries the target load balancing algorithm, so that the computer cluster can update the load balancing rule directly according to the service setting request, thereby saving the number of requests and reducing the network overhead.
Fig. 6 is a flowchart of an information editing method according to an embodiment of the present application, which may be used for the terminal 20 shown in fig. 1 or fig. 4. As shown in fig. 6, the method may include:
and 601, displaying an information editing page when an information editing instruction is received.
Step 602, receiving a target load balancing algorithm corresponding to a target micro-service input in an information editing page.
Step 603, a service setting request is sent to the computer cluster, where the service setting request is used to request to operate a target service of the computer cluster, and the service setting request instruction carries a target load balancing algorithm corresponding to the target service.
In summary, in the information editing method provided by the embodiment of the present application, the service setting request sent by the terminal to the computer cluster may carry the target load balancing algorithm corresponding to the target service. Therefore, the computer cluster can update the load balancing rule according to the target load balancing algorithm, and further when load balancing is performed based on the load balancing rule, the corresponding load balancing algorithm can be adopted for different services, for example, the load balancing algorithm is adopted for target service to perform load balancing, and the flexibility of the computer cluster in performing load balancing can be improved.
And the service setting request carries the target load balancing algorithm, so that the computer cluster can update the load balancing rule directly according to the service setting request, thereby saving the number of requests and reducing the network overhead.
Fig. 7 is a flowchart of another load balancing method according to an embodiment of the present application, which may be used in the load balancing system shown in fig. 1. As shown in fig. 7, the method may include:
and 701, when the terminal receives the information editing instruction, displaying an information editing page. Step 702 is performed.
The computer cluster may support the use of multiple applications, each of which may correspond to a service in the computer cluster to fulfill various operating requirements of the application. The developer can operate each service in the computer cluster through the terminal (such as a computer), for example, the developer can perform deployment operation or update operation on the service in the computer cluster. For example, when an application supported by a computer cluster needs to be updated, a developer may send a code required for updating the application to the computer cluster through a computer connected to the computer cluster, and enable a service corresponding to the application in the computer cluster to be updated accordingly. Alternatively, the developer may write the code directly on the computer, or may send the code written on other devices to the computer cluster through the computer.
When a developer needs to operate the service in the computer cluster, the developer can operate on the terminal to trigger the terminal to receive the information editing instruction, and then the display screen of the terminal can display the information editing page according to the information editing instruction. For example, the information editing page may be a code input page, and a developer may input information required by the computer cluster to operate the service, such as a code of the service or parameters of the service, in the information editing page.
Step 702, the terminal receives a target load balancing algorithm corresponding to the target service input in the information editing page. Step 703 is performed.
In an alternative example, a developer may write the content of the load balancing algorithm corresponding to the target service in the information editing page displayed on the display screen of the terminal, and accordingly the terminal may receive the target load balancing algorithm input in the information editing page.
In another optional example, the target load balancing algorithm is any one of a plurality of load balancing algorithms supported by the computer cluster, and corresponding identifiers are preset for the plurality of load balancing algorithms, so that a developer can directly input the identifier of the target load balancing algorithm in the information editing page. For example, the identifier of the load balancing algorithm may be a name set for the load balancing algorithm, where the name may indicate a load balancing manner of the load balancing algorithm, for example, a name of the polling method may be RR, and a worker may directly learn an implementation manner of the load balancing algorithm according to the name. Alternatively, the identification of the load balancing algorithm may be represented by an arbitrarily set value, for example, "1" may be used to represent the polling method, and "2" may be used to represent the minimum connection method. Optionally, a load balancing algorithm option may be displayed in the information editing page, and the developer may trigger (e.g., click on) the load balancing option to select a target load balancing algorithm corresponding to the target service. By way of example, after the load balancing algorithm option is triggered, the display screen of the terminal may display the identifiers of the various load balancing algorithms supported by the computer cluster, and the staff may click on the displayed identifiers to select the corresponding load balancing algorithm as the target load balancing algorithm.
Alternatively, the target load balancing algorithm corresponding to the target service may be recorded in the operation setting content of the target service, which may also be referred to as service details, e.g., the operation setting content may include service codes and comments (english), and the target load balancing algorithm is recorded in the comments in the operation setting content of the target service. For example, the developer may set the content at the operation of the target service entered in the information editing page, and trigger a load balancing option when writing the comment in the operation set content, select the target load balancing algorithm, and record the identification of the target load balancing algorithm in the comment.
In step 703, the terminal sends a service setting request to the computer cluster, where the service setting request is used to request to operate a target service of the computer cluster, and the service setting request carries a target load balancing algorithm corresponding to the target service. Step 704 is performed.
After finishing editing the operation setting content of the target service, the developer can trigger the terminal to generate a service setting request according to the operation setting content and send the service setting request to the computer cluster. Accordingly, the computer cluster may receive the service setting request sent by the terminal. The service setting request carries a target load balancing algorithm corresponding to the target service; if the service setting request carries operation setting content of the target service, the target load balancing algorithm is recorded in notes in the operation setting content. The service set request is for requesting an operation on a target service of the computer cluster. Optionally, the operation requested by the service setting request to perform the target service may include an update operation of the service or a deployment operation of the service, where the update operation of the service is to update a service originally existing in the computer cluster, and the deployment operation of the service is to add a service not originally existing in the computer cluster.
Optionally, the computer cluster includes an application programming interface Server (Application Programming Interface Server, API Server) component and a storage component. The storage component may be an Etcd component that discovers the storage repository for a highly available, strongly consistent service. Alternatively, the API Server component and the storage component may each be deployed in multiple nodes of a computer cluster. The API server component serves as a unified portal for the computer cluster, and the coordinator of each component in the computer cluster provides interface services in a hypertext transfer protocol (Hypertext transfer protocol, HTTP) API. The operations of adding, modifying, deleting, checking and monitoring the resources of the service in the computer cluster can be processed by the API Server component and then submitted to the Etcd component for storage. Wherein, the increase of the resource of the service is the deployment operation of the service, and the modification of the resource of the service is the update operation of the service. In the embodiment of the application, the terminal can send the service setting request to the API Server component of the computer cluster to request to operate the target service. The API Server can write the operation setting content of the target service carried by the service setting request into the Etcd component to realize the operation of the target service. When the target service is operated, the endpoint object corresponding to the target service will also change accordingly. The following embodiments of the present application will be explained taking an operation of a target service as an update operation as an example.
Step 704, the computer cluster determines whether the service setting request carries a target load balancing algorithm corresponding to the target service. If the service setting request carries a target load balancing algorithm corresponding to the target service, executing step 705; if the service request does not carry the target load balancing algorithm corresponding to the target service, step 706 is executed.
After receiving the service setting request, the computer cluster can acquire information carried by the service setting request and analyze the information to judge whether the service setting request carries a target load balancing algorithm corresponding to the target service. For example, the computer cluster may directly obtain the comment in the operation setting content carried by the service setting request, and determine whether the comment includes the target load balancing algorithm or the identifier thereof.
For example, proxy components running in each Node in the computer cluster may monitor each service and corresponding endpoint object in the computer cluster, such as list-monitoring (english: list-watch) of services and endpoints stored in the Etcd component. When the service and the corresponding endpoint object are determined to be changed, if the service is updated, the annotation in the operation setting content of the target service carried by the service setting request can be obtained, and then whether the identification of the target load balancing algorithm corresponding to the target service is recorded in the annotation is judged. Optionally, the identifier of the target load balancing algorithm may be recorded at a preset position in the annotation, and the proxy component may directly obtain information of the preset position, and determine whether the information is the identifier of the target load balancing algorithm. For example, the proxy component may compare the information of the preset location with the identifiers of the plurality of load balancing algorithms supported by the computer cluster, and determine whether the identifiers of the plurality of load balancing algorithms have the same identifier as the information. When the identifiers of the plurality of load balancing algorithms are the same as the information, determining that the service setting request carries a target load balancing algorithm corresponding to the target service, and determining that the load balancing algorithm indicated by the identifiers is the target load balancing algorithm. And when the identifiers of the load balancing algorithms are different from the information, determining that the service setting request does not carry the target load balancing algorithm corresponding to the target service.
Step 705, the computer cluster updates the load balancing rule according to the target load balancing algorithm. Step 707 is performed.
In the embodiment of the application, a load balancing algorithm required to be adopted when load balancing is carried out and state information of each pod in the computer cluster are recorded in a load balancing rule. When the computer cluster determines that the service setting request carries the target load balancing algorithm corresponding to the target service, the load balancing algorithm in the load balancing rule can be updated, and the load balancing algorithm corresponding to the target service in the service setting request is set as the target load balancing algorithm. The updating of the load balancing rules may be performed by a proxy component in the computer cluster. Optionally, the proxy component in the computer cluster may also update other content in the load balancing rule according to the operation of the API Server component on the service. For example, when monitoring an adding or deleting operation to a pod in a service, the proxy component updates state information of each pod in the service in a load balancing rule; or when the source address, the destination address or the port corresponding to the pod in the service is changed, the related information of the pod in the load balancing rule can be updated correspondingly.
Optionally, the load balancing rules in the computer cluster may include rules corresponding to each pod in the cluster, where each pod may correspond to a rule, and the load balancing rule may indicate a status of the pod, for example, indicate whether the pod can be used normally, and a source address, a destination address, a port, and the like corresponding to a request that the pod can process. The load balancing algorithm for the target service in the load balancing rule may be recorded in other positions than the rule corresponding to the pod.
In step 706, the computer cluster updates the load balancing rule according to the default load balancing algorithm. Step 707 is performed.
The computer cluster may correspond to a default load balancing algorithm, such as polling. When the computer cluster determines that the service setting request does not carry the target load balancing algorithm corresponding to the target service, the load balancing rule can be updated according to the default load balancing algorithm. Alternatively, the proxy component in the computer cluster may update other content outside the load balancing algorithm in the load balancing rule only according to the operation of the API Server component on the service at this time. For example, when a proxy component monitors a new add or delete operation to a pod in a service, the proxy component updates the state information of each pod in the service in the load balancing rule; or when the source address, the destination address or the port corresponding to the pod in a certain service is changed, the relevant information of the pod in the load balancing rule can be updated correspondingly. Other descriptions of the load balancing rule may refer to the related descriptions of step 705, and the embodiments of the present application are not repeated.
Step 707, the terminal sends a service request for the target service to the computer cluster. Step 708 is performed.
For example, an application supported by the target service may be run on the terminal, and when the user uses the application through the terminal, the user may trigger the terminal to send a service request for the target service to the computer cluster, so as to request the computer cluster to provide a corresponding service for the user.
Step 708, when the computer cluster receives the service request, load balancing is performed according to the load balancing rule.
When the computer cluster receives the service request sent by the terminal, the route required by processing the service request can be determined according to a load balancing algorithm, and further, the equipment for actually processing the service request or the computing resource in the equipment are determined so as to instruct the equipment to actually process the service request. For example, the service request sent by the terminal may carry a Cluster IP (english: cluster IP) of the target service, so as to indicate the service for which the service request is directed as the target service, where the Cluster IP is a unique IP address of the service in the computer Cluster. The terminal may send a service request to a load balancer (DS) in the computer cluster. The Director Server can route and forward according to the Cluster IP of the target service through a load balancing rule, and finally sends the service request sent by the terminal to a Real Server (RS) for actually processing the request, for example, to a real back-end Pod in the real Server.
Fig. 8 is a schematic diagram of a packet flow when load balancing is performed in a computer cluster according to an embodiment of the present application, and fig. 8 is illustrated by taking an IPVS rule as an example of a load balancing rule based on which load balancing is performed in the computer cluster. As shown in fig. 8, the terminal 20 may send the generated service request to the load balancer, and the operating system of the load balancer may include a kernel space and a user space, where the kernel space includes five chains, namely a pre-route (pre) chain, a packet In (INPUT) chain, a packet Out (OUTPUT) chain, a forwarding (forwarding) chain, and a post-route (post) chain. The service request sent by the terminal will reach the pre-routing chain in the kernel space of the load balancer first. The source address of the message is Client IP (CIP), that is, the IP address of the terminal, the destination address is Virtual IP (VIP), and the VIP is a cluster IP. The core of the load balancer can determine whether the destination address carried in the data packet of the service request is the address of the local machine, and when the destination address is determined to be the address of the local machine, the data packet can be sent to the INPUT chain. When a packet reaches the INPUT chain, the IPVS checks whether the destination address and the port identifier carried in the packet are in the IPVS rule, so as to determine whether the service requested by the packet is cluster service. If the destination address and port carried in the packet are not present in the IPVS rules, the INPUT chain sends the packet to the user space. If the destination address and port identification carried in the packet is present in the IPVS rules, then the IPVS may determine the backend server that processed the packet using the load balancing algorithm specified by the IPVS rules, and then the INPUT chain changes the destination address carried by the packet to the address of the backend server, i.e., the packet is destination address translated (Destination Network Address Translation, DNAT). The source address of the data message is CIP, and the destination address is the address (Real Server IP, RIP) of the Real Server of the back end. The INPUT chain may then send the packet after the destination address change to a POSROUTING chain, which determines a routing path, and sends the packet to a backend Real Server (Real Server) for processing by the Real Server. After receiving the data packet, the Real Server can detect whether the destination address of the data packet is the address of the local machine, and when determining that the destination address of the data packet is the address of the local machine, the Real Server processes the data packet and starts to construct a response message to be sent back to the Director Server. The source address of the data message is RIP and the destination address is CIP. Before responding to the terminal, the Director Server modifies the source address of the data packet into its own VIP address, and then responds to the terminal, wherein the source address of the data packet is VIP and the destination address is CIP.
The above embodiments of the present application take only a service setting request as an example of a request for operating only for one target service, alternatively, the service setting request may be a request for operating for a plurality of target services. For each of the plurality of target services, the load balancing system may execute steps 701 to 708, which are not described in detail in the embodiments of the present application.
It should be noted that, in the related art, a load balancing algorithm may be set only at the cluster level, and the same load balancing algorithm is adopted for all services in the computer cluster, that is, when requests for different services are received, the default load balancing algorithm is adopted to determine computing resources for processing the requests. In the embodiment of the application, the corresponding load balancing algorithm can be set for each service in the computer cluster, so that after the computer cluster receives the service request of the terminal, the computer cluster can adopt the proper load balancing algorithm for different services to carry out load balancing, the characteristics of the computer cluster for supporting various load balancing algorithms can be fully utilized, and the flexibility of the computer cluster for carrying out load balancing is improved.
In summary, in the load balancing method provided by the embodiment of the application, the computer cluster can update the load balancing rule according to the target load balancing algorithm corresponding to the target service carried by the service setting request, so that when load balancing is performed based on the load balancing rule, the corresponding load balancing algorithm can be adopted for different services, for example, the load balancing algorithm is adopted for the target service, and the flexibility of the computer cluster in load balancing is improved.
And the service setting request carries the target load balancing algorithm, so that the computer cluster can update the load balancing rule directly according to the service setting request, thereby saving the number of requests and reducing the network overhead.
The load balancing method in the embodiment of the application can be implemented by matching different nodes in the computer cluster, and the load balancing method in the embodiment of the application is introduced by taking the computer cluster comprising three nodes, namely an interface node, a storage node and a load balancing node as examples. Fig. 9 is a flowchart of yet another load balancing method according to an embodiment of the present application, as shown in fig. 9, where the method may include:
Step 901, when receiving an information editing instruction, the terminal displays an information editing page. Step 902 is performed.
It should be noted that, step 901 may refer to step 701, and the embodiments of the present application are not described herein again.
Step 902, the terminal receives a target load balancing algorithm corresponding to the target service input in the information editing page. Step 903 is performed.
It should be noted that, step 902 may refer to step 702, and embodiments of the present application are not described herein.
In step 903, the terminal sends a service setting request to the interface node, where the service setting request is used to request to operate a target service of the computer cluster, the service setting request carries operation setting content of the target service, and a target load balancing algorithm is recorded in an annotation in the operation setting content. Step 904 is performed.
It should be noted that, step 903 may refer to step 703, which is not described herein.
Step 904, the interface node stores the operation setting content of the target service in the storage node, so as to operate the target service according to the service setting request. Step 905 is performed.
For example, the service setting request may be used to request update or deployment of the target service, and the interface node may add, modify, or delete related information of the target service stored in the storage node according to the request, so as to implement an operation on the target service. It should be noted that, in step 903, reference may be made to the description related to the content of the operation setting stored in step 703, which is not described in detail in the embodiment of the present application.
In step 905, the load balancing node monitors the target service in the storage node. Step 906 is performed.
It should be noted that, step 905 may refer to the related description of the proxy component monitoring service and the end points in step 704, which is not described in detail in the embodiment of the present application.
Step 906, when the load balancing node monitors that the target service in the storage node changes, judging whether a target load balancing algorithm corresponding to the target service is recorded in an annotation in operation setting content of the target service. If the annotation in the operation setting content records a target load balancing algorithm corresponding to the target service, executing step 907; if the target load balancing algorithm corresponding to the target service is not recorded in the annotation in the operation setting content, step 908 is executed.
It should be noted that, step 906 may refer to step 704, which is not described in detail in the embodiment of the present application.
And step 907, the load balancing node updates the load balancing rule according to the target load balancing algorithm. Step 709 is performed.
It should be noted that, step 907 may refer to step 705, which is not described in detail in the embodiment of the present application.
Step 908, the load balancing node updates the load balancing rule according to the default load balancing algorithm. Step 709 is performed.
It should be noted that, step 908 may refer to step 706, which is not described in detail in the embodiment of the present application.
Step 909, the terminal sends a service request for the target service to the interface node. Step 910 is performed.
It should be noted that, in step 909, reference may be made to step 707, which is not described in detail in the embodiment of the present application.
In step 910, when the interface node receives the service request, the load balancing node performs load balancing according to the load balancing rule.
It should be noted that, step 910 may refer to step 708, which is not described in detail in the embodiment of the present application.
In summary, in the load balancing method provided by the embodiment of the present application, the load balancing node in the computer cluster may update the load balancing rule according to the target load balancing algorithm corresponding to the target service carried by the service setting request, so when load balancing is performed based on the load balancing rule, the load balancing node may use the corresponding load balancing algorithm for different services, for example, use the target load balancing algorithm for the target service to perform load balancing, thereby improving the flexibility of performing load balancing for the computer cluster.
And the service setting request carries the target load balancing algorithm, so that the computer cluster can update the load balancing rule directly according to the service setting request, thereby saving the number of requests and reducing the network overhead.
It should be understood that the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to those elements expressly listed but may include other elements not expressly listed or inherent to such product or apparatus. The term "module" as used in this disclosure refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the function associated with that element.
It should be noted that, the method embodiment provided in the embodiment of the present application can be referred to with the corresponding device embodiment, and the embodiment of the present application is not limited thereto. The sequence of the steps of the method embodiment provided by the embodiment of the application can be properly adjusted, the steps can be correspondingly increased or decreased according to the situation, and any method which is easily conceivable to be changed by a person skilled in the art within the technical scope of the disclosure of the application is covered in the protection scope of the application, so that the description is omitted.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, where the program in the computer readable storage medium runs on a computer, so that the computer performs the load balancing method provided by the embodiments of the present application. The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, cause the computer to execute the load balancing method provided by the embodiment of the application.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.

Claims (6)

1. A method of load balancing for Kubernetes computer clusters, the method comprising:
receiving a service setting request sent by a terminal through an application programming interface server, wherein the service setting request is used for requesting to operate a first target service of the Kubernetes computer cluster, the application programming interface server is a unified portal of the Kubernetes computer cluster, the first target service is any one of a plurality of services in the Kubernetes computer cluster, one service comprises a plurality of container nodes with the same label, and the one service provides a unified portal for the plurality of container nodes included in the service;
Responsive to an operation performed on the first target service, correspondingly changing a first endpoint object of the first target service;
when a proxy component detects that a first endpoint object changes, determining whether an identifier of a first target equalization algorithm in an annotation is matched with an identifier of a target equalization algorithm supported by the Kubernetes computer cluster, wherein the first endpoint object is an endpoint object corresponding to the first target service, the proxy component is used for setting a component of a load equalization rule in the Kubernetes cluster, the proxy component comprises a proxy process running on each node in the cluster, and the annotation is an annotation in operation setting content of a first target service carried by a service setting request;
when the identification of a first target balancing algorithm in the annotation is matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls to update a first load balancing rule of the first target service to update a target load balancing algorithm corresponding to the first target service to be the first target balancing algorithm; when the identification of the first target balancing algorithm in the annotation is not matched with the identification of the target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls the target load balancing algorithm corresponding to the first target service to be updated into a default balancing algorithm;
And when a service request aiming at the first target service is received, carrying out load balancing according to an updated target load balancing algorithm corresponding to the first target service.
2. The method of claim 1, wherein the operation comprises an update operation of a service or a deployment operation of a service.
3. An information editing method, applied to a terminal, comprising:
when an information editing instruction is received, displaying an information editing page;
receiving operation setting content of a first target service input in the information editing page, wherein an identification of a first target load balancing algorithm corresponding to the first target service is recorded in notes in the operation setting content, and the first target service is any one of a plurality of services in a Kubernetes computer cluster;
sending a service setting request to the Kubernetes computer cluster, so that the Kubernetes computer cluster receives the service setting request through an application programming interface server, wherein the service setting request is used for requesting to operate a first target service of the Kubernetes computer cluster, the application programming interface server is a unified portal of the Kubernetes computer cluster, the first target service is any one of a plurality of services in the computer cluster, one service comprises a plurality of container nodes with the same label, and one service provides a unified portal for the plurality of container nodes included in the service; and causing the Kubernetes computer cluster to correspondingly change a first endpoint object of the first target service in response to an operation performed on the first target service; when a proxy component detects that a first end point object is changed, determining whether an identifier of a first target balancing algorithm in an annotation is matched with an identifier of a target balancing algorithm supported by the Kubernetes computer cluster, wherein the first end point object is an end point object corresponding to the first target service, the proxy component is used for setting a component of a load balancing rule in the Kubernetes cluster, the proxy component comprises a proxy process running on each node in the cluster, and the annotation is an annotation in operation setting content of a first target service carried by a service setting request; when the identification of a first target balancing algorithm in the annotation is matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, enabling the proxy component to control and update a first load balancing rule of the first target service so as to update a target load balancing algorithm corresponding to the first target service to be the first target balancing algorithm; when the identification of a first target balancing algorithm in the annotation is not matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls the target load balancing algorithm corresponding to the first target service to be updated into a default balancing algorithm; and when the Kubernetes computer cluster receives the service request aiming at the first target service, carrying out load balancing according to the updated target load balancing algorithm corresponding to the first target service.
4. A computer cluster, wherein the computer cluster is a Kubernetes computer cluster, the Kubernetes computer cluster comprising:
an interface node, configured to receive a service setting request sent by a terminal through an application programming interface server, where the service setting request is used to request to operate a first target service of the Kubernetes computer cluster, where the application programming interface server is a unified entry of the Kubernetes computer cluster, the first target service is any one of multiple services in the Kubernetes computer cluster, one service includes multiple container nodes with the same label, and one service provides a unified entry for multiple container nodes included in the first target service; responsive to an operation performed on the first target service, correspondingly changing a first endpoint object of the first target service;
the load balancing node is used for determining whether the identification of a first target balancing algorithm in the annotation is matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster when the first end point object is detected to be changed through the proxy component, wherein the first end point object is an end point object corresponding to the first target service, the proxy component is used for setting a component of a load balancing rule in the Kubernetes cluster, the proxy component comprises a proxy process running on each node in the cluster, and the annotation is an annotation in operation setting content of the first target service carried by the service setting request; when the identification of a first target balancing algorithm in the annotation is matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls to update a first load balancing rule of the first target service to update a target load balancing algorithm corresponding to the first target service to be the first target balancing algorithm; when the identification of the first target balancing algorithm in the annotation is not matched with the identification of the target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls the target load balancing algorithm corresponding to the first target service to be updated into a default balancing algorithm; and when a service request aiming at the first target service is received, carrying out load balancing according to an updated target load balancing algorithm corresponding to the first target service.
5. A terminal for load balancing, the terminal comprising:
the communication interface is used for communicating with the Kubernetes computer cluster;
the display screen is used for displaying an information editing page when receiving an information editing instruction;
the processor is used for receiving operation setting content of a first target service input in the information editing page, an identification of a first target load balancing algorithm corresponding to the first target service is recorded in notes in the operation setting content, and the first target service is any one of a plurality of services in the Kubernetes computer cluster; sending a service setting request to the Kubernetes computer cluster, so that the Kubernetes computer cluster receives the service setting request through an application programming interface server, wherein the service setting request is used for requesting to operate a first target service of the Kubernetes computer cluster, the application programming interface server is a unified portal of the Kubernetes computer cluster, the first target service is any one of a plurality of services in the computer cluster, one service comprises a plurality of container nodes with the same label, and one service provides a unified portal for the plurality of container nodes included in the service; and causing the Kubernetes computer cluster to correspondingly change a first endpoint object of the first target service in response to an operation performed on the first target service; when a proxy component detects that a first end point object is changed, determining whether an identifier of a first target balancing algorithm in an annotation is matched with an identifier of a target balancing algorithm supported by the Kubernetes computer cluster, wherein the first end point object is an end point object corresponding to the first target service, the proxy component is used for setting a component of a load balancing rule in the Kubernetes cluster, the proxy component comprises a proxy process running on each node in the cluster, and the annotation is an annotation in operation setting content of a first target service carried by a service setting request; when the identification of a first target balancing algorithm in the annotation is matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, enabling the proxy component to control and update a first load balancing rule of the first target service so as to update a target load balancing algorithm corresponding to the first target service to be the first target balancing algorithm; when the identification of a first target balancing algorithm in the annotation is not matched with the identification of a target balancing algorithm supported by the Kubernetes computer cluster, the proxy component controls the target load balancing algorithm corresponding to the first target service to be updated into a default balancing algorithm; and when the Kubernetes computer cluster receives the service request aiming at the first target service, carrying out load balancing according to the updated target load balancing algorithm corresponding to the first target service.
6. A load balancing system, the load balancing system comprising: the computer cluster of claim 4 and the terminal of claim 5; the terminal is connected with the computer cluster.
CN202011116697.0A 2020-10-19 2020-10-19 Load balancing method and system, computer cluster, information editing method and terminal Active CN112256425B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011116697.0A CN112256425B (en) 2020-10-19 2020-10-19 Load balancing method and system, computer cluster, information editing method and terminal
PCT/CN2020/130183 WO2021120976A2 (en) 2020-10-19 2020-11-19 Load balance control method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011116697.0A CN112256425B (en) 2020-10-19 2020-10-19 Load balancing method and system, computer cluster, information editing method and terminal

Publications (2)

Publication Number Publication Date
CN112256425A CN112256425A (en) 2021-01-22
CN112256425B true CN112256425B (en) 2023-10-20

Family

ID=74245468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011116697.0A Active CN112256425B (en) 2020-10-19 2020-10-19 Load balancing method and system, computer cluster, information editing method and terminal

Country Status (2)

Country Link
CN (1) CN112256425B (en)
WO (1) WO2021120976A2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764886A (en) * 2021-01-29 2021-05-07 上海弘积信息科技有限公司 Load balancing controller based on Kubernetes platform
CN112822061B (en) * 2021-04-16 2021-07-20 杭州朗澈科技有限公司 Method and system for exposing service to outside by edge node
CN113676524A (en) * 2021-08-09 2021-11-19 浪潮云信息技术股份公司 Method for realizing multi-CPU architecture container network proxy
CN115134424B (en) * 2022-06-29 2024-02-02 中国工商银行股份有限公司 Load balancing method, load balancing device, computer equipment, storage medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945000A (en) * 2014-05-05 2014-07-23 安徽科大讯飞信息科技股份有限公司 Load balance method and load balancer
CN104394224A (en) * 2014-11-28 2015-03-04 无锡华云数据技术服务有限公司 Load balance system
CN110868465A (en) * 2019-11-13 2020-03-06 北京浪潮数据技术有限公司 Load balancing system and method for container cloud

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7757236B1 (en) * 2004-06-28 2010-07-13 Oracle America, Inc. Load-balancing framework for a cluster
CN105141541A (en) * 2015-09-23 2015-12-09 浪潮(北京)电子信息产业有限公司 Task-based dynamic load balancing scheduling method and device
CN110858159A (en) * 2018-08-24 2020-03-03 三星电子株式会社 Electronic device and method for load balancing in a multi-core processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945000A (en) * 2014-05-05 2014-07-23 安徽科大讯飞信息科技股份有限公司 Load balance method and load balancer
CN104394224A (en) * 2014-11-28 2015-03-04 无锡华云数据技术服务有限公司 Load balance system
CN110868465A (en) * 2019-11-13 2020-03-06 北京浪潮数据技术有限公司 Load balancing system and method for container cloud

Also Published As

Publication number Publication date
WO2021120976A2 (en) 2021-06-24
CN112256425A (en) 2021-01-22
WO2021120976A3 (en) 2021-08-19

Similar Documents

Publication Publication Date Title
CN108881030B (en) Routing method and device in gray release scene
CN112256425B (en) Load balancing method and system, computer cluster, information editing method and terminal
CN111225042B (en) Data transmission method and device, computer equipment and storage medium
CN112153071B (en) Message sending method, device, gateway and storage medium
CN108833607B (en) Physical address acquisition method, device and readable medium
WO2020001564A1 (en) Method, apparatus, and system for processing tasks
CN110704324B (en) Application debugging method, device and storage medium
CN112749362B (en) Control creation method, device, equipment and storage medium
CN111427949B (en) Method and device for creating big data service
CN111159604A (en) Picture resource loading method and device
CN110636144A (en) Data downloading method and device
CN111866140A (en) Fusion management apparatus, management system, service calling method, and medium
CN109828915B (en) Method, device, equipment and storage medium for debugging application program
CN111813322A (en) Method, device and equipment for creating storage pool and storage medium
CN113469360B (en) Reasoning method and device
CN110086814B (en) Data acquisition method and device and storage medium
CN111324293B (en) Storage system, data storage method, data reading method and device
CN112905328B (en) Task processing method, device and computer readable storage medium
CN112597417B (en) Page updating method and device, electronic equipment and storage medium
CN111191254B (en) Access verification method, device, computer equipment and storage medium
CN110569064B (en) Interface identifier generation method, device, equipment and storage medium
CN113076452A (en) Application classification method, device, equipment and computer readable storage medium
CN113158099A (en) Page display method and device and storage medium
CN111158791A (en) Configuration file updating method, device and system and storage medium
CN110851435A (en) Data storage method and device

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