WO2023207189A1 - Load balancing method and system, computer storage medium, and electronic device - Google Patents

Load balancing method and system, computer storage medium, and electronic device Download PDF

Info

Publication number
WO2023207189A1
WO2023207189A1 PCT/CN2022/142981 CN2022142981W WO2023207189A1 WO 2023207189 A1 WO2023207189 A1 WO 2023207189A1 CN 2022142981 W CN2022142981 W CN 2022142981W WO 2023207189 A1 WO2023207189 A1 WO 2023207189A1
Authority
WO
WIPO (PCT)
Prior art keywords
cloud host
load balancing
target
domain name
idle
Prior art date
Application number
PCT/CN2022/142981
Other languages
French (fr)
Chinese (zh)
Inventor
刘凯
赵建星
樊建刚
Original Assignee
京东科技信息技术有限公司
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 京东科技信息技术有限公司 filed Critical 京东科技信息技术有限公司
Publication of WO2023207189A1 publication Critical patent/WO2023207189A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • 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/10Protocols in which an application is distributed across nodes in the network

Definitions

  • the present disclosure relates to the technical field of cloud computing, and in particular to a load balancing method, a load balancing system, a computer storage medium and an electronic device.
  • Kubernetes clusters deployed on private cloud bare metal architecture usually cannot use LoadBalancer type services. Because Kubernetes itself does not provide an implementation of a network load balancer (a service of type LoadBalancer) for bare metal clusters. If the Kubernetes cluster is not running on the IaaS (Infrastructure as a Service, Infrastructure as a Service) platform of the public cloud, LoadBalancers will remain in the "suspended" state indefinitely when created, which means that only the public cloud vendor's own Kubernetes Support LoadBalancer.
  • IaaS Infrastructure as a Service, Infrastructure as a Service
  • MetalLB load balancers are generally used to solve the problem that private bare metal clusters cannot use LoadBalancer type services.
  • MetalLB supports two methods, namely Layer2 mode and BGP (Border Gateway Protocol) mode.
  • Layer2 mode has the problem of limited network bandwidth due to single-point forwarding.
  • BGP mode cannot effectively respond to node failures. When a node goes down, all nodes will stop working.
  • One or more embodiments of the present disclosure provide a load balancing method, a load balancing system, a computer storage medium, and an electronic device, thereby overcoming, at least to a certain extent, the problem in related technologies that a load balancing device is required to implement the load balancing function. .
  • a load balancing method which pre-configures a cloud host resource pool.
  • the cloud host resource pool includes multiple cloud hosts, and each cloud host is associated with a pre-allocated IP segment.
  • the method includes: in response to a load balancing instance creation request, scheduling at least two candidate cloud hosts from a cloud host resource pool; the load balancing instance is used to provide external client access; and selecting the IP segment corresponding to each of the candidate cloud hosts.
  • Select an idle IP call the domain name server to store at least two domain names corresponding to the idle IP; wherein, at least two of the idle IPs correspond to the same domain name; return the domain name to the client, so that the client starts from Obtain the target IP corresponding to the domain name from the domain name server; the target IP is any one of the at least two idle IPs; create the load balancing instance based on the target IP so that the client can pass the The load balancing instance establishes a connection with the target cloud host; the target IP is the IP corresponding to the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
  • a load balancing method is provided, which is applied to a target cloud host.
  • the method includes: receiving a business request sent by a client through a pre-created load balancing instance; based on the load balancing instance associated with the load balancing instance.
  • Load balancing strategy forwards the service request to the specified backend service.
  • a load balancing system including: a cloud host management module and a cloud host resource pool; the cloud host management module is used to manage a preconfigured cloud host resource pool, and the cloud host resource pool including a plurality of cloud hosts, each cloud host associated with a pre-allocated IP segment; the cloud host management module is used to respond to a load balancing instance creation request, dispatch at least two candidate cloud hosts from the cloud host resource pool ;
  • the load balancing instance is used to provide external client access; select an idle IP from the IP segment corresponding to each of the candidate cloud hosts, and call the domain name server to store at least two domain names corresponding to the idle IP; wherein, at least The two idle IPs correspond to the same domain name; the domain name is returned to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is the at least two idle IP addresses.
  • any of the IPs create the load balancing instance based on the target IP, so that the client establishes a connection with the target cloud host through the load balancing instance;
  • the target IP is the IP corresponding to the load balancing instance,
  • the target cloud host is a candidate cloud host corresponding to the target IP;
  • the target cloud host is used to receive a service request sent by the client through the load balancing instance; based on the load balancing policy associated with the load balancing instance, Forward the service request to the designated backend service.
  • a computer storage medium is provided, a computer program is stored thereon, and when the computer program is executed by a processor, the load balancing method described in the first and second aspects is implemented.
  • an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the operation via executing the executable instructions.
  • the load balancing method described in the first aspect and the second aspect is executed.
  • At least two candidate cloud hosts are scheduled from the cloud host resource pool, and one is selected from the IP segment corresponding to each cloud host.
  • Idle IP and call the domain name server to store the domain names corresponding to at least two idle IPs, and return the domain names to the client, which can avoid the technical problems of business interruption caused by calling a single cloud host for request forwarding each time when the cloud host fails. , improve the system’s emergency handling capabilities.
  • the target IP is associated with the load balancing instance, so that the client can establish a connection with the target cloud host through the load balancing instance, providing a new solution that can realize the load balancing function without using load balancing equipment, reducing operation and maintenance. Invest.
  • Figure 2 shows a schematic flow chart of the cloud host management module performing fault monitoring on the target cloud host in the embodiment of the present disclosure
  • Figure 3 shows a schematic flow chart of how to update the status of the backup cloud host so that the backup cloud host takes over the target cloud host in an embodiment of the present disclosure
  • Figure 4 shows a schematic flow chart of adding a cloud host to the cloud host resource pool in an embodiment of the present disclosure
  • Figure 5 shows a schematic flowchart of removing faulty cloud hosts from the cloud host resource pool in an embodiment of the present disclosure
  • Figure 6 shows a schematic flowchart of creating a load balancing instance in an embodiment of the present disclosure
  • Figure 7 shows a schematic flowchart of deleting a load balancing instance in an embodiment of the present disclosure
  • Figure 8 shows a schematic flow chart of how to manage a cloud host in an embodiment of the present disclosure
  • Figure 9 shows a schematic structural diagram of a load balancing system in a cloud environment in an embodiment of the present disclosure
  • FIG. 10 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments may, however, be embodied in various 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 concepts of the example embodiments.
  • the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
  • numerous specific details are provided to provide a thorough understanding of embodiments of the disclosure.
  • those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details described, or other methods, components, devices, steps, etc. may be adopted.
  • well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the disclosure.
  • IaaS is a cloud computing delivery model that delivers computing resources in the form of virtualized operating systems, workload management software, hardware, network and storage services. It can also include the delivery of operating systems and virtualization technologies to managed resources.
  • a load balancer is a method that distributes network requests to available servers in a server cluster by managing incoming Web (World Wide Web, Global Wide Area Network) data traffic and increasing effective network bandwidth.
  • LoadBalancer used to allocate tasks to less busy servers when the traffic is heavy
  • Kubernetes clusters cannot use LoadBalancer type services.
  • MetalLB is usually used to solve the problem that bare metal Kubernetes clusters cannot use LoadBalancer type services.
  • MetalLB is a load balancer that specifically solves the pain point of being unable to use LoadBalancer type services in bare metal Kubernetes clusters.
  • MetalLB uses a standardized routing protocol so that external services on bare metal Kubernetes clusters also work as well as possible. That is, MetalLB can help you create LoadBalancer-type Kubernetes services in bare metal Kubernetes clusters.
  • MetalLB supports publishing allocated External IP in two ways, namely Layer2 mode and BGP mode.
  • Layer2 mode the assigned External IP will be bound to a Node node machine network card, and the External IP will be announced through ARP (Address Discovery Protocol) to make it reachable in the local network.
  • ARP Address Discovery Protocol
  • BGP mode can achieve load balancing across multiple nodes and can also implement fine-grained traffic control based on the BGP policy mechanism.
  • MetalLB's Layer 2 mode will have a single point problem. All traffic of the service is forwarded through a single point, and its network bandwidth may also become a bottleneck. In addition, Layer 2 mode requires the cooperation of the ARP client. When a failover occurs, MetalLB will send an ARP packet to announce changes in IP and MAC address mapping, and the address allocation process is slightly cumbersome.
  • MetalLB's BGP mode cannot handle failover gracefully.
  • all active connected clients will receive a "communication peer closes the connection" notification.
  • the BGP router performs a simple hash on the source IP (Internet Protocol), destination IP, and protocol type of the data packet, and determines which node to send it to based on the hash value.
  • Kubernetes cluster nodes are unstable. When a node holding an External IP goes down, most of the active links will become unavailable due to rehash.
  • a load balancing method is first provided, which overcomes, at least to a certain extent, the problem in related technologies that a load balancing device is required to implement the load balancing function.
  • FIG. 1 shows a schematic flowchart of a load balancing method in an embodiment of the present disclosure.
  • the execution subject of the load balancing method may be a server deploying a cloud host management module.
  • a load balancing method includes the following steps:
  • Step S110 In response to the load balancing instance creation request, schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access;
  • Step S120 select an idle IP from the IP segment corresponding to each candidate cloud host, and call the domain name server to store the domain names corresponding to at least two idle IPs; wherein, at least two idle IPs correspond to the same domain name;
  • Step S130 return the domain name to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server;
  • the target IP is any one of at least two idle IPs;
  • Step S140 Create a load balancing instance based on the target IP so that the client establishes a connection with the target cloud host through the load balancing instance; the target IP is the IP of the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
  • At least two candidate cloud hosts are scheduled from the cloud host resource pool, and one is selected from the IP segment corresponding to each cloud host.
  • Idle IP and call the domain name server to store the domain names corresponding to at least two idle IPs, and return the domain names to the client, which can avoid the technical problems of business interruption caused by calling a single cloud host for request forwarding each time when the cloud host fails. , improve the system’s emergency handling capabilities.
  • the target IP is associated with the load balancing instance, so that the client can establish a connection with the target cloud host through the load balancing instance, which provides a new solution that can realize the load balancing function without resorting to load balancing equipment, reducing operation and maintenance. Invest.
  • Load Balance refers to balancing and allocating loads (work tasks) to multiple units to improve concurrent processing capabilities.
  • the role of load balancing is: first, to solve concurrency pressure and improve application processing performance (increase throughput and strengthen network processing capabilities); second, to provide failover and achieve high availability; third, to provide high availability by adding or reducing the number of servers. Website scalability (expansibility); fourth, security protection.
  • a cloud host resource pool may be pre-configured. For example, multiple cloud hosts may be pre-created to form a cloud host resource pool (that is, the cloud host resource pool includes multiple cloud hosts).
  • an IP segment can be assigned to each cloud host (each IP segment contains multiple IP addresses, for example: from 192.168.0.1 to 192.168.255.255, this is an IP segment), And start the load balancing service on each cloud host. Further, a notification message can be sent to the IaaS so that the IssS points the next hop of the IP segment to the cloud host.
  • step S110 After configuring the cloud host resource pool, if a load balancing instance creation request is received, step S110 can be entered. In step S110, in response to the load balancing instance creation request, at least two candidate cloud hosts are scheduled from the cloud host resource pool. ; The load balancing instance is used to provide external client access.
  • the cloud host management module when it receives the load balancing instance creation request, it can schedule at least two candidate cloud hosts from the cloud host resource pool. By scheduling at least two candidate cloud hosts, it can be ensured that when any candidate cloud host fails, there will be a backup cloud host to ensure the normal operation of the business.
  • the load balancing instance is a running load balancing service that is used to provide external client access.
  • At least two candidate cloud hosts can be scheduled from the cloud host resource pool according to a random algorithm, or at least two candidate cloud hosts can be scheduled from the cloud host resource pool using a preset round robin scheduling algorithm.
  • the situation is set by oneself, and this disclosure does not impose special restrictions on this.
  • step S120 an idle IP is selected from the IP segments corresponding to each candidate cloud host, and the domain name server is called to store domain names corresponding to at least two idle IPs; wherein at least two idle IPs correspond to the same domain name.
  • the cloud host management module may select an idle IP from the IP segment corresponding to each candidate cloud host. Furthermore, the above-mentioned idle IP can be bound to the loopback address of the candidate cloud host.
  • the loopback address is the IP inside the host IP stack. It is mainly used for network software testing and local machine inter-process communication, regardless of the program. , once data is sent using the loopback address, the protocol software returns it immediately without any network transmission.
  • the domain name corresponding to the above-mentioned idle IP can be generated according to the domain name rules (all idle IPs correspond to the same domain name). Furthermore, the DNS domain name server can be called to store the mapping relationship between the above-mentioned idle IP and the domain name, and will generate The domain name is returned to the Kubernetes cluster. For example, the selected free IPs are IP_1 and IP_2, and the generated domain name is dn1. Refer to Table 1. Table 1 shows the mapping relationship between the free IPs and domain names stored in the DNS domain name server.
  • IP_1 dn1 IP_2 dn1
  • the DNS domain name server By using the DNS domain name server to store the mapping relationship between free IPs and domain names, users only need to know the easy-to-remember domain name addresses without having to memorize a long list of IPs (which is not intuitive and very inconvenient for users to remember). For example, when a user enters a domain name in a browser, the browser can forward the domain name to the DNS domain name server so that the DNS domain name server determines the IP corresponding to the domain name. When the DNS domain name server returns the IP to the browser, the browser Requests can be made based on IP.
  • a domain name can be registered for the above-mentioned idle IP based on the following naming rules: $lbname.$lbnamespace.$suffix.
  • lbname is the load balancing identifier, for example, it can be a serial number or nickname
  • lbnamespace is the group to which the load balancing belongs.
  • the cloud hosts in the cloud host resource pool can be divided into multiple groups, and each group corresponds to a group identifier, then lbnamespace can be the group identifier to which the candidate cloud host belongs
  • suffix is the private network subdomain name agreed by the user, which can be set according to the actual situation. This disclosure does not impose special restrictions on this.
  • step S130 the domain name is returned to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of at least two idle IPs.
  • the registered domain name can be returned to the client, and then the client can send a domain name resolution request to the DNS domain name server to obtain the target IP corresponding to the above domain name from the DNS domain name server.
  • the domain name server can select a target IP from the idle IPs corresponding to the above domain name in a random or polling manner (for example: select IP_1 from IP_1 and IP_2 in Table 1 as the target IP) , and return the above target IP to the above client.
  • step S140 a load balancing instance is created based on the target IP, so that the client establishes a connection with the target cloud host through the load balancing instance; the target cloud host is a candidate cloud host corresponding to the target IP.
  • a load balancing instance can be created based on the above target IP (since the load balancing instance can provide external client access, when the target IP corresponding to the domain name is determined, it is equivalent to determining the target IP corresponding to the domain name.
  • the load balancing instance corresponding to the domain name the client can establish a connection with the target cloud host corresponding to the target IP through the load balancing instance.
  • the client After establishing a connection with the target cloud host, the client can send a service request to the above target IP. After receiving the above-mentioned business request, the target cloud host can forward the above-mentioned business request to the designated back-end service according to the load balancing policy contained in the above-mentioned load balancing instance to implement the load balancing function.
  • the above-mentioned business request is issued by the client and is used to request access to the Internet or request network resources.
  • the business request can also be called a service request message, an access request message, an access request packet, a service request packet, and an access request. Requests, etc. can be set according to the actual situation, and this disclosure does not impose special restrictions on this.
  • the above load balancing strategy can be any of the following:
  • Least Connections is an algorithm for communicating with the server that handles the least number of connections (number of sessions) among multiple servers. Even if the processing capabilities of each server are different and the processing volume of each business is also different, the load of the server can be reduced to a certain extent.
  • Weighted Least Connection is an algorithm that adds a weight to each server in the least connection algorithm. This algorithm allocates the number of connections to each server in advance and transfers business requests to the server with the smallest number of connections.
  • Random set random probability according to weight. The probability of collision on a section is high, but the larger the call volume, the more even the distribution will be, and the weight will be more even after using the weight according to probability, which is conducive to dynamically adjusting the provider weight.
  • 4IP hashing An algorithm that uniformly forwards packets from the same sender (or packets sent to the same destination) to the same server by managing the hashes of the sender IP and destination IP.
  • this algorithm can use flow (session) as a unit to ensure that communications from the same client can always be processed in the same server.
  • 5URL Uniform Resource Locator, Uniform Resource Locator
  • hash An algorithm that forwards requests sent to the same URL to the same server by managing the hash of the client request URL information.
  • the above-mentioned target cloud host can also periodically monitor the running status of each back-end service.
  • the CPU Central Processing Unit, central processing
  • the CPU occupancy rate of each back-end service can be obtained.
  • Parameters such as memory usage and disk usage, among which the above parameters can be obtained through the task manager that comes with the backend service.
  • the running status of the backend service can be determined based on the above parameters. For example, when the CPU occupancy/memory occupancy/disk occupancy is greater than or equal to the preset threshold, it can be determined that the running status of the above backend service is abnormal. When the above CPU occupancy/memory occupancy/disk occupancy are all less than When the above preset threshold is reached, it can be determined that the running status of the above backend service is normal.
  • the data stored on the above-mentioned back-end service can be backed up, and then the back-end service with abnormal running status can be eliminated.
  • the above-mentioned cloud host management module can also perform fault monitoring on the target cloud host.
  • Figure 2 shows the cloud host management module in the embodiment of the present disclosure monitoring the target cloud host.
  • step S201 the operating status of the target cloud host is periodically monitored.
  • the cloud host management module can periodically monitor the operating status of the target cloud host. For example, the cloud host management module can send a heartbeat detection message to the target cloud host every 2 seconds (the specific duration can be set according to the actual situation, and this disclosure does not specifically limit this).
  • the heartbeat response message of the cloud host is used to determine whether the operating status of the target cloud host is normal. For example, if the heartbeat response message returned by the target cloud host is received within a preset time period, it can be determined that the operating status of the target cloud host is normal; otherwise, it can be determined that the operating status of the target cloud host is abnormal.
  • step S202 in response to detecting abnormal operating status of the target cloud host, the target cloud host is marked as unschedulable.
  • step S203 if the abnormal running status of the target cloud host is detected, it can be determined whether the IP segments bound to the target cloud host have been released (that is, none of the multiple IPs included in the IP segment at the current moment have been released). occupied), if so, the following step S203 can be performed, otherwise, the waiting logic can be executed, and after each IP in the above IP segment is released, the following step S203 can be performed.
  • step S203 a backup cloud host of the target cloud host is selected from the cloud host resource pool to replace the target cloud host with the backup cloud host.
  • the cloud host management module may select a backup cloud host of the target cloud host from the cloud host resource pool to replace the target cloud host through the backup cloud host.
  • the cloud host management module can select the above-mentioned backup cloud host from the cloud host resource pool according to the following conditions: first, filter out all cloud hosts in normal operating status (hereinafter referred to as the first set), and then determine the first set of cloud hosts.
  • the number of idle IPs of each cloud host is selected from the first set to select cloud hosts whose number of idle IPs meets the preset number conditions (hereinafter referred to as the second set).
  • a cloud host can be randomly selected from the second set. As the above backup cloud host.
  • the backup cloud host After selecting the above-mentioned backup cloud host, you can first mark the backup cloud host as unschedulable, that is, lock the backup cloud host to avoid the backup cloud host from being used during the preparation period before the backup cloud host officially takes over the target cloud host.
  • the host's free IP is occupied, resulting in a shortage of free IPs.
  • the above-mentioned cloud host management module can also update the status of the backup cloud host after migrating the data on the target cloud host to the backup cloud host, thereby controlling The backup cloud host takes over the above target cloud host.
  • Figure 3 shows a schematic flow chart of how to update the status of the backup cloud host so that the backup cloud host takes over the target cloud host in an embodiment of the present disclosure, including steps S301 to S303:
  • step S301 data stored on the target cloud host is migrated to the backup cloud host.
  • the data stored on the target cloud host can be migrated to the above backup cloud host.
  • step S302 select an idle IP from the IP segment associated with the backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP of the target cloud host and the domain name to that of the backup cloud host. Mapping relationship between IP and domain name.
  • you can randomly select an idle IP for example: IP_3 from the above-mentioned backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP and the domain name of the target cloud host to the backup one.
  • IP_3 for example: IP_3
  • IP_2 dn1 IP_3 dn1
  • the present disclosure can take over the target cloud host through the backup cloud host without the client being aware of it, so that the client can still connect to the backup cloud host through the domain name, that is, the client's access The form remains unchanged.
  • step S303 the backup cloud host is marked as a schedulable state so that the backup cloud host can take over the target cloud host.
  • the backup cloud host can be marked as schedulable, so that the backup cloud host can take over the target cloud host.
  • an alarm notification can be sent to the manager of the application.
  • the alarm content can be "The target cloud host has failed, and the backup cloud host has taken over the target.” Cloud Host" to explain the fault and fault response to the above-mentioned managers. It should be noted that the specific alarm content can be set according to the actual situation, and this disclosure does not impose special restrictions on this.
  • Figure 4 shows a schematic flow chart of adding a cloud host to a cloud host resource pool in an embodiment of the present disclosure, including steps S401 to S405:
  • step S401 the cloud host management module creates a cloud host
  • IPAM IP Management Module
  • Etcd is a highly consistent distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or machine cluster
  • the unbound IP segment is sent to the cloud host management module, so that the cloud host management module binds an IP segment to the cloud host; and stores the corresponding relationship between the cloud host and the IP segment in Etcd;
  • step S403 the cloud host management module initializes the load balancing service
  • step S404 the cloud host management module adds the created cloud host to the cloud host resource pool
  • step S405 the cloud host management module sends a notification message to IaaS, so that IaaS uses the newly created cloud host as the next hop of the IP segment to which it is bound.
  • FIG. 5 shows a schematic flowchart of removing faulty cloud hosts from the cloud host resource pool in an embodiment of the present disclosure, including steps S501 to S505:
  • step S501 start;
  • step S502 the cloud host management module sends a message to IPAM, so that IPAM reads Etcd to determine whether the IP segment bound to the cloud host is released; if not, the waiting logic is executed;
  • step S503 if the cloud host management module determines that the IP segment is released, it terminates the operation of the cloud host;
  • step S504 the cloud host management module terminates the load balancing service
  • step S505 the cloud host management module updates the cloud host to an unschedulable state
  • step S506 the cloud host management module sends a notification message to IaaS, so that IaaS revokes the next hop configuration of the IP segment bound to the cloud host.
  • the present disclosure can quickly remove a certain cloud host when it fails, and use the backup cloud host to replace it, ensuring stable load balancing performance.
  • Figure 6 shows a schematic flowchart of creating a load balancing instance in an embodiment of the present disclosure, including steps S601 to S606:
  • step S601 the scheduler traverses the cloud host resource pool (sends a message to the cloud host management module so that the cloud host management module obtains cloud host information);
  • step S602 the scheduler selects at least two cloud hosts with the most idle IPs and two candidate cloud hosts;
  • step S603 the scheduler selects an idle IP from the IP segments bound to each cloud host (sends a message to the cloud host management module to determine the unoccupied idle IP);
  • step S604 the scheduler sends a status update notification to the cloud host management module, so that the cloud host management module updates the status of the cloud host to be schedulable;
  • step S605 the scheduler creates a load balancing instance and stores it in the load balancing instance pool;
  • step S606 the scheduler calls the DNS domain name server to register a domain name for the idle IP.
  • the management module updates the load balancing configuration to reload the load balancing service.
  • Figure 7 shows a schematic flowchart of deleting a load balancing instance in an embodiment of the present disclosure, including steps S701 to S705:
  • step S701 the scheduler updates the status of the load balancing instance to delete
  • step S702 the scheduler cancels the domain name
  • step S703 the scheduler releases what is bound to the cloud host (sends a message to IPAM to cause IPAM to release what is bound to the cloud host);
  • step S704 the scheduler deletes the load balancing instance
  • step S705 the scheduler sends a status update notification to the cloud host management module, so that the cloud host management module updates the status of the cloud host to unschedulable.
  • the load balancing service management module can unbind the idle IP from the local loopback address, and then the load balancing service management module can update the load balancing configuration to reload the load balancing service.
  • Figure 8 shows a schematic flow chart of how to manage a cloud host in an embodiment of the present disclosure, including steps S801 to S810:
  • step S801 the cloud host management module periodically traverses each cloud host
  • step S802 the cloud host management module detects whether each cloud host is in a normal state
  • step S803 If the cloud host is in a normal state, proceed to step S803, and the cloud host management module detects whether the load balancing service is in a normal state; if the load balancing service is in a normal state, proceed to step S804, with no action; otherwise, proceed to step S805, Trigger the mechanism to eliminate cloud hosts;
  • step S806 the cloud host management module traverses the cloud hosts and obtains cloud host information through the scheduler to determine the backup cloud host of the faulty cloud host;
  • step S807 the cloud host management module locks the backup cloud host
  • step S808 the cloud host management module migrates the load balancing instance corresponding to the failed target cloud host through the scheduler;
  • step S809 the cloud host management module marks the backup cloud host as schedulable
  • step S810 the cloud host management module sends an alarm notification to relevant managers.
  • the alarm notification includes information about the faulty cloud host, the backup cloud host, and the backup load balancing instance.
  • the present disclosure provides a universally applicable load balancing solution.
  • a kubernetes cluster is deployed in the cloud host resource pool, and the client can communicate with the cloud host resource pool through the load balancing instance.
  • Establish a connection with the target cloud host and then forward the business request through the target cloud host. It can be seen that this solution provides a new solution that can access the kubernetes cluster from the outside to achieve the load balancing function without resorting to relevant load balancing equipment. It is suitable for the network environment of all IaaS vendors and reduces operation and maintenance investment.
  • FIG. 9 shows a schematic structural diagram of the load balancing system in an embodiment of the present disclosure.
  • the load balancing system 900 may include a cloud host management module 910 and a cloud host resource pool 920.
  • the cloud host resource pool includes multiple cloud hosts 9201, and each cloud host is associated with a pre-allocated IP segment. in:
  • the cloud host management module 910 is used to respond to a load balancing instance creation request and schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access; and the IP corresponding to each candidate cloud host is obtained from Select an idle IP in the segment, call the domain name server to store the domain names corresponding to at least two idle IPs; among them, at least two idle IPs correspond to the same domain name; return the domain name to the client, so that the client obtains the domain name corresponding to the domain name server
  • the target IP; the target IP is any one of at least two idle IPs; create a load balancing instance based on the target IP so that the client can establish a connection with the target cloud host through the load balancing instance; the target cloud host is the candidate cloud corresponding to the target IP host;
  • Target cloud host 9201 is used to receive business requests sent by the client through the load balancing instance; based on the load balancing policy associated with the load balancing instance, forward the business request to the specified back-end service.
  • the cloud host management module 910 is configured as:
  • the backup cloud host satisfies the following conditions:
  • the running status of the backup cloud host is normal, and the number of idle IPs in the backup cloud host meets the preset number conditions.
  • the cloud host management module 910 is configured as:
  • the target cloud host 9201 is configured as:
  • the data stored on the backend service is deleted and the backend service is marked as unschedulable.
  • the running status of the backend service is determined by one or more of the following parameters: CPU occupancy, memory occupancy, and disk occupancy.
  • the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which may be a personal computer, a server, a mobile terminal, a network device, etc.) to execute a method according to an embodiment of the present disclosure.
  • a computing device which may be a personal computer, a server, a mobile terminal, a network device, etc.
  • This application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be included in the electronic device described in the above embodiments; it may also exist independently without being assembled into the electronic device.
  • the computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Computer-readable storage media may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Program code embodied on a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • the computer-readable storage medium carries one or more programs.
  • the electronic device implements the method described in the above embodiments.
  • an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.
  • FIG. 10 An electronic device 1000 according to this embodiment of the present disclosure is described below with reference to FIG. 10 .
  • the electronic device 1000 shown in FIG. 10 is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present disclosure.
  • electronic device 1000 is embodied in the form of a general computing device.
  • the components of the electronic device 1000 may include, but are not limited to: the above-mentioned at least one processing unit 1010, the above-mentioned at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), and the display unit 1040.
  • the storage unit stores program code, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section of this specification.
  • the processing unit 1010 can perform as shown in Figure 1: Step S110, in response to a load balancing instance creation request, schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access Entrance; Step S120, select an idle IP from the IP segment corresponding to each candidate cloud host, and call the domain name server to store the domain names corresponding to at least two idle IPs; among which, at least two idle IPs correspond to the same domain name; Step S130, return the domain name to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of at least two idle IPs; step S140, create a load balancing instance based on the target IP so that the client can pass the load
  • the storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and/or a cache storage unit 10202, and may further include a read-only storage unit (ROM) 10203.
  • RAM random access storage unit
  • ROM read-only storage unit
  • Storage unit 1020 may also include a program/utility 10204 having a set of (at least one) program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples, or some combination, may include the implementation of a network environment.
  • program/utility 10204 having a set of (at least one) program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples, or some combination, may include the implementation of a network environment.
  • Bus 1030 may be a local area representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or using any of a variety of bus structures. bus.
  • Electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with electronic device 1000, and/or with Any device that enables the electronic device 1000 to communicate with one or more other computing devices (eg, router, modem, etc.). This communication may occur through input/output (I/O) interface 1050.
  • the electronic device 1000 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 1060. As shown, network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030.
  • network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030.

