Resource management method and computing device
By installing independent resource management plug-ins on the host, the problem that the K8s cluster management tool cannot manage the host system services is solved, efficient and flexible resource management is achieved, and the system stability and management convenience are improved.
Patent Information
- Application Number
- CN202510127889.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-07-25
AI Technical Summary
The existing K8s cluster management tools cannot effectively manage system services on the host, resulting in inflexible and efficient resource management.
By installing resource management plug-ins on the host, the management of system services is realized, and different plug-ins run in independent processes, supporting activation, deactivation, upgrade and other operations to ensure system stability and isolation.
It improves the convenience and flexibility of management of host system services, enhances the stability and reliability of the system, and can adapt to business changes in a timely manner.
Smart Images

Figure CN120371506A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a resource management method and a computing device. Background Art
[0002] With the development of distributed computing, how to perform efficient and flexible resource management for multiple clusters has become a key research direction in the industry. For example, for the management of container clusters, the industry uses Kubernetes (abbreviated as K8s) as the mainstream container orchestration tool, which can be used to start containers, automate deployments, scale and manage containers, and recycle containers. However, this tool only has the function of managing the internal resources of the K8s cluster and cannot achieve more extensive resource management through the system services on the host. Summary of the Invention
[0003] The embodiments of the present application provide a resource management method and a computing device. Through a resource management plugin on the host where the target node in the cluster is located, resource management of the system services on the host where the target node is located is realized, and different resource management plugins can run as independent processes, which can significantly improve the convenience, flexibility, and scalability of management.
[0004] In a first aspect, the embodiments of the present application provide a resource management method, which includes: obtaining a first instruction for instructing to perform a first management operation on a target resource on the host where the target node is located; a first target plugin is running on the host where the target node is located, and the target resource is a system service on the host where the target node is located; in response to the first instruction, through the first target plugin, perform the first management operation on the target resource.
[0005] It can be understood that by instructing the resource management plugin, it is possible to realize the use of the system services on the host, and different resource management plugins can run independently of each other, with excellent isolation, which can improve the reliability and stability of the system and facilitate flexible management.
[0006] In a possible implementation manner, in response to the first instruction, performing the first management operation on the target resource through the first target plugin includes: determining the first target plugin corresponding to the plugin identifier according to the plugin identifier in the first instruction, and performing the first management operation on the target resource through the first target plugin.
[0007] It can be understood that through the plugin identifier in the first instruction, the accuracy of determining the first target plugin from multiple resource management plugins can be improved, and thus it can be ensured that the first management operation indicated by the first instruction is correctly performed on the target resource.
[0008] In a possible implementation, the method further includes: obtaining an uninstallation instruction for indicating to perform an uninstallation operation on a second target plugin in the resource management plugin, and finding the second target plugin from the host machine to which the target node belongs according to the plugin identifier and / or storage path of the second target plugin; uninstalling the second target plugin.
[0009] It can be understood that the plugin indicated by the uninstallation instruction can be any plugin in the resource management plugin. Through the plugin identifier and / or storage path in the uninstallation instruction, the accuracy and efficiency of finding the second target plugin can be ensured, other plugins can be prevented from being uninstalled by mistake, and the stable operation of the system can be guaranteed.
[0010] In a possible implementation, uninstalling the second target plugin includes: obtaining the running state information of the second target plugin; if the running state information indicates that the second target plugin is in an enabled state, first terminate the process of the second target plugin and then uninstall the second target plugin; if the running state information indicates that the second target plugin is in a disabled state, uninstall the second target plugin.
[0011] It can be understood that before uninstalling the second target plugin, according to the running state information of the second target plugin, first terminate the process of the second target plugin in the enabled state, and then uninstall the second target plugin, so as to avoid anomalies during the uninstallation process and ensure that the uninstallation operation can be successfully completed.
[0012] In a possible implementation, the method further includes: obtaining an upgrade instruction for indicating to perform an upgrade operation on a third target plugin in the resource management plugin; obtaining the upgrade version of the third target plugin according to the acquisition path included in the upgrade instruction; upgrading the third target plugin according to the plugin identifier and / or storage path included in the upgrade instruction.
[0013] It can be understood that the plugin indicated by the upgrade instruction can be any plugin in the resource management plugin. Through the acquisition path of the upgrade version of the third target plugin in the upgrade instruction, the upgrade version of the third target plugin can be accurately obtained, and then the third target plugin can be upgraded according to the plugin identifier and / or storage path of the third target plugin in the upgrade instruction, so as to ensure that the upgrade operation can be successfully completed.
[0014] In a possible implementation, the method further includes: obtaining an enabling instruction for indicating to perform an enabling operation on a fourth target plugin in the resource management plugin; creating a process for the fourth target plugin according to the plugin identifier of the fourth target plugin in the enabling instruction; and sending back a response message for the enabling instruction, where the response message is used to indicate that the fourth target plugin is successfully enabled.
[0015] It can be understood that the plugin indicated by the enable instruction can be any plugin in the resource management plugin. By creating a process for the fourth target plugin indicated by the enable instruction, the plugin can be successfully enabled, providing a basis for the realization of managing the target resources. And by sending back the response information indicating the successful enabling of the fourth target plugin, it is convenient for the sender of the enable instruction to timely know whether the fourth target plugin is successfully enabled, realizing the synchronization of the status of the fourth target plugin among different components.
[0016] In a possible implementation manner, the method further includes: obtaining a disable instruction for indicating to perform a disable operation on a fifth target plugin in the resource management plugin; and ending the process of the fifth target plugin according to the plugin identifier of the fifth target plugin in the disable instruction.
[0017] It can be understood that the plugin indicated by the disable instruction can be any plugin in the resource management plugin. Through the plugin identifier in the disable instruction, the process of the fifth target plugin indicated in the disable instruction can be accurately ended, avoiding misinterpreting the processes of other plugins, thereby ensuring the stability and reliability of the system.
[0018] In a possible implementation manner, the method further includes: obtaining an installation instruction for indicating to install a sixth target plugin on the host machine where the target node is located; if the installation instruction indicates a target path, installing the sixth target plugin under the target path; if the installation instruction does not indicate a target path, installing the sixth target plugin under the preset path of the host machine where the target node is located.
[0019] It can be understood that according to the installation instruction, it can be ensured that the sixth target plugin is successfully installed on the node, and it can also be installed under the corresponding path (target path or preset path) according to whether the installation instruction indicates a target path, providing a resource basis for the realization of managing the target resources. And since the resource management plugins installed on the host machine where the target node is located can run in independent processes simultaneously, the installation process will not interfere with the resource management operations that other resource management plugins can provide, nor will it interfere with the management operations for other resource management plugins.
[0020] In a possible implementation manner, the method further includes: obtaining a second instruction for indicating to obtain the health status information of a seventh target plugin; and in response to the fourth instruction, returning the health status information of the fourth target plugin, where the health status information is used to indicate whether the fourth target plugin can perform the corresponding resource management function.
[0021] It can be understood that transmitting back the health status information of the fourth target plug-in indicated by the second instruction realizes the synchronization of the health status information of the seventh target plug-in among different components, which helps to avoid resource management operations through abnormal plug-ins, and also helps to detect and handle abnormal plug-ins in a timely manner, significantly reducing the possibility of service interruption and data loss caused by plug-in failures, ensuring the continuous normal operation of user services, and improving the reliability and stability of the system.
[0022] In a possible implementation manner, the health status information of the resource management plug-in is periodically reported by the resource management plug-in to the target node, and the method further includes: detecting the health status information of the eighth target plug-in by executing a preset test script, where the eighth target plug-in is one that has not reported health status information for a period exceeding a preset interval, and the preset interval is longer than the reporting period.
[0023] It can be understood that in the case where a plug-in fails to report for a long time (exceeding the preset interval), actively detecting the plug-in through a preset test script to determine whether the eighth target plug-in is healthy. By combining the two methods of passive reception and active detection, abnormal plug-ins can be detected and processed in a timely manner, improving the reliability and stability of the system.
[0024] In a possible implementation manner, the method further includes: if the health status information of the eighth target plug-in indicates that the fifth target plug-in cannot execute the corresponding resource management function, restarting the process of the eighth target plug-in, and after restarting, detecting the health status information of the eighth target plug-in again through the test script.
[0025] It can be understood that in the case where the health status information of the eighth target plug-in indicates that the fifth target plug-in cannot execute the corresponding resource management function, restarting the process of the fifth target plug-in (a repair measure) to attempt to restore the eighth target plug-in to a healthy state, and after restarting, actively detecting the plug-in through a preset test script to determine again whether the eighth target plug-in is healthy, which helps to improve the reliability and stability of the system.
[0026] In a possible implementation manner, the method further includes: if after the number of times of restarting the process of the eighth target plug-in reaches the target number of times, the health status information indicates that the eighth target plug-in cannot execute the corresponding resource management function, generating a warning message; outputting the warning message to remind the operation and maintenance personnel to repair the eighth target plug-in.
[0027] It can be understood that after restarting the process of the eighth target plug-in multiple times (reaching the target number of times) and the eighth target plug-in still cannot execute the corresponding resource management function, generating and outputting a warning message to timely remind the operation and maintenance personnel to repair the eighth target plug-in can further improve the reliability and stability of the system.
[0028] In a second aspect, an embodiment of the present application provides a resource management device, which is used to execute any one of the resource management methods provided in the first aspect above.
[0029] In a possible implementation manner, an embodiment of the present application may divide the resource management device into functional modules according to the method provided in the first aspect above. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. Exemplarily, an embodiment of the present application may divide the resource management device into a reverse proxy module, a function and version management module, etc. The descriptions of the possible technical solutions and beneficial effects executed by each of the above-divided functional modules can refer to the technical solutions provided in the first aspect or its corresponding possible implementation manners, and will not be elaborated here.
[0030] In a third aspect, an embodiment of the present application provides a computing device, which includes a management controller and a memory, and the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor so that the computing device implements the resource management method as described in the above aspects.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program instruction is stored, and the computer program instruction is loaded and executed by the management controller in the computing device to implement the resource management method as described in the above aspects.
[0032] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The management controller of the computing device reads the computer instructions from the computer-readable storage medium, and the management controller executes the computer instructions, so that the computing device executes the resource management methods provided in the various optional implementation manners of the first aspect above.
[0033] For the specific descriptions of the second to fifth aspects and their various implementation manners in the embodiments of the present application, reference may be made to the detailed descriptions in the first aspect and its various implementation manners; and, for the beneficial effects of the second to fifth aspects and their various implementation manners, reference may be made to the analysis of the beneficial effects in the first aspect and its various implementation manners, and will not be elaborated here.
[0034] These aspects or other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a schematic diagram of a multi-cluster node provided by an embodiment of the present application;
[0036] Figure 2 A schematic diagram of a system architecture provided by an embodiment of this application;
[0037] Figure 3 An interaction interface diagram of a resource management plugin provided by an embodiment of this application;
[0038] Figure 4 A schematic diagram of the hardware structure of a computing device provided by an embodiment of this application;
[0039] Figure 5 A flowchart of a resource management method provided by an embodiment of this application;
[0040] Figure 6 is Figure 5 A schematic diagram of obtaining an instruction related to the illustrated embodiment;
[0041] Figure 7 is Figure 5 Another schematic diagram of obtaining an instruction related to the illustrated embodiment;
[0042] Figure 8 is Figure 6 A schematic diagram of a management operation related to the illustrated embodiment;
[0043] Figure 9 is Figure 7 A schematic diagram of a management operation related to the illustrated embodiment;
[0044] Figure 10 is Figure 5 A schematic diagram of plugin management related to the illustrated embodiment;
[0045] Figure 11 is Figure 5 Another schematic diagram of plugin management related to the illustrated embodiment;
[0046] Figure 12 A schematic diagram of the structure of a resource management device provided by an embodiment of this application. Detailed implementation manners
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will further describe the embodiments of this application in detail with reference to the accompanying drawings.
[0048] As used herein, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0049] Moreover, in the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more than two. "At least one (item)" or similar expressions refer to any combination of these items, including any combination of single item (s) or plural item (s). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or plural.
[0050] In addition, for the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first", "second", etc. do not necessarily mean different. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner for easy understanding.
[0051] First, an exemplary introduction to the application scenarios of the embodiments of the present application is provided.
[0052] As Figure 1 shown, Figure 1 is a schematic diagram of a multi - cluster node provided by the embodiments of the present application. Figure 1 The user shown can issue instructions to the cluster nodes through the control plane of the server via the interaction interface displayed on the client (such as a web browser, a mobile application, a command - line tool, etc.). Figure 1 Only the No. 1 cluster node (corresponding to the No. 1 host) and the No. 2 cluster node (corresponding to the No. 2 host) located on the server are shown as examples to Figure 1Taking the cluster nodes shown as an example of a K8s cluster, the traditional management method for multiple K8s clusters is mainly as follows: The K8s clusters are managed according to the cluster configuration file (kubeconfig). This method can manage the resources within the clusters, such as which target image file each cluster runs and establishing the target number of replicas, but it cannot reach the system services on the host machines to which the cluster nodes belong. Thus, it is difficult to perform management operations on the system services, such as installing drivers for the graphics cards of the host machines, systemd services, crond scheduled task services, Network Time Protocol (NTP) services, etc. Currently, to perform such operations, users can only log in to the operating systems of the host machines and then perform manual operations, which is inefficient.
[0053] In view of this, the embodiments of the present application provide a resource management method. An extended function capable of managing the system services of the host machine (also referred to as resources at the host machine level) is installed and run on the host machine to which the target node belongs in the form of a resource management plug-in. This not only realizes the management of the system services on the host machine, but also since each resource management plug-in runs as an independent process, when performing management operations such as enabling, disabling, and upgrading different plug-ins, it will not interfere with other plug-ins to continuously provide services, significantly improving the isolation and management convenience. Moreover, different resource management plug-ins can achieve process-level isolation, that is, when a resource management plug-in fails, it will not affect other normally running resource management plug-ins. Therefore, the stability and reliability of the system are significantly improved. And the resource management plug-ins can efficiently adjust according to the development and changes of the business in a timely manner, greatly saving time and costs and significantly improving the management efficiency.
[0054] In some feasible embodiments, a resource management method provided by the embodiments of the present application includes: obtaining a first instruction, where the first instruction is used to indicate performing a first management operation on a target resource on the host machine to which the target node belongs; a first target plug-in is running on the host machine to which the target node belongs, and the target resource is the system service on the host machine to which the target node belongs; in response to the first instruction, through the first target plug-in, perform the first management operation on the target resource. Through the resource management plug-in, the management of the system services on the host machine to which the target node belongs is realized, and different resource management plug-ins can run as independent processes with high isolation, so the stability, reliability of the system can be significantly improved, and the management convenience is also improved.
[0055] Secondly, an exemplary introduction to the system architecture of the embodiments of the present application is given.
[0056] The resource management method provided by the embodiments of the present application can be applied to the Figure 2 system architecture shown as followsFigure 2 The multi-cluster management system 10000 shown at least includes a cluster management module 11000, multiple nodes, and corresponding host machines (such as Figure 2 The 2 nodes belonging to different clusters shown are respectively: node 12100 running on host machine 12000, and node 13100 running on host machine 13000), where Figure 2 This is only a possible example. One or more nodes can run on one host machine, and the host machine can be a physical device or a virtual device. The embodiments of the present application do not limit this.
[0057] Figure 2 The cluster management module 11000 shown can be used to interact with users and nodes. For example, through the display terminal it is connected to ( Figure 2 not shown in the figure), it provides an intuitive and convenient interaction interface for users to view and manage a lot of information and interaction controls related to the resource management plug-in. When installing a new plug-in, the cluster management module 11000 can also be used to perform compatibility checks and necessary configuration adjustments. When uninstalling the plug-in, the cluster management module 11000 can also be used to clean up relevant resources and configurations to ensure the cleanliness and stability of the system.
[0058] Exemplarily, referring to Figure 3 , Figure 3 This is an interaction interface diagram of a resource management plug-in provided by an embodiment of the present application. Among them, the cluster management module 11000 shows the relevant information (only the function description, running status, and host machine where it is located are shown in the figure) of the resource management plug-in 12200, the resource management plug-in 13200, and the resource management plug-in 14200 through the display terminal 20000 it is connected to, as well as multiple interaction controls (only shown in the figure: execute, enable, disable, uninstall). Exemplarily: the function description of the resource management plug-in 12200 is: restart the host machine, the running status is: running normally, and the host machine where it is located is: host machine 12000; the function description of the resource management plug-in 13200 is: update the graphics card driver of the host machine, the running status is: not enabled, and the host machine where it is located is: host machine 13000; the function description of the resource management plug-in 14200 is: update the operating system of the host machine, the running status is: running normally, and the host machine where it is located is: host machine 14000. It should be noted that Figure 3 This is only a possible example. The specific interaction interface can be customized according to actual needs to display more or less information. For example, the version information of each plug-in, upgrade interaction controls, etc. can also be displayed, which will not be elaborated.
[0059] It is worth noting that the cluster management module 11000 can run on Figure 2It can also run on any node among the nodes on the host 12000 (such as node 12100) or the nodes on the host 13000 (such as node 13100), or on an independent computing device.
[0060] At least a management process 12110 runs on node 12100, and at least one resource management plugin 12200 is installed on the host 12000 where node 12100 is located. Among them, the management process 12110 can be used to execute the resource management method provided by the embodiments of the present application. For example, it receives instructions sent by the cluster management module 11000, and instructs the installed resource management plugin (such as Figure 2 the resource management plugin 12200 shown) to manage the resources in the host where node 12100 is located and that do not belong to the cluster where node 12100 is located, and perform operations such as enabling, disabling, uninstalling, and detecting the health status of the resource management plugin on node 12100, and can also install a new resource management plugin. Figure 2 Node 13100 shown and other nodes not shown are similar to node 12100 and will not be elaborated here.
[0061] Optionally, the multi-cluster management system 10000 further includes an infrastructure management service module 14000. The infrastructure management service module 14000 can respond to instructions issued by the cluster management module 11000, which can specifically be a node creation request. After receiving the corresponding request, the infrastructure management service module 14000 creates a compliant node (virtual node) using the resource pool composed of physical devices, or allocates compliant physical devices to the user (physical node), etc., to meet the user's needs, so that nodes and clusters can complete automated deployment smoothly according to the user's requirements.
[0062] In some feasible embodiments, the user can Figure 2 issue an instruction to create node 13100 to the infrastructure management service module 14000 through the cluster management module 11000 shown. Furthermore, in response to this instruction, the infrastructure management service module 14000 can plan and coordinate the corresponding resources to complete the creation of node 13100. During this process, the proxy function management module 11100 can provide a configuration file related to the management process (such as a cloud-init file). By executing this file, node 13100 can register the management process 13110 as a system service and run. After necessary detection, the cluster management module 11000 feeds back a reminder message indicating that node 13100 has been successfully created to the user. The aforementioned cloud-init is an open-source initialization tool that can provide initialization configuration capabilities such as initializing passwords, setting hostnames, and executing custom scripts for operating systems (such as Linux).
[0063] Optionally, the cluster management module 11000 specifically includes two different modules, such as Figure 2 The proxy function management module 11100 and the node proxy module 11200 are shown respectively. Among them, the proxy function management module 11100 can be used to Figure 3 The interactive interface shown displays the current status of each plug-in and receives user requests for the management and use of the plug-in. It can also serve as a static file server for resource management plug-ins, node configuration files, etc., and provide necessary static files for many operations in the multi-cluster management system 10000. The proxy function management module 11100 can also communicate with the infrastructure management service module 14000, and transmit the node configuration file when creating a node to start the target process (such as a process for downloading files, a management process for executing the resource management method provided in the embodiment of the present application, etc.), and can run these processes as system services on the host machine to improve the convenience of management; the node agent module 11200 can be used to obtain relevant requests from the proxy function management module 11100 and issue instructions to the nodes in the corresponding cluster to implement the function of using a resource management plug-in or to enable, upgrade, and other management operations on a resource management plug-in. It can also exchange authentication data with the node and perform inspections to improve the security of the system.
[0064] Optionally, for the node 12100, the management process 12110 specifically includes four different modules, such as Figure 2Shown are a service and authentication module 12111, a reverse proxy module 12112, a function and version management module 12113, and a performance and health module 12114. Among them, the service and authentication module 12111 can not only protect the user's authentication information using encryption technology, but also support two-way certificate authentication to provide the security of the system; the reverse proxy module 12112 can be used to efficiently process the received instructions, direct the resource management plug-in specified in the instructions, and implement management operations on the resources of the host that do not belong to the cluster. And in this process, it can combine relevant routing algorithms and load balancing strategies to ensure the reasonable allocation and processing of requests; the function and version management module 12113 can be used to enable, disable, install, uninstall, etc. the resource management plug-in through inter-process communication (IPC), such as unix socket; the performance and health module 12114 can be used to obtain the health status information of the plug-in by periodically sending heartbeat signals to the resource management plug-in and executing function test scripts, etc. And once it is found that the plug-in responds abnormally or the function fails, it can try to repair the plug-in in time. If the problem cannot be solved, it can also notify the user for manual intervention through warning information.
[0065] As Figure 2 shown, the resource management plug-in 12200 installed on the host 12000 can be used to manage the system service 12300 on the host 12000, and the resource management plug-in 13200 installed on the host 13000 can be used to manage the system service 13300 on the host 13000. Optionally, in order to further improve the convenience of managing the resource management plug-in, the management process 12110 can also manage the resource management plug-in 12200 through the system service module 12400 on the host 12000, and the management process 13110 can manage the resource management plug-in 13200 through the system service module 13400 on the host 13000. Exemplarily, Figure 4 is the above Figure 2 hardware structure diagram of the computing device corresponding to any node (or the host to which the node belongs) in the cluster management system 10000 shown above. Taking this computing device 100 as a server as an example, from the form point of view, this server can be a rack server or an all-in-one cabinet server; from the performance point of view, it can be a general server, a GPU (graphics processing unit) server, etc. or an artificial intelligence (AI) server, and can provide services for users including but not limited to microservices, cloud computing, high-performance computing, etc.
[0066] Among them, the hardware part of the computing device includes a processor 101, a memory 102, and a bus 103. Figure 2 The management process 12110 shown can run on the processor 101. The memory 102 can be a memory, installed in the memory slot of the computing device 100, and communicate with the processor 101 through the bus 103, and is used to store the logical code necessary to implement the resource management method provided in the embodiments of the present application.
[0067] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0068] The embodiments of the present application provide a resource management method, which is applicable to the above Figure 4 shown computing device 100. A management process can run on the processor 100 to execute the resource management method, specifically as Figure 5 shown, Figure 5 is a flowchart of a resource management method provided in the embodiments of the present application, specifically including:
[0069] S110, the management process obtains a first instruction.
[0070] Among them, the first instruction is used to indicate to perform a first management operation on the target resources on the host where the target node belongs. A first target plugin runs on the host where the target node belongs, and the target resources are system services on the host where the target node belongs.
[0071] It can be understood that the first management operation performed on the target resources on the host where the target node belongs mentioned in the embodiments of the present application includes, but is not limited to, restarting the host where the target node belongs, updating the operating system of the host where the target node belongs, updating the graphics card driver of the host where the target node belongs, etc. In other words, operations that cannot be directly performed through existing multi-cluster management tools but require the user to log in to the operating system of the host can be developed into resource management plugins and installed and run on the host where the target node belongs. In the embodiments of the present application, the corresponding foregoing extended functions are implemented through the resource management plugins installed on the hosts where the cluster nodes belong, and the corresponding management operations are performed on the target resources. It should be noted that among the multiple resource management plugins installed on the host where the node belongs, there can also be plugins for managing the resources within the target node, as a supplement or enhancement to traditional management tools.
[0072] Exemplarily, as Figure 6 shown,Figure 6 The Figure 5 schematic diagram of obtaining an instruction involved in the illustrated embodiment. According to the requirements of its business operation, the user issues a first instruction (i.e., Figure 6 step S1 in Figure 3 ) to the node 12100 through the cluster management module 11000 in the multi-cluster management system 10000, instructing to execute the function of the resource management plug-in 12200 (restart the host 12000). Specifically, the proxy function management module 11100 can forward the instruction of the user received through the interactive interface as described above
[0073] to the node proxy module 11200, and the node proxy module 11200 forwards the first instruction to the management process 12110 on the node 12100, and then the reverse proxy module 12112 in the management process 12110 obtains the first instruction. Since the first instruction is not directly obtained by the resource management plug-in but by the reverse proxy module, the concentration and convergence of access requests are achieved, and the true structure and access address of the node and the host can be hidden from external users, improving the security of the system. Moreover, if a large number of instructions are received in a short period of time, the reverse proxy module can also perform functions such as load balancing, instruction caching, and security control, which helps to improve the reliability and stability of the system. Figure 7 as shown Figure 7 In order to further improve the security of the system and avoid chaos and anomalies in management, when the management process receives the first instruction, identity verification can also be performed, such as Figure 5 shown in Figure 6 The schematic diagram of another way to obtain an instruction involved in the illustrated embodiment is different from the foregoing Figure 7 . The node proxy module 11200 can first load the authentication data (which can be a digital identity certificate) corresponding to the node 12100. After verification, it forwards the first instruction and its own identity verification data to the node 12100 (i.e., Figure 7 step S1 in Figure 7 ). The service and authentication module 12111 in the node 12100 performs identity verification on the received authentication data (i.e.,
[0074] step S2 in
[0075] ). If the verification fails, the execution of the first instruction is rejected; after verification passes, the first instruction is forwarded to the reverse proxy module 12112 (i.e., Figure 7 step S3 in
[0074] ) to wait for subsequent steps to be executed.
[0075] In the embodiments of the present application, different resource management plugins can be used to implement different resource management functions and can run on nodes as independent processes. Specifically, there is at least one corresponding process for each enabled resource management plugin.
[0076] In the embodiments of the present application, multiple resource management plugins can be installed on the host machine to which the target node belongs to implement different resource management operations. To accurately find the first target plugin indicated by the first instruction among multiple plugins, in a possible implementation, when performing step S120, the management process can specifically determine the first target plugin corresponding to the plugin identifier according to the plugin identifier in the first instruction, and then the management process instructs the first target plugin to perform the first management operation on the target resource. The plugin identifier can be one of unique identifiers such as the name or number of the plugin. Further, if it is determined that the first target plugin has been installed on the host machine, the management process can further determine whether the first target plugin has been enabled. If the first target plugin is not currently enabled, the management process can first create a process corresponding to the first target plugin to enable the first target plugin, and then perform the first management operation on the target resource through the first target plugin.
[0077] Exemplarily, as Figure 8 shown, Figure 8 For Figure 6 the schematic diagram of a management operation involved in the shown embodiment, the reverse proxy module 12112 responds to the first instruction, and through the resource management plugin 12200 (the first target plugin), uses the system service 12300 to restart the host machine 12000 (i.e., Figure 8 S1 in
[0078] Further, exemplarily, as Figure 9 shown, Figure 9 For Figure 7 the schematic diagram of a management operation involved in the shown embodiment, the service and authentication module 12111 functions the same as described above and will not be elaborated. When the management process 12110 performs step S120, first, the function and version management module 12113 determines whether there is a corresponding plugin in the recorded installed resource management plugins according to the plugin identifier in the first instruction (such as the plugin number: 12200) (i.e., Figure 9In S1), if it exists, the function and version management module 12113 can further determine whether the plugin is enabled. If the plugin is not currently enabled, the management process can first create the process of the plugin. After the function and version management module 12113 determines that the plugin is enabled, it searches whether the service interfaces registered by the resource management plugin can match the content in the first instruction successfully. In the case of successful matching, it returns the service interface to the reverse proxy module 12112. Further, the reverse proxy module 12112 establishes a connection with the unix socket for the hypertext transfer protocol (HTTP) service exposed by the resource management plugin 12200. If the establishment fails, it returns an error message to indicate that the plugin is unavailable and reports the connection exception; if the establishment is successful, the reverse proxy module 12112 restarts the host 12000 through the resource management plugin 12200 using the system service on the host 12000 (i.e., Figure 9 In S2), where the aforementioned HTTP is a basic protocol for transmitting data on the world wide web and can be used for the interaction of requests and responses between the reverse proxy module 12112 and the resource management plugin 12200.
[0079] By executing the foregoing steps S110 - S120, the management process can, through the first target plugin in the resource management plugin, implement corresponding management operations on the system services on the host to which the target node belongs. With the development of the business and other factors, operations such as iterative upgrade, installation, and uninstallation of the resource management plugin are required. To achieve flexible and efficient management of the resource management plugin, the embodiments of the present application also propose corresponding possible implementation methods, which will be described and explained in detail below.
[0080] In order to be able to flexibly adapt to the development of the business and also manage the resource management plugin, including uninstalling, upgrading, enabling, or disabling the resource management plugin, etc.
[0081] For the above different management operations, the embodiments of the present application also respectively provide corresponding possible implementation methods:
[0082] 1. In a possible implementation method, the management process obtains an uninstall instruction, which is used to instruct to perform an uninstall operation on the second target plugin in the resource management plugin; the management process searches for the second target plugin from the host to which the target node belongs according to the plugin identifier and / or storage path included in the uninstall instruction, and the management process uninstalls the second target plugin.
[0083] To avoid problems such as data loss that may be caused by direct uninstallation, in one possible implementation, before uninstalling the second target plug-in, the management process first obtains the running status information of the second target plug-in. If the running status information indicates that the second target plug-in is in the enabled state, the management process can first end the process of the second target plug-in and then uninstall the second target plug-in; correspondingly, if the running status information indicates that the second target plug-in is in the disabled state, the management process directly uninstalls the second target plug-in.
[0084] 2. In one possible implementation, the management process obtains an upgrade instruction, which is used to indicate to perform an upgrade operation on a third target plug-in in the resource management plug-in; the management process obtains the upgraded version of the third target plug-in according to the acquisition path included in the upgrade instruction. Furthermore, the management process upgrades the third target plug-in according to the plug-in identifier and / or storage path included in the upgrade instruction.
[0085] Furthermore, similar to the aforementioned uninstallation operation, before upgrading the third target plug-in, the management process can also first obtain the running status information of the third target plug-in. If the third target plug-in is in the enabled state, the management process first ends the process of the second target plug-in and then upgrades the third target plug-in; correspondingly, if the running status information indicates that the second target plug-in is in the disabled state, the management process directly upgrades the third target plug-in.
[0086] 3. In one possible implementation, the management process obtains an enable instruction, which is used to indicate to perform an enable operation on a fourth target plug-in in the resource management plug-in; creates a process for the fourth target plug-in according to the plug-in identifier of the fourth target plug-in in the enable instruction; and returns a response message for the enable instruction, where the response message is used to indicate that the fourth target plug-in is successfully enabled.
[0087] Furthermore, similar to the aforementioned uninstallation and upgrade operations, before enabling the fourth target plug-in, the management process can also first obtain the running status information of the fourth target plug-in. If the fourth target plug-in is already in the enabled state, the management process can directly return the response message for the fourth instruction; correspondingly, if the running status information indicates that the fourth target plug-in is in the disabled state, the management process creates a process for the fourth target plug-in and then returns the response message for the second instruction.
[0088] 4. In one possible implementation, the management process obtains a disable instruction, which is used to indicate to perform a disable operation on a fifth target plug-in in the resource management plug-in; and ends the process of the fifth target plug-in according to the plug-in identifier of the fifth target plug-in in the disable instruction.
[0089] Through the above different management operations, the management process can flexibly and efficiently manage the plugins installed on the host machine to which the node belongs, quickly adapt to the development and changes of business and technology, and since different resource management plugins can run as independent processes simultaneously, when the management process performs management operations on one plugin, it will not interfere with other resource management plugins to continuously provide stable services, significantly improving the reliability of the system, ensuring the continuity of business, and avoiding losses that may be caused by business interruption.
[0090] It should be noted that the foregoing first to fifth target plugins may refer to any one of the resource management plugins on the host machine to which the target node belongs, either the same plugin or different plugins, and the present application does not limit this.
[0091] 5. In a possible implementation manner, the management process obtains an installation instruction for instructing to install a sixth target plugin on the host machine to which the target node belongs; if the installation instruction indicates a target path, install the sixth target plugin under the target path; if the installation instruction does not indicate a target path, install the sixth target plugin under the preset path of the host machine to which the target node belongs.
[0092] Exemplarily, as Figure 10 shown, Figure 10 for Figure 5 the schematic diagram of a plugin management involved in the illustrated embodiment, on the host machine 12000 to which the node 12100 belongs, there are currently installed a resource management plugin 12200 (which can be used to manage the system service 12400 to restart the host machine) and a resource management plugin 12230 (which can be used to manage the system service 12400 to backup cluster data). In the next update plan, the user decides to upgrade the resource management plugin 12230 to support the backup of key configuration information of the host machine, and install a new resource management plugin 12240 (which can be used to manage the system service 12500 to count the occupied space of mirror resources).
[0093] First, the user issues an instruction to upgrade the resource management plugin 12230 to the node 12100 through the cluster management module 11000 (i.e., Figure 10 step S1 in
[0094] Furthermore, the node agent module 11200 sends the upgrade instruction to the function and version management module 12113 in the node 12100. In response to the upgrade instruction, the function and version management module 12113 first obtains the running status information of the resource management plugin 12230, determines that the resource management plugin 12230 is in an unenabled state. Furthermore, the function and version management module 12113 obtains the upgrade version of the resource management plugin 12230 according to the acquisition path in the upgrade instruction. Then, the function and version management module 12113 upgrades it according to the identifier of the resource management plugin 12230 (i.e., Figure 10 step S3 in
[0095] Since process-level isolation can be achieved between different resource management plugins, when upgrading the resource management plugin 12230, the user can still use the resource management plugin 12220 to restart the host machine, which will not be elaborated here.
[0096] Then, the user issues an instruction to install the resource management plugin 12240 to the node 12100 through the cluster management module 11000 (i.e., Figure 10 step S4 in Figure 10 ). Furthermore, the proxy function management service module 11100 in the cluster management module 11000 sends an instruction to install the resource management plugin 12240 to the node agent module 11200. The node agent module 1120 sends the installation instruction of the resource management plugin 12240 to the function and version management module 12113 in the management process 12110. Furthermore, after obtaining the installation instruction, the function and version management module 12113 installs the resource management plugin 12240 to the target path indicated by the installation instruction (i.e.,
[0097] step S5 in
[0098] Optionally, Figure 10 the management process 12110 shown may further include a service and authentication module 12111 for performing identity authentication (i.e., Figure 10 step S2 in ), which has been described in the foregoing content and will not be elaborated here.
[0099] In addition, if Figure 10 the interval between step S1 and step S2 in [[]] is less than the set verification time interval, and the first verification has passed, the service and authentication module 12111 can directly forward the installation instruction to the function and version management module 12113 without verification to improve efficiency (alternatively, verification can also be performed again for the purpose of improving security, without limitation),
[0100] It should be noted that when the management process 12110 performs management operations on the plug-in, it can also simultaneously instruct other resource management plug-ins to perform corresponding resource management operations, so as to ensure the continuity of the service.
[0101] In the embodiment of the present application, the health status of the resource management plug-in installed on the host can also be monitored. In a possible implementation manner, the management process obtains a second instruction, and the second instruction is used to indicate obtaining the health status information of the seventh target plug-in; in response to the second instruction, the health status information of the seventh target plug-in is returned, and the health status information is used to indicate whether the seventh target plug-in can perform the corresponding resource management function.
[0102] Specifically, the management process can obtain the health status information of the resource management plug-in by passively receiving the health status information reported by the resource management plug-in, actively executing test scripts to detect the health status information of the resource management plug-in, and other methods.
[0103] In the embodiment of the present application, the above two methods of passive reception and active detection can also be combined. In a possible implementation manner, the health status information of the resource management plug-in of the management process is periodically reported by the resource management plug-in to the target node; the method further includes: detecting the health status information of the eighth target plug-in by executing a preset test script, where the eighth target plug-in is a plug-in that has not reported health status information to the target node for more than a preset interval, and the preset interval is longer than the reporting period. If the health status information of the eighth target plug-in indicates that the eighth target plug-in cannot perform the corresponding resource management function, the management process restarts the process of the eighth target plug-in, and after restarting, the health status information of the eighth target plug-in is detected again through the test script.
[0104] That is to say, the resource management plug-ins on the host to which the target node belongs can periodically (such as reporting once per minute) report their own health status information to the management process. When the management process does not receive the health status information reported by a certain resource management plug-in (the eighth target plug-in) for a long time (such as exceeding the aforementioned 1 minute), the management process actively detects the health status information of the eighth target plug-in through a preset test script to confirm whether the plug-in is healthy.
[0105] Further, if the health status information of the fifth target plug-in indicates that the fifth target plug-in cannot execute the corresponding resource management function, the management process may restart the process of the eighth target plug-in, and after the restart, detect the health status information of the eighth target plug-in again through the test script.
[0106] To avoid the management process continuously restarting the process of the plug-in in the case of serious anomalies of the plug-in, in the embodiments of the present application, an upper limit on the number of restarts (target number) may be set. Furthermore, after the number of times the management process restarts the process of the eighth target plug-in reaches the target number, if the health status information still indicates that the eighth target plug-in cannot execute the corresponding resource management function, the management process generates a warning message and outputs the warning message to remind the operation and maintenance personnel to repair the eighth target plug-in.
[0107] In addition to the above operations of restarting the process, the management process may also repair the resource management plug-in with anomalies through other more targeted means. However, since different resource management plug-ins are used to implement different resource management functions, the corresponding repair means often vary greatly (restarting the process is a repair means with relatively high versatility). Corresponding repair scripts may be developed according to the actual situation, which will not be elaborated here. And the management process may establish an association relationship between the plug-in and its corresponding repair script during the installation of the plug-in (it may also be any other moment, without limitation) to improve the possible repair efficiency in the future.
[0108] Exemplarily, as Figure 11 shown, Figure 11 For Figure 5 Another schematic diagram of plug-in management involved in the shown embodiment, the performance and health module 12114 in the management process 12110 responds to the second instruction issued by the cluster management module 11000 (i.e., Figure 11 step S1 in Figure 11 ), obtains the health status information of the resource management plug-in 12220. In addition, the performance and health module 12114 can also continuously monitor the health status information of the resource management plug-ins 12220 - 12240, as well as relevant performance indicators (i.e.,
[0109] step S2 in
[0110] 1) Naming method for the resource management plugin: Name it as <plugin name> - <plugin architecture> - <version number>. Among them, the version management method of the resource management plugin can refer to the commonly used semantic versioning specification in the industry. Additionally, compress the plugin (such as in zip format). The compressed directory can have the following structure: a. The " / bin" directory for storing binary files, b. The " / systemd" directory for storing system service configurations, c. The " / etc" directory for storing configuration files, and d. The "manifest" directory for storing the resource management plugin description file.
[0111] Among them, the content of the resource management plugin description file should at least include the extended function name and supported operations (enable, disable, etc.), and can also include version information, brief description, supported online configuration items, etc. The specific description method can be in json format.
[0112] 2) The service interfaces that the resource management plugin needs to expose, that is, the application programming interface (API), for example, the health status information query API, etc.
[0113] The above mainly introduces the solution of the embodiment of this application from the perspective of methods. It can be understood that in order for the computing device to implement the above functions, it includes at least one of the corresponding hardware structures and software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this article, the embodiments of this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of this application.
[0114] The embodiments of this application can divide the resource management device into functional units according to the above method examples. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the embodiments of this application is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0115] Exemplarily, Figure 12 is a schematic structural diagram of a resource management device provided by an embodiment of this application. Figure 8The resource management device 800 shown can be applied to a computing device, or the resource management device 800 can be a computing device. The resource management device 800 includes:
[0116] A reverse proxy module 810, configured to obtain a first instruction for instructing to perform a first management operation on a target resource on a host machine to which a node belongs; the target resource includes resources in the host machine that do not belong to the cluster; in response to the first instruction, instruct a first target plugin in the resource management plugin to perform the first management operation on the target resource, and different resource management plugins are used to implement different resource management functions.
[0117] For example, in combination with Figure 5 , the reverse proxy module 810 can be used to execute S110 and S120 as shown in Figure 5 .
[0118] In a possible implementation, the reverse proxy module 810 is further configured to determine a first target plugin corresponding to the plugin identifier according to the plugin identifier in the first instruction; perform the first management operation on the target resource through the first target plugin.
[0119] In a possible implementation, the resource management device 800 further includes a function and version management module, configured to obtain an uninstallation instruction for instructing to perform an uninstallation operation on a second target plugin in the resource management plugin; find the second target plugin from the host machine to which the target node belongs according to the plugin identifier and / or storage path included in the uninstallation instruction; uninstall the second target plugin.
[0120] In a possible implementation, the function and version management module is further configured to obtain the running state information of the second target plugin; if the running state information indicates that the second target plugin is in an enabled state, first end the process of the second target plugin, and then uninstall the second target plugin; if the running state information indicates that the second target plugin is in a disabled state, uninstall the second target plugin.
[0121] In a possible implementation, the function and version management module is further configured to obtain an upgrade instruction for instructing to perform an upgrade operation on a third target plugin in the resource management plugin; obtain the upgrade version according to the acquisition path included in the upgrade instruction; upgrade the third target plugin according to the plugin identifier and / or storage path included in the upgrade instruction.
[0122] In a possible implementation, the function and version management module is further configured to obtain an enabling instruction for indicating to perform an enabling operation on a fourth target plugin in the resource management plugin; create a process of the fourth target plugin according to the plugin identifier of the fourth target plugin in the enabling instruction; and return a response message for the enabling instruction, where the response message is used to indicate that the enabling of the fourth target plugin is successful.
[0123] In a possible implementation, the function and version management module is further configured to obtain a disabling instruction for indicating to perform a disabling operation on a fifth target plugin in the resource management plugin; and end the process of the fifth target plugin according to the plugin identifier of the fifth target plugin in the disabling instruction.
[0124] In a possible implementation, the function and version management module is further configured to obtain an installation instruction for indicating to install a sixth target plugin on the host machine where the target node is located; if the third instruction indicates a target path, install the sixth target plugin under the target path; and if the third instruction does not indicate a target path, install the sixth target plugin under a preset path of the host machine where the target node is located.
[0125] In a possible implementation, the resource management device 800 further includes a performance and health module configured to obtain a second instruction for indicating to obtain the health status information of a seventh target plugin; and in response to the second instruction, return the health status information of the seventh target plugin, where the health status information is used to indicate whether the seventh target plugin can perform the corresponding resource management function.
[0126] In a possible implementation, the health status information of the resource management plugin is periodically reported by the resource management plugin to the target node, and the performance and health module is further configured to detect the health status information of an eighth target plugin by executing a preset test script, where the eighth target plugin is one that has not reported the health status information to the target node for a period exceeding a preset interval, and the preset interval is longer than the reporting period.
[0127] In a possible implementation, the performance and health module is further configured to, if the health status information of the eighth target plugin indicates that the eighth target plugin cannot perform the corresponding resource management function, restart the process of the eighth target plugin, and after the restart, detect the health status information of the eighth target plugin again through the test script.
[0128] In a possible implementation, the performance and health module is further configured to generate a warning message if the number of times of restarting the process of the eighth target plug-in reaches a target number and the health status information indicates that the eighth target plug-in is unable to perform the corresponding resource management function; and output the warning message to remind the operation and maintenance personnel to repair the eighth target plug-in.
[0129] As a feasible example, the resource management device 800 provided in this application is implemented by software modules. For example, the software modules can be provided to users through a cloud service subscription model, and users can select different subscription levels according to their needs; for another example, the software modules can also provide enterprise-level customization services with professional domain customization, interface personalization, and extended functions according to the needs of users or enterprises.
[0130] In addition, the resource management device 800 provided in this application can also be provided to users as a value-added service, and this application does not limit this. When the resource management device 800 is implemented by software modules, the resource management device 800 can also be embedded in multi-cluster management tools, cloud service systems, software as a service (SaaS) systems, or function as a service (FaaS) systems.
[0131] In the above embodiments, they can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (such as a floppy disk, magnetic disk, magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state drive (SSD)), etc.
[0132] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices, and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
[0133] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical, or other form.
[0134] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] In addition, each functional unit in various embodiments of the present application may be integrated into a processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0136] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk, or optical disk and other various media that can store program codes.
[0137] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A resource management method, characterized in that, The method includes: Obtaining a first instruction for instructing to perform a first management operation on a target resource on the host where the target node belongs; a first target plugin is running on the host where the target node belongs, and the target resource is a system service on the host where the target node belongs; In response to the first instruction, performing the first management operation on the target resource through the first target plugin.
2. The method according to claim 1, wherein The first instruction includes an identifier of the first target plugin, and in response to the first instruction, performing the first management operation on the target resource through the first target plugin includes: Determining a first target plugin corresponding to the plugin identifier according to the plugin identifier in the first instruction; Performing the first management operation on the target resource through the first target plugin.
3. The method according to claim 1 or 2, characterized in that The method further includes: Obtaining an uninstallation instruction for instructing to perform an uninstallation operation on a second target plugin in the resource management plugin; Finding the second target plugin from the host where the target node belongs according to the plugin identifier and / or storage path included in the uninstallation instruction; Uninstalling the second target plugin.
4. The method according to claim 3, characterized in that, The uninstalling the second target plugin includes: Obtaining the running status information of the second target plugin; If the running status information indicates that the second target plugin is in an enabled state, first ending the process of the second target plugin and then uninstalling the second target plugin; If the running status information indicates that the second target plugin is in a disabled state, uninstalling the second target plugin.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtaining an upgrade instruction for instructing to perform an upgrade operation on a third target plugin in the resource management plugin; Obtaining an upgraded version of the third target plugin according to the acquisition path included in the upgrade instruction; Upgrading the third target plugin according to the plugin identifier and / or storage path included in the upgrade instruction.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtaining an enabling instruction for instructing to perform an enabling operation on a fourth target plugin in the resource management plugin; Creating a process of the fourth target plugin according to the plugin identifier of the fourth target plugin in the enabling instruction; Returning a response message for the enabling instruction, where the response message is used to indicate that the fourth target plugin is successfully enabled.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: Obtaining a disabling instruction for instructing to perform a disabling operation on a fifth target plugin in the resource management plugin; Ending the process of the fifth target plugin according to the plugin identifier of the fifth target plugin in the disabling instruction.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: Obtaining an installation instruction for instructing to install a sixth target plugin on the host where the target node belongs; If the installation instruction indicates a target path, installing the sixth target plugin under the target path; If the installation instruction does not indicate a target path, installing the sixth target plugin under a preset path of the host where the target node belongs.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: Obtain a second instruction, where the second instruction is used to indicate obtaining the health status information of a seventh target plug-in; In response to the second instruction, return the health status information of the seventh target plug-in, where the health status information is used to indicate whether the seventh target plug-in can execute the corresponding resource management function.
10. The method according to claim 9, wherein The health status information of the resource management plug-in is periodically reported by the resource management plug-in to the target node; The method further includes: Detect the health status information of an eighth target plug-in by executing a preset test script, where the eighth target plug-in is one that has not reported the health status information to the target node for a period exceeding a preset interval, and the preset interval is longer than the reporting period.
11. The method according to claim 10, wherein The method further includes: If the health status information of the eighth target plug-in indicates that the eighth target plug-in cannot execute the corresponding resource management function, restart the process of the eighth target plug-in, and after the restart, detect the health status information of the eighth target plug-in again through the test script.
12. The method according to claim 11, wherein The method further includes: If, after the number of times of restarting the process of the eighth target plug-in reaches a target number, the health status information indicates that the eighth target plug-in cannot execute the corresponding resource management function, generate a warning message; Output the warning message to remind the operation and maintenance personnel to repair the eighth target plug-in.
13. A computing device, characterized in that, The computing device includes a processor and a memory; The processor is coupled to the memory; The memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the resource management method according to any one of claims 1 to 12.