Load balancer creation method and device, electronic equipment and storage medium

By creating a load balancer across resource pools in the cloud platform, the problem that the primary cloud host and the backup cloud host cannot provide load balancing services when the resource pool fails, achieving the effect of improving the availability of load balancers.

CN119814797AActive Publication Date: 2025-04-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202412000238.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the cloud platform, the primary cloud host and the backup cloud host cannot continue to provide load balancing services when the resource pool fails, resulting in a reduced availability of the load balancer.

Method used

By obtaining the load balancer creation requirements, including the index information and configuration information of the template file, scanning the preset global content library to obtain the target configuration template file, and creating cloud hosts in different resource pools to which the primary and secondary nodes belong to, according to the template file, to ensure that load balancing services can still be completed in the event of any cloud host failure.

Benefits of technology

Improves the availability of load balancers to ensure that when a primary cloud host or backup cloud host fails, another cloud host can still call resources in the resource pool to complete the load balance service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814797A_ABST
    Figure CN119814797A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a load balancer creation method and device, electronic equipment and a storage medium, and the method comprises the steps: scanning a preset global content library according to index information, and when a target configuration template file matched with the index information is obtained, obtaining a target configuration template file; according to identification information corresponding to the target configuration template file, the first sub-configuration information and the second sub-configuration information, judging whether a preset condition for creating a load balancer exists or not; and when it is determined that the preset condition for creating the load balancer exists, creating a cloud host in a resource pool to which the main node belongs and creating a cloud host in a resource pool to which the standby node belongs according to the target configuration template file. The cloud hosts are created in the two different resource pools respectively based on the target configuration template file obtained through scanning, and when any cloud host breaks down, the other cloud host can call the resources in the resource pool to complete load balancing service, so that the availability of the load balancer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for creating a load balancer. Background Art

[0002] At present, cloud platforms often manage a large number of resource pools. Resource pools are a collection of various hardware and software involved in cloud computing virtual data centers. They are a collection of resources divided according to the underlying virtualization technology or business usage scenarios. In response to user service needs, cloud platforms create service cloud hosts on the physical nodes of resource pools. To adapt to the load balancer, a resource pool is configured with a primary cloud host and a backup cloud host. The primary cloud host and the backup cloud host share the resources in the resource pool. However, when a resource in the resource pool fails, neither the primary cloud host nor the backup cloud host will be able to call the resource to complete the load balancing service.

[0003] Therefore, how to ensure that when any cloud host among the primary cloud host and the backup cloud host fails, the load balancing service can still be completed by calling the resources in the resource pool through another cloud host is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a load balancer creation method, device, electronic device and storage medium to solve the defects of related technologies such as reduced availability of the load balancer.

[0005] The first aspect of the present application provides a method for creating a load balancer, comprising:

[0006] Obtaining a load balancer creation requirement, wherein the load balancer creation requirement includes index information corresponding to a template file of a load balancer to be created, and configuration information corresponding to the load balancer to be created, wherein the configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to a master node to be created, and second sub-configuration information corresponding to a standby node to be created;

[0007] When a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, judging whether the preset conditions for creating a load balancer are met according to the identification information corresponding to the target configuration template file, the first sub-configuration information and the second sub-configuration information;

[0008] When it is determined that the preset conditions for creating a load balancer are met, a cloud host is created in the resource pool to which the primary node belongs, and a cloud host is created in the resource pool to which the standby node belongs, according to the target configuration template file, wherein creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different.

[0009] In an optional implementation, the index information includes a target tag, a target architecture, and a file status, and scanning a preset global content library according to the index information includes:

[0010] Scanning the preset global content library according to the target tag represented by the index information to screen the candidate configuration template file carrying the target tag in the preset global content library;

[0011] Screening a candidate configuration template file that matches the target architecture from among the candidate configuration template files;

[0012] Determining a candidate configuration template file according to the file status of each of the candidate configuration template files;

[0013] In the case that the candidate configuration template file is not unique, the target configuration template file is determined according to the upload time corresponding to each of the candidate configuration template files.