Landscapes

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

Abstract

The present disclosure relates to the technical field of cloud computing. Provided are a load balancing method and system, a medium, and a device. The method comprises: pre-configuring a cloud host resource pool, wherein the cloud host resource pool comprises a plurality of cloud hosts, and each cloud host is associated with a pre-allocated IP segment; in response to a load balancing instance creation request, scheduling at least two candidate cloud hosts from the cloud host resource pool; selecting an idle IP from an IP segment corresponding to each candidate cloud host, and invoking a domain name server to store a domain name corresponding to at least two idle IPs, wherein the at least two idle IPs correspond to the same domain name; returning the domain name to a client, such that the client acquires, from the domain name server, a target IP corresponding to the domain name; and creating a load balancing instance on the basis of the target IP, such that the client establishes a connection with a target cloud host by means of the load balancing instance. The present disclosure provides a load balancing solution with a wider application range.

Description

负载均衡方法及系统、计算机存储介质、电子设备Load balancing method and system, computer storage media, electronic equipment
相关申请的交叉引用Cross-references to related applications
本公开要求于2022年04月28日提交的申请号为202210470381.4、名称为“负载均衡方法及系统、计算机存储介质、电子设备”的中国专利申请的优先权,该中国专利申请的全部内容通过引用结合在本公开中。This disclosure claims priority to the Chinese patent application with application number 202210470381.4 and titled "Load Balancing Method and System, Computer Storage Media, Electronic Devices" submitted on April 28, 2022. The entire content of this Chinese patent application is incorporated by reference. incorporated in this disclosure.
技术领域Technical field
本公开涉及云计算技术领域,特别涉及一种负载均衡方法、负载均衡系统、计算机存储介质及电子设备。The present disclosure relates to the technical field of cloud computing, and in particular to a load balancing method, a load balancing system, a computer storage medium and an electronic device.
背景技术Background technique
私有云裸金属架构(相对云上环境而言)上部署的Kubernetes集群,通常是无法使用LoadBalancer类型的服务的。因为Kubernetes本身没有为裸机群集提供网络负载均衡器(类型为LoadBalancer的服务)的实现。如果Kubernetes集群没有在公有云的IaaS(Infrastructure as a Service,基础设施即服务)平台上运行,则LoadBalancers将在创建时无限期地保持“挂起”状态,也就是说只有公有云厂商自家的Kubernetes支持LoadBalancer。Kubernetes clusters deployed on private cloud bare metal architecture (relative to cloud environments) usually cannot use LoadBalancer type services. Because Kubernetes itself does not provide an implementation of a network load balancer (a service of type LoadBalancer) for bare metal clusters. If the Kubernetes cluster is not running on the IaaS (Infrastructure as a Service, Infrastructure as a Service) platform of the public cloud, LoadBalancers will remain in the "suspended" state indefinitely when created, which means that only the public cloud vendor's own Kubernetes Support LoadBalancer.
目前,一般是通过MetalLB负载均衡器来解决私有裸金属集群无法使用LoadBalancer类型服务的问题,MetalLB支持通过两种方式,即Layer2模式和BGP(Border Gateway Protocol,边界网关协议)模式。然而,Layer2模式存在因单点转发所导致的网络带宽受限问题,BGP模式无法有效应对节点故障,当某一节点宕机时会导致所有节点停止工作。Currently, MetalLB load balancers are generally used to solve the problem that private bare metal clusters cannot use LoadBalancer type services. MetalLB supports two methods, namely Layer2 mode and BGP (Border Gateway Protocol) mode. However, the Layer 2 mode has the problem of limited network bandwidth due to single-point forwarding. The BGP mode cannot effectively respond to node failures. When a node goes down, all nodes will stop working.
鉴于此,本领域亟需开发一种新的负载均衡方法及系统。In view of this, there is an urgent need to develop a new load balancing method and system in this field.
需要说明的是,上述背景技术部分公开的信息仅用于加强对本公开的背景的理解。It should be noted that the information disclosed in the above background section is only used to enhance understanding of the background of the present disclosure.
发明内容Contents of the invention
本公开的一个或多个实施例提供一种负载均衡方法、负载均衡系统、计算机存储介质及电子设备,进而至少在一定程度上克服了相关技术中需要借助负载均衡设备才能实现负载均衡功能的问题。One or more embodiments of the present disclosure provide a load balancing method, a load balancing system, a computer storage medium, and an electronic device, thereby overcoming, at least to a certain extent, the problem in related technologies that a load balancing device is required to implement the load balancing function. .
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。Additional features and advantages of the disclosure will be apparent from the following detailed description, or, in part, may be learned by practice of the disclosure.
根据本公开的第一方面,提供一种负载均衡方法,预配置云主机资源池,所述云主机资源池中包括多个云主机,各所述云主机关联一预分配的IP段,所述方法包括:响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机; 所述负载均衡实例用于对外提供客户端的访问入口;从各所述候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个所述空闲IP对应的域名;其中,至少两个所述空闲IP对应同一域名;将所述域名返回至客户端,以使所述客户端从域名服务器中获取到所述域名对应的目标IP;所述目标IP为所述至少两个空闲IP中任一;基于所述目标IP创建所述负载均衡实例,以使所述客户端通过所述负载均衡实例与目标云主机建立连接;所述目标IP为所述负载均衡实例对应的IP,所述目标云主机为所述目标IP对应的候选云主机。According to a first aspect of the present disclosure, a load balancing method is provided, which pre-configures a cloud host resource pool. The cloud host resource pool includes multiple cloud hosts, and each cloud host is associated with a pre-allocated IP segment. The method includes: in response to a load balancing instance creation request, scheduling at least two candidate cloud hosts from a cloud host resource pool; the load balancing instance is used to provide external client access; and selecting the IP segment corresponding to each of the candidate cloud hosts. Select an idle IP, call the domain name server to store at least two domain names corresponding to the idle IP; wherein, at least two of the idle IPs correspond to the same domain name; return the domain name to the client, so that the client starts from Obtain the target IP corresponding to the domain name from the domain name server; the target IP is any one of the at least two idle IPs; create the load balancing instance based on the target IP so that the client can pass the The load balancing instance establishes a connection with the target cloud host; the target IP is the IP corresponding to the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
根据本公开的第二方面,提供一种负载均衡方法,应用于目标云主机,所述方法包括:接收客户端通过预先创建的负载均衡实例发送的业务请求;基于所述负载均衡实例所关联的负载均衡策略,将所述业务请求转发至指定的后端服务。According to a second aspect of the present disclosure, a load balancing method is provided, which is applied to a target cloud host. The method includes: receiving a business request sent by a client through a pre-created load balancing instance; based on the load balancing instance associated with the load balancing instance. Load balancing strategy forwards the service request to the specified backend service.
根据本公开的第三方面,提供一种负载均衡系统,包括:云主机管理模块和云主机资源池;所述云主机管理模块用于管理预配置的云主机资源池,所述云主机资源池中包括多个云主机,各所述云主机关联一预分配的IP段;所述云主机管理模块,用于响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;所述负载均衡实例用于对外提供客户端的访问入口;从各所述候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个所述空闲IP对应的域名;其中,至少两个所述空闲IP对应同一域名;将所述域名返回至客户端,以使所述客户端从域名服务器中获取到所述域名对应的目标IP;所述目标IP为所述至少两个空闲IP中任一;基于所述目标IP创建所述负载均衡实例,以使所述客户端通过所述负载均衡实例与目标云主机建立连接;所述目标IP为所述负载均衡实例对应的IP,所述目标云主机为所述目标IP对应的候选云主机;所述目标云主机,用于接收客户端通过所述负载均衡实例发送的业务请求;基于所述负载均衡实例关联的负载均衡策略,将所述业务请求转发至指定的后端服务。According to a third aspect of the present disclosure, a load balancing system is provided, including: a cloud host management module and a cloud host resource pool; the cloud host management module is used to manage a preconfigured cloud host resource pool, and the cloud host resource pool including a plurality of cloud hosts, each cloud host associated with a pre-allocated IP segment; the cloud host management module is used to respond to a load balancing instance creation request, dispatch at least two candidate cloud hosts from the cloud host resource pool ; The load balancing instance is used to provide external client access; select an idle IP from the IP segment corresponding to each of the candidate cloud hosts, and call the domain name server to store at least two domain names corresponding to the idle IP; wherein, at least The two idle IPs correspond to the same domain name; the domain name is returned to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is the at least two idle IP addresses. Any of the IPs; create the load balancing instance based on the target IP, so that the client establishes a connection with the target cloud host through the load balancing instance; the target IP is the IP corresponding to the load balancing instance, The target cloud host is a candidate cloud host corresponding to the target IP; the target cloud host is used to receive a service request sent by the client through the load balancing instance; based on the load balancing policy associated with the load balancing instance, Forward the service request to the designated backend service.
根据本公开的第四方面,提供一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面和第二方面所述的负载均衡方法。According to a fourth aspect of the present disclosure, a computer storage medium is provided, a computer program is stored thereon, and when the computer program is executed by a processor, the load balancing method described in the first and second aspects is implemented.
根据本公开的第五方面,提供一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述第一方面和第二方面所述的负载均衡方法。According to a fifth aspect of the present disclosure, an electronic device is provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the operation via executing the executable instructions. The load balancing method described in the first aspect and the second aspect is executed.
由上述技术方案可知,本公开示例性实施例中的负载均衡方法、负载均衡系统、计算机存储介质及电子设备至少具备以下优点和积极效果:It can be seen from the above technical solutions that the load balancing method, load balancing system, computer storage medium and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
在本公开的一些实施例所提供的技术方案中,一方面,响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机,从各云主机对应的IP段中选取一空闲IP,并调用域名服务器存储至少两个空闲IP对应的域名,将域名返回至客户端,能够避免每次调用单个云主机进行请求转发所导致的当该云主机故障时导致业务中断的技术问题,提高系统的应急处理能力。进一步的,将目标ip关联至负载均衡实例, 以使客户端通过负载均衡实例与目标云主机建立连接,提供了一种无需借助负载均衡设备便能实现负载均衡功能的新方案,降低了运维投入。In the technical solution provided by some embodiments of the present disclosure, on the one hand, in response to a load balancing instance creation request, at least two candidate cloud hosts are scheduled from the cloud host resource pool, and one is selected from the IP segment corresponding to each cloud host. Idle IP, and call the domain name server to store the domain names corresponding to at least two idle IPs, and return the domain names to the client, which can avoid the technical problems of business interruption caused by calling a single cloud host for request forwarding each time when the cloud host fails. , improve the system’s emergency handling capabilities. Furthermore, the target IP is associated with the load balancing instance, so that the client can establish a connection with the target cloud host through the load balancing instance, providing a new solution that can realize the load balancing function without using load balancing equipment, reducing operation and maintenance. Invest.
本公开应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of 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. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1示出本公开实施例中负载均衡方法的流程示意图;Figure 1 shows a schematic flowchart of a load balancing method in an embodiment of the present disclosure;
图2示出本公开实施例中云主机管理模块对目标云主机进行故障监测的流程示意图;Figure 2 shows a schematic flow chart of the cloud host management module performing fault monitoring on the target cloud host in the embodiment of the present disclosure;
图3示出本公开实施例中如何更新备用云主机的状态,以使备用云主机接替目标云主机的流程示意图;Figure 3 shows a schematic flow chart of how to update the status of the backup cloud host so that the backup cloud host takes over the target cloud host in an embodiment of the present disclosure;
图4示出本公开实施例中在云主机资源池中添加云主机的流程示意图;Figure 4 shows a schematic flow chart of adding a cloud host to the cloud host resource pool in an embodiment of the present disclosure;
图5示出本公开实施例中从云主机资源池中剔除故障云主机的流程示意图;Figure 5 shows a schematic flowchart of removing faulty cloud hosts from the cloud host resource pool in an embodiment of the present disclosure;
图6示出本公开实施例中创建负载均衡实例的流程示意图;Figure 6 shows a schematic flowchart of creating a load balancing instance in an embodiment of the present disclosure;
图7示出本公开实施例中删除负载均衡实例的流程示意图;Figure 7 shows a schematic flowchart of deleting a load balancing instance in an embodiment of the present disclosure;
图8示出本公开实施例中如何管理云主机的流程示意图;Figure 8 shows a schematic flow chart of how to manage a cloud host in an embodiment of the present disclosure;
图9示出本公开实施例中云环境的负载均衡系统的结构示意图;Figure 9 shows a schematic structural diagram of a load balancing system in a cloud environment in an embodiment of the present disclosure;
图10示出本公开示例性实施例中电子设备的结构示意图。FIG. 10 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in various 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 concepts 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. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details described, or other methods, components, devices, steps, etc. may be adopted. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the disclosure.
本说明书中使用用语“一个”、“一”、“该”和“所述”用以表示存在一个或多个要素/组成部分/等;用语“包括”和“具有”用以表示开放式的包括在内的意思并且是指除了列出的要素/组成部分/等之外还可存在另外的要素/组成部分/等;用语“第一”和“第二” 等仅作为标记使用,不是对其对象的数量限制。The terms "a", "an", "the" and "said" are used in this specification to indicate the existence of one or more elements/components/etc.; the terms "include" and "have" are used to indicate an open-ended Inclusive is intended and means that there may be additional elements/components/etc. in addition to those listed; the terms "first" and "second" etc. are used as labels only and do not refer to The number of its objects is limited.
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。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 represent the same or similar parts, and thus their repeated description 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.
IaaS是一种云计算交付模式,它用虚拟化操作系统、工作负载管理软件、硬件、网络和存储服务的形式交付计算资源。它也可以包括操作系统和虚拟化技术到管理资源的交付。负载均衡器是一种把网络请求分散到一个服务器集群中的可用服务器上去,通过管理进入的Web(World Wide Web,全球广域网)数据流量和增加有效的网络带宽。IaaS is a cloud computing delivery model that delivers computing resources in the form of virtualized operating systems, workload management software, hardware, network and storage services. It can also include the delivery of operating systems and virtualization technologies to managed resources. A load balancer is a method that distributes network requests to available servers in a server cluster by managing incoming Web (World Wide Web, Global Wide Area Network) data traffic and increasing effective network bandwidth.
在私有云环境中通常没有云上环境所提供的LoadBalancer(当访问量很大的时候,用于分配任务给不繁忙的服务器)支持,因此,Kubernetes集群无法使用LoadBalancer类型的服务。In a private cloud environment, there is usually no support for LoadBalancer (used to allocate tasks to less busy servers when the traffic is heavy) provided by the cloud environment. Therefore, Kubernetes clusters cannot use LoadBalancer type services.
目前,为解决裸金属Kubernetes集群无法使用LoadBalancer类型服务的问题,通常会使用MetalLB。MetalLB是一个负载均衡器,专门解决裸金属Kubernetes集群中无法使用LoadBalancer类型服务的痛点。MetalLB使用标准化的路由协议,以便裸金属Kubernetes集群上的外部服务也尽可能地工作,即MetalLB能够帮助你在裸金属Kubernetes集群中创建LoadBalancer类型的Kubernetes服务。Currently, MetalLB is usually used to solve the problem that bare metal Kubernetes clusters cannot use LoadBalancer type services. MetalLB is a load balancer that specifically solves the pain point of being unable to use LoadBalancer type services in bare metal Kubernetes clusters. MetalLB uses a standardized routing protocol so that external services on bare metal Kubernetes clusters also work as well as possible. That is, MetalLB can help you create LoadBalancer-type Kubernetes services in bare metal Kubernetes clusters.
MetalLB支持通过两种方式对外发布已分配的External IP,即Layer2模式和BGP模式。其中,在Layer2模式下,分配的External IP将会绑定在一个Node节点机器网卡上,通过ARP(地址发现协议)宣告此External IP,使其在本地网络中可达,此方式能够适用于任何以太网环境。BGP模式可以实现跨多节点负载均衡,还可以基于BGP的策略机制实现细粒度的流量控制。MetalLB supports publishing allocated External IP in two ways, namely Layer2 mode and BGP mode. Among them, in Layer2 mode, the assigned External IP will be bound to a Node node machine network card, and the External IP will be announced through ARP (Address Discovery Protocol) to make it reachable in the local network. This method can be applied to any Ethernet environment. BGP mode can achieve load balancing across multiple nodes and can also implement fine-grained traffic control based on the BGP policy mechanism.
然而,MetalLB的Layer2模式会存在单点问题,服务的所有流量经由单点转发,其网络带宽也可能会成为瓶颈。另外,Layer2模式需要ARP客户端配合,当故障转移发生时,MetalLB会发送ARP包宣告IP和MAC地址映射的变化,地址分配流程略为繁琐。However, MetalLB's Layer 2 mode will have a single point problem. All traffic of the service is forwarded through a single point, and its network bandwidth may also become a bottleneck. In addition, Layer 2 mode requires the cooperation of the ARP client. When a failover occurs, MetalLB will send an ARP packet to announce changes in IP and MAC address mapping, and the address allocation process is slightly cumbersome.
MetalLB的BGP模式,不能优雅处理故障转移,当某个持有External IP的节点宕机后,所有活动链接的客户端将收到“通信对端关闭连接”通知。另外,BGP路由器对数据包的源IP(Internet Protocol,网际互连协议)、目的IP、协议类型进行简单的哈希,并依据哈希值觉得决定发给哪个节点。而Kubernetes集群节点是不稳定的,当某个持有External IP的节点宕机时,大部分的活动链接会因为rehash(重新哈希处理)而导致不可用。MetalLB's BGP mode cannot handle failover gracefully. When a node holding an External IP goes down, all active connected clients will receive a "communication peer closes the connection" notification. In addition, the BGP router performs a simple hash on the source IP (Internet Protocol), destination IP, and protocol type of the data packet, and determines which node to send it to based on the hash value. Kubernetes cluster nodes are unstable. When a node holding an External IP goes down, most of the active links will become unavailable due to rehash.
在本公开的实施例中,首先提供了一种负载均衡方法,至少在一定程度上克服相关技术中需要借助负载均衡设备才能实现负载均衡功能的问题。In the embodiments of the present disclosure, a load balancing method is first provided, which overcomes, at least to a certain extent, the problem in related technologies that a load balancing device is required to implement the load balancing function.
图1示出本公开实施例中负载均衡方法的流程示意图,该负载均衡方法的执行 主体可以是部署云主机管理模块的服务器。Figure 1 shows a schematic flowchart of a load balancing method in an embodiment of the present disclosure. The execution subject of the load balancing method may be a server deploying a cloud host management module.
参考图1,根据本公开的一个实施例的负载均衡方法包括以下步骤:Referring to Figure 1, a load balancing method according to one embodiment of the present disclosure includes the following steps:
步骤S110,响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;负载均衡实例用于对外提供客户端的访问入口;Step S110: In response to the load balancing instance creation request, schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access;
步骤S120,从各候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个空闲IP对应的域名;其中,至少两个空闲IP对应同一域名;Step S120, select an idle IP from the IP segment corresponding to each candidate cloud host, and call the domain name server to store the domain names corresponding to at least two idle IPs; wherein, at least two idle IPs correspond to the same domain name;
步骤S130,将域名返回至客户端,以使客户端从域名服务器中获取到域名对应的目标IP;目标IP为至少两个空闲IP中任一;Step S130, return the domain name to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of at least two idle IPs;
步骤S140,基于目标IP创建负载均衡实例,以使客户端通过负载均衡实例与目标云主机建立连接;目标IP为负载均衡实例的IP,目标云主机为目标IP对应的候选云主机。Step S140: Create a load balancing instance based on the target IP so that the client establishes a connection with the target cloud host through the load balancing instance; the target IP is the IP of the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
在图1所示实施例所提供的技术方案中,一方面,响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机,从各云主机对应的IP段中选取一空闲IP,并调用域名服务器存储至少两个空闲IP对应的域名,将域名返回至客户端,能够避免每次调用单个云主机进行请求转发所导致的当该云主机故障时导致业务中断的技术问题,提高系统的应急处理能力。进一步的,将目标ip关联至负载均衡实例,以使客户端通过负载均衡实例与目标云主机建立连接,提供了一种无需借助负载均衡设备便能实现负载均衡功能的新方案,降低了运维投入。In the technical solution provided by the embodiment shown in Figure 1, on the one hand, in response to a load balancing instance creation request, at least two candidate cloud hosts are scheduled from the cloud host resource pool, and one is selected from the IP segment corresponding to each cloud host. Idle IP, and call the domain name server to store the domain names corresponding to at least two idle IPs, and return the domain names to the client, which can avoid the technical problems of business interruption caused by calling a single cloud host for request forwarding each time when the cloud host fails. , improve the system’s emergency handling capabilities. Furthermore, the target IP is associated with the load balancing instance, so that the client can establish a connection with the target cloud host through the load balancing instance, which provides a new solution that can realize the load balancing function without resorting to load balancing equipment, reducing operation and maintenance. Invest.
以下对图1中的各个步骤的具体实现过程进行详细阐述:The specific implementation process of each step in Figure 1 is described in detail below:
负载均衡(Load Balance)指将负载(工作任务)进行平衡、分摊到多个单元上运行,从而提高并发处理能力。负载均衡的作用在于:第一,解决并发压力,提高应用处理性能(增加吞吐量,加强网络处理能力);第二,提供故障转移,实现高可用;第三,通过添加或者减少服务器数量,提供网站伸缩性(扩展性);第四,安全防护。Load Balance refers to balancing and allocating loads (work tasks) to multiple units to improve concurrent processing capabilities. The role of load balancing is: first, to solve concurrency pressure and improve application processing performance (increase throughput and strengthen network processing capabilities); second, to provide failover and achieve high availability; third, to provide high availability by adding or reducing the number of servers. Website scalability (expansibility); fourth, security protection.
在本公开的示例性实施例中,可以预先配置云主机资源池,例如,可以预先创建多个云主机,以形成云主机资源池(即云主机资源池中包括多个云主机)。In an exemplary embodiment of the present disclosure, a cloud host resource pool may be pre-configured. For example, multiple cloud hosts may be pre-created to form a cloud host resource pool (that is, the cloud host resource pool includes multiple cloud hosts).
示例性的,在各个云主机创建完成之后,可以为每个云主机分配一IP段(每个IP段包含多个IP地址,例如:从192.168.0.1到192.168.255.255这就是一个IP段),并在各个云主机上启动负载均衡服务。进一步的,可以向IaaS发送通知消息,以使IssS将该IP段的下一跳指向该云主机。For example, after each cloud host is created, an IP segment can be assigned to each cloud host (each IP segment contains multiple IP addresses, for example: from 192.168.0.1 to 192.168.255.255, this is an IP segment), And start the load balancing service on each cloud host. Further, a notification message can be sent to the IaaS so that the IssS points the next hop of the IP segment to the cloud host.
在配置好云主机资源池之后,若接收到负载均衡实例创建请求,则可以进入步骤S110,在步骤S110中,响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;负载均衡实例用于对外提供客户端的访问入口。After configuring the cloud host resource pool, if a load balancing instance creation request is received, step S110 can be entered. In step S110, in response to the load balancing instance creation request, at least two candidate cloud hosts are scheduled from the cloud host resource pool. ; The load balancing instance is used to provide external client access.
本步骤中,在云主机管理模块接收到负载均衡实例创建请求时,可以从云主机资源池中调度至少两个候选云主机。通过调度至少两个候选云主机,能够保证在任 一候选云主机故障时,有备用的云主机,保证业务的正常运行。In this step, when the cloud host management module receives the load balancing instance creation request, it can schedule at least two candidate cloud hosts from the cloud host resource pool. By scheduling at least two candidate cloud hosts, it can be ensured that when any candidate cloud host fails, there will be a backup cloud host to ensure the normal operation of the business.
其中,负载均衡实例是一个运行的负载均衡服务,用于对外提供客户端的访问入口。Among them, the load balancing instance is a running load balancing service that is used to provide external client access.
示例性的,可以根据随机算法从上述云主机资源池中调度至少两个候选云主机,或者,以预设的轮询调度算法从云主机资源池中调度至少两个候选云主机,可以根据实际情况自行设定,本公开对此不作特殊限定。For example, at least two candidate cloud hosts can be scheduled from the cloud host resource pool according to a random algorithm, or at least two candidate cloud hosts can be scheduled from the cloud host resource pool using a preset round robin scheduling algorithm. The situation is set by oneself, and this disclosure does not impose special restrictions on this.
在步骤S120中,从各候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个空闲IP对应的域名;其中,至少两个空闲IP对应同一域名。In step S120, an idle IP is selected from the IP segments corresponding to each candidate cloud host, and the domain name server is called to store domain names corresponding to at least two idle IPs; wherein at least two idle IPs correspond to the same domain name.
本步骤中,在从云主机资源池中调度至少两个候选云主机之后,云主机管理模块可以从各个候选云主机对应的IP段中各选取一空闲IP。进而,可以将上述空闲IP绑定在候选云主机的回送地址上,其中,回送地址(loopback address)即主机IP堆栈内部的IP,主要用于网络软件测试以及本地机进程间通信,无论什么程序,一旦使用回送地址发送数据,协议软件立即返回之,不进行任何网络传输。In this step, after scheduling at least two candidate cloud hosts from the cloud host resource pool, the cloud host management module may select an idle IP from the IP segment corresponding to each candidate cloud host. Furthermore, the above-mentioned idle IP can be bound to the loopback address of the candidate cloud host. The loopback address is the IP inside the host IP stack. It is mainly used for network software testing and local machine inter-process communication, regardless of the program. , once data is sent using the loopback address, the protocol software returns it immediately without any network transmission.
在选取上述空闲IP之后,可以根据域名规则生成上述空闲IP对应的域名(所有的空闲IP对应同一域名),进而,可以调用DNS域名服务器存储上述空闲IP与域名之间的映射关系,并将生成的域名返回至Kubernetes集群。示例性的,以选取出来的空闲IP为IP_1和IP_2,生成的域名为dn1为例进行说明,参考表1,表1示出DNS域名服务器中所存储的空闲IP与域名之间的映射关系。After selecting the above-mentioned idle IP, the domain name corresponding to the above-mentioned idle IP can be generated according to the domain name rules (all idle IPs correspond to the same domain name). Furthermore, the DNS domain name server can be called to store the mapping relationship between the above-mentioned idle IP and the domain name, and will generate The domain name is returned to the Kubernetes cluster. For example, the selected free IPs are IP_1 and IP_2, and the generated domain name is dn1. Refer to Table 1. Table 1 shows the mapping relationship between the free IPs and domain names stored in the DNS domain name server.
表1Table 1
空闲IPIdle IP 域名domain name
IP_1IP_1 dn1dn1
IP_2IP_2 dn1dn1
通过利用DNS域名服务器存储空闲IP与域名之间的映射关系,使得使用者只需了解易记的域名地址,而无需记忆一长串的IP(不直观,用户记忆十分不方便)。举例而言,当用户在浏览器中输入域名时,浏览器可以将域名转发至DNS域名服务器,以使DNS域名服务器确定域名对应的IP,待DNS域名服务器将IP返回给浏览器时,浏览器可以根据IP发出请求。By using the DNS domain name server to store the mapping relationship between free IPs and domain names, users only need to know the easy-to-remember domain name addresses without having to memorize a long list of IPs (which is not intuitive and very inconvenient for users to remember). For example, when a user enters a domain name in a browser, the browser can forward the domain name to the DNS domain name server so that the DNS domain name server determines the IP corresponding to the domain name. When the DNS domain name server returns the IP to the browser, the browser Requests can be made based on IP.
示例性的,可以基于以下命名规则为上述空闲IP注册域名:$lbname.$lbnamespace.$suffix。其中,lbname为负载均衡标识,示例性的,可以为序号或昵称;lbnamespace为负载均衡所属的组别,示例性的,可以把云主机资源池中的云主机分为多组,每组对应一个组别标识,则lbnamespace可以是候选云主机所属的组别标识;suffix为用户约定的私网子域名,可以根据实际情况自行设定,本公开对此不作特殊限定。For example, a domain name can be registered for the above-mentioned idle IP based on the following naming rules: $lbname.$lbnamespace.$suffix. Among them, lbname is the load balancing identifier, for example, it can be a serial number or nickname; lbnamespace is the group to which the load balancing belongs. For example, the cloud hosts in the cloud host resource pool can be divided into multiple groups, and each group corresponds to a group identifier, then lbnamespace can be the group identifier to which the candidate cloud host belongs; suffix is the private network subdomain name agreed by the user, which can be set according to the actual situation. This disclosure does not impose special restrictions on this.
在步骤S130中,将域名返回至客户端,以使客户端从域名服务器中获取到域名 对应的目标IP;目标IP为至少两个空闲IP中任一。In step S130, the domain name is returned to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of at least two idle IPs.
本步骤中,在注册好域名之后,可以将注册好的域名返回至客户端,进而,客户端可以向DNS域名服务器发送域名解析请求,以从DNS域名服务器中获取到上述域名对应的目标IP。例如,域名服务器在接收到上述域名之后,可以通过随机或轮询的方式从上述域名所对应的空闲IP中选取一目标IP(例如:从表1中的IP_1和IP_2中选取IP_1作为目标IP),并将上述目标IP返回至上述客户端。In this step, after registering the domain name, the registered domain name can be returned to the client, and then the client can send a domain name resolution request to the DNS domain name server to obtain the target IP corresponding to the above domain name from the DNS domain name server. For example, after receiving the above domain name, the domain name server can select a target IP from the idle IPs corresponding to the above domain name in a random or polling manner (for example: select IP_1 from IP_1 and IP_2 in Table 1 as the target IP) , and return the above target IP to the above client.
在步骤S140中,基于目标IP创建负载均衡实例,以使客户端通过负载均衡实例与目标云主机建立连接;目标云主机为目标IP对应的候选云主机。In step S140, a load balancing instance is created based on the target IP, so that the client establishes a connection with the target cloud host through the load balancing instance; the target cloud host is a candidate cloud host corresponding to the target IP.
本步骤中,在确定出目标IP之后,可以基于上述目标IP创建负载均衡实例(由于负载均衡实例可以对外提供客户端的访问入口,从而,当确定了域名对应的目标IP后,相当于确定了与域名对应的负载均衡实例),进而,客户端可以通过负载均衡实例与目标IP对应的目标云主机建立连接。In this step, after the target IP is determined, a load balancing instance can be created based on the above target IP (since the load balancing instance can provide external client access, when the target IP corresponding to the domain name is determined, it is equivalent to determining the target IP corresponding to the domain name. The load balancing instance corresponding to the domain name), and then the client can establish a connection with the target cloud host corresponding to the target IP through the load balancing instance.
在与目标云主机建立连接之后,客户端可以向上述目标IP发送业务请求。目标云主机在接收到上述业务请求之后,可以根据上述负载均衡实例中所包含的负载均衡策略,将上述业务请求转发至指定的后端服务,以实现负载均衡功能。After establishing a connection with the target cloud host, the client can send a service request to the above target IP. After receiving the above-mentioned business request, the target cloud host can forward the above-mentioned business request to the designated back-end service according to the load balancing policy contained in the above-mentioned load balancing instance to implement the load balancing function.
其中,上述业务请求为客户端发出的,用于请求访问互联网或请求网络资源端,业务请求也可以称之为服务请求报文、访问请求报文、访问请求数据包、服务请求数据包、访问请求等,可以根据实际情况自行设定,本公开对此不作特殊限定。Among them, the above-mentioned business request is issued by the client and is used to request access to the Internet or request network resources. The business request can also be called a service request message, an access request message, an access request packet, a service request packet, and an access request. Requests, etc. can be set according to the actual situation, and this disclosure does not impose special restrictions on this.
示例性的,上述负载均衡策略可以是以下任意一种:For example, the above load balancing strategy can be any of the following:
①轮询:对所有的后端服务轮询发送业务请求;①Polling: Poll all back-end services to send business requests;
②最少连接及最少加权连接:最少连接(Least Connections)是在多个服务器中,与处理连接数(会话数)最少的服务器进行通信的算法。即使在每台服务器处理能力各不相同,每笔业务处理量也不相同的情况下,也能够在一定程度上降低服务器的负载。加权最少连接(Weighted Least Connection)为最少连接算法中的每台服务器附加权重的算法,该算法事先为每台服务器分配处理连接的数量,并将业务请求转至连接数最少的服务器上。② Least Connections and Least Weighted Connections: Least Connections is an algorithm for communicating with the server that handles the least number of connections (number of sessions) among multiple servers. Even if the processing capabilities of each server are different and the processing volume of each business is also different, the load of the server can be reduced to a certain extent. Weighted Least Connection is an algorithm that adds a weight to each server in the least connection algorithm. This algorithm allocates the number of connections to each server in advance and transfers business requests to the server with the smallest number of connections.
③随机算法:Random随机,按权重设置随机概率。在一个截面上碰撞的概率高,但调用量越大分布越均匀,而且按概率使用权重后也比较均匀,有利于动态调整提供者权重。③ Random algorithm: Random, set random probability according to weight. The probability of collision on a section is high, but the larger the call volume, the more even the distribution will be, and the weight will be more even after using the weight according to probability, which is conducive to dynamically adjusting the provider weight.
④IP散列:通过管理发送方IP和目的地IP的散列,将来自同一发送方的分组(或发送至同一目的地的分组)统一转发到相同服务器的算法。当客户端有一系列业务需要处理而必须和一个服务器反复通信时,该算法能够以流(会话)为单位,保证来自相同客户端的通信能够一直在同一服务器中进行处理。④IP hashing: An algorithm that uniformly forwards packets from the same sender (or packets sent to the same destination) to the same server by managing the hashes of the sender IP and destination IP. When a client has a series of services to process and must communicate repeatedly with a server, this algorithm can use flow (session) as a unit to ensure that communications from the same client can always be processed in the same server.
⑤URL(Uniform Resource Locator,统一资源定位符)散列:通过管理客户端请求URL信息的散列,将发送至相同URL的请求转发至同一服务器的算法。⑤URL (Uniform Resource Locator, Uniform Resource Locator) hash: An algorithm that forwards requests sent to the same URL to the same server by managing the hash of the client request URL information.
在本公开的示例性实施例中,上述目标云主机还可以周期性监测各后端服务的运行状态,示例性的,可以获取各个后端服务的CPU(Central Processing Unit,中央处理)占用率、内存占用率、磁盘占用率等参数,其中,上述参数均可以通过后端服务自带的任务管理器来获取,进而,可以根据上述参数确定后端服务的运行状态。示例性的,当CPU占用率/内存占用率/磁盘占用率大于或等于预设阈值时,可以确定上述后端服务的运行状态异常,当上述CPU占用率/内存占用率/磁盘占用率均小于上述预设阈值时,可以确定上述后端服务的运行状态正常。In an exemplary embodiment of the present disclosure, the above-mentioned target cloud host can also periodically monitor the running status of each back-end service. For example, the CPU (Central Processing Unit, central processing) occupancy rate of each back-end service can be obtained. Parameters such as memory usage and disk usage, among which the above parameters can be obtained through the task manager that comes with the backend service. Furthermore, the running status of the backend service can be determined based on the above parameters. For example, when the CPU occupancy/memory occupancy/disk occupancy is greater than or equal to the preset threshold, it can be determined that the running status of the above backend service is abnormal. When the above CPU occupancy/memory occupancy/disk occupancy are all less than When the above preset threshold is reached, it can be determined that the running status of the above backend service is normal.
从而,在监测出上述后端服务的运行状态异常时,可以将上述后端服务上存储的数据进行备份,进而,将该运行状态异常的后端服务剔除。Therefore, when the abnormal running status of the above-mentioned back-end service is detected, the data stored on the above-mentioned back-end service can be backed up, and then the back-end service with abnormal running status can be eliminated.
在本公开的示例性实施例中,上述云主机管理模块还可以对目标云主机进行故障监测,可选的,参考图2,图2示出本公开实施例中云主机管理模块对目标云主机进行故障监测的流程示意图,包含步骤S201-步骤S203:In an exemplary embodiment of the present disclosure, the above-mentioned cloud host management module can also perform fault monitoring on the target cloud host. Optionally, refer to Figure 2. Figure 2 shows the cloud host management module in the embodiment of the present disclosure monitoring the target cloud host. A schematic flow chart for fault monitoring, including steps S201 to S203:
在步骤S201中,周期性监测目标云主机的运行状态。In step S201, the operating status of the target cloud host is periodically monitored.
本步骤中,上述云主机管理模块可以周期性监测上述目标云主机的运行状态。示例性的,云主机管理模块可以每间隔2秒(具体时长可以根据实际实际情况自行设定,本公开对此不作特殊限定)向目标云主机发送一心跳检测报文,根据是否接收到该目标云主机的心跳响应报文来确定该目标云主机的运行状态是否正常。示例性的,若在预设时长内接收到上述目标云主机返回的心跳响应报文,则可以确定该目标云主机的运行状态正常,否则,确定出上述目标云主机的运行状态异常。In this step, the cloud host management module can periodically monitor the operating status of the target cloud host. For example, the cloud host management module can send a heartbeat detection message to the target cloud host every 2 seconds (the specific duration can be set according to the actual situation, and this disclosure does not specifically limit this). The heartbeat response message of the cloud host is used to determine whether the operating status of the target cloud host is normal. For example, if the heartbeat response message returned by the target cloud host is received within a preset time period, it can be determined that the operating status of the target cloud host is normal; otherwise, it can be determined that the operating status of the target cloud host is abnormal.
在步骤S202中,响应于监测到目标云主机的运行状态异常,将目标云主机标记为不可调度状态。In step S202, in response to detecting abnormal operating status of the target cloud host, the target cloud host is marked as unschedulable.
本步骤中,若监测到目标云主机的运行状态异常,则可以判断该目标云主机所绑定的IP段是否均已被释放(即当前时刻该IP段中所包含的多个IP均未被占用),若是,则可以执行以下步骤S203,否则,可以执行等待逻辑,待上述IP段中的各IP均被释放之后,执行以下步骤S203。In this step, if the abnormal running status of the target cloud host is detected, it can be determined whether the IP segments bound to the target cloud host have been released (that is, none of the multiple IPs included in the IP segment at the current moment have been released). occupied), if so, the following step S203 can be performed, otherwise, the waiting logic can be executed, and after each IP in the above IP segment is released, the following step S203 can be performed.
在步骤S203中,从云主机资源池中选取目标云主机的备用云主机,以通过备用云主机接替目标云主机。In step S203, a backup cloud host of the target cloud host is selected from the cloud host resource pool to replace the target cloud host with the backup cloud host.
本步骤中,云主机管理模块可以从上述云主机资源池中选取目标云主机的备用云主机,以通过备用云主机接替上述目标云主机。In this step, the cloud host management module may select a backup cloud host of the target cloud host from the cloud host resource pool to replace the target cloud host through the backup cloud host.
示例性的,云主机管理模块可以根据以下条件从云主机资源池中选取上述备用云主机:首先,筛选出所有运行状态正常的云主机(以下称第一集合),进而,确定第一集合中各云主机的空闲IP的数目,从第一集合中筛选出空闲IP的数目满足预设数目条件的云主机(以下称第二集合),进而,可以从该第二集合中随机选取一云主机作为上述备用云主机。For example, the cloud host management module can select the above-mentioned backup cloud host from the cloud host resource pool according to the following conditions: first, filter out all cloud hosts in normal operating status (hereinafter referred to as the first set), and then determine the first set of cloud hosts. The number of idle IPs of each cloud host is selected from the first set to select cloud hosts whose number of idle IPs meets the preset number conditions (hereinafter referred to as the second set). Furthermore, a cloud host can be randomly selected from the second set. As the above backup cloud host.
在选取上述备用云主机之后,可以先将该备用云主机标记为不可调度状态,即 对该备用云主机进行上锁,以避免在备用云主机正式接替目标云主机之前的准备期间内,备用云主机的空闲IP被占用,导致空闲IP不足的情况。After selecting the above-mentioned backup cloud host, you can first mark the backup cloud host as unschedulable, that is, lock the backup cloud host to avoid the backup cloud host from being used during the preparation period before the backup cloud host officially takes over the target cloud host. The host's free IP is occupied, resulting in a shortage of free IPs.
在选取上述备用云主机并将备用云主机标记为不可调度状态之后,上述云主机管理模块还可以在将目标云主机上的数据迁移至备用云主机之后,更新备用云主机的状态,进而,控制备用云主机接替上述目标云主机。可选的,参考图3,图3示出本公开实施例中如何更新备用云主机的状态,以使备用云主机接替目标云主机的流程示意图,包含步骤S301-步骤S303:After selecting the above-mentioned backup cloud host and marking the backup cloud host as unschedulable, the above-mentioned cloud host management module can also update the status of the backup cloud host after migrating the data on the target cloud host to the backup cloud host, thereby controlling The backup cloud host takes over the above target cloud host. Optionally, refer to Figure 3. Figure 3 shows a schematic flow chart of how to update the status of the backup cloud host so that the backup cloud host takes over the target cloud host in an embodiment of the present disclosure, including steps S301 to S303:
在步骤S301中,将目标云主机上存储的数据迁移至备用云主机上。In step S301, data stored on the target cloud host is migrated to the backup cloud host.
本步骤中,可以将目标云主机上存储的数据迁移至上述备用云主机上。In this step, the data stored on the target cloud host can be migrated to the above backup cloud host.
在步骤S302中,从备用云主机关联的IP段中选取一空闲IP,将空闲IP发送至域名服务器,以使域名服务器将目标云主机的空闲IP与域名的映射关系变更为备用云主机的空闲IP与域名的映射关系。In step S302, select an idle IP from the IP segment associated with the backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP of the target cloud host and the domain name to that of the backup cloud host. Mapping relationship between IP and domain name.
本步骤中,可以从上述备用云主机上随机选取一空闲IP(例如:IP_3),并将空闲IP发送至域名服务器,以使域名服务器将目标云主机的空闲IP与域名的映射关系变更为备用云主机的空闲IP与域名的映射关系。In this step, you can randomly select an idle IP (for example: IP_3) from the above-mentioned backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP and the domain name of the target cloud host to the backup one. The mapping relationship between the free IP of the cloud host and the domain name.
从而,参考表2,上述域名服务器中存储的空闲IP与域名的映射关系变更为:Therefore, referring to Table 2, the mapping relationship between the idle IP and the domain name stored in the above domain name server changes to:
表2Table 2
空闲IPIdle IP 域名domain name
IP_2IP_2 dn1dn1
IP_3IP_3 dn1dn1
从而,在目标云主机故障的情况下,本公开可以在客户端无感知的情况下,通过备用云主机接替该目标云主机,使得客户端仍可以通过域名连接到备用云主机,即客户端的访问形式未发生变化。Therefore, when the target cloud host fails, the present disclosure can take over the target cloud host through the backup cloud host without the client being aware of it, so that the client can still connect to the backup cloud host through the domain name, that is, the client's access The form remains unchanged.
在步骤S303中,将备用云主机标记为可调度状态,以通过备用云主机接替目标云主机。In step S303, the backup cloud host is marked as a schedulable state so that the backup cloud host can take over the target cloud host.
本步骤中,在域名服务器更新其中存储的空闲IP与域名之间的映射关系之后,可以将备用云主机标记为可调度状态,以实现通过备用云主机接替目标云主机。In this step, after the domain name server updates the mapping relationship between the idle IP and the domain name stored therein, the backup cloud host can be marked as schedulable, so that the backup cloud host can take over the target cloud host.
示例性的,在将备用云主机标记为可调度状态之后,可以向应用方的管理人员发送告警通知,示例性的,告警内容可以是“目标云主机发生故障,已通过备用云主机接替上述目标云主机”,以向上述管理人员说明故障及故障应对情况,需要说明的是,具体的告警内容可以根据实际情况自行设定,本公开对此不作特殊限定。For example, after marking the backup cloud host as schedulable, an alarm notification can be sent to the manager of the application. For example, the alarm content can be "The target cloud host has failed, and the backup cloud host has taken over the target." Cloud Host" to explain the fault and fault response to the above-mentioned managers. It should be noted that the specific alarm content can be set according to the actual situation, and this disclosure does not impose special restrictions on this.
参考图4,图4示出本公开实施例中在云主机资源池中添加云主机的流程示意图,包含步骤S401-步骤S405:Referring to Figure 4, Figure 4 shows a schematic flow chart of adding a cloud host to a cloud host resource pool in an embodiment of the present disclosure, including steps S401 to S405:
在步骤S401中,云主机管理模块创建云主机;In step S401, the cloud host management module creates a cloud host;
在步骤S402中,IPAM(IP管理模块)从Etcd(Etcd是一个高度一致的分布式键值存储,它提供了一种可靠的方式来存储需要由分布式系统或机器集群访问的数据)中获取未被绑定的IP段并发送至云主机管理模块,以使云主机管理模块为云主机绑定一个IP段;并将云主机与IP段的对应关系存储至Etcd中;In step S402, IPAM (IP Management Module) obtains it from Etcd (Etcd is a highly consistent distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or machine cluster) The unbound IP segment is sent to the cloud host management module, so that the cloud host management module binds an IP segment to the cloud host; and stores the corresponding relationship between the cloud host and the IP segment in Etcd;
在步骤S403中,云主机管理模块初始化负载均衡服务;In step S403, the cloud host management module initializes the load balancing service;
在步骤S404中,云主机管理模块将创建好的云主机添加至云主机资源池中;In step S404, the cloud host management module adds the created cloud host to the cloud host resource pool;
在步骤S405中,云主机管理模块向IaaS发送通知消息,以使IaaS将该新创建的云主机作为其所绑定的IP段的下一跳。In step S405, the cloud host management module sends a notification message to IaaS, so that IaaS uses the newly created cloud host as the next hop of the IP segment to which it is bound.
在创建好云主机之后,若监控到云主机的运行状态异常,则可以将该云主机从上述云主机资源池中剔除。参考图5,图5示出本公开实施例中从云主机资源池中剔除故障云主机的流程示意图,包含步骤S501-步骤S505:After the cloud host is created, if the operating status of the cloud host is abnormal, the cloud host can be removed from the cloud host resource pool. Referring to Figure 5, Figure 5 shows a schematic flowchart of removing faulty cloud hosts from the cloud host resource pool in an embodiment of the present disclosure, including steps S501 to S505:
在步骤S501中,开始;In step S501, start;
在步骤S502中,云主机管理模块向IPAM发送消息,以使IPAM读取Etcd确定该云主机所绑定的IP段是否被释放;若未释放,则执行等待逻辑;In step S502, the cloud host management module sends a message to IPAM, so that IPAM reads Etcd to determine whether the IP segment bound to the cloud host is released; if not, the waiting logic is executed;
在步骤S503中,云主机管理模块若判断出IP段被释放,则终止云主机的运行;In step S503, if the cloud host management module determines that the IP segment is released, it terminates the operation of the cloud host;
在步骤S504中,云主机管理模块终止负载均衡服务;In step S504, the cloud host management module terminates the load balancing service;
在步骤S505中,云主机管理模块更新该云主机为不可调度状态;In step S505, the cloud host management module updates the cloud host to an unschedulable state;
在步骤S506中,云主机管理模块向IaaS发送通知消息,以使IaaS撤销该云主机所绑定的IP段的下一跳配置。In step S506, the cloud host management module sends a notification message to IaaS, so that IaaS revokes the next hop configuration of the IP segment bound to the cloud host.
基于以上实施方式,本公开能够在某个云主机发生故障的时候,快速将其剔除,并利用备用云主机对其进行补位,保障负载均衡性能平稳。Based on the above implementation, the present disclosure can quickly remove a certain cloud host when it fails, and use the backup cloud host to replace it, ensuring stable load balancing performance.
参考图6,图6示出本公开实施例中创建负载均衡实例的流程示意图,包含步骤S601-步骤S606:Referring to Figure 6, Figure 6 shows a schematic flowchart of creating a load balancing instance in an embodiment of the present disclosure, including steps S601 to S606:
在步骤S601中,调度器遍历云主机资源池(向云主机管理模块发送消息,以使云主机管理模块获取云主机信息);In step S601, the scheduler traverses the cloud host resource pool (sends a message to the cloud host management module so that the cloud host management module obtains cloud host information);
在步骤S602中,调度器选取空闲IP最多的至少两个云主机两个候选云主机;In step S602, the scheduler selects at least two cloud hosts with the most idle IPs and two candidate cloud hosts;
在步骤S603中,调度器从各云主机所绑定的IP段中选取空闲IP(向云主机管理模块发送消息,以确定未被占用的空闲);In step S603, the scheduler selects an idle IP from the IP segments bound to each cloud host (sends a message to the cloud host management module to determine the unoccupied idle IP);
在步骤S604中,调度器向云主机管理模块发送状态更新通知,以使云主机管理模块更新云主机的状态为可调度;In step S604, the scheduler sends a status update notification to the cloud host management module, so that the cloud host management module updates the status of the cloud host to be schedulable;
在步骤S605中,调度器创建负载均衡实例,存入负载均衡实例池;In step S605, the scheduler creates a load balancing instance and stores it in the load balancing instance pool;
在步骤S606中,调度器调用DNS域名服务器,为空闲IP注册域名。In step S606, the scheduler calls the DNS domain name server to register a domain name for the idle IP.
在创建好负载均衡实例之后,可以添加该负载均衡实例,并将空闲IP绑定至本地回送地址上,以及,将负载均衡实例关联的负载均衡策略同步至负载均衡配置中,进而,负载均衡服务管理模块更新负载均衡配置,以重新加载负载均衡服务。After creating a load balancing instance, you can add the load balancing instance, bind the idle IP to the local loopback address, and synchronize the load balancing policy associated with the load balancing instance to the load balancing configuration, and then the load balancing service The management module updates the load balancing configuration to reload the load balancing service.
参考图7,图7示出本公开实施例中删除负载均衡实例的流程示意图,包含步骤S701-步骤S705:Referring to Figure 7, Figure 7 shows a schematic flowchart of deleting a load balancing instance in an embodiment of the present disclosure, including steps S701 to S705:
在步骤S701中,调度器更新负载均衡实例的状态为删除;In step S701, the scheduler updates the status of the load balancing instance to delete;
在步骤S702中,调度器注销域名;In step S702, the scheduler cancels the domain name;
在步骤S703中,调度器释放云主机所绑定的(向IPAM发送消息,以使IPAM释放云主机所绑定的);In step S703, the scheduler releases what is bound to the cloud host (sends a message to IPAM to cause IPAM to release what is bound to the cloud host);
在步骤S704中,调度器删除负载均衡实例;In step S704, the scheduler deletes the load balancing instance;
在步骤S705中,调度器向云主机管理模块发送状态更新通知,以使云主机管理模块更新云主机的状态为不可调度。In step S705, the scheduler sends a status update notification to the cloud host management module, so that the cloud host management module updates the status of the cloud host to unschedulable.
在删除负载均衡实例之后,负载均衡服务管理模块可以将空闲IP从本地回送地址上解绑,进而,负载均衡服务管理模块可以更新负载均衡配置,以重新加载负载均衡服务。After deleting the load balancing instance, the load balancing service management module can unbind the idle IP from the local loopback address, and then the load balancing service management module can update the load balancing configuration to reload the load balancing service.
参考图8,图8示出本公开实施例中如何管理云主机的流程示意图,包含步骤S801-步骤S810:Referring to Figure 8, Figure 8 shows a schematic flow chart of how to manage a cloud host in an embodiment of the present disclosure, including steps S801 to S810:
在步骤S801中,云主机管理模块周期性遍历各云主机;In step S801, the cloud host management module periodically traverses each cloud host;
在步骤S802中,云主机管理模块检测各云主机是否处于正常状态;In step S802, the cloud host management module detects whether each cloud host is in a normal state;
若云主机处于正常状态,则进入步骤S803中,云主机管理模块检测负载均衡服务是否处于正常状态;若负载均衡服务处于正常状态,则进入步骤S804中,不动作;否则,进入步骤S805中,触发剔除云主机的机制;If the cloud host is in a normal state, proceed to step S803, and the cloud host management module detects whether the load balancing service is in a normal state; if the load balancing service is in a normal state, proceed to step S804, with no action; otherwise, proceed to step S805, Trigger the mechanism to eliminate cloud hosts;
在步骤S806中,云主机管理模块遍历云主机,通过调度器获取云主机信息,以确定故障云主机的备用云主机;In step S806, the cloud host management module traverses the cloud hosts and obtains cloud host information through the scheduler to determine the backup cloud host of the faulty cloud host;
在步骤S807中,云主机管理模块锁定备用云主机;In step S807, the cloud host management module locks the backup cloud host;
在步骤S808中,云主机管理模块通过调度器迁移发生故障的目标云主机对应的负载均衡实例;In step S808, the cloud host management module migrates the load balancing instance corresponding to the failed target cloud host through the scheduler;
在步骤S809中,云主机管理模块将备用云主机标记为可调度状态;In step S809, the cloud host management module marks the backup cloud host as schedulable;
在步骤S810中,云主机管理模块向相关管理人员发送告警通知,告警通知中包含故障云主机、备用云主机以及备份的负载均衡实例的相关信息。In step S810, the cloud host management module sends an alarm notification to relevant managers. The alarm notification includes information about the faulty cloud host, the backup cloud host, and the backup load balancing instance.
基于以上技术方案,本公开提供了一种普遍适用的负载均衡方案,通过预配置云主机资源池,云主机资源池中部署了kubernetes集群,而客户端通过负载均衡实例可以与云主机资源池中的目标云主机建立连接,进而,通过目标云主机实现业务请求的转发。可见,该方案无需借助相关负载均衡设备提供了一种无需借助负载均衡设备便能从外部访问kubernetes集群进而实现负载均衡功能的新方案,适用于所有IaaS厂商的网络环境,降低了运维投入。Based on the above technical solution, the present disclosure provides a universally applicable load balancing solution. By preconfiguring a cloud host resource pool, a kubernetes cluster is deployed in the cloud host resource pool, and the client can communicate with the cloud host resource pool through the load balancing instance. Establish a connection with the target cloud host, and then forward the business request through the target cloud host. It can be seen that this solution provides a new solution that can access the kubernetes cluster from the outside to achieve the load balancing function without resorting to relevant load balancing equipment. It is suitable for the network environment of all IaaS vendors and reduces operation and maintenance investment.
本公开还提供了一种负载均衡系统,图9示出本公开实施例中负载均衡系统的结构示意图;如图9所示,负载均衡系统900可以包括云主机管理模块910和云主 机资源池920,云主机资源池中包括多个云主机9201,各云主机关联一预分配的IP段。其中:The present disclosure also provides a load balancing system. Figure 9 shows a schematic structural diagram of the load balancing system in an embodiment of the present disclosure. As shown in Figure 9, the load balancing system 900 may include a cloud host management module 910 and a cloud host resource pool 920. , the cloud host resource pool includes multiple cloud hosts 9201, and each cloud host is associated with a pre-allocated IP segment. in:
云主机管理模块910,用于响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;负载均衡实例用于对外提供客户端的访问入口;从各候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个空闲IP对应的域名;其中,至少两个空闲IP对应同一域名;将域名返回至客户端,以使客户端从域名服务器中获取到域名对应的目标IP;目标IP为至少两个空闲IP中任一;基于目标IP创建负载均衡实例,以使客户端通过负载均衡实例与目标云主机建立连接;该目标云主机为目标IP对应的候选云主机;The cloud host management module 910 is used to respond to a load balancing instance creation request and schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access; and the IP corresponding to each candidate cloud host is obtained from Select an idle IP in the segment, call the domain name server to store the domain names corresponding to at least two idle IPs; among them, at least two idle IPs correspond to the same domain name; return the domain name to the client, so that the client obtains the domain name corresponding to the domain name server The target IP; the target IP is any one of at least two idle IPs; create a load balancing instance based on the target IP so that the client can establish a connection with the target cloud host through the load balancing instance; the target cloud host is the candidate cloud corresponding to the target IP host;
目标云主机9201,用于接收客户端通过负载均衡实例发送的业务请求;基于负载均衡实例关联的负载均衡策略,将业务请求转发至指定的后端服务。 Target cloud host 9201 is used to receive business requests sent by the client through the load balancing instance; based on the load balancing policy associated with the load balancing instance, forward the business request to the specified back-end service.
在本公开的示例性实施例中,云主机管理模块910,被配置为:In an exemplary embodiment of the present disclosure, the cloud host management module 910 is configured as:
周期性监测目标云主机的运行状态;Periodically monitor the operating status of the target cloud host;
响应于监测到目标云主机的运行状态异常,将目标云主机标记为不可调度状态;In response to detecting abnormal operating status of the target cloud host, mark the target cloud host as unschedulable;
从云主机资源池中选取目标云主机的备用云主机,以通过备用云主机接替该目标云主机。Select the backup cloud host of the target cloud host from the cloud host resource pool to take over the target cloud host through the backup cloud host.
在本公开的示例性实施例中,备用云主机满足以下条件:In an exemplary embodiment of the present disclosure, the backup cloud host satisfies the following conditions:
备用云主机的运行状态正常,且,备用云主机中空闲IP的数目满足预设数目条件。The running status of the backup cloud host is normal, and the number of idle IPs in the backup cloud host meets the preset number conditions.
在本公开的示例性实施例中,云主机管理模块910,被配置为:In an exemplary embodiment of the present disclosure, the cloud host management module 910 is configured as:
将目标云主机上存储的数据迁移至备用云主机上;Migrate the data stored on the target cloud host to the backup cloud host;
从备用云主机关联的IP段中选取空闲IP,将空闲IP发送至域名服务器,以使域名服务器将目标云主机的空闲IP与域名的映射关系变更为备用云主机的空闲IP与域名的映射关系;Select an idle IP from the IP segment associated with the backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP and the domain name of the target cloud host to the mapping relationship between the idle IP and the domain name of the backup cloud host. ;
将备用云主机标记为可调度状态,以通过备用云主机接替目标云主机。Mark the standby cloud host as schedulable so that the standby cloud host can take over the target cloud host.
在本公开的示例性实施例中,目标云主机9201,被配置为:In an exemplary embodiment of the present disclosure, the target cloud host 9201 is configured as:
周期性监测后端服务的运行状态;Periodically monitor the running status of back-end services;
响应于监测到后端服务的运行状态异常,则删除后端服务上存储的数据,并将后端服务标记为不可调度状态。In response to detecting abnormal running status of the backend service, the data stored on the backend service is deleted and the backend service is marked as unschedulable.
在本公开的示例性实施例中,后端服务的运行状态通过以下一个或多个参数确定:CPU占用率、内存占用率、磁盘占用率。In an exemplary embodiment of the present disclosure, the running status of the backend service is determined by one or more of the following parameters: CPU occupancy, memory occupancy, and disk occupancy.
上述负载均衡系统中各模块的具体细节已经在对应的负载均衡方法中进行了详细的描述,因此此处不再赘述。The specific details of each module in the above load balancing system have been described in detail in the corresponding load balancing method, so they will not be described again here.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的 两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into being embodied by multiple modules or units.
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。Furthermore, although various steps of the methods of the present disclosure are depicted in the drawings in a specific order, this does not require or imply that the steps must be performed in that specific order, or that all of the illustrated steps must be performed to achieve the desired results. result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution, etc.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施方式的方法。Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which may be a personal computer, a server, a mobile terminal, a network device, etc.) to execute a method according to an embodiment of the present disclosure.
本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。This application also provides a computer-readable storage medium. The computer-readable storage medium may be included in the electronic device described in the above embodiments; it may also exist independently without being assembled into the electronic device.
计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmed read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
计算机可读存储介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。Computer-readable storage media may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现如上述实施例中所述的方法。The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.
此外,在本公开实施例中还提供了一种能够实现上述方法的电子设备。In addition, an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art will understand that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as "Circuit", "Module" or "System".
下面参照图10来描述根据本公开的这种实施方式的电子设备1000。图10显示的电子设备1000仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。An electronic device 1000 according to this embodiment of the present disclosure is described below with reference to FIG. 10 . The electronic device 1000 shown in FIG. 10 is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present disclosure.
如图10所示,电子设备1000以通用计算设备的形式表现。电子设备1000的组件可以包括但不限于:上述至少一个处理单元1010、上述至少一个存储单元1020、连接不同系统组件(包括存储单元1020和处理单元1010)的总线1030以及显示单元1040。As shown in Figure 10, electronic device 1000 is embodied in the form of a general computing device. The components of the electronic device 1000 may include, but are not limited to: the above-mentioned at least one processing unit 1010, the above-mentioned at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), and the display unit 1040.
其中,存储单元存储有程序代码,该程序代码可以被处理单元1010执行,使得处理单元1010执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。例如,处理单元1010可以执行如图1中所示的:步骤S110,响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;负载均衡实例用于对外提供客户端的访问入口;步骤S120,从各候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个空闲IP对应的域名;其中,至少两个空闲IP对应同一域名;步骤S130,将域名返回至客户端,以使客户端从域名服务器中获取到域名对应的目标IP;该目标IP为至少两个空闲IP中任一;步骤S140,基于目标IP创建负载均衡实例,以使客户端通过负载均衡实例与目标云主机建立连接;目标IP为负载均衡实例对应的IP,目标云主机为目标IP对应的候选云主机。The storage unit stores program code, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section of this specification. For example, the processing unit 1010 can perform as shown in Figure 1: Step S110, in response to a load balancing instance creation request, schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external client access Entrance; Step S120, select an idle IP from the IP segment corresponding to each candidate cloud host, and call the domain name server to store the domain names corresponding to at least two idle IPs; among which, at least two idle IPs correspond to the same domain name; Step S130, return the domain name to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of at least two idle IPs; step S140, create a load balancing instance based on the target IP so that the client can pass the load The balancing instance establishes a connection with the target cloud host; the target IP is the IP corresponding to the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
存储单元1020可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)10201和/或高速缓存存储单元10202,还可以进一步包括只读存储单元(ROM)10203。The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and/or a cache storage unit 10202, and may further include a read-only storage unit (ROM) 10203.
存储单元1020还可以包括具有一组(至少一个)程序模块10205的程序/实用工具10204,这样的程序模块10205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。 Storage unit 1020 may also include a program/utility 10204 having a set of (at least one) program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples, or some combination, may include the implementation of a network environment.
总线1030可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。 Bus 1030 may be a local area representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or using any of a variety of bus structures. bus.
电子设备1000也可以与一个或多个外部设备1100(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1000交互的设备通信,和/或与使得该电子设备1000能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1050进行。并且,电子设备1000还可以通过网络适配器1060与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1060通过总线1030与电子设备1000的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1000使用其它硬件和/或软件模块,包括 但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。 Electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with electronic device 1000, and/or with Any device that enables the electronic device 1000 to communicate with one or more other computing devices (eg, router, modem, etc.). This communication may occur through input/output (I/O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 1060. As shown, network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030. It should be understood that, although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. . 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. 一种负载均衡方法,预配置云主机资源池,所述云主机资源池中包括多个云主机,各所述云主机关联一预分配的IP段,所述方法包括:A load balancing method that pre-configures a cloud host resource pool. The cloud host resource pool includes multiple cloud hosts, and each cloud host is associated with a pre-allocated IP segment. The method includes:
    响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;所述负载均衡实例用于对外提供客户端的访问入口;In response to the load balancing instance creation request, schedule at least two candidate cloud hosts from the cloud host resource pool; the load balancing instance is used to provide external access to the client;
    从各所述候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个所述空闲IP对应的域名;其中,至少两个所述空闲IP对应同一域名;Select an idle IP from the IP segment corresponding to each candidate cloud host, and call the domain name server to store the domain names corresponding to at least two of the idle IPs; wherein, at least two of the idle IPs correspond to the same domain name;
    将所述域名返回至客户端,以使所述客户端从域名服务器中获取到所述域名对应的目标IP;所述目标IP为所述至少两个空闲IP中任一;Return the domain name to the client, so that the client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of the at least two idle IPs;
    基于所述目标IP创建所述负载均衡实例,以使所述客户端通过所述负载均衡实例与目标云主机建立连接;所述目标IP为所述负载均衡实例对应的IP,所述目标云主机为所述目标IP对应的候选云主机。Create the load balancing instance based on the target IP, so that the client establishes a connection with the target cloud host through the load balancing instance; the target IP is the IP corresponding to the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1, further comprising:
    周期性监测所述目标云主机的运行状态;Periodically monitor the operating status of the target cloud host;
    响应于监测到所述目标云主机的运行状态异常,将所述目标云主机标记为不可调度状态;In response to detecting abnormal operating status of the target cloud host, marking the target cloud host as unschedulable;
    从所述云主机资源池中选取所述目标云主机的备用云主机,以通过所述备用云主机接替所述目标云主机。Select a backup cloud host of the target cloud host from the cloud host resource pool to take over the target cloud host through the backup cloud host.
  3. 根据权利要求2所述的方法,其中,所述备用云主机满足以下条件:The method according to claim 2, wherein the backup cloud host meets the following conditions:
    所述备用云主机的运行状态正常,且,所述备用云主机中空闲IP的数目满足预设数目条件。The running status of the backup cloud host is normal, and the number of idle IPs in the backup cloud host meets the preset number condition.
  4. 根据权利要求3所述的方法,其中,所述方法还包括:The method of claim 3, further comprising:
    将所述目标云主机上存储的数据迁移至所述备用云主机上;Migrate the data stored on the target cloud host to the backup cloud host;
    从所述备用云主机关联的IP段中选取空闲IP,将所述空闲IP发送至域名服务器,以使所述域名服务器将所述目标云主机的空闲IP与所述域名的映射关系变更为所述备用云主机的空闲IP与所述域名的映射关系;Select an idle IP from the IP segment associated with the backup cloud host, and send the idle IP to the domain name server, so that the domain name server changes the mapping relationship between the idle IP of the target cloud host and the domain name to the desired value. The mapping relationship between the idle IP of the backup cloud host and the domain name;
    将所述备用云主机标记为可调度状态,以通过所述备用云主机接替所述目标云主机。Mark the backup cloud host as a schedulable state so that the backup cloud host can take over the target cloud host.
  5. 一种负载均衡方法,应用于目标云主机,所述方法包括:A load balancing method, applied to the target cloud host, the method includes:
    接收客户端通过预先创建的负载均衡实例发送的业务请求;Receive business requests sent by clients through pre-created load balancing instances;
    基于所述负载均衡实例所关联的负载均衡策略,将所述业务请求转发至指定的后端服务。Based on the load balancing policy associated with the load balancing instance, the service request is forwarded to the designated backend service.
  6. 根据权利要求5所述的方法,其中,所述方法还包括:The method of claim 5, further comprising:
    周期性监测所述后端服务的运行状态;Periodically monitor the running status of the backend service;
    响应于监测到所述后端服务的运行状态异常,则删除所述后端服务上存储的数 据,并将所述后端服务标记为不可调度状态。In response to monitoring the abnormal running status of the back-end service, delete the data stored on the back-end service and mark the back-end service as unschedulable.
  7. 根据权利要求6所述的方法,其中,所述后端服务的运行状态通过以下一个或多个参数确定:CPU占用率、内存占用率、磁盘占用率。The method according to claim 6, wherein the running status of the back-end service is determined by one or more of the following parameters: CPU occupancy, memory occupancy, and disk occupancy.
  8. 一种负载均衡系统,包括:A load balancing system including:
    云主机管理模块和云主机资源池;所述云主机管理模块用于管理预配置的云主机资源池,所述云主机资源池中包括多个云主机,各所述云主机关联一预分配的IP段;Cloud host management module and cloud host resource pool; the cloud host management module is used to manage a preconfigured cloud host resource pool. The cloud host resource pool includes multiple cloud hosts, and each cloud host is associated with a pre-allocated IP segment;
    所述云主机管理模块,用于响应于负载均衡实例创建请求,从云主机资源池中调度至少两个候选云主机;所述负载均衡实例用于对外提供客户端的访问入口;从各所述候选云主机对应的IP段中选取一空闲IP,调用域名服务器存储至少两个所述空闲IP对应的域名;其中,至少两个所述空闲IP对应同一域名;将所述域名返回至客户端,以使所述客户端从域名服务器中获取到所述域名对应的目标IP;所述目标IP为所述至少两个空闲IP中任一;基于所述目标IP创建所述负载均衡实例,以使所述客户端通过所述负载均衡实例与目标云主机建立连接;所述目标IP为所述负载均衡实例对应的IP,所述目标云主机为所述目标IP对应的候选云主机;The cloud host management module is used to dispatch at least two candidate cloud hosts from the cloud host resource pool in response to a load balancing instance creation request; the load balancing instance is used to provide external client access; from each of the candidates Select an idle IP from the IP segment corresponding to the cloud host, call the domain name server to store at least two domain names corresponding to the idle IP; wherein, at least two of the idle IPs correspond to the same domain name; return the domain name to the client to The client obtains the target IP corresponding to the domain name from the domain name server; the target IP is any one of the at least two idle IPs; and the load balancing instance is created based on the target IP so that all The client establishes a connection with the target cloud host through the load balancing instance; the target IP is the IP corresponding to the load balancing instance, and the target cloud host is the candidate cloud host corresponding to the target IP;
    所述目标云主机,用于接收客户端通过所述负载均衡实例发送的业务请求;基于所述负载均衡实例关联的负载均衡策略,将所述业务请求转发至指定的后端服务。The target cloud host is used to receive the service request sent by the client through the load balancing instance; and forward the service request to the designated back-end service based on the load balancing policy associated with the load balancing instance.
  9. 一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至8中任意一项所述的负载均衡方法。A computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the load balancing method according to any one of claims 1 to 8 is implemented.
  10. 一种电子设备,包括:An electronic device including:
    处理器;以及processor; and
    存储器,用于存储所述处理器的可执行指令;memory for storing executable instructions for the processor;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至8中任意一项所述的负载均衡方法。Wherein, the processor is configured to execute the load balancing method according to any one of claims 1 to 8 by executing the executable instructions.
PCT/CN2022/142981 2022-04-28 2022-12-28 Load balancing method and system, computer storage medium, and electronic device WO2023207189A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210470381.4 2022-04-28
CN202210470381.4A CN114900526B (en) 2022-04-28 2022-04-28 Load balancing method and system, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023207189A1 true WO2023207189A1 (en) 2023-11-02

Family

ID=82720543

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142981 WO2023207189A1 (en) 2022-04-28 2022-12-28 Load balancing method and system, computer storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN114900526B (en)
WO (1) WO2023207189A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900526B (en) * 2022-04-28 2024-04-16 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic equipment
US11909819B1 (en) * 2022-11-28 2024-02-20 Hewlett Packard Enterprise Development Lp Synchronization of client IP binding database across extended networks leveraging BGP control plane

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055314A (en) * 2017-12-08 2018-05-18 锐捷网络股份有限公司 The management method and group system of a kind of group system
US20210084537A1 (en) * 2018-05-29 2021-03-18 Huawei Technologies Co., Ltd. Load balance method and apparatus thereof
CN112995247A (en) * 2019-12-12 2021-06-18 阿里巴巴集团控股有限公司 Method, device and system for transmitting or processing data
CN114900526A (en) * 2022-04-28 2022-08-12 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic device

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071609B2 (en) * 2012-10-08 2015-06-30 Google Technology Holdings LLC Methods and apparatus for performing dynamic load balancing of processing resources
US9032081B1 (en) * 2014-05-29 2015-05-12 Signiant, Inc. System and method for load balancing cloud-based accelerated transfer servers
US9838482B1 (en) * 2014-12-18 2017-12-05 Amazon Technologies, Inc. Maintaining client/server session affinity through load balancers
CN107590001B (en) * 2017-09-08 2020-12-22 北京京东尚科信息技术有限公司 Load balancing method and device, storage medium and electronic equipment
CN108200218B (en) * 2018-03-09 2021-11-26 北京奇艺世纪科技有限公司 Method and device for realizing load balance and electronic equipment
CN108494868A (en) * 2018-03-30 2018-09-04 三盟科技股份有限公司 A kind of load-balancing method under the operation system based on cloud and system
CN109831524B (en) * 2019-03-11 2023-04-18 平安科技(深圳)有限公司 Load balancing processing method and device
CN111800458B (en) * 2020-05-22 2021-04-23 浙商银行股份有限公司 Dynamic load balancing method and system for Kubernetes container cloud platform
CN112162819B (en) * 2020-09-18 2023-12-22 北京浪潮数据技术有限公司 Application deployment method crossing virtual machines and Kubernetes clusters
CN112437136A (en) * 2020-11-12 2021-03-02 浪潮云信息技术股份公司 Method and system for realizing cloud native load balancing service
CN113783922A (en) * 2021-03-26 2021-12-10 北京沃东天骏信息技术有限公司 Load balancing method, system and device
CN113127199B (en) * 2021-04-22 2023-10-20 康键信息技术(深圳)有限公司 Load balancing configuration method, device, equipment and storage medium
CN113949707B (en) * 2021-09-30 2024-04-30 上海浦东发展银行股份有限公司 OpenResty and K8S-based container cloud service discovery and load balancing method
CN114153592A (en) * 2021-10-29 2022-03-08 郑州云海信息技术有限公司 Physical host load scheduling method and device of cloud platform, electronic equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055314A (en) * 2017-12-08 2018-05-18 锐捷网络股份有限公司 The management method and group system of a kind of group system
US20210084537A1 (en) * 2018-05-29 2021-03-18 Huawei Technologies Co., Ltd. Load balance method and apparatus thereof
CN112995247A (en) * 2019-12-12 2021-06-18 阿里巴巴集团控股有限公司 Method, device and system for transmitting or processing data
CN114900526A (en) * 2022-04-28 2022-08-12 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "[Transfer] Domain Name Load Balancing ---- Combined with cloud resolution to achieve cross-regional load balancing", CSDN BLOG, 5 July 2017 (2017-07-05), XP093102653, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_33973600/article/details/85921427?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167598969516800186582090%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167598969516800186582090&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-85921427-null-null.142v73insert_down3,201v4add_ask,239v1control&utm_term=%E5%9F%9F%E5%90%8D%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%20----%E7%BB%93%E5%90%88%E4%BA%91%E8%A7%A3%E6%9E%90%E5%AE%9E%E7%8E%B0%E8%B7%A8%E5%9C%B0%E5%9F%9F%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1&spm=1018.2226.3001.4187> [retrieved on 20231117] *

Also Published As

Publication number Publication date
CN114900526A (en) 2022-08-12
CN114900526B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN111464592B (en) Load balancing method, device, equipment and storage medium based on micro-service
US11765110B2 (en) Method and system for providing resiliency in interaction servicing across data centers
CN107078969B (en) Realize computer equipment, the system and method for load balancing
US20210328858A1 (en) Communications methods and apparatus for migrating a network interface and/or ip address from one pod to another pod in a kubernetes system
WO2023207189A1 (en) Load balancing method and system, computer storage medium, and electronic device
CN111615066B (en) Distributed micro-service registration and calling method based on broadcast
JP5381998B2 (en) Cluster control system, cluster control method, and program
EP2993838B1 (en) Methods for setting a member identity of gateway device and corresponding management gateway devices
US8321862B2 (en) System for migrating a virtual machine and resource usage data to a chosen target host based on a migration policy
JP2017084406A (en) Scheduling for fabric distributed resource
WO2012122812A1 (en) Resource management method and system, and resource manager
CN108833462A (en) A kind of system and method found from registration service towards micro services
WO2021120633A1 (en) Load balancing method and related device
Xie et al. Supporting seamless virtual machine migration via named data networking in cloud data center
CN113709220B (en) High-availability implementation method and system of virtual load equalizer and electronic equipment
US11799948B2 (en) Cloud service datacenter selection based on data sovereignty policies
US9760370B2 (en) Load balancing using predictable state partitioning
JP2013206112A (en) Computer system and sub-system management method
Hu et al. v-bundle: Flexible group resource offerings in clouds
KR101382177B1 (en) System and method for dynamic message routing
US12015521B2 (en) Using an application programming interface (API) gateway to manage communications in a distributed system
WO2020063251A1 (en) Communication method and related device
WO2023032105A1 (en) Job control system and method for controlling same
WO2023032103A1 (en) Job control system and job control method
WO2023032104A1 (en) Job control system and method for controlling same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22939995

Country of ref document: EP

Kind code of ref document: A1