Abnormality processing method and related device
Abstract
This application discloses an exception handling method, which includes: when the service self-checking component detects that the target service is abnormal, judging whether there is an exception handling process for performing operations on the target service; when there is no exception handling process, obtaining the target service Status information: When the status information is inactive, the service self-check component performs exception handling operations on the target service. When the service self-checking component detects an abnormality, it is judged whether there is an abnormal handling process that performs an operation on the target service, and when there is no abnormal handling process, it is determined whether the status information is inactive, so as to avoid the existence of an abnormal handling process for operations at the same time , It also avoids that other processes have just finished processing the target service, and there is no need to perform exception handling on the target service again, avoiding mutual exclusion problems, and improving the experience of operating the file system. The application also discloses an abnormality processing device, a server, and a computer-readable storage medium, which have the above beneficial effects.

Term
14.9 yearsto projected expiry
Projected expiry 24 August 2041, counted from filing; an application has no term until it is granted.
- Priority and filed
- Published
- Today
- Projected expiry
10 claims: 2 independent, 8 dependent
- 1一种异常处理方法,其特征在于,包括: 当服务自检组件检测到目标服务出现异常时,判断是否存在对所述目标服务执行操作 的异常处理进程; 当不存在所述异常处理进程时,获取所述目标服务的状态信息; 当所述状态信息为未活动时,通过所述服务自检组件对所述目标服务执行异常处理操 作。
- 2根据权利要求1所述的异常处理方法,其特征在于,当服务自检组件检测到目标服务 出现异常时,判断是否存在对所述目标服务执行操作的异常处理进程,包括: 当所述服务自检组件检测到所述目标服务的端口未被占用时,判断是否存在管理软件 下发的所述异常处理进程。
- 3根据权利要求2所述的异常处理方法,其特征在于,当所述服务自检组件检测到所述 目标服务的端□未被占用时,判断是否存在管理软件下发的所述异常处理进程,包括: 当所述服务自检组件检测到所述目标服务的端口未被占用时,判断是否存在所述管理 软件下发的i sm_p i d进程。
- 4根据权利要求1所述的异常处理方法,其特征在于,还包括: 当存在所述异常处理进程时,对所述服务自检组件的异常处理操作执行终止操作,并 通过所述异常处理进程对所述目标服务进行异常处理。
- 5根据权利要求1所述的异常处理方法,其特征在于,当不存在所述异常处理进程时, 获取所述目标服务的状态信息,包括: 当不存在所述异常处理进程时,通过查询命令获取所述目标服务的状态信息。
- 6根据权利要求1所述的异常处理方法,其特征在于,当所述状态信息为未活动时,通 过所述服务自检组件对所述目标服务执行异常处理操作,包括: 当所述状态信息为未活动时,通过所述服务自检组件对所述目标服务执行重启操作。
- 7根据权利要求1所述的异常处理方法,其特征在于,还包括: 当所述状态信息为活动时,对所述服务自检组件的异常处理操作执行终止操作。
- 8一种异常处理装置,其特征在于,包括: 进程判断模块,用于当服务自检组件检测到目标服务出现异常时,判断是否存在对所 述目标服务执行操作的异常处理进程; 状态获取模块,用于当不存在所述异常处理进程时,获取所述目标服务的状态信息; 异常处理模块,用于当所述状态信息为未活动时,通过所述服务自检组件对所述目标 服务执行异常处理操作。
- 9一种服务器,其特征在于,包括: 存储器,用于存储计算机程序; 处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的异常处理方法 的步骤。
- 10一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机 程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的异常处理方法的 步骤。
Independent claims10
111 paragraphs, as filed
An exception handling method and related device technical field
[0001] This application relates to the field of computer technology, and in particular to an exception handling method, an exception handling device, a server, and a computer-readable storage medium.
Background technique
[0002] With the continuous development of data storage technology, more and more functions appear in the file system to cope with complex usage scenarios. Among them, smb (Server Messages Block, information service block) is a component of the ceph (distributed file system) file system, which provides smb services to share directories and files on the file system. Take the windows client as an example, you can mount the smb shared folder by mapping a network drive, and map it as a windows network disk.
[0003] In the related art, when the smb service is configured on the management software, the restart smb command will be issued. At this time, the restart is divided into two processes: stop and start. When the stop is executed, it happens to be monitored by ctdb (Cluster Trivial Database, cluster database) that smb is in the stop state, then ctdb will also execute restart smb to pull up the smb service. When ctdb executes stop, the management software has just executed to start smb, so the start of the control software will be cancelled, causing the control software to report an error and fail to restart the smb. Similarly, when ctdb is restarting the smb service, if the management software happens to also issue the restart smb command, then ctdb will also report an error to restart the smb. It can be seen that in the corresponding management software, the mutual exclusion problem of multiple resource accessing resources is prone to occur, which reduces the experience of operating the file system.
[0004] Therefore, how to avoid the mutual exclusion problem of accessing resources is a key issue for those skilled in the art.
Summary of the invention
[0005] The purpose of this application is to provide an exception handling method, an exception handling device, a server, and a computer-readable storage medium, so as to avoid mutual exclusion problems during exception handling and improve the experience of operating the file system.
[0006] In order to solve the above technical problems, this application provides an exception handling method, including:
[0007] When the service self-checking component detects that the target service is abnormal, it determines whether there is an exception handling process for performing operations on the target service;
[0008] When the exception handling process does not exist, obtain the status information of the target service;
[0009] When the status information is inactive, an exception handling operation is performed on the target service through the service self-checking component.
[0010] Optionally, when the service self-checking component detects that the target service is abnormal, determining whether there is an exception handling process for performing operations on the target service includes:
[0011] When the service self-checking component detects that the port of the target service is not occupied, it determines whether there is the exception handling process issued by the management software.
[0012] Optionally, when the service self-checking component detects that the port of the target service is not occupied, determining whether there is the exception handling process issued by the management software includes:
[0013] When the service self-checking component detects that the port of the target service is not occupied, it determines whether there is an ism_pid process issued by the management software.
[0014] Optionally, it further includes:
[0015] When the abnormal handling process exists, a termination operation is performed on the abnormal handling operation of the service self-check component, and the target service is abnormally handled through the abnormal handling process.
[0016] Optionally, when the exception handling process does not exist, obtaining the status information of the target service includes: [0017] When the exception handling process does not exist, obtaining information about the target service through a query command status information.
[0018] Optionally, when the status information is inactive, performing an exception handling operation on the target service through the service self-check component includes:
[0019] When the status information is inactive, a restart operation is performed on the target service through the service self-check component.
[0020] Optionally, it further includes:
[0021] When the status information is active, a termination operation is performed on the abnormal handling operation of the service self-check component.
[0022] This application also provides an exception handling device, including:
[0023] The process judgment module is used for judging whether there is an exception handling process for performing operations on the target service when the service self-checking component detects that the target service is abnormal;
[0024] The status acquisition module is used to acquire the status information of the target service when the exception handling process does not exist;
[0025] The exception handling module is configured to perform an exception handling operation on the target service through the service self-checking component when the status information is inactive.
[0026] This application also provides a server, including:
[0027] The memory is used to store a computer program;
[0028] The processor is configured to implement the steps of the above-mentioned exception handling method when the computer program is executed.
[0029] The present application also provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the abnormal handling method described above are implemented.
[0030] An exception handling method provided by the present application includes: when the service self-checking component detects that the target service is abnormal, determining whether there is an exception handling process for performing operations on the target service; when the abnormality does not exist During processing, the status information of the target service is acquired; when the status information is inactive, an exception handling operation is performed on the target service through the service self-checking component.
[0031] When an abnormality is detected by the service self-checking component, it is determined whether there is an abnormal handling process that performs an operation on the target service, that is, whether there is another process for abnormal handling at this time, and when there is no abnormal handling process Then determine whether the status information is inactive, and finally perform the exception handling operation, avoiding the exception handling process that operates at the same time, and also avoiding other processes that have just completed the target service processing, and there is no need to perform exception processing on the target service again. Avoid mutual exclusion problems and improve the experience of operating the file system.
[0032] This application also provides an exception handling device, a server, and a computer-readable storage medium, which have the above beneficial effects, and will not be repeated here.
Description of the drawings
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, in the following description The drawings are merely examples of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative efforts.
[0034] FIG. 1 is a flowchart of an exception handling method provided by an embodiment of the application;
[0035] FIG. 2 is a schematic structural diagram of an exception handling device provided by an embodiment of the application.
Detailed ways
[0036] The core of this application is to provide an exception handling method, an exception handling device, a server, and a computer-readable storage medium to avoid mutual exclusion problems during exception handling and improve the experience of operating the file system.
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the description The embodiments are a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
[0038] In the related technology, when the smb service is configured on the management software, the restart smb command is issued, and restart is divided into two processes, stop and start. When the stop is executed, it happens to be monitored by ctdb (Cluster Trivial Database, cluster database) that smb is in the stop state, then ctdb will also execute restart smb to pull up the smb service. When ctdb executes stop, the management software has just executed to start smb, and the start of the management software will be cancelled, causing the management software to report an error and fail to restart smb. Similarly, when ctdb is restarting the smb service, if the management software happens to also issue the restart smb command, then ctdb will also report an error to restart the smb. It can be seen that in the corresponding management software, the mutual exclusion problem of multiple resource accessing resources is prone to occur, which reduces the experience of operating the file system.
[0039] Therefore, an exception handling method provided by the present application is to determine whether there is an exception handling process for performing an operation on the target service when the service self-check component detects an exception, that is, to determine whether there are other processes at this time Perform exception handling, and determine whether the status information is inactive when there is no exception handling process, and finally perform exception handling operations, avoiding the exception handling process that is performing operations at the same time, and avoiding other processes from just processing the target service Finished, no need to perform exception handling on the target service again, ultimately avoiding mutual exclusion problems, and improving the experience of operating the file system.
[0040] The following uses an embodiment to describe an exception handling method provided in the present application.
[0041] Please refer to FIG. 1, which is a flowchart of an exception handling method provided by an embodiment of the application.
[0042] In this embodiment, the method may include:
[0043] S101: When the service self-checking component detects that the target service is abnormal, it is judged whether there is an abnormal processing process for performing an operation on the target service;
[0044] It can be seen that this step aims to determine whether there is an exception handling process for performing operations on the target service when the service self-checking component detects that the target service is abnormal. That is, the service self-checking component judges whether the target service is abnormal. When it is determined that the target service is abnormal, in order to avoid the problem of operation failure caused by operating the target service at the same time.
[0045] Further, this step may include:
[0046] When the service self-checking component detects that the terminal of the target service is not occupied, it determines whether there is an exception handling process issued by the management software.
[0047] It can be seen that this optional solution is mainly to further explain how to detect and judge. In this optional solution, when the service self-checking component detects that the target port is not occupied, it determines whether there is an exception handling process issued by the management software. Therefore, it can be thought of whether the port of the target service needs to be occupied in this optional solution. If it is, it means that the target service is normal and there is no abnormality. If not, it means that the target service is abnormal.
[0048] For example, in the smb service, when the smb service is started, ports 445 and 139 are in an occupied state. Therefore, ctdb executes a monitor event every 5s. In the monitor event, ctdb checktcpport 445 is called to detect whether the 445 port of smb is occupied. The specific principle is to try the bind445 terminal. If the binding succeeds, it means that the port is not occupied. Binding failed, indicating that the modified terminal is occupied by the smb service. If port 445 is occupied, it means that the smb service is normal. On the contrary, if port 445 is not occupied, it means that the smb service is abnormal.
[0049] Further, the above-mentioned optional solutions may also include:
[0050] When the service self-checking component detects that the terminal of the target service is not occupied, it determines whether there is an ism_pid process issued by the management software.
[0051] It can be seen that this optional solution mainly explains how to make a judgment. In this optional solution, when the service self-checking component detects that the port of the target service is not occupied, it determines whether there is an ism_pid process issued by the management software. Among them, the ism_pid process is the process for the management software to restart the smb.
[0052] S102, when there is no exception handling process, obtain status information of the target service;
[0053] On the basis of S101, this step aims to obtain status information of the target service when there is no abnormal handling process.
[0054] That is to say, when there is no exception handling process, it cannot be determined that there is no problem in performing exception handling on the target service at this time. It also needs to be judged by the status information of the target service. That is, it is judged whether the target service has just been abnormally handled. Therefore, in this step, the status information of the target service needs to be obtained.
[0055] Wherein, the status information is active or inactive. When the status information is active, it means that the target service has just been exception handling completed, and there is no need to perform exception handling again. When the status information is inactive, it means that the target service has not been executed the corresponding exception handling operation, and the exception handling operation needs to be executed.
[0056] Further, this step may include:
[0057] When there is no exception handling process, the status information of the target service is obtained through the query command.
[0058] It can be seen that this optional solution mainly explains how to obtain status information. In this optional solution, when there is no exception handling process, the status information of the target service is obtained through a query command. Wherein, the used query command can be any query command provided in the prior art, and there is no specific limitation here.
[0059] In addition, this embodiment may further include:
[0060] When there is an abnormal handling process, a termination operation is performed on the abnormal handling operation of the service self-checking component, and the target service is abnormally handled through the abnormal handling process.
[0061] It can be seen that this optional solution mainly explains how to handle when there is an exception handling process. In this optional solution, when the exception handling process exists, it means that there is a process for processing the target service at this time. The service self-check component does not need to perform exception handling, and the related operations of the service self-check component need to be stopped. deal with.
[0062] S103: When the status information is inactive, perform an exception handling operation on the target service through the service self-check component.
[0063] On the basis of S102, this step aims to perform an exception handling operation on the target service through the service self-check component when the status information is inactive.
[0064] Further, this step may include:
[0065] When the status information is inactive, the target service is restarted through the service self-check component.
[0066] It can be seen that this optional solution mainly explains how to handle exceptions. In this optional solution, when the status information is inactive, the target service is restarted through the service self-check component.
[0067] In addition to stopping daggers, this embodiment may also include:
[0068] When the status information is active, a termination operation is performed on the abnormal handling operation of the service self-check component.
[0069] It can be seen that this optional solution mainly explains how to handle when the status information is active. When the status information is active, it means that the exception handling process has just completed the exception handling of the target service, and if the exception handling needs to be performed again, then the related operation can be terminated.
[0070] In summary, this embodiment judges whether there is an abnormal handling process for performing operations on the target service when the service self-checking component detects an abnormality, that is, it determines whether there are other processes for abnormal handling at this time, and if there is no abnormality. In the exception handling process, determine whether the status information is inactive, and finally perform the exception handling operation, avoiding the exception handling process that operates at the same time, and avoiding other processes that have just completed the target service processing, and there is no need to perform the target service again Exception handling, ultimately avoiding mutual exclusion problems, and improving the experience of operating the file system.
[0071] The following uses a specific embodiment to further illustrate an exception handling method provided in the present application.
[0072] In this embodiment, the method may include:
[0073] Step 1. When the service self-checking component detects that the terminal of the target service is not occupied, it is judged whether there is an ism_p id process issued by the management software;
[0074] Step 2. When there is an exception handling process, perform a termination operation on the exception handling operation of the service self-check component, and perform exception handling on the target service through the exception handling process;
[0075] Step 3. When there is no exception handling process, obtain the status information of the target service through a query command;
[0076] Step 4, when the status information is inactive, perform a restart operation on the target service through the service self-check component; [0077] Step 5, when the status information is active, terminate the abnormal handling operation of the service self-check component operate.
[0078] Based on the above steps, in a specific application scenario, the above operation steps can be applied to the technical field of ctdb processing smb exceptions.
[0079] The steps of this embodiment may include:
[0080] Step 1. When ctdb detects that the smb service is abnormal, check whether the process ism_pid that manages the soft start or restart smb exists;
[0081] Step 2. If the ism_pid process exists, the ctdb restart smb process automatically exits, and the soft restart smb process continues;
[0082] Step 3. If the ism_pid process does not exist, it means that either the ism_pid process has just exited, or no process has started the smb. At this time, you need to view the smb status through the systemctl status smb command to further judge;
[0083] Step 4. If the smb status is active, it means that the ism_pid process has just exited, the smb has been started, and ctdb does not need to restart the smb, so ctdb is responsible for restarting the child process of the smb to exit;
[0084] Step 5. If the smb status is inactive, it means that the ism_pid process has not appeared, and the smb status is still abnormal, and ctdb is required to restart the smb service.
[0085] It can be seen that in this embodiment, when the service self-checking component detects an abnormality, it determines whether there is an abnormal processing process that performs an operation on the target service, that is, whether there is another process for abnormal processing at this time, and when there is no abnormality When processing the process, determine whether the status information is inactive, and finally perform the exception handling operation, avoiding the exception handling process of the operation at the same time, and avoiding other processes that have just completed the target service processing, and there is no need to perform exceptions to the target service again. Processing, ultimately avoiding mutual exclusion problems, and improving the experience of operating the file system.
[0086] The exception handling device provided by the embodiment of the present application will be introduced below. The exception handling device described below and the exception handling method described above can be referred to each other.
[0087] Please refer to FIG. 2, which is a schematic structural diagram of an exception handling apparatus provided by an embodiment of the application.
[0088] In this embodiment, the device may include:
[0089] The process judgment module 100 is used for judging whether there is an exception handling process for performing operations on the target service when the service self-checking component detects that the target service is abnormal;
[0090] The status acquisition module 200 is used to acquire status information of the target service when there is no abnormal handling process;
[0091] The exception handling module 300 is configured to perform exception handling operations on the target service through the service self-checking component when the status information is inactive.
[0092] Optionally, the process judgment module 100 is specifically configured to judge whether there is an exception handling process issued by the management software when the service self-checking component detects that the port of the target service is not occupied.
[0093] Optionally, the process determining module 100 is specifically configured to determine whether there is an ism_pid process issued by the management software when the service self-checking component detects that the port of the target service is not occupied.
[0094] Optionally, the device may further include:
[0095] The first termination module is used to perform a termination operation on the exception handling operation of the service self-check component when there is an exception handling process, and perform exception handling on the target service through the exception handling process.
[0096] Optionally, the status obtaining module 200 is specifically configured to obtain status information of the target service through a query command when there is no abnormal handling process.
[0097] Optionally, the exception processing module 300 is specifically configured to perform a restart operation on the target service through the service self-check component when the status information is inactive.
[0098] Optionally, the device may further include:
[0099] The second termination module is used to perform a termination operation on the abnormal handling operation of the service self-check component when the status information is active.
[0100] An embodiment of the present application also provides a server, including:
[0101] The memory is used to store a computer program;
[0102] The processor is configured to implement the steps of the exception handling method described in the above embodiment when the computer program is executed.
[0103] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the exception handling method as described in the above embodiment is implemented A step of.
[0104] The various embodiments in the description are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0105] Professionals may further realize that the units and algorithm steps of the examples described in the embodiments disclosed in this article can be implemented by electronic hardware, computer software or a combination of the two, in order to clearly illustrate the hardware and For the interchangeability of software, the composition and steps of each example have been generally described in accordance with the function in the above description. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
[0106] The steps of the method or algorithm described in the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory
Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the technical field.
[0107] The above describes in detail an exception handling method, an exception handling device, a server, and a computer-readable storage medium provided by this application. Specific examples are used in this article to illustrate the principles and implementation of the application. The description of the above examples is only used to help understand the method and core ideas of the application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
1 sheet
Sheet 1
Every citation, both ways
| Document | Relation | Office | Category | Cited during | Relevant claims |
|---|---|---|---|---|---|
| CN101299677A | Cites | China | X | Search report | 1-10 |
| CN102571965A | Cites | China | A | Search report | 1-5 |
| CN111309627A | Cites | China | A | Search report | 1-10 |
| US6467050B1 | Cites | United States of America | A | Search report | 1-5 |
| US8627331B1 | Cites | United States of America | A | Search report | 1-10 |
| 佚名: "如何解决资源并发访问问题", HTTPS://ZHUANLAN.ZHIHU.COM/P/285686315, 11 November 2020 (2020-11-11) | Non-patent | – | – | Search report | – |
2 members in 1 office
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 202110975231 | China | A | |
| CN20211975231 | – | – | – |
Members2
| Document | Office | Kind | |
|---|---|---|---|
| CN113687929AThis record | China | A | |
| CN113687929B | China | B |
3 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Patent grantGrantedGR01 | GR01 | |
| Entry into force of request for substantive examinationSE01 | SE01 | |
| PublicationPB01 | PB01 |
Numbers
- Publication
- 113687929
- Publication, DOCDB
- 113687929
- Publication, EPODOC
- CN113687929
- Application
- 109752314
- Application, DOCDB
- 202110975231
- Application, EPODOC
- CN202110975231
Titles2
- Chinese
- 一种异常处理方法及相关装置
- English
- Exception processing method and related device
Classification
- CPC, 2
- G06F9/48
- G06F9/52
- IPC, 2
- G06F9 48
- G06F9 52