[0014] In an optional embodiment, 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 obtained, an abnormal prompt message is generated to create the target configuration template file locally;

[0016] Adding a target tag to the target configuration template file to obtain a configuration template file to be uploaded;

[0017] Upload the configuration template file to be uploaded to the preset global content library.

[0018] In an optional implementation, judging whether preset conditions for creating a load balancer are met according to the identification information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information includes:

[0019] According to the identification information corresponding to the target configuration template file, searching the target configuration template file from the master image library of the master node to determine whether the target configuration template file exists in the master image library;

[0020] According to the identification information corresponding to the target configuration template file, searching the target configuration template file from the standby image library of the standby node to determine whether the target configuration template file exists in the standby image library;

[0021] When it is determined that the target configuration template file exists in the primary image library and the backup image library respectively, 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 the backup image library, it is determined that the preset condition for creating the load balancer is not met;

[0023] The identification information includes a file name, the first sub-configuration information includes a primary image library corresponding to the primary node, and the second sub-configuration information includes a backup image library corresponding to the backup node.

[0024] In an optional embodiment, 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 preset conditions for creating a load balancer are met based on the identification information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information.

[0027] In an optional embodiment, the method further includes:

[0028] When the target configuration template file needs to be updated, 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 to update the configuration of the cloud host created in the resource pool to which the primary node belongs and the cloud host created in the resource pool to which the backup node belongs based on the new target configuration template file.

[0030] In an optional embodiment, the method further includes:

[0031] Scanning a preset virtual disk to obtain a plurality of configuration template files; wherein the preset virtual disk stores a plurality of configuration template files uploaded by a user;

[0032] The preset global content library is constructed based on the multiple configuration template files.

[0033] A second aspect of the present application provides a load balancer creation device, comprising:

[0034] An acquisition module, configured to acquire a load balancer creation requirement, wherein the load balancer creation requirement includes index information corresponding to a template file of a load balancer to be created, and configuration information corresponding to the load balancer to be created, wherein the configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to a master node to be created, and second sub-configuration information corresponding to a standby node to be created;

[0035] A judgment module, configured to, when a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, judge whether the preset conditions for creating a load balancer are met according to the identification information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information;

[0036] A creation module, which is used to create a cloud host in the resource pool to which the primary node belongs and a cloud host in the resource pool to which the standby node belongs according to the target configuration template file when it is determined that the preset conditions for creating a load balancer are met, wherein creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different.

[0037] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;

[0038] The memory stores computer-executable instructions;

[0039] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.

[0040] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.

[0041] A fifth aspect of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the method described in the first aspect and various possible designs of the first aspect.

[0042] The technical solution of this application has the following advantages:

[0043] The present application provides a load balancer creation method, device, electronic device and storage medium, the method comprising: obtaining a load balancer creation requirement, wherein the load balancer creation requirement comprises index information corresponding to a template file of a load balancer to be created, and configuration information corresponding to the load balancer to be created, the configuration information comprising attribute information corresponding to the load balancer, first sub-configuration information corresponding to a primary node to be created, and second sub-configuration information corresponding to a standby node to be created; when a preset global content library is scanned according to the index information, and a target configuration template file matching the index information is obtained, judging whether a preset condition for creating a load balancer is met according to identification information, first sub-configuration information and second sub-configuration information corresponding to the target configuration template file; when it is determined that the preset condition for creating a load balancer is met, creating a cloud host in a resource pool to which the primary node belongs, and creating a cloud host in a resource pool to which the standby node belongs, respectively, according to the target configuration template file, wherein creating the load balancer comprises creating cloud hosts in resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different. The method provided by the above scheme performs template scanning on the preset global content library, and creates cloud hosts for hosting the load balancer in two different resource pools based on the target configuration template files obtained by the scan, so as to ensure that when any cloud host among the primary cloud host and the backup cloud host fails, the load balancing service can still be completed by calling the resources in the resource pool through another cloud host, so as to improve the availability of the load balancer. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0045] Figure 1 A schematic diagram of the structure of the load balancer creation system based on the embodiment of the present application;

