A load balancer creation method, device, electronic equipment and storage medium
By creating primary and backup cloud hosts in different resource pools of the cloud platform, the availability problem of the load balancer in the cloud platform during failure is solved, and service continuity and reliability are achieved when the primary or backup cloud host fails.
Patent Information
- Application Number
- CN202412000238.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In a cloud platform, when the primary cloud host and the backup cloud host fail, they cannot access resources in the resource pool to complete the load balancing service, resulting in reduced availability of the load balancer.
By obtaining the load balancer creation requirements, the system scans the preset global content library using index information to obtain the target configuration template file. Based on the identification information and sub-configuration information, it determines whether the preset conditions for creating a load balancer are met. Cloud hosts are then created in different resource pools belonging to the primary and backup nodes to ensure that load balancing services can still be completed even if any cloud host fails.
It improves the availability of the load balancer, ensuring that it can still respond to business requests normally when the primary cloud host or the backup cloud host fails, thereby enhancing the service continuity and reliability of the cloud platform.
Smart Images

Figure CN119814797B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for creating a load balancer. Background Technology
[0002] Currently, cloud platforms often manage numerous resource pools. A resource pool is a collection of various hardware and software components involved in a cloud computing virtual data center, allocated based on underlying virtualization technology or business usage scenarios. In response to user service demands, the cloud platform creates service cloud hosts on the physical nodes of the resource pool. To accommodate load balancers, a resource pool is configured with a primary cloud host and a backup cloud host. The primary and backup cloud hosts share the resources within the pool. However, when a resource in the pool fails, neither the primary nor the backup cloud host can utilize that resource to perform load balancing services.
[0003] Therefore, ensuring that load balancing services can still be completed by calling resources from the resource pool through another cloud host when either the primary or backup cloud host fails is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This application provides a load balancer creation method, apparatus, electronic device, and storage medium to address the shortcomings of related technologies, such as reduced availability of load balancers.
[0005] The first aspect of this application provides a method for creating a load balancer, including:
[0006] Obtain load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created.
[0007] When the preset global content library is scanned according to the index information and a target configuration template file matching the index information is obtained, it is determined whether the preset conditions for creating a load balancer are met based on the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file.
[0008] When the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool to which the primary node belongs, and cloud hosts are created in the resource pool to which the backup node belongs, according to the target configuration template file. Creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the backup node belong, respectively, and the resource pools to which the primary node and the backup node belong are different.
[0009] In one optional implementation, the index information includes target tags, target architecture, and file status, and the step of scanning a preset global content library based on the index information includes:
[0010] Based on the target tags represented by the index information, the preset global content library is scanned to filter out candidate configuration template files carrying the target tags in the preset global content library;
[0011] Filter the candidate configuration template files in the candidate configuration template files to find the one that matches the target architecture;
[0012] Based on the file status of each candidate configuration template file, the alternative configuration template files are determined;
[0013] If the alternative configuration template files are not unique, the target configuration template file is determined based on the upload time corresponding to each of the alternative configuration template files.
[0014] In an optional implementation, the method further includes:
[0015] When the preset global content library is scanned according to the index information and no target configuration template file matching the index information is found, an error message is generated so that the target configuration template file can be created locally.
[0016] Add a target tag to the target configuration template file to obtain the configuration template file to be uploaded;
[0017] Upload the configuration template file to be uploaded to the preset global content library.
[0018] In one optional implementation, determining whether the preset conditions for creating a load balancer are met based on the identifier information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information includes:
[0019] Based on the identification information corresponding to the target configuration template file, the target configuration template file is searched in the master image library of the master node to determine whether the target configuration template file exists in the master image library;
[0020] Based on the identification information corresponding to the target configuration template file, the target configuration template file is searched in the backup image library of the backup node to determine whether the target configuration template file exists in the backup image library;
[0021] When it is determined that the target configuration template file exists in both the primary image library and the backup image library, it is determined that the preset conditions for creating the load balancer are met.
[0022] When it is determined that the target configuration template file does not exist in the primary image library and / or backup image library, it is determined that the preset conditions for creating the load balancer are not met.
[0023] The identification information includes a file name, the first sub-configuration information includes the primary image library corresponding to the primary node, and the second sub-configuration information includes the backup image library corresponding to the backup node.
[0024] In an optional implementation, the method further includes:
[0025] When it is determined that the preset conditions for creating a load balancer are not met, an asynchronous task is started to distribute the target configuration template file in the preset global content library to the primary image library corresponding to the primary node and / or the backup image library corresponding to the backup node.
[0026] Return to the step of determining whether the preset conditions for creating a load balancer are met based on the identifier information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information.
[0027] In an optional implementation, the method further includes:
[0028] If it is necessary to update the target configuration template file, the target configuration template file in the preset global content library is updated to obtain a new target configuration template file;
[0029] The new target configuration template file is uploaded to the primary image library and the backup image library, so as to update the configuration of the cloud hosts created in the resource pool to which the primary node belongs and the cloud hosts created in the resource pool to which the backup node belongs, based on the new target configuration template file.
[0030] In an optional implementation, the method further includes:
[0031] Scan a preset virtual disk to obtain multiple configuration template files; wherein, the preset virtual disk stores multiple configuration template files uploaded by the user;
[0032] Based on the multiple configuration template files, the preset global content library is constructed.
[0033] A second aspect of this application provides a load balancer creation apparatus, comprising:
[0034] The acquisition module is used to acquire load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created.
[0035] The judgment module is used to determine whether the preset conditions for creating a load balancer are met when a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, based on the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file.
[0036] A creation module is used to create cloud hosts in the resource pool to which the primary node belongs and in the resource pool to which the backup node belongs, respectively, according to the target configuration template file when it is determined that the preset conditions for creating a load balancer are met. The creation of the load balancer includes creating cloud hosts in the resource pools to which the primary node and the backup node belong, respectively, and the resource pools to which the primary node and the backup node belong are different.
[0037] A third aspect of this application provides an electronic device, comprising: at least one processor and a memory;
[0038] The memory stores computer-executed instructions;
[0039] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method described in the first aspect above and various possible designs of the first aspect.
[0040] The fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method described in the first aspect above and various possible designs of the first aspect.
[0041] The fifth aspect of this application provides a computer program product including computer instructions for causing a computer to perform the methods described in the first aspect above and various possible designs of the first aspect.
[0042] The technical solution of this application has the following advantages:
[0043] This application provides a load balancer creation method, apparatus, electronic device, and storage medium. The method includes: obtaining load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to a template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created, the configuration information including attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created; when a target configuration template file matching the index information is obtained after scanning a preset global content library according to the index information, the method determines whether the preset conditions for creating a load balancer are met based on the identification information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file; when the preset conditions for creating a load balancer are met, the method creates cloud hosts in the resource pool to which the master node belongs and in the resource pool to which the backup node belongs, respectively, according to the target configuration template file, wherein creating a load balancer includes creating cloud hosts in the resource pools to which the master node and the backup node belong, respectively, the resource pools to which the master node and the backup node belong are different. The method provided by the above solution scans a preset global content library for templates and creates cloud hosts for load balancers in two different resource pools based on the target configuration template files obtained from the scan. This ensures that if either the primary cloud host or the backup cloud host fails, the load balancing service can still be completed by calling resources in the resource pool through the other cloud host, thereby improving the availability of the load balancer. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0045] Figure 1 This is a schematic diagram of the structure of the load balancer creation system on which the embodiments of this application are based;
[0046] Figure 2 A flowchart illustrating the load balancer creation method provided in this application embodiment;
[0047] Figure 3 This is a schematic diagram of the cloud platform structure provided in an embodiment of this application;
[0048] Figure 4 A schematic diagram of the structure of an exemplary load balancer creation system provided in the embodiments of this application;
[0049] Figure 5 A schematic diagram of the structure of the load balancer creation device provided in the embodiments of this application;
[0050] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0051] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.
[0054] In related technologies, cloud computing is an add-on, use, and delivery model for internet-based services, typically involving the provision of dynamically scalable and often virtualized resources via the internet. A cloud computing platform, also known as a cloud platform, is a service based on hardware and software resources, providing computing, networking, and storage capabilities. It can be divided into three categories: storage-based cloud platforms primarily for data storage, computing-based cloud platforms primarily for data processing, and comprehensive cloud computing platforms that combine computing, data storage, and processing. Cloud computing breaks down massive data processing programs into countless smaller programs, which are then processed and analyzed by a system composed of multiple servers to obtain results and return them to the user. Therefore, cloud computing can process tens of thousands of data points in a very short time, achieving powerful network services. Current cloud services are no longer simply distributed computing, but rather the result of a hybrid evolution and leap forward of computer technologies such as distributed computing, utility computing, load balancing, parallel computing, network storage, hot backup redundancy, and virtualization.
[0055] Furthermore, cloud computing services include Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). Broadly speaking, cloud computing aggregates numerous computing resources and automates their management through software, enabling rapid resource provision with minimal human intervention. Cloud computing is not a completely new network technology, but rather a new concept of network application. Its core concept is to provide fast and secure cloud computing services and data storage on websites, centered around the internet, allowing everyone who uses the internet to access the vast computing resources and data centers available online.
[0056] In cloud platforms, a server load balancer is a traffic distribution and control service that distributes access traffic to backend server groups (which may include cloud physical machines and cloud hosts) according to forwarding policies. Load balancing extends the service capabilities of applications and enhances their availability. By configuring virtual service addresses, load balancers virtualize the added backend server group members into a high-performance, highly available application service pool, and distribute requests from clients to members of the backend server group according to forwarding rules. Load balancers have good compatibility and traffic processing capabilities for both IPv4 and IPv6, supporting the creation of load balancers using either IPv4 or IPv6 networks and distributing traffic to different backend server group members.
[0057] Cloud platforms often manage numerous resource pools. A resource pool is a collection of various hardware and software involved in a cloud computing virtual data center, and it is a collection of resources divided according to the underlying virtualization technology or business usage scenarios.
[0058] To address the aforementioned issues, this application provides a load balancer creation method, apparatus, electronic device, and storage medium. The method includes: obtaining load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to a template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the primary node to be created, and second sub-configuration information corresponding to the backup node to be created; when a target configuration template file matching the index information is obtained after scanning a preset global content library based on the index information, the method determines whether the preset conditions for creating a load balancer are met based on the identifier information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file; when the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool to which the primary node belongs and in the resource pool to which the backup node belongs, respectively, based on the target configuration template file. The creation of the load balancer includes creating cloud hosts in the resource pools to which the primary node and the backup node belong, respectively, and the resource pools to which the primary node and the backup node belong are different. The method provided by the above solution scans a preset global content library for templates and creates cloud hosts for load balancers in two different resource pools based on the target configuration template files obtained from the scan. This ensures that if either the primary cloud host or the backup cloud host fails, the load balancing service can still be completed by calling resources in the resource pool through the other cloud host, thereby improving the availability of the load balancer.
[0059] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0060] First, the structure of the load balancer creation system on which this application is based will be described:
[0061] The load balancer creation method, apparatus, electronic device, and storage medium provided in this application are applicable to creating load balancers across resource pools on cloud platforms. Figure 1 The diagram shown is a structural schematic of the load balancer creation system based on the embodiments of this application. It mainly includes several resource pools, a preset global content library, and a load balancer creation device. The load balancer creation device is used to store the load balancer configuration template file in the preset global content library, and to create cloud hosts on nodes of different resource pools based on the configuration template file, carrying the core traffic distribution capabilities of the target load balancer.
[0062] This application provides a method for creating a load balancer across resource pools on a cloud platform. The execution subject of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices that can be used to create a load balancer across resource pools on a cloud platform.
[0063] like Figure 2 The diagram shown is a flowchart illustrating a load balancer creation method provided in an embodiment of this application. The method includes:
[0064] Step 201: Obtain the load balancer creation requirements.
[0065] The load balancer creation requirements include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the primary node to be created, and second sub-configuration information corresponding to the backup node to be created.
[0066] Step 202: After scanning the preset global content library according to the index information and obtaining the target configuration template file that matches the index information, determine whether the preset conditions for creating a load balancer are met based on the identification information, first sub-configuration information and second sub-configuration information corresponding to the target configuration template file.
[0067] The index information includes at least the target tag, target architecture, and file status. The configuration template file is either the OVA template file or the ISO file for the load balancer; this file is used to create the cloud hosts that the load balancer will depend on in the future.
[0068] Specifically, in one embodiment, for the creation of a preset global content library, a preset virtual disk can be scanned to obtain multiple configuration template files; wherein, the preset virtual disk stores multiple configuration template files uploaded by the user; and a preset global content library is constructed based on the multiple configuration template files.
[0069] Specifically, an FTP service can be deployed in the cloud platform's deployment environment, and a preset virtual disk can be mounted on it to store configuration template files. The configuration template files are then stored in the preset global content library, meaning the preset virtual disk serves as the storage backend for the preset global content library.
[0070] Specifically, the system scans a preset global content library based on index information to obtain a target configuration template file that matches the index information. Further, the scanned target configuration template file is checked; that is, based on the identifier information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file, it is determined whether the currently obtained target configuration template file meets the preset conditions for creating a load balancer.
[0071] Step 203: When it is determined that the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool to which the master node belongs, and cloud hosts are created in the resource pool to which the backup node belongs, according to the target configuration template file.
[0072] Creating a load balancer involves creating cloud hosts in the resource pools of the primary and backup nodes, respectively, with the primary and backup nodes belonging to different resource pools.
[0073] It should be noted that the load balancer in the cloud platform is created and managed by a separate program that supports the creation, modification, and deletion of load balancers. Each time a load balancer is created, two cloud hosts are created as the primary and backup. These two cloud hosts are also deployed and managed by this program, which is the control plane system. After these two cloud hosts are created, they only provide data plane support for the load balancing service, that is, traffic distribution service.
[0074] Specifically, when the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool belonging to the primary node and the resource pool belonging to the backup node, respectively, according to the target configuration template file. By configuring the primary and backup cloud hosts on primary and backup nodes belonging to different resource pools, the target load balancer can respond to business requests based on either the primary or backup resource pool. Even if either the primary or backup resource pool fails, the target load balancer can still respond to business requests normally, thereby improving the availability of the cloud platform load balancer.
[0075] Among them, such as Figure 3 The diagram shown is a structural schematic of the cloud platform provided in this application embodiment. The cloud platform includes multiple resource pools, each of which includes various resources such as network resources, storage resources, and computing resources. The load balancer depends on the resource pool for operation. The method provided in this application embodiment supports automated and accurate processing of multiple related configuration items across multiple resource pools and multiple architectures. It greatly simplifies user operations when processing OVA templates of different architectures, cross-resource pools, storage pools, and host load balancers.
[0076] Specifically, after creating the primary and backup cloud hosts, the first step is to initialize the target load balancer on both hosts. This initialization can be done using the configuration information in the target configuration template file. These configurations may include network settings, port mappings, health check parameters, and load balancing algorithms. Once started, the load balancer listens for traffic on the ports assigned to it. When a request arrives, the load balancer forwards it to the backend servers of the primary or backup resource pool according to a pre-defined load balancing strategy (such as round-robin, least connections, IP hashing, etc.). In a high-availability configuration, if the primary node or primary resource pool fails, the load balancer can automatically switch to the backup node or backup resource pool. The backup node will take over the traffic, ensuring service continuity.
[0077] Based on the above embodiments, as an implementable approach, in one embodiment, scanning a preset global content library according to index information includes:
[0078] Step 2021: Scan the preset global content library according to the target tags represented by the index information, so as to filter the candidate configuration template files carrying the target tags in the preset global content library;
[0079] Step 2022: Filter the candidate configuration template files that match the target architecture from the candidate configuration template files;
[0080] Step 2023: Determine the alternative configuration template files based on the file status of each candidate configuration template file;
[0081] Step 2024: If there is not a unique alternative configuration template file, determine the target configuration template file based on the upload time of each alternative configuration template file.
[0082] It should be noted that the OVA template files or ISO files in the default global content library carry target tags, such as the tag "load balancer template".
[0083] The index information includes the following attributes for the load balancer: name, virtual data center, CPU architecture (target architecture), specifications, number of CPU cores, memory, virtual private cloud, subnet, and IP address. The name identifies a specific load balancer; the virtual data center limits the tenant scope in which the load balancer is created; the CPU architecture includes x86_64 and aarch64, with the former being x86 architecture and the latter ARM architecture; specifications support both general and custom specifications. General specifications include: Simple: 4C4G, Standard: 8C8G, High-end: 16C16G, High-end II: 16C32G, Super: 32C32G, Super II: 32C64G, where "C" represents the number of CPU cores and "G" represents the memory size (e.g., 4C4G means a 4-core CPU and 4Gib of memory); custom specifications allow users to freely set the number of CPU cores and memory size; the number of CPU cores is used to limit... In a load balancer, the number of CPUs on the cloud host nodes used to support load balancing services is an integer between 4 and 128. This attribute is valid when the specification is custom. Memory limits the memory size of the cloud host nodes used to support load balancing services. It supports MiB and GiB units. When MiB is selected, the range is an integer between 4096 and 4194304. When GiB is selected, the range is an integer between 4 and 4096. This attribute is valid when the specification is custom. Virtual Private Cloud: Builds an isolated, user-configurable and managed virtual network environment. Subnet: Used by the load balancer to provide services externally. IP Address: Used to configure the service IP address of the load balancer to provide services externally, derived from available IP addresses within the subnet.
[0084] The index information includes the first sub-configuration information corresponding to the master node to be created and the second sub-configuration information corresponding to the standby node to be created, which includes: resource pool, host, storage pool, and target image library. A resource pool is a collection of various hardware and software involved in a cloud computing virtual data center. It is a collection of resources divided according to the underlying virtualization technology or business usage scenarios. A virtual data center can be bound to multiple resource pools. A host is the physical hardware device used to create cloud hosts that support load balancing services. A storage pool is based on storage virtualization technology, abstracting different types of storage devices into uniformly managed logical storage resources to provide unified and comprehensive storage services. A target image library refers to the data directory under the resource pool used to store images such as OVA and ISO. When a cloud host is created on a resource pool, its internal design allows it to use only the resource pool's own image library to specify image files for installing the cloud host operating system, deploying built-in services, etc.
[0085] Specifically, the preset global content library stores OVA template files for creating load balancers, which include the operating system, the software suite that carries the load balancing service (traffic distribution service suite), configuration information for necessary configuration, etc. After completion, these files are uploaded to the preset global content library and tagged with "load balancer template". To save configuration template files to a preset global content library, a computing module component can be added to the cloud platform. This component scans all files on preset virtual disks mounted under the deployed FTP service. Users can manually upload files and store them on the FTP service in designated preset virtual disks. The system supports database interaction, storing scanned file data and user-uploaded data in a table within the global content library. Data attributes in the table include file name, status, tags, size, CPU architecture, chip manufacturer, operating system, upload time, etc. Tags can be added or deleted from files in the global content library. Tags are multiple unique strings, including but not limited to "load balancer template," etc. Multiple unique tags can be added to each file, and all tags can be deleted. The system supports retrieving file data stored in the database table based on tags, architecture information, name, status, and other attributes. Paginated retrieval is supported, as well as sorting by name, size, CPU architecture, and upload time in ascending or descending order. The system also supports uploading specified template files from the global content library to the resource pool's image library.
[0086] Specifically, after determining the index information corresponding to the template file of the load balancer to be created, the system first extracts all candidate configuration template files carrying the target tag from the preset global content library based on the target tag (load balancer template tag) represented by the index information. Then, it filters these candidate configuration template files to find those that match the target architecture represented by the index information. Next, it determines whether each candidate configuration template file is in a normal state, and selects those in a normal state as backup configuration template files. Finally, it uses the latest version of the backup configuration template file in a normal state as the target configuration template file. In other words, it can sort the backup configuration template files in reverse chronological order by upload time and attempt to retrieve the first normal backup configuration template file as the target configuration template file.
[0087] Accordingly, in one embodiment, when a target configuration template file matching the index information is not found after scanning the preset global content library based on the index information, an error message is generated to create the target configuration template file locally; a target tag is added to the target configuration template file to obtain the configuration template file to be uploaded; and the configuration template file to be uploaded is uploaded to the preset global content library.
[0088] During the screening process, if the configuration template file with the target tag does not include a candidate configuration template file that matches the target architecture or the status of each candidate configuration template file is abnormal, it is determined that the preset global content library does not include a target configuration template file that meets the creation requirements of the preset load balancer. That is, after scanning the preset global content library according to the index information, no target configuration template file matching the index information is obtained.
[0089] Specifically, if, after screening, it is determined that the preset global content library does not contain a target configuration template file that meets the requirements for creating a preset load balancer, then it can be determined that no load balancer-specific template file has been uploaded to the global content library, or the load balancer-specific template file does not have the target tag "load balancer template", or the load balancer-specific template file is no longer available, i.e., the target configuration template file cannot be obtained from the preset global content library. In this case, an error message can be generated to remind relevant technical personnel to handle the alarm.
[0090] Furthermore, while generating error messages, the system can check whether the corresponding load balancer template file exists in the global content library, or whether the template file is correctly tagged with "load balancer template." If the global content library does not contain a load balancer-specific template file, relevant technical personnel need to upload the missing template. If the template file is not correctly tagged, it needs to be re-tagged or the file information updated. If the template file is no longer available, the latest version of the template file needs to be obtained and uploaded to the preset global content library. This involves creating a target configuration template file locally, adding a target tag to the target configuration template file to obtain the configuration template file to be uploaded, and then uploading the configuration template file to be uploaded to the preset global content library for subsequent scanning and retrieval.
[0091] Based on the above embodiments, as an implementable approach, in one embodiment, determining whether the preset conditions for creating a load balancer are met based on the identifier information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file includes:
[0092] Step 2025: Based on the identification information corresponding to the target configuration template file, search for the target configuration template file in the master image library of the master node to determine whether the target configuration template file exists in the master image library;
[0093] Step 2026: Based on the identification information corresponding to the target configuration template file, search for the target configuration template file in the standby image library of the standby node to determine whether the target configuration template file exists in the standby image library;
[0094] Step 2027: When it is determined that the target configuration template file exists in both the primary image library and the backup image library, it is determined that the preset conditions for creating a load balancer are met.
[0095] Step 2028: When it is determined that the target configuration template file does not exist in the primary image library and / or the backup image library, it is determined that the preset conditions for creating a load balancer are not met.
[0096] The identification information includes the file name, the first sub-configuration information includes the primary image library corresponding to the primary node, and the second sub-configuration information includes the backup image library corresponding to the backup node.
[0097] Accordingly, in one embodiment, when it is determined that the preset conditions for creating a load balancer are not met, an asynchronous task is started to distribute the target configuration template file in the preset global content library to the primary image library corresponding to the primary node and / or the backup image library corresponding to the backup node; then the process returns to the step of determining whether the preset conditions for creating a load balancer are met based on the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file.
[0098] Specifically, such as Figure 4 The diagram shows a schematic of an exemplary load balancer creation system provided in this application embodiment. After uploading the target configuration template file from the preset global content library to the primary mirror library of the primary node and the backup mirror library of the backup node, the system searches for a file with the same name in the target mirror library selected by the primary node and the backup node, respectively, based on the file name of the target configuration template file. If both exist, the system determines that the preset conditions for creating a load balancer are met, and the subsequent creation of the target load balancer proceeds directly. If neither exists, an asynchronous task is initiated to simultaneously distribute the load balancer-specific OVA template file (target configuration template file) from the global content library to the primary mirror library selected by the primary node and the backup mirror library selected by the backup node. If one of the primary or backup nodes does not have the file, an asynchronous task is initiated to distribute the load balancer-specific OVA template file from the global content library to the target mirror library (primary or backup mirror library) selected by the node that does not have the file. Figure 4 The .ova file in the configuration template is the configuration template file. Figure 4 The configuration template file shown carries the "Load Balancer Template" tag.
[0099] Specifically, assuming that both the primary image repository of the primary resource pool and the backup image repository of the backup resource pool include the target configuration template file, cloud hosts carrying load balancing services are created in the primary and backup node resource pools, and built-in services (traffic distribution services) are started in each of them. Finally, the primary and backup node cloud hosts are deployed as a whole service cluster to jointly leverage the core business capabilities of load balancing.
[0100] Specifically, in one embodiment, when it is necessary to update the target configuration template file, the target configuration template file in the preset global content library is updated to obtain a new target configuration template file; the new target configuration template file is uploaded to the primary image library and the backup image library, so as to update the configuration of the cloud hosts created in the resource pool to which the primary node belongs and the cloud hosts created in the resource pool to which the backup node belongs, based on the new target configuration template file.
[0101] Specifically, regardless of the number of resource pools on the cloud platform, it has the capability to automatically distribute dedicated template files for load balancers, achieving full coverage. Users only need to simply upload dedicated template files for multiple architectures to the global content library and tag them as "load balancer templates." This provides the effect of centralized management and distributed deployment, greatly simplifying user operations and bringing high flexibility. It also offers extremely high management efficiency when centrally managing very large-scale resource pools. Another advantage is that the target configuration template file is only distributed from the global content library to the target image library of the corresponding node when a load balancer is created for the first time in a primary or backup resource pool. Subsequent creations do not require repeated distribution of this file; the previously distributed file will be directly scheduled from the target image library to create the load balancer.
[0102] Furthermore, this overall design supports smooth rolling upgrades. If, after using the service for a period of time, a user needs to add advanced features and finds that the content of the dedicated template file needs optimization, they only need to rewrite the dedicated template file after optimization, specify a new file name, and then simply upload it to the preset global content library and tag it as "load balancer template". Subsequently, when creating a new load balancer, this new dedicated template file will be automatically selected and distributed to the target image library of the primary and backup node resource pools. This template file will be used to rebuild the two primary and backup cloud hosts under the load balancer. After the new ones are rebuilt, the old two cloud hosts will be deleted to update the configuration of the cloud hosts. The newly rebuilt cloud hosts will be updated in the basic information of the current load balancer. The load balancing capacity of subsequent traffic distribution will be distributed to the two new cloud hosts to process, thereby optimizing the traffic distribution service of the target load balancer provided by the primary and backup cloud hosts. The entire process requires no manual intervention.
[0103] The load balancer creation method provided in this application embodiment obtains load balancer creation requirements, which include index information corresponding to the template file of the load balancer to be created and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created. When a target configuration template file matching the index information is obtained after scanning a preset global content library based on the index information, the method determines whether the preset conditions for creating a load balancer are met based on the identifier information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file. When it is determined that the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool to which the master node belongs and in the resource pool to which the backup node belongs, respectively, according to the target configuration template file. The creation of the load balancer includes creating cloud hosts in the resource pools to which the master node and the backup node belong, respectively, and the resource pools to which the master node and the backup node belong are different. The method described above performs template scanning on a pre-defined global content library and creates cloud hosts for load balancers in two different resource pools based on the target configuration template files obtained from the scan. This ensures that even if either the primary or backup cloud host fails, the load balancing service can still be completed by utilizing resources from the other cloud host in the resource pool, thereby improving the availability of the load balancer. Furthermore, it can automatically manage dedicated template files, significantly enhancing reliability while reducing user operational complexity and improving the compatibility and flexibility of load balancer creation.
[0104] This application provides a load balancer creation apparatus for executing the load balancer creation method provided in the above embodiments.
[0105] like Figure 5 The diagram shown is a structural schematic of a load balancer creation device provided in an embodiment of this application. The load balancer creation device 50 includes: an acquisition module 501, a judgment module 502, and a creation module 503.
[0106] The module includes an acquisition module for acquiring load balancer creation requirements, which include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the primary node to be created, and second sub-configuration information corresponding to the backup node to be created. The judgment module, when scanning a preset global content library based on the index information and obtaining a target configuration template file matching the index information, determines whether the preset conditions for creating a load balancer are met based on the identifier information, first sub-configuration information, and second sub-configuration information corresponding to the target configuration template file. The creation module, when determining that the preset conditions for creating a load balancer are met, creates cloud hosts in the resource pool to which the primary node belongs and in the resource pool to which the backup node belongs, respectively, based on the target configuration template file. Creating a load balancer includes creating cloud hosts in the resource pools to which the primary node and backup node belong, respectively, and the resource pools to which the primary node and backup node belong are different.
[0107] Regarding the load balancer creation device in this embodiment, the specific methods by which each module performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0108] The load balancer creation device provided in this application embodiment is used to execute the load balancer creation method provided in the above embodiment. Its implementation method and principle are the same, and will not be described again.
[0109] This application provides an electronic device for executing the load balancer creation method provided in the above embodiments.
[0110] like Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. The electronic device 60 includes at least one processor 61 and a memory 62.
[0111] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to execute the load balancer creation method provided in the above embodiment.
[0112] The electronic device provided in this application embodiment is used to execute the load balancer creation method provided in the above embodiment. Its implementation method and principle are the same, and will not be described again.
[0113] This application provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the load balancer creation method provided in any of the above embodiments.
[0114] The storage medium containing computer-executable instructions provided in this application embodiment can be used to store the computer-executable instructions of the load balancer creation method provided in the foregoing embodiment. Its implementation method and principle are the same, and will not be described again.
[0115] This application provides a computer program product, including computer instructions, which are used to cause a computer to execute the load balancer creation method provided in the foregoing embodiments.
[0116] The computer program product provided in this application embodiment can be used to execute the computer instructions for the load balancer creation method provided in the foregoing embodiment. Its implementation method and principle are the same, and will not be described again.
[0117] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0118] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0119] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0120] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the present invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0122] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for creating a load balancer, characterized in that, include: Obtain load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created. When the preset global content library is scanned according to the index information and a target configuration template file matching the index information is obtained, it is determined whether the preset conditions for creating a load balancer are met based on the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file. When the preset conditions for creating a load balancer are met, cloud hosts are created in the resource pool to which the primary node belongs, and cloud hosts are created in the resource pool to which the backup node belongs, according to the target configuration template file. Creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the backup node belong, respectively, and the resource pools to which the primary node and the backup node belong are different.
2. The method according to claim 1, characterized in that, The index information includes target tags, target architecture, and file status. The step of scanning the preset global content library based on the index information includes: Based on the target tags represented by the index information, the preset global content library is scanned to filter out candidate configuration template files carrying the target tags in the preset global content library; Filter the candidate configuration template files in the candidate configuration template files to find the one that matches the target architecture; Based on the file status of each candidate configuration template file, the alternative configuration template files are determined; If the alternative configuration template files are not unique, the target configuration template file is determined based on the upload time corresponding to each of the alternative configuration template files.
3. The method according to claim 2, characterized in that, The method further includes: When the preset global content library is scanned according to the index information and no target configuration template file matching the index information is found, an error message is generated so that the target configuration template file can be created locally. Add a target tag to the target configuration template file to obtain the configuration template file to be uploaded; Upload the configuration template file to be uploaded to the preset global content library.
4. The method according to claim 1, characterized in that, The step of determining whether the preset conditions for creating a load balancer are met based on the identifier information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information includes: Based on the identification information corresponding to the target configuration template file, the target configuration template file is searched in the master image library of the master node to determine whether the target configuration template file exists in the master image library; Based on the identification information corresponding to the target configuration template file, the target configuration template file is searched in the backup image library of the backup node to determine whether the target configuration template file exists in the backup image library; When it is determined that the target configuration template file exists in both the primary image library and the backup image library, it is determined that the preset conditions for creating the load balancer are met. When it is determined that the target configuration template file does not exist in the primary image library and / or backup image library, it is determined that the preset conditions for creating the load balancer are not met. The identification information includes a file name, the first sub-configuration information includes the primary image library corresponding to the primary node, and the second sub-configuration information includes the backup image library corresponding to the backup node.
5. The method according to claim 1, characterized in that, The method further includes: When it is determined that the preset conditions for creating a load balancer are not met, an asynchronous task is started to distribute the target configuration template file in the preset global content library to the primary image library corresponding to the primary node and / or the backup image library corresponding to the backup node. Return to the step of determining whether the preset conditions for creating a load balancer are met based on the identifier information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information.
6. The method according to claim 5, characterized in that, The method further includes: If it is necessary to update the target configuration template file, the target configuration template file in the preset global content library is updated to obtain a new target configuration template file; The new target configuration template file is uploaded to the primary image library and the backup image library, so as to update the configuration of the cloud hosts created in the resource pool to which the primary node belongs and the cloud hosts created in the resource pool to which the backup node belongs, based on the new target configuration template file.
7. The method according to claim 1, characterized in that, The method further includes: Scan a preset virtual disk to obtain multiple configuration template files; wherein, the preset virtual disk stores multiple configuration template files uploaded by the user; Based on the multiple configuration template files, the preset global content library is constructed.
8. A load balancer creation device, characterized in that, include: The acquisition module is used to acquire load balancer creation requirements, wherein the load balancer creation requirements include index information corresponding to the template file of the load balancer to be created, and configuration information corresponding to the load balancer to be created. The configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to the master node to be created, and second sub-configuration information corresponding to the backup node to be created. The judgment module is used to determine whether the preset conditions for creating a load balancer are met when a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, based on the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file. A creation module is used to create cloud hosts in the resource pool to which the primary node belongs and in the resource pool to which the backup node belongs, respectively, according to the target configuration template file when it is determined that the preset conditions for creating a load balancer are met. The creation of the load balancer includes creating cloud hosts in the resource pools to which the primary node and the backup node belong, respectively, and the resource pools to which the primary node and the backup node belong are different.
9. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-organization collaboration platform-based data backup storage management method
CN106598782A
Load balancing application creating method and device, computer equipment and storage medium
CN110224860A