Cluster management method and device, computer equipment and storage medium
By automatically judging and processing alarm conditions in cluster resource management, intelligent peak staggered management of cluster capacity is realized, solving the problem of inefficient resource management in the existing technology, and improving resource utilization and operation and maintenance efficiency.
Patent Information
- Application Number
- CN202510217651.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-05-30
AI Technical Summary
The existing cluster resource management methods rely on manual processing, resulting in low processing efficiency and low resource utilization, which cannot meet the rapidly changing market demand.
A cluster management method is proposed. By judging whether the target cluster meets the preset alarm conditions, query the current capacity based on the query script, calculate the number of target nodes to be increased, filter the designated server from the standby resource pool, configure the network interface, and add the target server to the target cluster.
It realizes automatic and intelligent cluster capacity staggered management, improves the processing efficiency of resource management, effectively improves the utilization rate and stability of server resources, frees manpower, and improves operation and maintenance efficiency.
Smart Images

Figure CN120075234A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of data processing and fintech, and particularly to a cluster management method, apparatus, computer device, and storage medium. Background Art
[0002] In the fields of finance and healthcare, the resource management of clusters is crucial for the efficient operation of businesses and the rational utilization of resources. However, currently, the cluster resource management in these two fields mainly relies on manual processing methods, which have obvious problems in terms of processing efficiency and resource utilization.
[0003] With the rapid development of businesses and the continuous increase in transaction volumes, the amount of data that financial institutions and healthcare institutions need to process has increased sharply, posing higher requirements for the management of cluster resources. However, the existing manual management methods for cluster resources often lead to lagging processing efficiency, unable to meet the rapidly changing market demands, resulting in low resource utilization. Summary of the Invention
[0004] The purpose of the embodiments of this application is to propose a cluster management method, apparatus, computer device, and storage medium to solve the technical problems of the existing cluster resource management method that relies on manual processing methods, with low storage processing efficiency and low resource utilization.
[0005] To solve the above technical problems, the embodiments of this application provide a cluster management method, which adopts the following technical solutions:
[0006] Judge whether the target cluster meets the preset warning conditions;
[0007] If so, query the current capacity of the target cluster based on a preset query script;
[0008] Based on the current capacity, calculate the number of target nodes to be added corresponding to the target cluster;
[0009] Based on the number of target nodes, screen out designated servers from a preset standby resource pool;
[0010] Configure the network interface of the designated server to the network corresponding to the target cluster to obtain a corresponding target server;
[0011] Add the target server to the target cluster.
[0012] Further, the step of screening out designated servers from a preset standby resource pool based on the number of target nodes specifically includes:
[0013] Screen out the first servers that meet the preset hardware configuration conditions from the standby resource pool;
[0014] Obtain the load information, geographical location, and network latency time of each of the first servers;
[0015] Based on the load information, geographical location, and network latency time of each of the first servers, call a preset scoring strategy to calculate the priority scores of each of the first servers;
[0016] Select a second server with the lowest priority score from all the first servers;
[0017] Use the second server as the designated server.
[0018] Further, the step of calculating the priority scores of each of the first servers by calling a preset scoring strategy based on the load information, geographical location, and network latency time of each of the first servers specifically includes:
[0019] Obtain the designated load information, designated geographical location, and designated network latency time of a third server; wherein, the third server is any one of all the first servers;
[0020] Generate a corresponding comprehensive load score based on the designated load information;
[0021] Generate a distance value corresponding to the cluster based on the designated geographical location;
[0022] Based on a preset weighted calculation algorithm, perform calculation processing on the comprehensive load score, the distance value, and the designated network latency time to obtain a corresponding weighted calculation result;
[0023] Use the weighted calculation result as the designated priority score of the third server.
[0024] Further, the step of calculating the number of target nodes to be added corresponding to the target cluster based on the current capacity specifically includes:
[0025] Obtain a preset calculation strategy;
[0026] Perform calculation processing on the current capacity based on the calculation strategy to obtain a corresponding calculation result;
[0027] Use the calculation result as the number of target nodes to be added corresponding to the target cluster.
[0028] Further, after the step of adding the target server to the target cluster, it further includes:
[0029] Monitor the status information of the target server based on a preset monitoring tool;
[0030] Obtain the operation information of the expansion operation corresponding to the target server;
[0031] Perform storage processing on the status information and the operation information.
[0032] Furthermore, the cluster management method further includes:
[0033] Obtain the load performance information of the target cluster;
[0034] Construct a resource adjustment strategy corresponding to the target cluster based on the load performance information;
[0035] Perform corresponding resource adjustment processing on the target cluster based on the resource adjustment strategy.
[0036] Furthermore, before the step of screening out the specified server from the preset standby resource pool based on the target node quantity, it further includes:
[0037] Obtain the initially selected server;
[0038] Construct a corresponding server list based on the initially selected server;
[0039] Use the server list as the standby resource pool.
[0040] To solve the above technical problem, an embodiment of the present application further provides a cluster management device, which adopts the following technical solution:
[0041] A judgment module, used to judge whether the target cluster meets the preset alarm condition;
[0042] A query module, used to, if so, query the current capacity of the target cluster based on a preset query script;
[0043] A calculation module, used to calculate the target node quantity to be added corresponding to the target cluster based on the current capacity;
[0044] A screening module, used to screen out the specified server from the preset standby resource pool based on the target node quantity;
[0045] A configuration module, used to configure the network interface of the specified server as the network corresponding to the target cluster to obtain the corresponding target server;
[0046] A processing module, used to add the target server to the target cluster.
[0047] To solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0048] Determine whether the target cluster meets the preset warning conditions;
[0049] If so, query the current capacity of the target cluster based on the preset query script;
[0050] Based on the current capacity, calculate the number of target nodes to be added corresponding to the target cluster;
[0051] Based on the number of target nodes, screen out the specified servers from the preset standby resource pool;
[0052] Configure the network interface of the specified server as the network corresponding to the target cluster to obtain the corresponding target server;
[0053] Add the target server to the target cluster.
[0054] To solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, adopting the following technical solutions:
[0055] Determine whether the target cluster meets the preset warning conditions;
[0056] If so, query the current capacity of the target cluster based on the preset query script;
[0057] Based on the current capacity, calculate the number of target nodes to be added corresponding to the target cluster;
[0058] Based on the number of target nodes, screen out the specified servers from the preset standby resource pool;
[0059] Configure the network interface of the specified server as the network corresponding to the target cluster to obtain the corresponding target server;
[0060] Add the target server to the target cluster.
[0061] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
[0062] This application first determines whether the target cluster meets the preset warning conditions; if so, it queries the current capacity of the target cluster based on a preset query script; then, based on the current capacity, calculates the number of target nodes to be added corresponding to the target cluster; then, based on the number of target nodes, filters out specified servers from a preset spare resource pool; subsequently, configures the network interfaces of the specified servers as the network corresponding to the target cluster to obtain corresponding target servers; finally, adds the target servers to the target cluster. When this application detects that the target cluster meets the preset warning conditions, it will query the current capacity of the target cluster based on the use of the query script, calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity, and then filter out specified servers from the preset spare resource pool based on the number of target nodes. Subsequently, it configures the network interfaces of the specified servers as the network corresponding to the target cluster to obtain corresponding target servers, and finally adds the target servers to the target cluster, thereby enabling automatic and intelligent automation of the capacity peak-shaving management of the cluster, improving the processing efficiency of the resource management of the cluster, effectively improving the utilization rate and stability of the server resources of the cluster, while liberating human resources and improving the operation and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the solutions in this application, the following will briefly introduce the drawings required for the description of the embodiments of this application. Obviously, the drawings below are some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0064] Figure 1 is an exemplary system architecture diagram to which this application can be applied;
[0065] Figure 2 Flowchart of an embodiment of the cluster management method according to this application;
[0066] Figure 3 is a schematic structural diagram of an embodiment of the cluster management device according to this application;
[0067] Figure 4 is a schematic structural diagram of an embodiment of the computer device according to this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs; the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects and not to describe a specific order.
[0069] References to "embodiments" in this document mean that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of this application. The phrase does not necessarily refer to the same embodiment everywhere in the specification, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0070] To enable those skilled in the technical field to better understand the solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0071] As Figure 1 shown, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. The terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. The network 102 is used as a medium to provide a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0072] Users can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications may be installed on the terminal device 101, such as a web browser application, a shopping application, a search application, an instant messaging tool, an email client, a social platform software, etc.
[0073] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop 1011, the tablet computer 1012, or the mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, and so on.
[0074] The server 103 can be a server that provides various services, such as a background server that supports the pages displayed on the terminal device 101.
[0075] It should be noted that the cluster management method provided by the embodiments of the present application is generally executed by the server / terminal device. Correspondingly, the cluster management device is generally set in the server / terminal device.
[0076] It should be understood that Figure 1 the numbers of the terminal devices, the network, and the servers in
[0077] Continuing to refer to Figure 2 , a flowchart of an embodiment of the cluster management method according to the present application is shown. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted. The cluster management method provided by the embodiments of the present application can be applied to any scenario that requires cluster management. Then, this cluster management method can be applied to the products in these scenarios. For example, cluster management in the financial field. The described cluster management method includes the following steps:
[0078] Step S201, determine whether the target cluster meets the preset alarm conditions.
[0079] In this embodiment, the electronic device on which the cluster management method runs (such as Figure 1The server / terminal device shown can obtain relevant data of the target cluster through a wired connection method or a wireless connection method. It should be noted that the above wireless connection method can include, but is not limited to, 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other currently known or future-developed wireless connection methods. The execution subject of this application is specifically a cluster management system, or simply referred to as the system. In the business scenarios of the financial field or the medical field, the above target cluster can be a Kubernetes (abbreviated as K8s) cluster deployed in a financial enterprise or a medical enterprise. Among them, a monitoring tool is pre-configured to monitor the resource usage conditions such as CPU and memory of the target cluster, and corresponding alarm rules are configured. When it is detected that the CPU or memory usage rate of the target cluster exceeds 80%, it is determined that the target cluster meets the alarm conditions and an alarm is triggered.
[0080] Step S202, if so, query the current capacity of the target cluster based on a preset query script.
[0081] In this embodiment, the above query script is an automated script pre-constructed for triggering the information collection process of the current capacity of the cluster. The current capacity of the above target cluster can include the total number of CPU cores of the target cluster or the total memory size.
[0082] Step S203, based on the current capacity, calculate the number of target nodes to be added corresponding to the target cluster.
[0083] In this embodiment, for the specific implementation process of calculating the number of target nodes to be added corresponding to the target cluster based on the current capacity, this application will further describe the details in subsequent specific embodiments and will not elaborate too much here.
[0084] Step S204, screen out the specified server from a preset spare resource pool based on the number of target nodes.
[0085] In this embodiment, for the specific implementation process of screening out the specified server from a preset spare resource pool based on the number of target nodes, this application will further describe the details in subsequent specific embodiments and will not elaborate too much here.
[0086] Step S205, configure the network interface of the specified server to the network corresponding to the target cluster to obtain the corresponding target server.
[0087] In this embodiment, by configuring the network interface of the specified server to join the network of the target cluster, for example, by setting the VLAN Tag, the target server with the network configuration completed is obtained.
[0088] Step S206: Add the target server to the target cluster.
[0089] In this embodiment, the target server can be added to the above-mentioned target cluster by using kubectl or other tools, including issuing a cluster key (such as a kubeconfig file), configuring components such as kubelet, and starting the kubelet service.
[0090] This application first determines whether the target cluster meets the preset warning conditions; if so, queries the current capacity of the target cluster based on a preset query script; then calculates the number of target nodes to be added corresponding to the target cluster based on the current capacity; then screens out the specified server from the preset standby resource pool based on the number of target nodes; subsequently configures the network interface of the specified server to the network corresponding to the target cluster to obtain the corresponding target server; finally adds the target server to the target cluster. When this application detects that the target cluster meets the preset warning conditions, it will query the current capacity of the target cluster based on the use of the query script, calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity, and then screen out the specified server from the preset standby resource pool based on the number of target nodes. Subsequently, the network interface of the specified server is configured to the network corresponding to the target cluster to obtain the corresponding target server, and finally the target server is added to the target cluster, so that the automatic intelligent capacity peak-shaving management of the cluster can be realized, the processing efficiency of the resource management of the cluster is improved, the utilization rate and stability of the server resources of the cluster are effectively improved, and at the same time, manpower is liberated and the operation and maintenance efficiency is improved.
[0091] In some optional implementation manners, step S204 includes the following steps:
[0092] Screen out the first servers that meet the preset hardware configuration conditions from the standby resource pool.
[0093] In this embodiment, the hardware configuration (such as CPU, memory) of the required nodes can be evaluated according to the current load and expected load of the target cluster to obtain the corresponding hardware configuration conditions. Exemplarily, the hardware configuration conditions may include screening out servers with the number of CPU cores greater than or equal to 4 and the memory greater than or equal to 16GB.
[0094] Obtain the load information, geographical location, and network latency time of each of the first servers.
[0095] In this embodiment, key metrics such as the CPU usage rate, memory usage rate, and disk I / O of the first server can be obtained by using a monitoring system or API and used as corresponding load information; the physical location of the first server (such as the city and data center) can be obtained and used as the corresponding geographical location; the network latency time from the user or request source to the first server can be measured by using ping or other network testing tools.
[0096] Based on the load information, geographical location, and network latency time of each of the first servers, a preset scoring strategy is called to calculate the priority scores of each of the first servers.
[0097] In this embodiment, the specific implementation process of calling a preset scoring strategy to calculate the priority scores of each of the first servers based on the load information, geographical location, and network latency time of each of the first servers will be further described in detail in subsequent specific embodiments of this application and will not be elaborated here too much.
[0098] The second server with the lowest priority score is screened out from all the first servers.
[0099] In this embodiment, by numerically comparing the priority scores of all the first servers, the second server with the lowest priority score is screened out from all the first servers.
[0100] The second server is used as the designated server.
[0101] In this application, the first servers that meet the preset hardware configuration conditions are screened out from the standby resource pool; then the load information, geographical location, and network latency time of each of the first servers are obtained; then, based on the load information, geographical location, and network latency time of each of the first servers, a preset scoring strategy is called to calculate the priority scores of each of the first servers; subsequently, the second server with the lowest priority score is screened out from all the first servers; finally, the second server is used as the designated server. In this application, by first screening out the first servers that meet the preset hardware configuration conditions from the standby resource pool and obtaining the load information, geographical location, and network latency time of each first server, and then calculating the priority scores of each first server based on the use of the scoring strategy, so that subsequently the second server with the lowest priority score is screened out from all the first servers to be used as the final designated server. Since the designated server has the highest priority corresponding to the load information, geographical location, and network latency time, the screening accuracy of the designated server is effectively improved.
[0102] In some alternative implementation manners of this embodiment, calling a preset scoring strategy to calculate the priority scores of the first servers based on the load information, geographical locations, and network latency times of the first servers includes the following steps:
[0103] Obtain the specified load information, specified geographical location, and specified network latency time of the third server.
[0104] In this embodiment, the above-mentioned third server is any one of all the first servers.
[0105] Generate a corresponding comprehensive load score based on the specified load information.
[0106] In this embodiment, a comprehensive load score between 0 and 1 can be obtained by weighted averaging the CPU usage rate, memory usage rate, and disk I / O usage rate included in the specified load information. Among them, the higher the load, the closer the score is to 1.
[0107] Generate a distance value corresponding to the cluster based on the specified geographical location.
[0108] In this embodiment, the distance value can be obtained by calculating the straight-line distance between the target cluster and the third server or using a certain geographical distance algorithm (such as the Haversine formula).
[0109] Based on a preset weighted calculation algorithm, perform calculation processing on the comprehensive load score, the distance value, and the specified network latency time to obtain a corresponding weighted calculation result.
[0110] In this embodiment, the above-mentioned weighted calculation algorithm can specifically adopt the weighted average method. According to business requirements, weights are assigned to the load information, geographical location, and network latency time. For example, if low latency is crucial for the business, the weight of the network latency time may be higher; if it is desired to balance the load, the weight of the load score may be higher. Furthermore, using the above-mentioned weighted calculation algorithm, according to the above comprehensive load score, distance value, specified network latency time, and defined weights, a priority score is calculated for each server. Exemplarily, if the weight of the load information is defined as 0.5, the weight of the geographical location is 0.3, and the weight of the network latency time is 0.2, the score can be calculated using the following formula: Priority score = (Comprehensive load score × 0.5) + (Distance value × (-0.3)) + (Network latency time × (-0.2)). Additionally, the servers can be sorted according to the priority scores subsequently. The lower the score, the higher the priority (because the load score is a positive indicator, while the distance and latency are negative indicators, so a low score means low load, short distance, and small latency).
[0111] Use the weighted calculation result as the specified priority score of the third server.
[0112] In this application, the specified load information, specified geographical location, and specified network latency time of the third server are obtained; where the third server is any one of all the first servers; then a corresponding comprehensive load score is generated based on the specified load information; then a distance value corresponding to the cluster is generated based on the specified geographical location; subsequently, based on a preset weighted calculation algorithm, the comprehensive load score, the distance value, and the specified network latency time are calculated and processed to obtain a corresponding weighted calculation result; finally, the weighted calculation result is used as the specified priority score of the third server. By obtaining the specified load information, specified geographical location, and specified network latency time of the third server, generating a corresponding comprehensive load score based on the specified load information, and generating a distance value corresponding to the target cluster based on the specified location information, and then calculating and processing the comprehensive load score, distance value, and specified network latency time based on the use of the weighted calculation algorithm, it is possible to quickly and accurately generate the specified priority score of the third server, effectively improving the calculation efficiency of the priority score, ensuring the accuracy of the obtained priority score, and facilitating subsequent accurate screening and processing of the first server according to the obtained priority score.
[0113] In some optional implementation manners, step S203 includes the following steps:
[0114] Obtain a preset calculation strategy.
[0115] In this embodiment, the content of the above calculation strategy includes: the number of added nodes can be set to 10% of the current capacity of the cluster. Exemplarily, if the cluster currently has 10 nodes, each node has 4 CPU cores and 16 GB of memory, then 1 node can be added to the cluster.
[0116] Perform calculation processing on the current capacity based on the calculation strategy to obtain a corresponding calculation result.
[0117] In this embodiment, the above current capacity can be correspondingly calculated and processed according to the content of the above calculation strategy, so as to obtain a calculation result.
[0118] Use the calculation result as the target node to be added corresponding to the target cluster.
[0119] This application obtains a preset calculation strategy; then, based on the calculation strategy, it performs calculation processing on the current capacity to obtain a corresponding calculation result; subsequently, the calculation result is used as the number of target nodes to be added corresponding to the target cluster. By performing calculation processing on the current capacity of the target cluster based on the use of the calculation strategy, this application can quickly and accurately calculate the number of target nodes to be added corresponding to the target cluster, improving the generation efficiency of the number of target nodes and ensuring the accuracy of the obtained number of target nodes.
[0120] In some alternative implementation manners, after step S206, the above electronic device may further perform the following steps:
[0121] Monitor the status information of the target server based on a preset monitoring tool.
[0122] In this embodiment, a monitoring tool with a function of setting health checks (such as the Readiness Probe of a Pod) can be used to detect the status information of the target server. The status information may include whether the target server has successfully joined the cluster and is normally sharing the load.
[0123] Obtain the operation information of the scaling operation corresponding to the target server.
[0124] In this embodiment, the above operation information may at least include information such as time, the number of nodes, and the operator.
[0125] Perform storage processing on the status information and the operation information.
[0126] In this embodiment, a log management tool can be used to store and query the above status information and operation information for subsequent auditing and troubleshooting.
[0127] This application monitors the status information of the target server based on a preset monitoring tool; then obtains the operation information of the scaling operation corresponding to the target server; subsequently, performs storage processing on the status information and the operation information. After adding the target server to the target cluster, this application will also intelligently monitor the status information of the target server based on the use of the monitoring tool, obtain the operation information of the scaling operation corresponding to the target server, and then, by performing storage processing on the status information and the operation information, can ensure the data security of the obtained status information and operation information and is conducive to subsequent auditing and troubleshooting.
[0128] In some alternative implementation manners of this embodiment, the above electronic device may further perform the following steps:
[0129] Obtain the load performance information of the target cluster.
[0130] In this embodiment, the load performance information of the target cluster can be collected. For example, it can include testing the K8S cluster during low-frequency use at night, while a large amount of computing resources are required for the online big data service at night.
[0131] Based on the load performance information, a resource adjustment strategy corresponding to the target cluster is constructed.
[0132] In this embodiment, the content of the above resource adjustment strategy includes: in a task scenario, according to the load performance of each cluster in daily life, the resource size of each cluster within a certain period can be planned in advance to improve the reuse rate of server resources. Specifically, at a specified time, such as after 20:00, the test k8s cluster will automatically scale down and take offline some node nodes, controlling the overall load at about 70%-75%. The offline node nodes will be expanded into the spare resource pool. Before the big data batch processing task is executed at a specified time, such as 22:00, the resources in the spare resource pool will be expanded into the online cluster, and after the batch processing task is completed in the early morning, the number of each cluster will be restored.
[0133] Based on the resource adjustment strategy, corresponding resource adjustment processing is performed on the target cluster.
[0134] In this embodiment, corresponding resource adjustment processing can be performed on the target cluster according to the content of the above resource adjustment strategy.
[0135] This application obtains the load performance information of the target cluster; then constructs a resource adjustment strategy corresponding to the target cluster based on the load performance information; and subsequently performs corresponding resource adjustment processing on the target cluster based on the resource adjustment strategy. By obtaining the load performance information of the target cluster, this application will intelligently construct a resource adjustment strategy corresponding to the target cluster based on the load performance information, and then realize corresponding resource adjustment processing on the target cluster based on the use of the resource adjustment strategy, thereby effectively improving the utilization rate and stability of the server resources of the target cluster.
[0136] In some optional implementation manners of this embodiment, before step S204, the above electronic device can further perform the following steps:
[0137] Obtain a pre-selected initial server.
[0138] In this embodiment, a batch of buffer servers can be pre-selected according to actual business needs and used as the above initial servers. These servers have already deployed K8S components, and through simple configuration, these servers can be added to the specified cluster at any time.
[0139] Based on the initial server, a corresponding server list is constructed.
[0140] In this embodiment, the initially selected server can be based on a dynamically maintained server list, including the IP addresses, configuration information, etc. of the servers. Specifically, the network architecture of the front computer room is a VXLAN architecture. Based on this network environment, the network cards of the servers can be added to each environment by configuring VLAN tags. In this way, the condition for different K8S clusters in different environments to share the same server resource pool is met.
[0141] Use the server list as the backup resource pool.
[0142] This application obtains a pre-selected initial server; then constructs a corresponding server list based on the initial server; subsequently, uses the server list as the backup resource pool. By obtaining a pre-selected initial server, and then constructing a corresponding server list based on the initial server and using it as the corresponding backup resource pool, this application can achieve the rapid construction of the backup resource pool, improving the construction efficiency and intelligence of the backup resource pool.
[0143] In some alternative implementation manners, the obtained user information has obtained the consent of the user and complies with the provisions of relevant laws and relevant policies.
[0144] In addition, the non-company software tools or components that appear in the embodiments of this application are only for illustrative introduction and do not represent actual use.
[0145] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0146] It should be emphasized that to further ensure the privacy and security of the above-mentioned number of target nodes, the above-mentioned number of target nodes can also be stored in a node of a blockchain.
[0147] The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Blockchain, in essence, is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity (anti-counterfeiting) of the information and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0148] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0149] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0150] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, Read-Only Memory (ROM), or a Random Access Memory (RAM), etc.
[0151] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. Their execution order does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0152] Further reference Figure 3 to Figure 2 As an implementation of the method shown above, an embodiment of a cluster management device is provided in the present application. This device embodiment corresponds to the method embodiment shown in Figure 2 and this device can be specifically applied to various electronic devices.
[0153] Such as Figure 3As shown in the figure, the cluster management device 300 described in this embodiment includes: a judgment module 301, a query module 302, a calculation module 303, a screening module 304, a configuration module 305, and a processing module 306. Among them:
[0154] The judgment module 301 is used to judge whether the target cluster meets the preset alarm conditions;
[0155] The query module 302 is used to, if so, query the current capacity of the target cluster based on a preset query script;
[0156] The calculation module 303 is used to calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity;
[0157] The screening module 304 is used to screen out specified servers from a preset spare resource pool based on the number of target nodes;
[0158] The configuration module 305 is used to configure the network interface of the specified server as the network corresponding to the target cluster to obtain a corresponding target server;
[0159] The processing module 306 is used to add the target server to the target cluster. In this embodiment, the operations respectively performed by the above modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0160] In some optional implementation manners of this embodiment, the screening module 304 includes:
[0161] The first screening sub-module is used to screen out the first servers that meet the preset hardware configuration conditions from the spare resource pool;
[0162] The acquisition sub-module is used to acquire the load information, geographical location, and network delay time of each of the first servers;
[0163] The first calculation sub-module is used to call a preset scoring strategy to calculate the priority scores of each of the first servers based on the load information, geographical location, and network delay time of each of the first servers;
[0164] The second screening sub-module is used to screen out the second servers with the lowest priority scores from all the first servers;
[0165] The first determination sub-module is used to use the second server as the specified server.
[0166] In this embodiment, the operations respectively performed by the above modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0167] In some alternative implementation manners of this embodiment, the first calculation sub-module includes:
[0168] An obtaining unit, configured to obtain specified load information, a specified geographical location, and a specified network latency time of a third server; wherein, the third server is any one of all the first servers;
[0169] A first generating unit, configured to generate a corresponding comprehensive load score based on the specified load information;
[0170] A second generating unit, configured to generate a distance value corresponding to the cluster based on the specified geographical location;
[0171] A calculating unit, configured to perform calculation processing on the comprehensive load score, the distance value, and the specified network latency time based on a preset weighted calculation algorithm to obtain a corresponding weighted calculation result;
[0172] A determining unit, configured to use the weighted calculation result as the specified priority score of the third server.
[0173] In this embodiment, the operations respectively performed by the foregoing modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0174] In some alternative implementation manners of this embodiment, the calculation module 303 includes:
[0175] A second obtaining sub-module, configured to obtain a preset calculation policy;
[0176] A second calculation sub-module, configured to perform calculation processing on the current capacity based on the calculation policy to obtain a corresponding calculation result;
[0177] A second determining sub-module, configured to use the calculation result as the number of target nodes to be added corresponding to the target cluster.
[0178] In this embodiment, the operations respectively performed by the foregoing modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0179] In some alternative implementation manners of this embodiment, the cluster management device further includes:
[0180] A monitoring module, configured to monitor the status information of the target server based on a preset monitoring tool;
[0181] A first obtaining module, configured to obtain operation information of an expansion operation corresponding to the target server;
[0182] A storage module for storing and processing the status information and the operation information.
[0183] In this embodiment, the operations respectively performed by the above modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0184] In some optional implementation manners of this embodiment, the cluster management device further includes:
[0185] A second acquisition module for acquiring the load performance information of the target cluster;
[0186] A first construction module for constructing a resource adjustment policy corresponding to the target cluster based on the load performance information;
[0187] An adjustment module for performing corresponding resource adjustment processing on the target cluster based on the resource adjustment policy.
[0188] In this embodiment, the operations respectively performed by the above modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0189] In some optional implementation manners of this embodiment, the cluster management device further includes:
[0190] A third acquisition module for acquiring a pre-selected initial server;
[0191] A second construction module for constructing a corresponding server list based on the initial server;
[0192] A determination module for using the server list as the standby resource pool.
[0193] In this embodiment, the operations respectively performed by the above modules or units correspond one by one to the steps of the cluster management method in the foregoing embodiment, and will not be elaborated herein.
[0194] To solve the above technical problems, an embodiment of the present application further provides a computer device. For details, please refer to Figure 4 , Figure 4 which is the basic structural block diagram of the computer device in this embodiment.
[0195] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are communicatively connected to each other via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0196] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touchpad, a voice control device, etc.
[0197] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit and the external storage device of the computer device 4. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the cluster management method. In addition, the memory 41 can also be used to temporarily store various data that have been output or will be output.
[0198] In some embodiments, the processor 42 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the cluster management method.
[0199] The network interface 43 may include a wireless network interface or a wired network interface, and this network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0200] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
[0201] In the embodiments of the present application, the present application first determines whether the target cluster meets the preset warning conditions; if so, queries the current capacity of the target cluster based on a preset query script; then calculates the number of target nodes to be added corresponding to the target cluster based on the current capacity; then filters out the specified servers from a preset spare resource pool based on the number of target nodes; subsequently configures the network interface of the specified server as the network corresponding to the target cluster to obtain the corresponding target server; and finally adds the target server to the target cluster. When the present application detects that the target cluster meets the preset warning conditions, it will query the current capacity of the target cluster based on the use of the query script, calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity, and then filter out the specified servers from the preset spare resource pool based on the number of target nodes. Subsequently, the network interface of the specified server is configured as the network corresponding to the target cluster to obtain the corresponding target server, and finally the target server is added to the target cluster, so that the automatic and intelligent capacity peak-shaving management automation of the cluster can be realized, the processing efficiency of the resource management of the cluster is improved, the utilization rate and stability of the server resources of the cluster are effectively improved, and at the same time, manpower is liberated and the operation and maintenance efficiency is improved.
[0202] The present application also provides another implementation manner, that is, to provide a computer-readable storage medium storing computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to execute the steps of the cluster management method as described above.
[0203] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
[0204] In the embodiments of the present application, the present application first determines whether the target cluster meets the preset warning conditions; if so, queries the current capacity of the target cluster based on a preset query script; then calculates the number of target nodes to be added corresponding to the target cluster based on the current capacity; then filters out designated servers from a preset spare resource pool based on the number of target nodes; subsequently configures the network interfaces of the designated servers to the network corresponding to the target cluster to obtain corresponding target servers; and finally adds the target servers to the target cluster. When the present application detects that the target cluster meets the preset warning conditions, it will query the current capacity of the target cluster based on the use of the query script, calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity, and then filter out designated servers from the preset spare resource pool based on the number of target nodes. Subsequently, the network interfaces of the designated servers are configured to the network corresponding to the target cluster to obtain corresponding target servers, and finally the target servers are added to the target cluster, so that the automatic intelligent capacity peak shaving management of the cluster can be realized, the processing efficiency of the resource management of the cluster is improved, the utilization rate and stability of the server resources of the cluster are effectively improved, and at the same time, human resources are liberated and the operation and maintenance efficiency is improved.
[0205] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
[0206] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The drawings of the present application show the preferred embodiments, but do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure content of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. Any equivalent structure made directly or indirectly using the specification and drawings of the present application in other related technical fields shall be within the scope of the patent protection of the present application by the same token.
Claims
1. A cluster management method, characterized in that: The steps include: Determine whether the target cluster meets the preset alarm conditions; If yes, query the current capacity of the target cluster based on a preset query script; Based on the current capacity, calculating the number of target nodes to be added corresponding to the target cluster; Filtering a designated server from a preset backup resource pool based on the target node quantity; Configuring the network interface of the designated server to a network corresponding to the target cluster to obtain a corresponding target server; Add the target server to the target cluster.
2. The cluster management method according to claim 1, characterized in that: The step of selecting a designated server from a preset standby resource pool based on the target node quantity specifically includes: Selecting a first server that meets a preset hardware configuration condition from the backup resource pool; Obtaining load information, geographic location, and network delay time of each of the first servers; Based on the load information, geographical location and network delay time of each of the first servers, a preset scoring strategy is called to calculate the priority score of each of the first servers; Filter out the second server with the lowest priority score from all the first servers; The second server is used as the designated server.
3. The cluster management method according to claim 2, characterized in that: The step of invoking a preset scoring strategy to calculate the priority score of each first server based on the load information, geographical location, and network delay time of each first server specifically includes: Obtaining specified load information, a specified geographical location, and a specified network delay time of a third server; wherein the third server is any one of all the first servers; generating a corresponding comprehensive load score based on the specified load information; generating a distance value corresponding to the cluster based on the specified geographic location; Based on a preset weighted calculation algorithm, the comprehensive load score, the distance value and the specified network delay time are calculated and processed to obtain a corresponding weighted calculation result; The weighted calculation result is used as the designated priority score of the third server.
4. The cluster management method according to claim 1, characterized in that: The step of calculating the number of target nodes to be added corresponding to the target cluster based on the current capacity specifically includes: Get the preset calculation strategy; Calculate the current capacity based on the calculation strategy to obtain a corresponding calculation result; The calculation result is used as the target number of nodes to be added corresponding to the target cluster.
5. The cluster management method according to claim 1, characterized in that: After the step of adding the target server to the target cluster, the method further includes: Monitoring the status information of the target server based on a preset monitoring tool; Acquire operation information of a capacity expansion operation corresponding to the target server; The state information and the operation information are stored and processed.
6. The cluster management method according to claim 1, characterized in that: The cluster management method further includes: Obtaining load performance information of the target cluster; Building a resource adjustment strategy corresponding to the target cluster based on the load performance information; Based on the resource adjustment policy, corresponding resource adjustment processing is performed on the target cluster.
7. The cluster management method according to claim 1, characterized in that: Before the step of selecting a designated server from a preset standby resource pool based on the target node quantity, the method further includes: Get the pre-selected initial server; Building a corresponding server list based on the initial server; The server list is used as the backup resource pool.
8. A cluster management device, characterized in that: include: A judgment module is used to judge whether the target cluster meets the preset alarm conditions; A query module, used for, if yes, querying the current capacity of the target cluster based on a preset query script; A calculation module, configured to calculate the number of target nodes to be added corresponding to the target cluster based on the current capacity; A screening module, used for screening out a designated server from a preset backup resource pool based on the number of target nodes; A configuration module, configured to configure the network interface of the designated server to a network corresponding to the target cluster, and obtain a corresponding target server; A processing module is used to add the target server to the target cluster.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the cluster management method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the cluster management method according to any one of claims 1 to 7 are implemented.