[0046] Figure 2 A flow chart of a method for creating a load balancer provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the structure of the cloud platform provided in the embodiment of the present application;

[0048] Figure 4 A schematic diagram of the structure of an exemplary load balancer creation system provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of the structure of a load balancer creation device provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0054] In related technologies, cloud computing is a mode of increasing, using and delivering related services based on the Internet, which usually involves providing dynamic, scalable and often virtualized resources through the Internet. Cloud computing platform, also known as cloud platform, is a service based on hardware resources and software resources, providing computing, network and storage capabilities. It can be divided into three categories, namely storage cloud platform mainly for data storage, computing cloud platform mainly for data processing, and comprehensive cloud computing platform that takes both computing and data storage processing into account. Cloud computing decomposes huge data computing processing programs into countless small programs, and then processes and analyzes these small programs through a system composed of multiple servers, obtains results and returns them to users. Therefore, cloud computing can complete the processing of tens of thousands of data in a very short time, thereby achieving powerful network services. At this stage, cloud services are no longer just a kind of distributed computing, but the result of the hybrid evolution and leap of computer technologies such as distributed computing, utility computing, load balancing, parallel computing, network storage, hot backup redundancy and virtualization.

[0055] In addition, cloud computing services include Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS). In a broad sense, cloud computing brings together many computing resources and implements automated management through software, which can quickly provide resources with only a few people involved. Cloud computing is not a new network technology, but a new network application concept. Its core concept is to provide fast and secure cloud computing services and data storage on the website with the Internet as the center, so that everyone who uses the Internet can use the huge computing resources and data centers on the network.

[0056] In the cloud platform, Server Load Balancer is a traffic distribution control service that distributes access traffic to backend server groups (backend server groups, which can include cloud physical machines and cloud hosts) according to forwarding strategies. Load balancing expands the service capabilities of applications and enhances the availability of applications. By setting virtual service addresses, load balancing virtualizes the added backend server group members into a high-performance, highly available application service pool, and distributes requests from clients to members in the backend server group according to forwarding rules. Load balancers have good compatibility and traffic processing capabilities for both IPv4 and IPv6, support the creation of load balancers using IPv4 or IPv6 networks, and distribute traffic to different backend server group members.

[0057] Cloud platforms often manage a large number of resource pools. 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.

[0058] In response to the above problems, an embodiment of the present application provides a load balancer creation method, device, electronic device and storage medium, the method comprising: obtaining a load balancer creation requirement, wherein the load balancer creation requirement includes index information corresponding to a template file of a 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 a primary node to be created, and second sub-configuration information corresponding to a standby node to be created; when a preset global content library is scanned according to the index information, and a target configuration template file matching the index information is obtained, judging whether the preset conditions for creating the load balancer are met according to identification 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 the load balancer are met, creating a cloud host in a resource pool to which the primary node belongs, and creating a cloud host in a resource pool to which the standby node belongs, respectively, according to the target configuration template file, wherein creating the load balancer includes creating cloud hosts in resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different. The method provided by the above scheme performs template scanning on the preset global content library, and creates cloud hosts for hosting the load balancer in two different resource pools based on the target configuration template files obtained by the scan, so as to ensure that when any cloud host among the primary cloud host and the backup cloud host fails, the load balancing service can still be completed by calling the resources in the resource pool through another cloud host, so as to improve the availability of the load balancer.

[0059] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0060] First, the structure of the load balancer creation system on which this application is based is described:

[0061] The load balancer creation method, device, electronic device and storage medium provided in the embodiments of the present application are suitable for creating a load balancer across resource pools of a cloud platform. Figure 1 As shown, it is a schematic diagram of the structure of the load balancer creation system based on the embodiment of the present application, which mainly includes several resource pools, a preset global content library and a load balancer creation device. Among them, the load balancer creation device is used to save the configuration template file of the load balancer in the preset global content library, so as to create a cloud host carrying the service of the target load balancer to realize the core traffic distribution capability on the nodes of different resource pools based on the configuration template file.

[0062] The embodiment of the present application provides a load balancer creation method for creating a load balancer across resource pools of a cloud platform. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used to create a load balancer across resource pools of a cloud platform.

