Task execution method and computing device
By setting up shared storage space between computing devices, the problem that hyperconverged management servers cannot manage resources is solved, ensuring that task requests are executed and the results are accurately transmitted back, improving cluster stability and monitoring capabilities of management servers.
Patent Information
- Application Number
- CN202410850850.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-08
AI Technical Summary
In the case where the hyperconverged management server cannot manage resources on the computing device, virtual machines, storage and network resources cannot be effectively monitored and managed, affecting cluster stability and may even lead to business interruption.
By setting a shared storage space between computing devices, the task request issued by the management server is written and retrieved from the shared storage space by the second computing device, ensuring that the task request can be executed, and the execution result is transmitted back through the shared storage space Manage servers to ensure the accuracy of task execution and cluster stability.
It effectively avoids the loss of computing equipment and management servers, improves the stability of the server cluster and the accuracy of task execution, and ensures the monitoring and management of computing device resources by the management server.
Smart Images

Figure CN118916127A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information technology, and in particular to a task execution method and a computing device. Background Art
[0002] With the rapid development of computing technology, storage technology and network technology, in order to improve the flexibility, utilization and scalability of physical resources, computing devices can be connected to each other through the network to form a large virtual machine resource pool, providing users with unified computing power and storage services. Among them, hyper-convergence technology can realize resource sharing and management in a software-defined manner. Hyper-convergence technology can use the local hard disk and software of computing devices to build a scalable distributed system, and build a computing engine on it to form a cluster including virtualized computing, virtualized storage, and virtual networks, and manage computing devices and virtualized resources in the cluster through a hyper-convergence platform.
[0003] In the case where the hyper-converged management server cannot manage the resources on the computing device, such as virtual machines, storage and network resources, etc., the services in the hyper-converged cluster will be affected and even cause business interruption.
[0004] In the related art, the only option is to wait for the hyper-converged management server to monitor, manage and operate the resources in the computing device again. Therefore, if the computing device cannot execute the task request, the stability of the cluster will be poor. Summary of the invention
[0005] The embodiment of the present application provides a task execution method and computing device, which can avoid the inability of computing devices to execute task requests, thereby improving the stability of the cluster. The technical solution is as follows:
[0006] In a first aspect, a task execution method is provided, which is applied to a first computing device, and the method includes: receiving a task request issued by a management server; the task request is a request to be executed by a second computing device; writing the task request to a shared storage space, so that the second computing device obtains and executes the task request from the shared storage space.
[0007] It can be understood that by having the first computing device receive the task request issued by the management server and write the task request into the shared storage space, the second computing device can obtain the task request from the shared storage space and respond to it, thereby solving the technical problem that the second computing device cannot execute the task when the communication with the management server is abnormal, and improving the stability of the server cluster.
[0008] In one possible implementation, if the second computing device obtains and responds to the task request from the shared storage space, and writes the execution result of the task request into the shared storage space, the execution result is obtained from the shared storage space; and the execution result is sent to the management server.
[0009] It is understandable that the first computing device can obtain the execution result in the shared storage space, and the execution result is written into the shared storage space by the second computing device after responding to the task request. The first computing device sends the execution result to the management server, and the management server can monitor the task execution of the second computing device to ensure the accuracy of task execution.
[0010] In a possible implementation method, identification information of the second computing device is obtained; and the task request is written into a shared storage space according to the identification information.
[0011] It can be understood that the first computing device writes the task request into the shared storage space according to the identification information of the second computing device, which can ensure the accuracy of the task request executed by the second computing device.
[0012] In one possible implementation, identification information of the second computing device sent by the management server is received.
[0013] It can be understood that when the second computing device is unable to execute the task request of the management server, the management server sends the identification information of the second computing device to the first computing device, and the first computing device can write the task request into the shared storage space based on the identification information of the second computing device, thereby improving the accuracy and efficiency of task execution.
[0014] In one possible implementation, before receiving the task request issued by the management server, the method also includes: obtaining the resource status of the second computing device from the shared storage space; the resource status is used to indicate the status of at least one resource among the computing resources, storage resources or network resources in the second computing device; and sending the resource status to the management server so that the management server issues the task request based on the resource status.
[0015] It is understandable that the first computing device can send the resource status of the second computing device to the management server. The management server can send a task request to the first computing device based on the resource status. The accuracy of the task request sent by the management server can be guaranteed, while ensuring that the second computing device can receive monitoring and management from the management server.
[0016] According to a second aspect, a task execution method is provided, which is applied to a second computing device, and the method includes: obtaining a task request from a shared storage space; the task request is a request sent by a management server to a first computing device and written by the first computing device to the shared storage space; and responding to the task request.
[0017] It can be understood that by having the second computing device obtain the task request from the shared storage space and respond to the task request, it is possible to execute the task request issued by the management server when there is an abnormal communication between the second computing device and the management server, thereby avoiding the loss of connection between the second computing device and the management server, thereby improving the stability of the server cluster.
[0018] In a possible implementation, the execution result is written into a shared storage space; the execution result is obtained by the first computing device from the shared storage space and sent to the management server.
[0019] It is understandable that after responding to the task request, the second computing device writes the execution result to the shared storage space. The first computing device can obtain the execution result from the shared storage space and send it to the management server. This ensures that the management server can monitor the execution of the task request of the second computing device and improve the accuracy of task execution.
[0020] In one possible implementation, a resource status is written to a shared storage space so that the first computing device obtains and sends the resource status from the shared storage space; the resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
[0021] It can be understood that the second computing device writes the resource status into the shared storage space, which enables the first computing device to obtain the resource status from the shared storage space and send it to the management server, thereby realizing the management server's monitoring of the second computing device, thereby improving the effectiveness of the task instructions issued by the management server.
[0022] In a possible implementation, if the task request includes a log collection request, respond to and execute the log collection request; write the log resource into a shared storage space, so that the first computing device obtains and sends the log from the shared storage space.
[0023] It is understandable that, due to the abnormal communication between the second computing device and the management server, the management server cannot send the log collection request to the second computing device, and the second computing device cannot execute the log collection request. The first computing device writes the received log collection request into the shared storage space. Therefore, the second computing device can obtain the log collection request from the shared storage space and respond. This solves the problem that the management server cannot collect logs of the second computing device.
[0024] In the third aspect, a task execution device is provided. The embodiment of the present application can divide the functional modules of the task execution device according to the method provided in the first aspect above. For example, each functional module can be divided according to each function, or two or more functions can be inherited in one processing module. Exemplarily, the embodiment of the present application can divide the task execution device into a receiving module and a processing module according to the function. The description of the possible technical solutions and beneficial effects executed by the above-mentioned divided functional modules can refer to the technical solutions provided by the above-mentioned first aspect or its corresponding possible implementation method, which will not be repeated here.
[0025] In a fourth aspect, a task execution device is provided. The embodiment of the present application can divide the functional modules of the task execution device according to the method provided in the second aspect. For example, each functional module can be divided according to each function, or two or more functions can be inherited in one processing module. Exemplarily, the embodiment of the present application can divide the task execution device into an acquisition module and a processing module according to the function. The description of the possible technical solutions and beneficial effects executed by each of the functional modules divided above can refer to the technical solutions provided by the second aspect or its corresponding possible implementation method, which will not be repeated here.
[0026] In a fifth aspect, an embodiment of the present application provides a computing device, the computing device comprising a first computing device and a second computing device; wherein the computing device comprises a processor and a memory, the memory stores computer instructions, and the computer instructions are loaded and executed by the processor so that the computing device implements the task execution method of the first aspect or the second aspect as described above.
[0027] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored. The computer program is loaded and executed by a processor to implement the task execution method of the first aspect or the second aspect mentioned above.
[0028] In a seventh aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the task execution method provided in various optional implementations of the first aspect or the second aspect.
[0029] For the specific description of the third to seventh aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first aspect, the second aspect and their various implementations; and for the beneficial effects of the third to seventh aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect, the second aspect and their various implementations, which will not be repeated here.
[0030] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a server cluster 100 provided in an embodiment of the present application is shown;
[0032] Figure 2 A schematic diagram of a task management system provided by an embodiment of the present application is shown;
[0033] Figure 3 A schematic diagram of the software architecture of a transfer system provided in an embodiment of the present application is shown;
[0034] Figure 4 A schematic diagram of the software architecture of a resource management system provided in an embodiment of the present application is shown;
[0035] Figure 5 A schematic diagram of a task execution method provided in an embodiment of the present application is shown;
[0036] Figure 6 A schematic diagram of a task execution method provided in an embodiment of the present application is shown;
[0037] Figure 7 A schematic diagram of an interaction of a task execution method provided by an embodiment of the present application is shown;
[0038] Figure 8 A schematic diagram of the structure of a task execution device 400 provided in an embodiment of the present application is shown;
[0039] Fig. 9 A structural schematic diagram of a task execution device 800 provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0041] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0042] First, the application scenarios of the embodiments of the present application are exemplarily introduced.
[0043] A hyper-converged cluster is a network architecture formed in a software-defined manner. Hyper-converged technology usually appears in the form of software on the hardware of computing devices, and can virtualize the computing resources and storage resources in computing devices to form computing resource pools and storage resource pools respectively. Users can manage the physical resources, virtual resources, and network resources in the hyper-converged cluster through the hyper-converged platform. In order to enhance the stability of the hyper-converged cluster, computing resources, storage resources, and management resources of the hyper-converged platform are usually distributed on different physical network cards.
[0044] Figure 1 FIG. 1 shows a schematic diagram of a server cluster 100 provided in an embodiment of the present application. Figure 1 As shown, the server cluster 100 includes a management server 110 , a shared storage space 130 , and at least two computing devices 120 .
[0045] The computing device 120 may be a server, specifically a blade server, a high-density server, a rack server, or a high-performance server, etc. Meanwhile, the computing devices 120 may communicate with each other through a service network port.
[0046] The management server 110 is a server that integrates cluster software technology and multiple management functions, and can be a blade server, a high-density server, a rack server, or a high-performance server, etc. It is used to manage the basic settings in the cluster, that is, to monitor and manage the computing devices 120 in the server cluster 100 and the resources in the computing devices 120. The management server 110 communicates with the computing devices 120 through the management network port in the computing devices 120.
[0047] The shared storage space 130 refers to a storage resource that can be accessed and used by multiple computing devices in a server cluster. The computing devices 120 communicate with the shared storage space 130 through their respective storage network ports. The shared storage space 130 can be provided by a storage device in the server cluster 100; it can also be composed of storage resources of multiple computing devices 120 or management servers 110 in the server cluster 100; or it can also be provided by a storage device outside the server cluster 100. This is not limited here.
[0048] An embodiment of the present application provides a task execution method, which is applied to a server cluster. The server cluster may include a first computing device, a second computing device, and a management server. The method includes the first computing device receiving a request task issued by the management server and writing the request task into a shared storage space. The task request is a request to be executed by the second computing device. The second computing device obtains the task request from the shared storage space, and the second computing device responds to the task request. The management server sends the task request to the first computing device that is normally connected to the management server. The first computing device writes the task request into the shared storage space. The second computing device can obtain the task request from the shared storage space and respond, thereby establishing a connection with the management server and executing the task request of the management server. This can avoid the second computing device from losing connection with the management server and improve the stability of the server cluster. The above-mentioned task execution method can be applied to Figure 1 In the scenario of the server cluster 100 shown.
[0049] Secondly, the system architecture of the embodiment of the present application is exemplarily introduced.
[0050] Figure 2 FIG. 1 shows a schematic diagram of a task management system provided by an embodiment of the present application. Figure 2 As shown, the task management system 200 includes a management server 110, a first computing device 210, a second computing device 220, and a shared storage space 130. The computing device 120 may include the first computing device 210 and the second computing device 220. The method shown in the embodiment of the present application may be applied to the task management system 200.
[0051] The management server 110 is a server that integrates centralized software technology and multiple management functions, and can be a blade server, a high-density server, a rack server, or a high-performance server, etc. The management server 110 is used to manage the basic settings in the server cluster, that is, to monitor and manage the resources in the first computing device 210 and the second computing device 220.
[0052] The shared storage space 130 refers to a storage resource that can be accessed and used by multiple computing devices in a server cluster. The shared storage space 130 can be provided by a storage device in the server cluster 100; it can also be composed of storage resources of multiple computing devices 120 or management servers 110 in the server cluster 100; or it can also be provided by a storage device outside the server cluster 100. This is not limited here. Specifically, in the task management system 200, the shared storage space 130 can be accessed and used by the first computing device 210 and the second computing device 220.
[0053] The first computing device 210 communicates normally with the management server 110; the first computing device 210 may be a server, specifically a blade server, a high-density server, a rack server, or a high-performance server. The first computing device 210 may receive a task request sent by the management server 110, and the task request is a request to be executed by the second computing device. The first computing device 210 writes the task request to the shared storage space, so that the second computing device 220 obtains and executes the task request from the shared storage space.
[0054] The second computing device 220 has abnormal communication with the management server 110. The second computing device 220 may be a server, specifically a blade server, a high-density server, a rack server, or a high-performance server. The second computing device 220 obtains a task request from the shared storage space 130 and responds to the task request, thereby establishing a connection with the management server 110.
[0055] Figure 3 A schematic diagram of the software architecture of a transfer system provided in an embodiment of the present application is shown. Figure 3 As shown, the software architecture of the transfer system can be applied to Figure 2 In the first computing device 210 shown, the software architecture of the transfer system includes a platform docking module, a storage docking module and a data buffer module.
[0056] The platform docking module is used to receive task requests sent by the management server. The storage docking module is used to write task requests into the shared storage space, and is also used to obtain execution results or resource status from the shared storage space. The data buffer module is used to store task requests, execution results or resource status as a data cache to improve the efficiency of task execution.
[0057] Figure 4 FIG. 1 shows a schematic diagram of the software architecture of a resource management system provided by an embodiment of the present application. Figure 4 As shown, the software architecture of the resource management system can be applied to Figure 2 In the second computing device 220 shown, the software architecture of the resource system includes a resource monitoring module, a task execution module, a network monitoring module and a storage docking module.
[0058] Among them, the resource monitoring module is used to monitor the resource status in the second computing device 220. The storage docking module is used to obtain the host resources in the second computing device and write the resource status or execution results into the shared storage space. The task execution module is used to read the task request in the shared storage space through the storage docking module and respond to the task request. The network monitoring module is used to monitor the network status of the management network port of the second computing device 220, and activate the resource management system when the communication between the second computing device 220 and the management server is abnormal; when the communication between the second computing device 220 and the management server is normal, the resource management system is put into a dormant state.
[0059] Above Figure 3 and Figure 4 The software architecture of the transit system and the software architecture of the resource management system shown can be applied simultaneously in the same computing device.
[0060] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate 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. Ordinary technicians in this field can 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 also applicable to similar technical problems.
[0061] For ease of understanding, the following is an exemplary introduction to the task execution method provided by the present application in conjunction with the accompanying drawings. The task execution method is applicable to Figure 2 A first computing device is shown in task management system 200 .
[0062] Figure 5 A schematic diagram of a task execution method provided in an embodiment of the present application is shown. The task execution method is applicable to Figure 2 The first computing device 210 in the task management system 200 is shown. The task execution method includes the following steps:
[0063] S101: A first computing device receives a task request sent by a management server.
[0064] In the embodiment of the present application, the communication between the first computing device and the management server is normal; and the communication between the second computing device and the management server is abnormal.
[0065] The task request is a request to be executed by the second computing device.
[0066] In one possible implementation, the first computing device obtains the resource status of the second computing device from the shared storage space, and sends the resource status to the management server, so that the management server issues a task request according to the resource status.
[0067] The resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
[0068] Exemplarily, since the communication between the first computing device and the management server is normal, and the communication between the second computing device and the management server is abnormal, the first computing device obtains the resource status of the second computing device from the shared storage space and sends the resource status to the management server. After receiving the resource status of the second computing device, the management server can issue a task request to be executed by the second computing device according to the information indicated by the resource status.
[0069] For example, the first computing device obtains the resource status of the second computing device from the shared storage space, indicating that the business resources in the second computing device are overloaded, and the first computing device sends the resource status of the second computing device to the management server. The user obtains the business resource overload in the second computing device through the management server, and the user can send a virtual machine shutdown request to the first computing device through the management server, so that the second computing device can execute the virtual machine shutdown request and shut down the virtual machine, solving the problem of business resource overload.
[0070] S102: The first computing device writes the task request into the shared storage space, so that the second computing device obtains and executes the task request from the shared storage space.
[0071] It should be noted that the network card where the network port of the first computing device or the second computing device communicates with the management server is different from the network card where the first computing device or the second computing device communicates with the shared storage space. Therefore, both the first computing device and the second computing device support access to and use of the shared storage space.
[0072] In one possible implementation, the first computing device obtains identification information of the second computing device; and the first computing device writes the task request into a shared storage space according to the identification information.
[0073] Exemplarily, the identification information of the second computing device may be an IP address or a host name of the second computing device, etc. The first computing device may write the task request into the shared storage space according to the identification information of the second computing device, so that the second computing device can obtain and respond to the task request from the shared storage space.
[0074] For example, if the task request sent by the management server and received by the first computing device includes the IP address or host name of the second computing device, the first computing device can directly write the task request into the shared storage space.
[0075] In one possible implementation, the first computing device receives identification information of the second computing device sent by the management server.
[0076] For example, if the management server detects abnormal communication between the second computing device and the management server, the management server sends the IP address or host name of the second computing device to the first computing device, and the first computing device can create a task record file using the IP address. Therefore, the first computing device can write the task request into the task record file.
[0077] S103, when the second computing device obtains and responds to the task request from the shared storage space and writes the execution result of the task request into the shared storage space, the first computing device obtains the execution result from the shared storage space.
[0078] That is, the first computing device can obtain the execution result in the shared storage space; the execution result is written into the shared storage space by the second computing device in response to the task request.
[0079] In a possible implementation manner, the first computing device obtains the execution progress from the shared storage space.
[0080] The execution progress is written into the shared storage space by the second computing device and is used to indicate the process of the second computing device responding to the task request.
[0081] Exemplarily, the execution progress is the process of the second computing device executing the task request. The second computing device can write the process of the task request execution to the shared storage space at a preset period. The first computing device can obtain the execution progress from the shared storage space at a preset period and send it to the management server, so that the user can obtain the process of the task request execution through the management server, ensuring the accuracy and reliability of the second computing device executing the task request.
[0082] S104: The first computing device sends the execution result to the management server.
[0083] In the embodiment of the present application, since the first computing device communicates normally with the management server, the first computing device can send the execution result to the management server.
[0084] That is, the management server can receive the execution result sent by the first computing device, determine the result of the second computing device responding to the task request, and implement the monitoring and management of the second computing device by the management server.
[0085] In one possible implementation, the first computing device sends the execution progress to the management server, so that the user can obtain the progress of the task request execution through the management server to adjust or modify the task request of the second computing device and improve the execution efficiency of the task request.
[0086] It can be seen from the above methods S103 and S104 that the first computing device obtains the execution progress and execution results of the task request of the second computing device from the shared storage space, and sends the execution progress and execution results to the management server, so that the management server establishes a connection with the second computing device, thereby ensuring that the management server can monitor the execution status of the task request of the second computing device and improve the accuracy of task execution.
[0087] Figure 6 A schematic diagram of a task execution method provided in an embodiment of the present application is shown. The task execution method is applicable to Figure 2 The second computing device 220 in the task management system 200 is shown. The task execution method includes the following steps:
[0088] S201: The second computing device obtains a task request from a shared storage space.
[0089] In the embodiment of the present application, the communication between the second computing device and the management server is abnormal; the communication between the first computing device and the management server is normal.
[0090] The task request is a request sent by the management server to the first computing device and written into the shared storage space by the first computing device.
[0091] It should be noted that the network card where the network port of the second computing device communicates with the management server is located is different from the network card where the second computing device communicates with the shared storage space. Therefore, when the second computing device communicates abnormally with the management server, the communication between the second computing device and the shared storage space will not be affected.
[0092] In a possible implementation, the second computing device obtains the task request from a task record file, wherein the task record file is created in a shared storage space by the first computing device according to the identification information.
[0093] Exemplarily, when the second computing device communicates abnormally with the management server, the first computing device can create a task record file in the shared storage space according to the identification information of the second computing device. The identification information can be the IP address or host name of the second computing device. If the first computing device writes the task request into the task record file according to the identification information of the second computing device, the second computing device can obtain the task request from the task record file.
[0094] In one possible implementation, the second computing device writes the resource status into the shared storage space, so that the first computing device obtains and sends the resource status from the shared storage space.
[0095] The resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
[0096] Exemplarily, if the second computing device monitors abnormal communication with the management server, the second computing device writes the resource status into the shared storage space, so that the management server can obtain the resource status of the second computing device through the first computing device, and the second computing device can communicate with the management server.
[0097] For example, when the second computing device communicates abnormally with the management server, the second computing device can create a resource record file in the shared storage space. The resource record file can be addressed by the identification information of the second computing device. The second computing device writes the resource status into the resource record file. At this time, the first computing device can address according to the identification information of the second computing device, obtain the resource status from the resource record file, and send the resource status to the management server. The management server can issue a task request that the second computing device needs to execute based on the resource status.
[0098] It can be seen from the above method that the second computing device writes the resource status into the shared storage space, which can ensure the management server's monitoring and management of the second computing device and avoid the second computing device from losing connection with the management server.
[0099] S202: The second computing device responds to the task request.
[0100] In an embodiment of the present application, the second computing device is capable of responding to the task request.
[0101] Exemplarily, the second computing device can obtain and respond to the task request.
[0102] That is, the second computing device can obtain the task request from the shared storage space or the task record file and respond to the task request. This solves the technical problem that the second computing device cannot execute the management server task when the communication between the second computing device and the management server is abnormal; it avoids the loss of connection between the second computing device and the management server, thereby improving the stability of the cluster.
[0103] S203: The second computing device writes the execution result into the shared storage space.
[0104] The execution result is obtained by the first computing device from the shared storage space and sent to the management server.
[0105] That is, after the second computing device responds to the task request, it writes the execution result into the shared storage space, so that the first computing device can obtain the execution result from the shared storage space and send it to the management server, thereby ensuring the accuracy of task execution.
[0106] In a possible implementation manner, the second computing device writes the execution progress into a shared storage space.
[0107] The execution progress is used to indicate the process of the second computing device responding to the task request.
[0108] Exemplarily, the execution progress is the process of the second computing device executing the task request, and the second computing device can write the process of the task request execution to the shared storage space at a preset period. The first computing device can obtain the execution progress from the shared storage space at a preset period.
[0109] That is to say, the second computing device writes the execution progress into the shared storage space, so that the first computing device obtains the execution progress from the shared storage space and sends it to the management server, so that the user can obtain the progress of the task request execution through the management server, and the management server can monitor the entire process of the second computing device responding to the task request in order to make adjustments, thereby improving the accuracy of task execution.
[0110] In one possible implementation, if the task request includes a log collection request, the second computing device responds to and executes the log collection request. The second computing device writes the log resource into the shared storage space, so that the first computing device obtains and sends the log from the shared storage space.
[0111] Exemplarily, the second computing device responds to the task request, and if the task request includes a log collection request, the execution result of the second computing device responding to the task request includes a log resource. The second computing device can write the log resource to the shared storage space, so that the first computing device obtains the log resource from the shared storage space and sends it to the management server.
[0112] It can be seen from the above method that the second computing device writes the execution result and execution progress into the shared storage space, so that the first computing device obtains the execution progress and execution result of the task request of the second computing device from the shared storage space, and sends the execution progress and execution result to the management server, so that the management server establishes a connection with the second computing device, which can ensure that the management server can monitor the execution status of the task request of the second computing device and improve the accuracy of task execution.
[0113] The above embodiments respectively describe the task execution method from the perspective of the first computing device and the second computing device as the execution subjects. The following will introduce it from the perspective of data interaction between the first computing device and the second computing device.
[0114] Figure 7 FIG. 1 shows an interactive diagram of a task execution method provided by an embodiment of the present application. Figure 7As shown, the management server 110 is a server that integrates cluster software technology and multiple management functions; the first computing device 210 communicates normally with the management server 110; the second computing device 220 communicates abnormally with the management server 110; and the shared storage space 130 can be accessed and used by the first computing device 210 and the second computing device 220.
[0115] It should be noted that the network card where the network port for the second computing device 220 to communicate with the management server 110 is located is different from the network card for the second computing device 220 to communicate with the shared storage space 130. Therefore, when the communication between the second computing device 220 and the management server 110 is abnormal, the communication between the second computing device 220 and the shared storage space 130 will not be affected.
[0116] If the second computing device detects abnormal communication with the management server, the second computing device creates a resource record file in the shared storage space (S301). The resource record file can be addressed by the identification information of the second computing device. The second computing device writes the resource status into the shared storage space (S302). Specifically, the second computing device can write the resource status into the resource record file. The resource status is used to indicate the status of at least one resource among the computing resources, storage resources or network resources in the second computing device.
[0117] If the management server detects abnormal communication with the second computing device, the management server sends the identification information of the second computing device to the first computing device (S303). For example, the identification information may be the IP address or host name of the second computing device. The first computing device determines whether the second computing device can perform the task based on the identification information (S304). For example, the first computing device determines that there is a resource record file in the shared storage space through the identification information, and then determines that the second computing device can perform the task. The first computing device can also obtain the resource status from the shared storage space, and the first computing device sends the resource status to the management server (S305). The management server determines the task request based on the resource status (S306). Among them, the task request is the request to be executed by the second computing device.
[0118] The management server sends the task request to the first computing device (S307). The first computing device writes the task request to the shared storage space according to the identification information of the second device (S308). Specifically, if the task request sent by the management server and received by the first computing device includes the identification information of the second computing device, the first computing device can directly write the task request to the shared storage space. Optionally, the first computing device can create a task record file using the identification information of the second computing device, and the first computing device writes the received task request to the task record file.
[0119] The second computing device obtains the task request from the shared storage space (S309), the second computing device responds to the task request (S310), and the second computing device writes the execution result to the shared storage space (S311). The first computing device obtains the execution result from the shared storage space (S312). At the same time, the first computing device sends the execution result to the management server (S313), and the management server completes the execution of the task request (S314). Optionally, the second computing device can also write the execution progress of the task request to the shared storage space, and the first computing device can obtain the execution progress from the shared storage space and send it to the management server, so that the management server can monitor the task execution process and improve the efficiency of task execution.
[0120] For example, the task request sent by the management server to the second computing device includes a log collection request. Since the second computing device communicates abnormally with the management server, while the first computing device communicates normally with the management server, the management server sends the log collection request to the first computing device. The first computing device writes the log collection request into the shared storage space. The second computing device can obtain the log collection task from the shared storage space, respond to and execute the log collection task. The second computing device writes the execution result of the log collection task into the shared storage space. The execution result includes the log resource of the second computing device. The first computing device sends the obtained log resource to the management server. At this time, the user can obtain the log resource of the second computing device through the management server. Optionally, the second computing device can also write the execution progress of the log collection request into the shared storage space, and the first computing device can obtain the execution progress from the shared storage space and send it to the management server. It can ensure that the management server monitors and manages the response to the log collection request of the second computing device.
[0121] The above method can enable the second computing device to complete the execution of the log collection request sent by the management server when the second computing device and the management server have abnormal communication, thereby avoiding the loss of connection between the second computing device and the management server.
[0122] In summary, an embodiment of the present application provides a task execution method for solving the technical problem that a task request cannot be executed on a second computing device. The method includes a first computing device receiving a task request issued by a management server. The first computing device writes the task request into a shared storage space. Among them, the task request is a request to be executed by the second computing device. The second computing device obtains the task request from the shared storage space and responds to the task request. In the above method, the second computing device can obtain the task request from the shared storage space and respond, thereby establishing a connection with the management server and executing the task request of the management server, which can avoid the problem that the second computing device loses connection with the management server and cannot execute the task; and further improves the stability of the server cluster.
[0123] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It can be understood that in order to realize the above functions, the task execution device includes at least one of the hardware structure and software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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 the present application.
[0124] The embodiment of the present application can divide the task execution device into functional units according to the above method example. For example, each functional unit can be divided according 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 software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0125] For example, Figure 8 FIG. 4 shows a schematic diagram of the structure of a task execution device 400 provided in an embodiment of the present application. Figure 8 As shown, the task execution device 400 can be applied to a first computing device, and the task execution device 400 includes:
[0126] The receiving module 401 is used to receive a task request sent by the management server; the task request is a request to be executed by the second computing device.
[0127] The processing module 402 is used to write the task request into the shared storage space, so that the second computing device obtains and executes the task request from the shared storage space.
[0128] In a possible implementation, the task execution device 400 further includes a sending module for sending the execution result to a management server.
[0129] In a possible implementation, the sending module is further used to send the resource status to the management server, so that the management server sends the task request according to the resource status.
[0130] In one possible implementation, the task execution apparatus 400 further includes an acquisition module for acquiring identification information of the second computing device.
[0131] In a possible implementation, the receiving module 401 is further configured to receive identification information of the second computing device sent by the management server.
[0132] In one possible implementation, the processing module 402 is further configured to obtain the execution result from the shared storage space if the second computing device obtains and responds to the task request from the shared storage space and writes the execution result of the task request into the shared storage space.
[0133] In a possible implementation, the processing module 402 is further configured to write the task request into the shared storage space according to the identification information.
[0134] In one possible implementation, the processing module 402 is further used to obtain the resource status of the second computing device from the shared storage space; the resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
[0135] It should be noted that the task execution device 400 can be applied to Figure 2 The task management system 200 is shown in a first computing device 210 .
[0136] For a detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any of the above-mentioned task execution devices 400 and the description of the beneficial effects can refer to the above Figure 5 The corresponding method embodiments will not be described in detail.
[0137] For example, Fig. 9 FIG. 8 is a schematic diagram showing the structure of a task execution device 800 provided in an embodiment of the present application. Fig. 9 As shown, the task execution device 800 can be applied to a second computing device, and the task execution device 800 includes:
[0138] The acquisition module 801 is used to acquire a task request from the shared storage space; the task request is a request sent by the management server to the first computing device and written into the shared storage space by the first computing device.
[0139] The processing module 802 is used to respond to the task request.
[0140] In a possible implementation, the processing module 802 is further configured to write the execution result into a shared storage space; the execution result is obtained by the first computing device from the shared storage space and sent to the management server.
[0141] In one possible implementation, the processing module 802 is also used to write the resource status into a shared storage space so that the first computing device obtains and sends the resource status from the shared storage space; the resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
[0142] In one possible implementation, the processing module 802 is further used to respond to and execute the log collection request if the task request includes a log collection request; write the log resource into the shared storage space so that the first computing device obtains and sends the log from the shared storage space.
[0143] It should be noted that the task execution device 800 can be applied to Figure 2 The task management system 200 is shown in the second computing device 220 .
[0144] For a detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. Figure 6 The corresponding method embodiments will not be described in detail.
[0145] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer instruction is stored, and the at least one computer instruction is loaded and executed by a processor to implement the task execution method of each embodiment above. For the explanation of the relevant content and the description of the beneficial effects in any of the above-mentioned computer-readable storage media, reference can be made to the above-mentioned corresponding embodiments, and no further description is given here.
[0146] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer performs any of the task execution methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or data center that includes one or more media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0147] It should be noted that the above-mentioned device for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to, the above-mentioned memory, computer-readable storage medium and communication chip, etc., all have non-volatile (non-transitory). Those skilled in the art should be aware that in the above one or more examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0148] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A task execution method, It is characterized in that The method is applied to a first computing device and includes: receiving a task request issued by a management server; the task request is a request to be executed by the second computing device; The task request is written into a shared storage space, so that the second computing device obtains and executes the task request from the shared storage space.
2. The method according to claim 1, It is characterized in that The method further comprises: When the second computing device obtains and responds to the task request from the shared storage space and writes the execution result of the task request into the shared storage space, obtaining the execution result from the shared storage space; The execution result is sent to the management server.
3. The method according to claim 1 or 2, It is characterized in that Writing the task request into a shared storage space comprises: Obtaining identification information of the second computing device; The task request is written into the shared storage space according to the identification information.
4. The method according to claim 3, It is characterized in that The obtaining identification information of the second computing device includes: The identification information of the second computing device sent by the management server is received.
5. The method according to any one of claims 1 to 4, It is characterized in that Before receiving the task request sent by the management server, the method further includes: Acquire a resource status of the second computing device from the shared storage space; the resource status is used to indicate a status of at least one resource among computing resources, storage resources or network resources in the second computing device; The resource status is sent to the management server, so that the management server issues the task request according to the resource status.
6. A task execution method, It is characterized in that The method is applied to a second computing device, comprising: Obtaining a task request from a shared storage space; the task request is a request sent by a management server to the first computing device and written by the first computing device into the shared storage space; Respond to the task request.
7. The method according to claim 6, It is characterized in that The method further comprises: The execution result is written into the shared storage space; the execution result is acquired by the first computing device from the shared storage space and sent to the management server.
8. The method according to claim 6 or 7, It is characterized in that The method further comprises: The resource status is written into the shared storage space so that the first computing device obtains and sends the resource status from the shared storage space; the resource status is used to indicate the status of at least one resource among computing resources, storage resources or network resources in the second computing device.
9. The method according to any one of claims 6 to 8, It is characterized in that The responding and executing the task request includes: If the task request includes a log collection request, respond to and execute the log collection request; The log resource is written into the shared storage space, so that the first computing device obtains and sends the log from the shared storage space.
10. A computing device, It is characterized in that The computing device includes: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instructions so that the server performs the task execution method as described in any one of claims 1-5 or 6-9.
