Node elastic scaling method and device, computer equipment, readable storage medium and program product
By creating scaling groups and obtaining node status in the Internet system and dynamically adjusting cluster resources, the slow response and system crash caused by high load are solved, and stable operation when traffic is high and cost reduction when traffic is low.
Patent Information
- Application Number
- CN202411742755.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-04
AI Technical Summary
When the Internet system is running at high load, it may cause slow response or system crash, affecting the user experience.
By creating multiple scalable groups in the cluster, obtaining the container group and node status, determining the configuration information of scalable and scalable nodes, and encapsulating this information into a request body through the adaptation layer interface and sending it to the target cloud platform to dynamically adjust the cluster resources.
Increase the number of hosts when the traffic is high to ensure the normal operation of each node of the cluster and improve user experience; reduce the number of hosts when the traffic is low to reduce costs.
Smart Images

Figure CN119561842A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a node elastic scaling method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of mobile Internet, various Internet systems are facing the challenge of various traffic surges. For example, the Double Eleven flash sales and Weibo hot searches may cause their respective Internet systems to run at high load. When the system runs at high load, there will be problems such as slow response or even system crash, affecting the user experience. Summary of the invention
[0003] Based on this, it is necessary to provide a node elastic scaling method, device, computer equipment, computer-readable storage medium and computer program product that can ensure the normal operation of each node in the system when the system traffic is high, in order to address the above technical problems.
[0004] In a first aspect, the present application provides a node elastic scaling method, comprising:
[0005] Create multiple scaling groups based on the configuration information of each node in the cluster;
[0006] Get the container group status and node status in the cluster;
[0007] Acquire configuration information of scalable nodes from the multiple scaling groups according to the container group state;
[0008] Acquire configuration information of scalable nodes from the multiple scaling groups according to the node status;
[0009] Define common data structures for interacting with the cloud platform;
[0010] Creating an adaptation layer interface according to the general data structure and multiple authentication methods;
[0011] The adaptation layer interface is called to encapsulate the configuration information of the expandable node into a first request body, and the configuration information of the shrinkable node is encapsulated into a second request body, and sent to the target cloud platform.
[0012] In one of the embodiments, acquiring configuration information of scalable nodes from the multiple scaling groups according to the container group state includes:
[0013] When the container group state is in an unschedulable state, obtaining cache states of the multiple scaling groups;
[0014] The scaling group whose cache status is available is simulatedly scheduled to obtain the configuration information of the scalable node.
[0015] In one of the embodiments, the simulating scheduling of the scaling group whose cache status is available to obtain the configuration information of the scalable node includes:
[0016] For each scaling group whose cache status is available, simulate creating a new node resource;
[0017] Obtaining a scheduling request for the container group in the unschedulable state;
[0018] If the new node resource meets the scheduling request, add the scaling group corresponding to the new node resource to the scalable list;
[0019] Based on a preset screening strategy, screening out an optimal scaling group from the scalable list;
[0020] The configuration information of the scalable node is obtained from the optimal scaling group.
[0021] In one of the embodiments, acquiring configuration information of scalable nodes from the multiple scaling groups according to the node status includes:
[0022] Acquire node resource utilization according to the node status;
[0023] The nodes whose node resource utilization is lower than a preset threshold are regarded as nodes to be shrunk;
[0024] Performing simulated rescheduling on the nodes to be shrunk to obtain scalable nodes;
[0025] The configuration information of the scalable node is obtained from the scaling group corresponding to the scalable node.
[0026] In one embodiment, the simulating rescheduling of the nodes to be shrunk to obtain scalable nodes includes:
[0027] Simulate scheduling of the container group on the node to be shrunk to the remaining nodes;
[0028] If all container groups on the node to be shrunk can be scheduled to the remaining nodes, the node to be shrunk is used as a scalable node.
[0029] In one embodiment, the method further comprises:
[0030] After receiving a first response body from the target cloud platform in response to the first request body, updating the expected number of nodes in a first scaling group; the first scaling group is one of the multiple scaling groups and includes configuration information of the scalable nodes;
[0031] After receiving a second return body in response to the second request body by the target cloud platform, delete the scalable nodes in the second scaling group and update the expected number of nodes in the second scaling group; the second scaling group is one of the multiple scaling groups and contains configuration information of the scalable nodes.
[0032] In a second aspect, the present application also provides a node elastic expansion device, including:
[0033] The scaling group creation module is used to create multiple scaling groups based on the configuration information of each node in the cluster;
[0034] An elastic scaling module, used to obtain the container group status and node status in the cluster; obtain the configuration information of the expandable nodes from the multiple scaling groups according to the container group status; obtain the configuration information of the shrinkable nodes from the multiple scaling groups according to the node status;
[0035] A cloud platform interaction module is used to define a general data structure for interacting with the cloud platform; create an adaptation layer interface based on the general data structure and multiple authentication methods; call the adaptation layer interface to encapsulate the configuration information of the scalable node into a first request body, and encapsulate the configuration information of the scalable node into a second request body, and send it to the target cloud platform.
[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the node elastic scaling method provided in any of the above embodiments is implemented.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the node elastic scaling method provided in any of the above embodiments is implemented.
[0038] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the node elastic scaling method provided in any of the above embodiments.
[0039] The node elastic scaling method, device, computer equipment, computer-readable storage medium and computer program product create multiple scaling groups according to the configuration information of each node in the cluster, obtain the container group status and node status in the cluster, obtain the configuration information of the expandable node from the multiple scaling groups according to the container group status, obtain the configuration information of the shrinkable node from the multiple scaling groups according to the node status, and call the adaptation layer interface to encapsulate the configuration information of the expandable node into a first request body, and encapsulate the configuration information of the shrinkable node into a second request body, and send it to the target cloud platform to call the IaaS service of the target cloud platform to create a new host according to the first request body, or delete the corresponding host according to the second request body, so as to realize the dynamic adjustment of cluster resources, increase the number of hosts when the traffic is high, ensure the normal operation of each node in the cluster, and improve the user experience; reduce the number of hosts when the traffic is low, and reduce the cost. Furthermore, by defining a general data structure for interacting with the cloud platform, an adaptation layer interface is created according to the general data structure and multiple authentication methods, and the adaptation layer interface can be compatible with different cloud platforms, realize cross-platform use, and facilitate users to migrate data across cloud platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A schematic diagram of a process of a node elastic scaling method in one embodiment;
[0042] Figure 2 A schematic diagram of a flow chart of performing simulated scheduling on a scaling group whose cache status is available to obtain configuration information of expandable nodes in an embodiment;
[0043] Figure 3 A schematic diagram of a process of obtaining configuration information of scalable nodes from multiple scaling groups according to node states in an embodiment;
[0044] Figure 4 The following is a schematic diagram of a node elastic scaling method in one embodiment;
[0045] Figure 5 is a structural block diagram of a node elastic expansion and contraction device in one embodiment;
[0046] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In an exemplary embodiment, Figure 1 As shown, a node elastic scaling method is provided, including the following steps 102 to 114.
[0049] Step 102: Create multiple scaling groups according to the configuration information of each node in the cluster.
[0050] A scaling group is a data structure defined based on a custom resource definition (CRD) in cloud native technology. The same scaling group can be used to manage a group of subordinate nodes with the same application scenario and instance type. The scaling group contains the configuration information of the subordinate nodes, such as host templates, label information, taint information, and other information. Among them, the host template contains general host specifications, images, disk resources and other information. Exemplarily, the configuration information of the subordinate nodes and the expected number of nodes can be written in the preset fields of the scaling group, such as the "status" field. In addition, the additionalProperties attribute of the Map type is also defined in the scaling group. The Map type parameter can be used to describe a set of dynamic parameters. The additionalProperties attribute specifies the additional properties of the Map type parameter, which is convenient for developers to do customized development.
[0051] Step 104: Obtain the container group status and node status in the cluster.
[0052] A container group (pod) is the smallest scheduling unit in a Kubernetes cluster. A container group can contain one or more containers. Multiple containers in a container group share the same IP and network port. The container group status mainly refers to whether the container group is running and whether it can be scheduled. In a Kubernetes cluster, the status field of a container group indicates the status of the container group. The status of the container group can be obtained by calling the status field of the container group.
[0053] A node can be a virtual machine or a physical machine. A node is the operating environment of a container group. In a Kubernetes cluster, each container group is assigned to a specific host to run. The node status mainly refers to the usage of resources such as memory and CPU of the node. Similarly, the status field of a node indicates the node status, and the node status can be obtained by calling the status field of the node.
[0054] Step 106: Obtain configuration information of scalable nodes from multiple scaling groups according to the container group status.
[0055] Whether capacity expansion is required can be determined based on the container group status. If capacity expansion is required, scalable nodes can be found from multiple scaling groups and the configuration information of the scalable nodes can be obtained.
[0056] Step 108: Obtain configuration information of scalable nodes from multiple scaling groups according to the node status.
[0057] Whether to perform capacity reduction can be determined according to the node status. If capacity reduction is required, a scalable node can be found from multiple scaling groups, and configuration information of the scalable node can be obtained.
[0058] Step 110, defining a common data structure for interacting with the cloud platform.
[0059] When using the cloud platform interface to create or delete a host, the data that interacts with different cloud platforms is essentially the configuration information of the node, such as host template information such as memory, CPU, and image, but the field names of different cloud platforms may be different. The interaction process of multiple commonly used cloud platforms can be simplified and summarized, and a common data format that is independent of the cloud platform can be defined to be compatible with different cloud platforms.
[0060] Step 112: Create an adaptation layer interface based on the general data structure and multiple authentication methods.
[0061] The authentication method is used to verify whether the user or upper-layer application has access rights. Multiple authentication methods include commonly used authentication methods such as AK / SK (Access Key / Secret Access Key), Bearer Token, and JWT (JSON Web Token), and can also include user-defined authentication methods. Among them, user-defined authentication methods can be obtained through the secondary development authentication interface. The general data structure and multiple authentication methods can be encapsulated into an adapter layer interface, so that users or upper-layer applications only need to configure the parameters of the general data structure, the authentication method, and the authentication parameters, without having to worry about the differences in the underlying cloud platform.
[0062] Step 114, calling the adaptation layer interface to encapsulate the configuration information of the expandable node into a first request body, encapsulate the configuration information of the shrinkable node into a second request body, and send them to the target cloud platform.
[0063] Among them, the target cloud platform can be configured by the user. The CA component can encapsulate the configuration information of the expansion node into a first request body by calling the adaptation layer interface, and encapsulate the configuration information of the scalable node into a second request body by calling the adaptation layer interface, and send it to the target cloud platform to call the IaaS (Infrastructure as a Service) service of the target cloud platform to create a new host according to the first request body, or delete the corresponding host according to the second request body. It should be noted that the first request body and the second request body are only to distinguish the request body corresponding to the expansion node and the request body corresponding to the shrinking node. The CA component can call the adaptation layer interface to send the first request body or the second request body to the target cloud platform respectively, or it can encapsulate the configuration information of the expandable node and the configuration information of the scalable node into one request body and send it to the target cloud platform.
[0064] In an embodiment of the present application, multiple scaling groups are created according to the configuration information of each node in the cluster, the container group status and node status in the cluster are obtained, the configuration information of the expandable nodes is obtained from the multiple scaling groups according to the container group status, the configuration information of the scalable nodes is obtained from the multiple scaling groups according to the node status, and the adaptation layer interface is called to encapsulate the configuration information of the expandable nodes into a first request body, and the configuration information of the scalable nodes is encapsulated into a second request body, and sent to the target cloud platform, so as to call the IaaS service of the target cloud platform to create a new host according to the first request body, or delete the corresponding host according to the second request body, thereby realizing dynamic adjustment of cluster resources, increasing the number of hosts when the traffic is high, ensuring the normal operation of each node in the cluster, and improving the user experience; when the traffic is low, reducing the number of hosts and reducing costs. Furthermore, by defining a general data structure for interacting with the cloud platform, an adaptation layer interface is created according to the general data structure and multiple authentication methods, and the adaptation layer interface can be compatible with different cloud platforms, realizing cross-platform use, and facilitating users to migrate data across cloud platforms.
[0065] In one embodiment, configuration information of scalable nodes is obtained from multiple scaling groups according to container group states, including the step of obtaining cache states of multiple scaling groups when the container group state is an unschedulable state, and performing simulated scheduling on the scaling group whose cache state is an available state to obtain configuration information of the scalable nodes.
[0066] As mentioned above, the status of the container group can be obtained through the status field of the container group. The status field of the container group contains a condition object, which contains two pieces of information: the status type and the status value. In the condition object of the container group, the unschedulable type condition indicates that the container group has been scheduled to a certain node. When the status value of the unschedulable type condition is "False", it means that there is a problem with the scheduling of the container group. The container group is in an unschedulable state and needs to be expanded. You can create a scheduled task to refresh the cache status of the scaling group regularly. The cache status of the scaling group includes an available state and an unavailable state. For the scaling group whose cache status is an available state, simulated scheduling can be performed to obtain the configuration information of the expandable node, specifically including steps 202-210.
[0067] Step 202: For each scaling group whose cache status is available, simulate creating a new node resource.
[0068] The new node resources include the node's CPU, memory and other resource information, label information, and taint information.
[0069] Step 204: Obtain a scheduling request for the container group that is in an unschedulable state.
[0070] The scheduling request of a container group includes the resource requirements such as CPU and memory, affinity / anti-affinity rules, and tolerance required by the container group.
[0071] Step 206: When the new node resource satisfies the scheduling request, the scaling group corresponding to the new node resource is added to the scalable list.
[0072] Determine whether the new node resources meet the scheduling request of the tolerance, including: the resource requirements of the container group such as CPU and memory cannot exceed the available resources of the node, the affinity / anti-affinity rules of the container group must meet the label information of the node, and the taint information of the node must be tolerated by the tolerance of the container group, etc. If the new node resources meet the scheduling request, the scaling group corresponding to the new node resources can be added to the scalable list.
[0073] Step 208: Filter out the optimal scaling group from the scalable list based on a preset screening strategy.
[0074] The preset screening strategy may be pre-set by the user and may be a combination of multiple screening strategies. For example, the preset strategy may be a highest priority strategy or a lowest resource utilization strategy.
[0075] Step 210: Obtain configuration information of scalable nodes from the optimal scaling group.
[0076] In this embodiment, by obtaining the cache status of multiple scaling groups when the container group status is an unschedulable state, and performing simulated scheduling on the scaling groups whose cache status is an available state, the configuration information of the scalable nodes is obtained, so that the target cloud platform can create a new host based on the configuration information of the scalable nodes, thereby ensuring the normal operation of each node in the cluster.
[0077] In one embodiment, Figure 3 As shown, the configuration information of scalable nodes is obtained from multiple scaling groups according to the node status, including steps 302-308.
[0078] Step 302: Obtain node resource utilization according to the node status.
[0079] Node resource utilization refers to the utilization of the node's CPU, memory and other resources. Node resource utilization can be calculated based on the used resources and available resources in the node status.
[0080] Step 304: Nodes whose node resource utilization is lower than a preset threshold are regarded as nodes to be shrunk.
[0081] The preset threshold can be set by the user.
[0082] Step 306: simulate rescheduling the nodes to be shrunk to obtain scalable nodes.
[0083] Specifically, the container groups on the node to be shrunk may be simulated and scheduled to the remaining nodes. If all the container groups on the node to be shrunk can be scheduled to the remaining nodes, the node to be shrunk is used as a scalable node.
[0084] You can first obtain the resource requirements, tolerance, affinity / anti-affinity rules, etc. of the container group on the node to be shrunk, and determine whether there are nodes among the remaining nodes that have sufficient available resources to meet the resource requirements of the container group on the node to be shrunk, and whether the taint information is tolerated by the tolerance of the container group on the node to be shrunk, and the label information includes the affinity / anti-affinity rules of the container group on the node to be shrunk. Only when all container groups on the node to be shrunk can be scheduled to the remaining nodes, can the node to be shrunk be used as a scalable node, otherwise, the node to be shrunk cannot be shrunk, and the next node to be shrunk will be considered.
[0085] Step 308: Obtain configuration information of the scalable node from the scaling group corresponding to the scalable node.
[0086] In this embodiment, by obtaining the node resource utilization rate according to the node status, the nodes whose node resource utilization rate is lower than the preset threshold are regarded as nodes to be shrunk, and the nodes to be shrunk are simulated and re-scheduled to obtain scalable nodes, and the configuration information of the scalable nodes is obtained from the scaling groups corresponding to the scalable nodes, so that the target cloud platform can delete the corresponding hosts based on the configuration information of the scalable nodes, thereby reducing costs.
[0087] In one embodiment, the node elastic scaling method of the present application also includes: after receiving a first return body in response to the first request body from the target cloud platform, updating the expected number of nodes in the first scaling group; and after receiving a second return body in response to the second request body from the target cloud platform, deleting the scalable nodes in the second scaling group and updating the expected number of nodes in the second scaling group. The first scaling group is one of multiple scaling groups and includes configuration information of scalable nodes, and the second scaling group is one of multiple scaling groups and includes configuration information of scalable nodes.
[0088] Since the scaling group manages the configuration information of subordinate nodes, the corresponding scaling group needs to be updated regardless of whether the expansion action or the reduction action is performed. After receiving the first return body based on the first request body response from the target cloud platform, that is, the target cloud platform has created a new host, the configuration information of the node corresponding to the new host can be created in the first scaling group, and the expected number of nodes can be added to the new number of hosts; after receiving the second return body based on the second request body response from the target cloud platform, that is, the target cloud platform has deleted the corresponding host, the configuration information of the scalable nodes in the second scaling group can be deleted, and the expected number of nodes can be subtracted from the number of deleted scalable nodes.
[0089] For better understanding, a more specific embodiment is given to illustrate the node elastic scaling method of the present application. The solution architecture of the node elastic scaling method of the present embodiment is as follows: Figure 4As shown. The CA (Cluster AutoScaling, node elastic scaling) component consists of a core module, an evaluator, a simulator, and an extension selector. The core module is responsible for the overall expansion and contraction of nodes. When it is detected that a container group in the cluster cannot be scheduled, the expansion process is triggered; when the contraction conditions are met, the contraction process is triggered. The evaluator is used to calculate the scaling group that meets the expansion requirements and the number of nodes that need to be expanded according to the configuration of the scaling group when expansion is required. The simulator is used to find the scalable nodes that meet the simulated contraction rescheduling conditions when contracting. The extension selector is used to select the best one from the scaling groups selected by the evaluator according to the set policy or algorithm when expanding. In addition, the CA component also generates a first client connecting to the cluster and a second client calling the IaaS adaptation layer according to a custom configuration file. The CA component can refresh the scaling group based on the first client and call the adaptation layer interface of the IaaS adaptation layer based on the second client.
[0090] The IaaS adaptation layer is used to define a common data structure for interacting with the cloud platform, create an adaptation layer interface based on the common data structure and multiple authentication methods, and encapsulate the configuration information of the scalable nodes or the scalable nodes obtained by the CA component into a request body through the adaptation layer interface and send it to the target cloud platform. The response data of the target cloud platform is encapsulated into a return body using a common data structure and sent to the CA component.
[0091] The target cloud platform may be a current mainstream cloud service provider, such as Alibaba Cloud, Huawei Cloud, or a private cloud.
[0092] based on Figure 4 The solution architecture shown in the figure, the node elastic scaling method of the present application may include the following steps:
[0093] (1) Define a scaling group and define a scaling group controller through Kubernetes. Use the scaling group controller to create multiple scaling groups based on the configuration information of each node in the cluster.
[0094] (2) The CA component monitors the container group status and node status in the cluster.
[0095] (3) When the container group is in an unschedulable state, the CA component triggers the expansion process:
[0096] Based on the first client, the cache status of multiple scaling groups is obtained; for each scaling group whose cache status is in an available state, a new node resource is simulated to be created; a scheduling request of a container group in an unschedulable state is obtained; when the new node resource meets the scheduling request, the scaling group corresponding to the new node resource is added to the scalable list; based on a preset screening strategy, the optimal scaling group is screened out from the scalable list; the configuration information of the scalable node is obtained from the optimal scaling group; the adaptation layer interface is called to encapsulate the configuration information of the scalable node into a first request body and send it to the target cloud platform; after receiving the first return body of the target cloud platform in response to the first request body, the first client is called to update the expected number of nodes in the first scaling group.
[0097] (4) The CA component obtains the node resource utilization rate based on the node status. When the node resource utilization rate is lower than the preset threshold, the scaling-down process is triggered:
[0098] Nodes whose node resource utilization is lower than a preset threshold are regarded as nodes to be shrunk; container groups on the nodes to be shrunk are simulated and scheduled to the remaining nodes; if all container groups on the nodes to be shrunk can be scheduled to the remaining nodes, the nodes to be shrunk are regarded as scalable nodes; configuration information of the scalable nodes is obtained from the scaling group corresponding to the scalable nodes; the adaptation layer interface is called to encapsulate the configuration information of the scalable nodes into a second request body, and send it to the target cloud platform; after receiving the second return body in response to the second request body by the target cloud platform, the scalable nodes in the second scaling group are deleted, and the expected number of nodes in the second scaling group is updated.
[0099] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0100] Based on the same inventive concept, the embodiment of the present application also provides a node elastic expansion and contraction device for implementing the node elastic expansion and contraction device method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more node elastic expansion and contraction device embodiments provided below can refer to the limitations of the node elastic expansion and contraction device method above, and will not be repeated here.
[0101] In an exemplary embodiment, Figure 5 As shown, a node elastic scaling device is provided, including: a scaling group creation module 502, an elastic scaling module 504 and a cloud platform interaction module 506, wherein:
[0102] The scaling group creation module 502 is used to create multiple scaling groups according to the configuration information of each node in the cluster;
[0103] The elastic scaling module 504 is used to obtain the container group status and node status in the cluster; obtain the configuration information of the expandable nodes from multiple scaling groups according to the container group status; obtain the configuration information of the shrinkable nodes from multiple scaling groups according to the node status;
[0104] The cloud platform interaction module 506 is used to define a general data structure for interacting with the cloud platform; create an adaptation layer interface based on the general data structure and multiple authentication methods; call the adaptation layer interface to encapsulate the configuration information of the scalable node into a first request body, and encapsulate the configuration information of the scalable node into a second request body, and send it to the target cloud platform.
[0105] In one embodiment, the elastic scaling module includes a trigger unit, an expansion evaluation unit, a shrink simulation unit, and an expansion selection unit, wherein:
[0106] The trigger unit is used to trigger the expansion process when the container group state is unschedulable, and obtain the node resource utilization rate according to the node state, and trigger the reduction process when the node resource utilization rate is lower than the preset threshold.
[0107] The capacity expansion evaluation unit is used to obtain the cache status of multiple scaling groups; perform simulated scheduling on the scaling groups whose cache status is available, and obtain a scalable list.
[0108] The expansion selection unit is used to filter out the optimal scaling group from the scalable list based on the preset filtering strategy; obtain the configuration information of the scalable node from the optimal scaling group
[0109] The scaling simulation unit is used to simulate the rescheduling of the nodes to be shrunk to obtain the nodes that can be shrunk; the configuration information of the scalable nodes is obtained from the scaling group corresponding to the scalable nodes.
[0110] In one embodiment, the capacity expansion evaluation unit is further used to simulate the creation of new node resources for each scaling group whose cache status is available; obtain the scheduling request of the container group in an unschedulable state; and add the scaling group corresponding to the new node resource to the scalable list when the new node resource meets the scheduling request.
[0111] In one embodiment, the shrinking simulation unit is further used to simulate scheduling of container groups on the node to be shrunk to the remaining nodes; if all container groups on the node to be shrunk can be scheduled to the remaining nodes, the node to be shrunk is used as a scalable node.
[0112] In one embodiment, the elastic scaling module is also used to update the expected number of nodes in the first scaling group after receiving a first return body in response to the first request body from the target cloud platform; the first scaling group is one of multiple scaling groups and contains configuration information of scalable nodes; after receiving a second return body in response to the second request body from the target cloud platform, delete the scalable nodes in the second scaling group and update the expected number of nodes in the second scaling group; the second scaling group is one of multiple scaling groups and contains configuration information of scalable nodes.
[0113] Each module in the above-mentioned node elastic expansion device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0114] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store various configuration files. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a node elastic scaling method is implemented.
[0115] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0116] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the node elastic scaling method provided in any of the above embodiments is implemented.
[0117] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the node elastic scaling method provided in any of the above embodiments is implemented.
[0118] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the node elastic scaling method provided in any of the above embodiments.
[0119] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0120] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0121] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A node elastic scaling method, characterized in that: include: Create multiple scaling groups based on the configuration information of each node in the cluster; Get the container group status and node status in the cluster; Acquire configuration information of scalable nodes from the multiple scaling groups according to the container group state; Acquire configuration information of scalable nodes from the multiple scaling groups according to the node status; Define common data structures for interacting with the cloud platform; Creating an adaptation layer interface according to the general data structure and multiple authentication methods; The adaptation layer interface is called to encapsulate the configuration information of the expandable node into a first request body, and the configuration information of the shrinkable node is encapsulated into a second request body, and sent to the target cloud platform.
2. The method according to claim 1, characterized in that The acquiring configuration information of scalable nodes from the multiple scaling groups according to the container group state includes: When the container group state is in an unschedulable state, obtaining cache states of the multiple scaling groups; The scaling group whose cache status is available is simulatedly scheduled to obtain the configuration information of the scalable node.
3. The method according to claim 2, characterized in that The performing simulation scheduling on the scaling group whose cache status is in the available status to obtain the configuration information of the scalable node includes: For each scaling group whose cache status is available, simulate creating a new node resource; Obtaining a scheduling request for the container group in the unschedulable state; If the new node resource meets the scheduling request, add the scaling group corresponding to the new node resource to the scalable list; Based on a preset screening strategy, screening out an optimal scaling group from the scalable list; The configuration information of the scalable node is obtained from the optimal scaling group.
4. The method according to claim 1, characterized in that: The acquiring configuration information of scalable nodes from the multiple scaling groups according to the node status includes: Acquire node resource utilization according to the node status; The nodes whose node resource utilization is lower than a preset threshold are regarded as nodes to be shrunk; Simulate rescheduling of the nodes to be shrunk to obtain scalable nodes; The configuration information of the scalable node is obtained from the scaling group corresponding to the scalable node.
5. The method according to claim 4, characterized in that The simulating rescheduling of the nodes to be shrunk to obtain scalable nodes includes: Simulate scheduling of the container group on the node to be shrunk to the remaining nodes; If all container groups on the node to be shrunk can be scheduled to the remaining nodes, the node to be shrunk is used as a scalable node.
6. The method according to claim 1, characterized in that The method further comprises: After receiving a first response body from the target cloud platform in response to the first request body, updating the expected number of nodes in a first scaling group; the first scaling group is one of the multiple scaling groups and includes configuration information of the scalable nodes; After receiving a second return body in response to the second request body by the target cloud platform, delete the scalable nodes in the second scaling group and update the expected number of nodes in the second scaling group; the second scaling group is one of the multiple scaling groups and contains configuration information of the scalable nodes.
7. A node elastic expansion device, characterized in that: include: The scaling group creation module is used to create multiple scaling groups based on the configuration information of each node in the cluster; The elastic scaling module is used to obtain the container group status and node status in the cluster; and obtain the configuration information of the scalable nodes from the multiple scaling groups according to the container group status; Acquire configuration information of scalable nodes from the multiple scaling groups according to the node status; A cloud platform interaction module is used to define a general data structure for interacting with the cloud platform; and to create an adaptation layer interface based on the general data structure and multiple authentication methods; The adaptation layer interface is called to encapsulate the configuration information of the expandable node into a first request body, and the configuration information of the shrinkable node is encapsulated into a second request body, and sent to the target cloud platform.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource allocation method and device, equipment and readable storage medium
CN112463395A
Cluster capacity management method and system
CN114064199A
Visual learning method, system and device and storage medium
CN115145743A
Management system, method and equipment for multiple cloud platforms
CN116112526A
Cluster container scheduling method, device and equipment and computer readable storage medium
CN116974689A