[0063] like Figure 2 FIG. 1 is a flow chart of a method for creating a load balancer provided in an embodiment of the present application, the method comprising:

[0064] Step 201, obtaining a load balancer creation requirement.

[0065] Among them, the load balancer creation requirement includes 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 standby node to be created.

[0066] Step 202, 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 according to the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file.

[0067] The index information at least includes a target tag, a target architecture, and a file status, etc. The configuration template file is an OVA template file or an ISO file of the load balancer, which is used to create a cloud host that the load balancer depends 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 based on the multiple configuration template files, a preset global content library is constructed.

[0069] Specifically, a set of FTP services can be deployed in the deployment environment of the cloud platform, and a preset virtual disk can be mounted on it to store configuration template files, so as to store the configuration template files in the preset global content library, that is, the preset virtual disk is the storage backend of the preset global content library.

[0070] Specifically, the preset global content library is scanned according to the index information to obtain a target configuration template file that matches the index information in the preset global content library. Further, the scanned target configuration template file is checked, that is, according to the identification information, the first sub-configuration information and the second sub-configuration information corresponding to the target configuration template file, it is determined whether the preset conditions for creating a load balancer are met based on the currently obtained target configuration template file.

[0071] Step 203, when it is determined that the preset conditions for creating a load balancer are met, a cloud host is created in the resource pool to which the master node belongs and a cloud host is created in the resource pool to which the standby node belongs according to the target configuration template file.

[0072] The creation of the load balancer includes creating cloud hosts in resource pools to which the master node and the standby node belong respectively, and the resource pools to which the master node and the standby node belong are different.

[0073] It should be noted that the load balancer in the cloud platform is created and managed by a separate program, which supports the creation, modification, and deletion of load balancers. Every time a load balancer is created, two cloud hosts will be created as the primary and backup. These two cloud hosts are also deployed and managed by this program. This program is the control plane system. After the two cloud hosts are created, they only provide data plane support for the load balancing service, that is, the traffic distribution service.

[0074] Specifically, when it is determined that the preset conditions for creating a load balancer are met, a cloud host is created in the resource pool to which the primary node belongs, and a cloud host is created in the resource pool to which the backup node belongs, respectively, according to the target configuration template file. By configuring the primary cloud host and the backup cloud host in the primary node and the backup node belonging to different resource pools, the target load balancer can respond to business requests based on the primary resource pool or the backup resource pool. Even if the primary resource pool or the 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, Figure 3 As shown, it is a structural diagram of the cloud platform provided in the embodiment of the present application. The cloud platform includes multiple resource pools, each resource pool includes multiple resources, such as network resources, storage resources and computing resources, etc. The load balancer relies on the resource pool to run. The method provided in the embodiment of the present application supports automatic and accurate processing of multiple related configuration items across multiple resource pools and multiple architectures, which greatly simplifies user operations when processing OVA templates of different architectures and building load balancers across resource pools, storage pools and hosts.

[0076] Specifically, after completing the creation of the primary cloud host and the backup cloud host, first initialize the target load balancer configuration for the primary cloud host and the backup cloud host. Specifically, you can use the configuration information in the target configuration template file to initialize the load balancer. These configurations may include network settings, port mapping, health check parameters, load balancing algorithms, etc. After the load balancer is started, it starts listening to traffic on the port assigned to it. When a request arrives, the load balancer forwards the request to the backend server of the primary resource pool or the backup resource pool according to the preset load balancing strategy (such as polling, least connection, IP hash, etc.). In a high availability configuration, if the primary node or the primary resource pool fails, the load balancer can automatically switch to the backup node and the backup resource pool. The backup node will take over the traffic to ensure the continuity of the service.

[0077] Based on the above embodiment, as an implementable manner, 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 tag represented by the index information to select the candidate configuration template file carrying the target tag in the preset global content library;

[0079] Step 2022, screening candidate configuration template files that match the target architecture from among the candidate configuration template files;

[0080] Step 2023, determining a candidate configuration template file according to the file status of each candidate configuration template file;

[0081] Step 2024: When the candidate configuration template files are not unique, determine the target configuration template file according to the upload time corresponding to each candidate configuration template file.

[0082] It should be noted that the OVA template file or ISO file in the preset global content library carries a target tag, such as the tag "load balancer template".

[0083] Among them, the attribute information corresponding to the load balancer contained in the index information specifically includes: name, virtual data center, CPU architecture (target architecture), specifications, number of CPU cores, memory, virtual private cloud, subnet and IP address, etc. Among them, the name is used to identify the special name of a load balancer; the virtual data center is used to limit the scope of the tenant category in which the load balancer is created; the CPU architecture includes x86_64 and aarch64, of which the former is the x86 architecture and the latter is the arm architecture; specifications: support general specifications and custom specifications, general specifications include simple type: 4C4G, standard type: 8C8G, high-end type: 16C16G, high-end type II: 16C32G, super type: 32C32G, super type II: 32C64G, among which "C" represents the number of CPU cores and "G" represents the memory size, such as 4C4G represents a 4-core CPU and 4Gib of memory; custom specifications support free setting of the number of CPU cores and memory size; the number of CPU cores is used to limit Specifies the number of CPUs of the node cloud host used to carry the load balancing service in the load balancer. The range is an integer between 4 and 128. This attribute is valid when the specification is custom. Memory is used to limit the memory size of the node cloud host used to carry the load balancing service in the load balancer. It supports MiB and GiB. 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 virtual network environment that is configured and managed by users themselves. Subnets are used for load balancers to provide external services. IP addresses are used to configure the service IPs that the load balancer provides external services, which are derived from the available IP addresses in the subnet.

[0084] Among them, 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 contained in the index information include: resource pool, host, storage pool and target image library. The resource pool is a collection of various hardware and software involved in the 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; the host is used to create a hardware physical device of the node cloud host that carries the load balancing service; the storage pool is based on storage virtualization technology, which abstracts different types of storage devices into logical storage resources under unified management to provide unified and comprehensive storage services; the target image library refers to the data directory under the resource pool for storing OVA, ISO and other images. When creating a cloud host on the resource pool, its internal design is that only the image library of the resource pool itself can be used to specify the image file, which is used to install the cloud host operating system, deploy built-in services, etc.

[0085] Specifically, for the preset global content library, the OVA template file stored therein for making a load balancer contains the operating system, the software suite that carries the load balancing service (traffic distribution service suite), configuration information for necessary configuration, etc. After completion, it is uploaded to the preset global content library and labeled as "load balancer template". In order to save the configuration template file to the preset global content library, a computing module component can be added to the cloud platform to scan all files in the preset virtual disk mounted under the deployed ftp service based on the computing module component; support users to manually upload files and store them under the ftp service, and save them in the established preset virtual disk; support interaction with the database, support scanned file data and user manually uploaded data to be stored in the table of the global content library of the database, the attributes of the data in the table include file name, status, label, size, CPU architecture, chip manufacturer, operating system, upload time, etc.; support adding or deleting labels to files in the global content library, the labels are multiple non-repeating strings, including but not limited to "load balancer template", etc., each file supports adding multiple non-repeating labels, and can also delete all labels added to the file; support retrieval of file data stored in the database table according to attributes such as labels, architecture information, name, status, support paged retrieval, and can also support reverse or forward sorting according to name, size, CPU architecture, and upload time; support uploading the specified template file in the global content library to the image library of the resource pool.

[0086] Specifically, after determining the index information corresponding to the template file of the load balancer to be created, first extract all candidate configuration template files carrying the target tag in the preset global content library according to the target tag (load balancer template tag) represented by the index information. Then, select the candidate configuration template files that match the target architecture represented by the index information from these candidate configuration template files. Then, further determine whether the file status of each candidate configuration template file is normal, so as to use the candidate configuration template files with normal status as candidate configuration template files. Finally, use the candidate configuration template file with the latest version and normal status as the target configuration template file. That is, you can sort in reverse order according to the upload time, and try to take out the first candidate configuration template file with normal status as the target configuration template file.

[0087] Accordingly, in one embodiment, when the preset global content library is scanned according to the index information and the target configuration template file matching the index information is not obtained, an exception prompt 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] Among them, during the screening process, if the configuration template file with the target tag does not include the 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 the target configuration template file that meets the preset load balancer creation requirements, 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 have a target configuration template file that meets the preset load balancer creation requirements, 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 is not marked with the target label of "load balancer template", or the load balancer-specific template file is no longer available, that is, the target configuration template file cannot be obtained from the preset global content library. At this time, an abnormal prompt message can be generated to remind relevant technical personnel to perform alarm processing.

[0090] Furthermore, while generating the exception prompt information, you can check whether there is a corresponding load balancer template file in the global content library, or whether the template file is correctly marked with the "load balancer template" label based on the exception prompt information. If it is found that the load balancer-specific template file is not uploaded in the global content library, the relevant technical personnel need to upload the missing template. If the template file is not correctly marked, the file information needs to be re-marked or updated. If the template file is no longer available, you need to re-obtain the latest version of the template file and upload it to the preset global content library, that is, create a target configuration template file locally, add a target label to the target configuration template file, and obtain the configuration template file to be uploaded; upload the configuration template file to be uploaded to the preset global content library for subsequent process scanning and acquisition.

[0091] Based on the above embodiment, as an implementable manner, in one embodiment, judging whether the preset conditions for creating a load balancer are met according to the identification information, the first sub-configuration information, and the second sub-configuration information corresponding to the target configuration template file includes:

[0092] Step 2025: Search the target configuration template file from the master image library of the master node according to the identification information corresponding to the target configuration template file to determine whether the target configuration template file exists in the master image library;

[0093] Step 2026: Search the target configuration template file from the backup image library of the backup node according to the identification information corresponding to the target configuration template file to determine whether the target configuration template file exists in the backup image library.

[0094] Step 2027: When it is determined that the target configuration template file exists in the primary image library and the backup image library respectively, 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 a file name, the first sub-configuration information includes a primary image library corresponding to the primary node, and the second sub-configuration information includes a 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; 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, Figure 4 As shown, it is a structural diagram of an exemplary load balancer creation system provided in an embodiment of the present application. After uploading the target configuration template file in the preset global content library to the primary image library of the master node and the backup image library of the backup node, the target image library (primary image library) selected by the master node and the target image library (backup image library) selected by the backup node are searched for files with the same name according to the file name of the target configuration template file: if both are available, it is determined that the preset conditions for creating a load balancer are met, and the subsequent creation of the target load balancer is directly performed; if neither is available, an asynchronous task is started to distribute the load balancer-specific OVA template file (target configuration template file) in the global content library to the primary image library selected by the master node and the backup image library selected by the backup node at the same time; if one of the master or backup node is missing, an asynchronous task is started to distribute the load balancer-specific OVA template file in the global content library to the target image library (primary image library or backup image library) selected by the node that does not have it. Among them, Figure 4 The .ova file in is the configuration template file. Figure 4 The configuration template file shown in the figure carries the "Load Balancer Template" tag.

[0099] Specifically, when it is determined that the main image library of the main resource pool and the backup image library of the backup resource pool both include the target configuration template file, cloud hosts that carry the load balancing service are created in the primary and backup node resource pools, and the built-in services (traffic distribution services) are started in each of them. Finally, the primary and backup node cloud hosts are deployed as an overall service cluster to jointly exert the core business capabilities of load balancing.

[0100] Specifically, in one embodiment, when the target configuration template file needs to be updated, 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 host created in the resource pool to which the primary node belongs and the cloud host created in the resource pool to which the backup node belongs based on the new target configuration template file.

[0101] Specifically, no matter how many resource pools the cloud platform has, it has the ability to fully automate the distribution of dedicated template files for load balancers, and can achieve full coverage. Users only need to simply upload dedicated template files of multiple architectures in the global content library and label them as "load balancer templates". It has the effect of centralized control and distributed deployment, greatly simplifies user operations, and brings high flexibility. When centralized control is performed on extremely large resource pools, it has super high management efficiency. Another advantage is that only when a load balancer is created for the first time in a certain primary and backup resource pool, the target configuration template file will be distributed from the global content library to the target image library of the corresponding node. Subsequent creation does not need to distribute this file again, and the previously distributed file will be directly dispatched in the target image library to create the load balancer.

[0102] In addition, this overall design supports smooth rolling upgrades. If users need to add advanced functions after using it for a period of time and find that they need to optimize the content in the dedicated template file, they only need to re-type a new version of the dedicated template file after the optimization is completed, specify a new file name, and then simply upload it to the preset global content library and label it as "load balancer template". When creating a new load balancer later, this new dedicated template file will be automatically selected and distributed to the target image library of the primary and backup node resource pools, and 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 realize the configuration update of the cloud hosts. The newly rebuilt cloud hosts are updated to the basic information of the current load balancer, and the subsequent balanced load capacity of traffic distribution will be distributed to the new two cloud hosts for processing, so as to optimize the traffic distribution service of the target load balancer provided by the primary and backup cloud hosts. The entire process does not require manual intervention.

[0103] The load balancer creation method provided in the embodiment of the present application obtains the load balancer creation requirement, wherein the load balancer creation requirement includes 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, and 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 standby 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 the load balancer are met according to the identification information, the first sub-configuration information, and the second sub-configuration information corresponding to the target configuration template file; when it is determined that the preset conditions for creating the load balancer are met, a cloud host is created in the resource pool to which the primary node belongs, and a cloud host is created in the resource pool to which the standby node belongs, according to the target configuration template file, wherein creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different. The method provided by the above scheme scans the preset global content library for templates, and creates cloud hosts for carrying load balancers in two different resource pools based on the target configuration template files obtained from the scan, so as to ensure that when any cloud host in the primary cloud host and the backup cloud host fails, the load balancing service can still be completed by calling the resources in the resource pool through another cloud host, so as to improve the availability of the load balancer. In addition, it can also automatically manage and control special template files, greatly enhance reliability, reduce the complexity of user operations, and improve the compatibility and flexibility of load balancer creation.

[0104] An embodiment of the present application provides a load balancer creation device, which is used to execute the load balancer creation method provided in the above embodiment.

[0105] like Figure 5 , which is a schematic diagram of the structure of a load balancer creation device provided in an embodiment of the present application. The load balancer creation device 50 comprises: an acquisition module 501 , a judgment module 502 and a creation module 503 .

[0106] An acquisition module is used to obtain a load balancer creation requirement, wherein the load balancer creation requirement includes 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, and 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 standby node to be created; a judgment module is used to determine whether the preset conditions for creating a load balancer are met according to identification information, first sub-configuration information and second sub-configuration information corresponding to the target configuration template file when a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information; a creation module is used to create a cloud host in a resource pool to which the primary node belongs, and create a cloud host in a resource pool to which the standby node belongs, according to the target configuration template file, when it is determined that the preset conditions for creating a load balancer are met, wherein creating a load balancer includes creating cloud hosts in resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different.

[0107] Regarding the load balancer creation device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0108] The load balancer creation device provided in the embodiment of the present application 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 repeated here.

[0109] An embodiment of the present application provides an electronic device for executing the load balancer creation method provided in the above embodiment.

[0110] like Figure 6 FIG. 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present 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, so that the at least one processor executes the load balancer creation method provided in the above embodiment.

[0112] The electronic device provided in the embodiment of the present application 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 repeated here.

[0113] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a load balancer creation method provided in any of the above embodiments is implemented.

[0114] The storage medium containing computer executable instructions provided in the embodiment of the present application can be used to store computer executable instructions of the load balancer creation method provided in the aforementioned embodiment. Its implementation method and principle are the same and will not be repeated here.

[0115] An embodiment of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the load balancer creation method provided in the aforementioned embodiment.

[0116] The embodiment of the present application provides a computer program product that can be used to execute computer instructions of the load balancer creation method provided in the aforementioned embodiment. Its implementation method and principle are the same and will not be repeated here.

[0117] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0120] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0121] A part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0122] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is 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 refer to the corresponding process in the aforementioned method embodiment, 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 the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for creating a load balancer, characterized in that: include: Obtaining a load balancer creation requirement, wherein the load balancer creation requirement includes index information corresponding to a template file of a load balancer to be created, and configuration information corresponding to the load balancer to be created, wherein the configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to a master node to be created, and second sub-configuration information corresponding to a standby node to be created; When a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, judging whether the preset conditions for creating a load balancer are met according to the identification information corresponding to the target configuration template file, the first sub-configuration information and the second sub-configuration information; When it is determined that the preset conditions for creating a load balancer are met, a cloud host is created in the resource pool to which the primary node belongs, and a cloud host is created in the resource pool to which the standby node belongs, according to the target configuration template file, wherein creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different.

2. The method according to claim 1, characterized in that The index information includes a target tag, a target architecture, and a file status. The scanning of a preset global content library according to the index information includes: Scanning the preset global content library according to the target tag represented by the index information to screen the candidate configuration template file carrying the target tag in the preset global content library; Screening a candidate configuration template file that matches the target architecture from among the candidate configuration template files; Determining a candidate configuration template file according to the file status of each of the candidate configuration template files; In the case that the candidate configuration template file is not unique, the target configuration template file is determined according to the upload time corresponding to each of the candidate configuration template files.

3. The method according to claim 2, characterized in that The method further comprises: When the preset global content library is scanned according to the index information and no target configuration template file matching the index information is obtained, an abnormal prompt message is generated to create the target configuration template file locally; Adding a target tag to the target configuration template file to obtain a 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 determining, according to the identification information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information, whether the preset condition for creating a load balancer is met includes: According to the identification information corresponding to the target configuration template file, searching the target configuration template file from the master image library of the master node to determine whether the target configuration template file exists in the master image library; According to the identification information corresponding to the target configuration template file, searching the target configuration template file from the standby image library of the standby node to determine whether the target configuration template file exists in the standby image library; When it is determined that the target configuration template file exists in the primary image library and the backup image library respectively, 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 the backup image library, it is determined that the preset condition for creating the load balancer is not met; The identification information includes a file name, the first sub-configuration information includes a primary image library corresponding to the primary node, and the second sub-configuration information includes a backup image library corresponding to the backup node.

5. The method according to claim 1, characterized in that The method further comprises: 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 preset conditions for creating a load balancer are met based on the identification 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 comprises: When the target configuration template file needs to be updated, 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 to update the configuration of the cloud host created in the resource pool to which the primary node belongs and the cloud host 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 comprises: Scanning a preset virtual disk to obtain a plurality of configuration template files; wherein the preset virtual disk stores a plurality of configuration template files uploaded by a user; The preset global content library is constructed based on the multiple configuration template files.

8. A load balancer creation device, characterized in that: include: An acquisition module, configured to acquire a load balancer creation requirement, wherein the load balancer creation requirement includes index information corresponding to a template file of a load balancer to be created, and configuration information corresponding to the load balancer to be created, wherein the configuration information includes attribute information corresponding to the load balancer, first sub-configuration information corresponding to a master node to be created, and second sub-configuration information corresponding to a standby node to be created; A judgment module, configured to, when a target configuration template file matching the index information is obtained after scanning the preset global content library according to the index information, judge whether the preset conditions for creating a load balancer are met according to the identification information corresponding to the target configuration template file, the first sub-configuration information, and the second sub-configuration information; A creation module, which is used to create a cloud host in the resource pool to which the primary node belongs and a cloud host in the resource pool to which the standby node belongs according to the target configuration template file when it is determined that the preset conditions for creating a load balancer are met, wherein creating the load balancer includes creating cloud hosts in the resource pools to which the primary node and the standby node belong, respectively, and the resource pools to which the primary node and the standby node belong are different.

9. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to 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, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 7 is implemented.

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

  • Load balancing method and device for cloud host cluster and server

    CN111614746A

  • Database scheduling method and device, equipment and storage medium

    CN116954863A

  • Disaster recovery processing method, device and equipment and computer readable storage medium

    CN119127557A