Hard disk fault processing method and device, equipment and storage medium
By automatically monitoring and handling the failure of NVMe hard disk in the software RAID, the problem of low monitoring and fault handling efficiency in the existing technology is solved, efficient monitoring and rapid fault response are achieved, and the degree of automation and reliability of the server system is improved.
Patent Information
- Application Number
- CN202411687282.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, the monitoring and fault handling efficiency of NVMe hard disks in software RAID is low and requires a lot of manual intervention.
By monitoring the operating status of NVMe hard disks in the software RAID, the faulty hard disks are automatically detected, and alarms and fault handling are performed to reduce manual intervention by administrators.
It realizes efficient monitoring and rapid failure response of NVMe hard disks, improves the automation level of server systems, reduces maintenance costs, and improves the stability and reliability of the system.
Smart Images

Figure CN119537152A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a hard disk failure processing method, device, equipment and storage medium. Background Art
[0002] With the rapid development of technologies such as big data, cloud computing, and cloud native, the security and reliability of data storage have become key issues. The Non-Volatile Memory Express (NVMe) host controller interface specification can make full use of the low latency and parallelism of the high-speed Peripheral Component Interconnect Express (PCIe) channel to improve the read and write performance of solid-state drives. Therefore, NVMe hard drives are increasingly widely used. Use NVMe hard drives to build software redundant arrays of independent hard drives (Redundant Arrays of Independent Disks (RAID) have the advantages of low cost and high flexibility and are widely used in the server field.
[0003] Currently, the operating status of NVMe hard disks in software RAID is usually checked regularly by manual methods. After determining that an NVMe hard disk in the software RAID is abnormal (such as failure or damage, etc.), the fault is manually handled, such as replacing the failed NVMe hard disk, reconfiguring RAID, etc. However, the above method of monitoring and troubleshooting NVMe hard disks in software RAID has the problem of low efficiency. Summary of the invention
[0004] The present application provides a hard disk fault handling method, device, equipment and storage medium to solve the problem of low efficiency in monitoring and fault handling of NVMe hard disks in software RAID through the current method.
[0005] In a first aspect, the present application provides a hard disk failure processing method, comprising:
[0006] Monitor the running status of NVMe hard disks in software RAID. Software RAID is obtained by building NVMe hard disks.
[0007] Based on the running status, determine whether there is a faulty NVMe hard disk in the software RAID;
[0008] If so, an alarm is issued for the faulty NVMe hard disk and the fault is handled.
[0009] In a second aspect, the present application provides a hard disk failure processing device, comprising:
[0010] The monitoring module is used to monitor the operating status of the NVMe hard disk in the software RAID. The software RAID is obtained by building the NVMe hard disk;
[0011] A determination module, used for determining whether there is a faulty NVMe hard disk in the software RAID based on a running status;
[0012] The processing module is used to, if yes, issue an alarm for the faulty NVMe hard disk and perform fault processing.
[0013] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0014] Memory stores computer-executable instructions;
[0015] The processor executes the computer-executable instructions stored in the memory to implement the above first aspect and / or various possible implementations of the first aspect.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed, the above first aspect and / or various possible implementation methods of the first aspect are implemented.
[0017] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above first aspect and / or various possible implementation methods of the first aspect when the computer program is executed.
[0018] The hard disk fault handling method, device, equipment and storage medium provided in the present application monitor the operating status of the NVMe hard disk in the software RAID. The software RAID is obtained by assembling the NVMe hard disk, realizing automatic monitoring of the NVMe hard disk, reducing the need for manual intervention by the administrator, and improving the automation level of the server system. Based on the operating status, determine whether there is a faulty NVMe hard disk in the software RAID; if so, an alarm is issued for the faulty NVMe hard disk, and fault handling is performed, which can timely discover and handle the fault of the NVMe hard disk, realize efficient monitoring of the NVMe hard disk and rapid fault response, effectively reduce the impact of the fault on the server data, ensure the security and integrity of the server data, and improve the stability and reliability of the server system; at the same time, it can reduce the need for manual intervention, reduce maintenance costs, and improve the operating efficiency of the server system, which meets the current server field The demand for high performance and high reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0021] Figure 2 A flowchart of a hard disk failure processing method provided in an embodiment of the present application Figure 1 ;
[0022] Figure 3 A flowchart of a hard disk failure processing method provided in an embodiment of the present application Figure 2 ;
[0023] Figure 4 A schematic diagram of the structure of a hard disk failure processing device provided in one embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0025] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0027] First, the terms involved in this application are explained:
[0028] A computer instruction set architecture (x86). x86 is a general term for the central processing unit (CPU) architecture and its instruction set that is based on Intel 8086 (a microprocessor) and backward compatible, and is mainly used in processor products.
[0029] Advanced RISC Machine (ARM) is a widely used, low-power, and low-cost Reduced Instruction Set Computer (RISC) processor architecture.
[0030] The Non-Volatile Memory Host Controller Interface Specification (NVMe) is built on the high-speed Peripheral Component Interconnect PCIe channel to connect the host and memory subsystem; NVMe enables the host to fully utilize the speed of Solid State Drive (SSD) and Storage Class Memory (SCM).
[0031] Redundant Array of Independent Drives (RAID) is a data storage technology that combines multiple physical hard drives to form a logical hard drive, thereby improving data reliability, performance, and storage capacity. Hardware RAID refers to the implementation of RAID functions through an independent RAID controller card with an independent hardware processor. Software RAID refers to the implementation of RAID functions through the operating system and the host's CPU, without the need for an independent RAID controller card.
[0032] A software RAID management tool (multiple devices admin, mdadm) is a standard software RAID management tool under the Linux operating system, which provides a series of functions to operate and manage software RAID.
[0033] A baseboard management controller (BMC) is a specialized microcontroller embedded on a server motherboard that is used to remotely monitor and manage the server. It can run independently of the server's operating system and continue to run when the server is shut down or the operating system crashes.
[0034] With the rapid development of technologies such as big data, cloud computing, and cloud native, the security and reliability of data storage have become key issues. Traditional independent hard disk redundant arrays rely on hardware RAID cards, which have the problems of high cost and poor flexibility. As the core equipment of information technology infrastructure, servers require a cost-effective and flexible hard disk redundancy solution. Among them, servers are, for example, servers with ARM and x86 architectures. NVMe is a transmission specification based on non-volatile memory, which aims to make full use of the low latency and parallelism of PCIe channels to improve the read and write performance of solid-state drives. For example, in the TDSQL (a distributed database solution) database scenario, it has been tested and verified that NVMe hard drives have higher input and output (IO) throughput and more reasonable resource investment (the capacity of a single shard is expanded from 1T to 2T, and the number of shards is reduced by half), which can support higher concurrency.
[0035] Compared with the monitoring of NVMe hard disk RAID through hardware RAID cards, software RAID built through NVMe hard disks has the advantages of low cost and high flexibility, and is widely used in the server field. NVMe hard disks may fail for various reasons, affecting data reliability and system stability. RAID cards usually have independent processors and caches, and provide the function of monitoring the health of hard disks. The software RAID built through NVMe hard disks is implemented through management software at the operating system level, and its data security depends on the implementation method of the operating system and hard disk management software.
[0036] Currently, the operating status of NVMe hard disks in software RAID is usually checked regularly by manual methods. After determining that an NVMe hard disk in the software RAID is abnormal (such as failure or damage, etc.), the fault is manually handled, such as replacing the failed NVMe hard disk, reconfiguring RAID, etc. However, the above method of monitoring and troubleshooting NVMe hard disks in software RAID has the problem of low efficiency.
[0037] In another related technology, RAID cards can be used to monitor NVMe hard disk RAID, but usually manual intervention (such as administrators) is still required to handle faults. In addition, RAID cards will have some built-in automatic fault handling mechanisms, such as hot spare disk synchronization, array data recovery, and capacitor protection, but these functions usually require RAID card hardware support, which is costly, and currently RAID cards support up to 4 NVMe hard disks, while software RAID does not have a limit on the number of NVMe hard disks and is more flexible to use.
[0038] In summary, the current related technologies still rely mainly on manual intervention in software RAID monitoring and fault handling, and the degree of automation is relatively low. The cost of building NVMe hard disk RAID through RAID cards is high and there is a limit on the number of NVMe hard disks. Therefore, a low-cost and highly automated solution for NVMe hard disk fault handling is urgently needed.
[0039] Based on the above problems, the present application provides a hard disk fault processing method, device, equipment and storage medium, which automatically monitors the operating status of the NVMe hard disk in the software RAID. The software RAID is obtained by assembling the NVMe hard disk, and timely discovers and handles the failure of the NVMe hard disk, thereby realizing efficient monitoring and rapid fault response of the NVMe hard disk, which can effectively reduce the impact of the failure on the server data, ensure the security and integrity of the server data, and improve the stability and reliability of the server system; at the same time, it can reduce the need for manual intervention, reduce maintenance costs, and improve the operating efficiency of the server system, which meets the current server field The demand for high performance and high reliability.
[0040] In the following, the application scenarios of the solutions provided in this application are first illustrated.
[0041] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, in this application scenario, the server cluster 11 includes multiple servers 111 and a memory 112, and the memory 112 is used to store data during the operation of the server 111. For the NVMe hard disk in the server 111, the server 111 automatically monitors the operating status of the NVMe hard disk in the software RAID according to the hard disk fault handling method provided in the embodiment of the present application. When the NVMe hard disk in the server 111 fails, an alarm is issued for the faulty NVMe hard disk (an alarm message is sent to the administrator, and the indicator light corresponding to the faulty NVMe hard disk is turned on), and the fault is handled. After receiving the alarm message for the faulty NVMe hard disk, the administrator conducts a fault review, powers off the faulty NVMe hard disk, and contacts the equipment department personnel to replace the faulty NVMe hard disk. After the equipment department personnel replaces the faulty NVMe hard disk with a new target NVMe hard disk, the server 111 re-establishes the software RAID based on the target NVMe hard disk, and turns off the indicator light corresponding to the faulty NVMe hard disk.
[0042] It should be noted that Figure 1 This is only a schematic diagram of an application scenario provided by the embodiment of the present application. Figure 1 does not limit the equipment included in Figure 1 The positional relationship between the devices is limited.
[0043] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0044] Figure 2 A flowchart of a hard disk failure processing method provided in an embodiment of the present application Figure 1 The method of the embodiment of the present application can be applied to an electronic device, which can be a server or a server cluster. Figure 2 As shown, the method of the embodiment of the present application includes:
[0045] S201. Monitor the running status of the NVMe hard disk in the software RAID, where the software RAID is obtained by building the NVMe hard disk.
[0046] It can be understood that software RAID can realize RAID function through the operating system and the server's CPU without the need for an independent RAID controller card. Software RAID is obtained by building NVMe hard drives, and has the characteristics of low cost and high flexibility.
[0047] Optionally, the software RAID is obtained in the following manner: determine that the NVMe hard disk meets the formation conditions, and the formation conditions at least include that the NVMe hard disk is not included in other software RAIDs, the NVMe hard disk is not mounted to the file system, the NVMe hard disk does not contain partition information, and the capacities of the NVMe hard disks are the same; based on the NVMe hard disk, form a software RAID through a preset script.
[0048] Exemplarily, taking the operating system of the electronic device executing the embodiment of the method as the Linux operating system, before executing the hard disk fault handling method provided in the embodiment of the present application, the management tools mdadm and NVMe-cli (a command line tool for managing and configuring storage devices of the NVMe protocol) of the software RAID can be installed, wherein mdadm is used for component software RAID; NVMe-cli is used to view the information of the NVMe hard disk. The specific installation execution instruction is, for example, yuminstall-y mdadm NVMe-cli. Before forming a software RAID through a preset script, first determine whether the NVMe hard disk meets the formation conditions through a preset script, such as checking that the NVMe hard disk is not included in other software RAIDs, the NVMe hard disk is not mounted to the file system, the NVMe hard disk does not contain partition information, and the capacity of multiple NVMe hard disks is the same through a preset script, then it can be determined that the NVMe hard disk meets the formation conditions. If it is determined that the NVMe hard disk does not meet the formation conditions, an error can be prompted, and then the problem can be manually solved and then the software RAID can be formed through a preset script. The preset script will turn off the RAID consistency check after forming the software RAID. For example, the following building execution instruction may be executed to build a software RAID through a preset script: bash create_raid10.sh -n 6; wherein the parameter description corresponding to the building execution instruction is shown in Table 1. Optionally, the software RAID may also be deleted through a preset script.
[0049] Table 1
[0050]
[0051] In this embodiment, the operating status of the NVMe hard disk in the software RAID can be monitored in real time.
[0052] S202. Determine whether there is a faulty NVMe hard disk in the software RAID based on the operating status.
[0053] In this step, it is possible to determine whether there is a faulty NVMe hard disk in the software RAID based on the operating state of the NVMe hard disk in the software RAID monitored. Exemplarily, it is possible to obtain monitoring information based on the operating state of the NVMe hard disk in the software RAID monitored, and the monitoring information includes, for example, system log, mdadm's timing script execution result and NVMe hard disk's self-monitoring analysis and reporting technology log (smartlog) etc. By automatically checking the monitoring information, it is possible to determine whether there is a faulty NVMe hard disk in the software RAID without manual participation. For how to determine whether there is a faulty NVMe hard disk in the software RAID based on the operating state, it can be referred to the subsequent embodiments, which will not be repeated here.
[0054] S203: If yes, an alarm is issued for the faulty NVMe hard disk, and the fault is handled.
[0055] In this step, after determining that there is a faulty NVMe hard disk in the software RAID, an alarm can be issued for the faulty NVMe hard disk and the fault can be handled. For example, for the faulty NVMe hard disk, the alarm information can be recorded and output to the administrator. When handling the fault of the faulty NVMe hard disk, for example, the spare NVMe hard disk can be switched to read and write data to ensure the normal operation of the server system.
[0056] The hard disk fault handling method provided in the embodiment of the present application monitors the operating status of the NVMe hard disk in the software RAID. The software RAID is obtained by assembling the NVMe hard disk, realizing automatic monitoring of the NVMe hard disk, reducing the need for manual intervention by the administrator, and improving the automation level of the server system. Based on the operating status, determine whether there is a faulty NVMe hard disk in the software RAID; if so, an alarm is issued for the faulty NVMe hard disk, and fault handling is performed, which can timely discover and handle the fault of the NVMe hard disk, realize efficient monitoring of the NVMe hard disk and rapid fault response, effectively reduce the impact of the fault on the server data, ensure the security and integrity of the server data, and improve the stability and reliability of the server system; at the same time, it can reduce the need for manual intervention, reduce maintenance costs, and improve the operating efficiency of the server system, meeting the current server field's demand for high performance and high reliability.
[0057] Figure 3 A flowchart of a hard disk failure processing method provided in an embodiment of the present application Figure 2 Based on the above embodiments, the present application further describes a method for handling hard disk failures. Figure 3 As shown, the method of the embodiment of the present application may include:
[0058] S301, monitoring the running status of the NVMe hard disk in the software RAID, where the software RAID is obtained by building the NVMe hard disk.
[0059] The detailed description of this step can be found in Figure 2 The relevant description of S201 in the illustrated embodiment will not be repeated here.
[0060] In the embodiment of the present application, Figure 2 The step S202 may further include the following four steps S302 to S305:
[0061] S302: Based on the running status, obtain monitoring information, wherein the monitoring information includes at least one of a system log, a timed script execution result of a software RAID management tool, and a self-monitoring analysis and reporting technology log (smartlog) of an NVMe hard disk.
[0062] Exemplarily, the management tool of software RAID is such as mdadm, and monitoring information can be obtained based on the running status of the NVMe hard disk in the monitored software RAID. Monitoring information, for example, includes system log, mdadm's timing script execution result, and NVMe hard disk's smartlog, etc. By automatically viewing the monitoring information, it can be determined whether there is a faulty NVMe hard disk in the software RAID without manual participation. Table 2 shows specific monitoring information (i.e., monitoring items), alarm-related information, disposal operations, and preset abnormal key fields (i.e., abnormal keyword samples) in the Linux operating system, wherein, after the kernel log is detected to be abnormal, other alarm items will be scanned immediately to locate the problem.
[0063] Table 2
[0064]
[0065]
[0066] S303: Determine whether the monitoring information contains a preset abnormal key field.
[0067] In this step, it is possible to automatically check whether the monitoring information contains a preset abnormal key field, wherein the preset abnormal key field is, for example, the abnormal keyword sample in Table 2, such as focusing on checking the abnormal keyword sample whose alarm level is "error".
[0068] If it is determined that the monitoring information does not contain the preset abnormal key field, continue to monitor the operating status of the NVMe hard disk in the software RAID, that is, execute step S301; if it is determined that the monitoring information contains the preset abnormal key field, execute step S304.
[0069] S304. Determine that there is a faulty NVMe hard disk in the software RAID, and continue to execute step S305.
[0070] In the embodiment of the present application, Figure 2 The step S203 may further include the following two steps S305 and S306:
[0071] S305. Based on the monitoring information, obtain alarm information, where the alarm information at least includes the drive letter, slot number and serial number (SN) number of the faulty NVMe hard drive.
[0072] Exemplarily, referring to Table 2, alarm information can be obtained based on monitoring information, such as focusing on obtaining alarm information with an alarm level of "error", and the alarm information can include, for example, the drive letter, slot number, and SN number of the faulty NVMe hard disk. Taking the Linux operating system as an example, the alarm information can be recorded in the alarm logs / var / NVMe_monitor / monitor_service.log and / var / log / abcsys.log. Accordingly, the alarm log contains the drive letter, slot number, and SN number of the faulty NVMe hard disk.
[0073] S306: Output alarm information to warn of the faulty NVMe hard disk and perform fault handling.
[0074] In this step, after the alarm information is obtained, the alarm information can be output to warn the faulty NVMe hard disk and perform fault handling. Among them, for example, the alarm information can be output to the administrator by email so that the administrator can receive the alarm information in time and perform corresponding processing. When the faulty NVMe hard disk is being handled, for example, the spare NVMe hard disk can be switched to read and write data to ensure the normal operation of the server system.
[0075] S307, in response to an instruction to light up the indicator light corresponding to the faulty NVMe hard disk, light up the indicator light according to the slot number.
[0076] In this step, after determining the faulty NVMe hard disk, the indicator light corresponding to the faulty NVMe hard disk can be turned on according to the slot number of the faulty NVMe hard disk. It can be understood that for some servers, for example, the indicator light corresponding to the faulty NVMe hard disk can be turned on through the ledmon software (a software used to monitor and manage the status of light-emitting diode indicator lights); while for some servers, it is necessary to use a script to turn on the indicator light corresponding to the faulty NVMe hard disk. Assuming that NVMe1n1 represents the drive letter of the faulty NVMe hard disk, the indicator light corresponding to the faulty NVMe hard disk can be turned on through the following light-up execution command: ledctl--locate on / dev / NVMe1n1.
[0077] Optionally, you can use the command mdadm-D / dev / md10 to check whether the NVMe hard disk failure is consistent with the record in the alarm information, that is, to conduct a fault review. It should be noted that if two NVMe hard disks in the same group fail at the same time, the software RAID group cannot be restored. After the disk replacement operation is performed, the software RAID group needs to be deleted and rebuilt. For example, the NVMe hard disks in the same group are adjacent NVMe hard disks: set-A and set-B. If the NVMe hard disk is actively re-inserted in a non-fault scenario, it is necessary to first perform the operation of removing the target hard disk (such as set-B) from the software RAID group. Specifically, you can first execute the command: mdadm--fail / dev / md10 / dev / NVMe1n1 to mark the faulty NVMe hard disk as faulty, and then execute the command: mdadm--remove / dev / md10 / dev / NVMe1n1 to remove the faulty NVMe hard disk from the software RAID group. Correspondingly, you can execute the command: mdadm-D / dev / md10 to view the execution result of the command to remove the faulty NVMe hard disk from the software RAID group, that is, the status of set-B is removed.
[0078] On the basis of the above embodiment, the slot number of the faulty NVMe hard disk is recorded in the alarm information, and the faulty NVMe hard disk can be accurately powered off according to the slot number; after the NVMe hard disk is powered off, the drive letter of the powered-off NVMe hard disk cannot be identified from the operating system, and the indicator light corresponding to the NVMe hard disk remains in its original state. The equipment department can be notified of the faulty NVMe hard disk, and the equipment department records the SN number of the faulty NVMe hard disk to be replaced, and replaces the NVMe hard disk on the server motherboard that is faulty or has an indicator light on with a new NVMe hard disk, and confirms that it is inserted into the same slot.
[0079] Optionally, after lighting the indicator light according to the slot number, the hard disk fault handling method provided in the embodiment of the present application may also include: determining the drive letter of the target NVMe hard disk based on a preset comparison method. Wherein, the target NVMe hard disk is a new NVMe hard disk after replacing the faulty NVMe hard disk, and the preset comparison method includes checking the drive letter against the SN number of the target NVMe hard disk, comparing the drive letter changes before and after replacing the target NVMe hard disk, and comparing at least one of the NVMe hard disks that are not included in the software RAID and can be recognized by the system.
[0080] Exemplarily, after replacing the faulty NVMe hard drive with a new NVMe hard drive (i.e., the target NVMe hard drive), the drive letter of the target NVMe hard drive (such as represented by NVMexny) can be determined based on a preset comparison method. Among them, the preset comparison method is, for example, to check the drive letter against the SN number of the target NVMe hard drive by executing the following instruction: NVMe list, or to compare the drive letter changes before and after replacing the target NVMe hard drive, or to compare the NVMe hard drives that are not included in the software RAID and can be recognized by the system. If the NVMe hard drive is passively disconnected or the server has been restarted after the NVMe hard drive is unplugged, the drive letter of the NVMe hard drive will usually change.
[0081] Optionally, after determining the drive letter of the target NVMe hard drive based on a preset comparison method, the hard drive failure handling method provided in the embodiment of the present application may also include: in response to an add execution instruction for the target NVMe hard drive, adding the target NVMe hard drive to the software RAID according to the drive letter of the target NVMe hard drive; in response to a turn off execution instruction for the indicator light, turning off the indicator light.
[0082] Exemplarily, after determining the drive letter (i.e., NVMexny) of the target NVMe hard disk based on a preset comparison method, the target NVMe hard disk can be added to the software RAID by executing the following instruction: mdadm-a / dev / md10 / dev / NVMexny, where the parameter description corresponding to the instruction is shown in Table 3.
[0083] Table 3
[0084] parameter illustrate -a,--add Adding NVMe drives to software RAID dev / md10 Name of the software RAID group / dev / NVMexny NVMe hard disk used to build software RAID
[0085] After adding the target NVMe hard disk to the software RAID, you can also view the addition result by executing the following command: mdadm-D / dev / md10. For example, the addition result is: spare rebuilding, which means that the software RAID is rebuilt based on the spare NVMe hard disk (that is, the newly added NVMexny). After confirming that the target NVMe hard disk has been added to the software RAID, you can turn off the indicator light corresponding to the target NVMe hard disk by executing the following shutdown command: ledctl--locate off / dev / NVMexny.
[0086] The hard disk fault handling method provided in the embodiment of the present application monitors the running status of the NVMe hard disk in the software RAID, and the software RAID is obtained by building the NVMe hard disk to realize automatic monitoring of the NVMe hard disk; based on the running status, the monitoring information is obtained to determine whether the monitoring information contains a preset abnormal key field, and if so, it is determined that there is a faulty NVMe hard disk in the software RAID; based on the monitoring information, the alarm information is obtained, and the alarm information is output to warn the faulty NVMe hard disk and perform fault handling; in response to the lighting execution instruction of the indicator light corresponding to the faulty NVMe hard disk, the indicator light is lit according to the slot number, so that the fault of the NVMe hard disk can be discovered and handled in time, and efficient monitoring and rapid fault response of the NVMe hard disk can be realized, and the impact of the fault on the server data can be effectively reduced, the security and integrity of the server data can be guaranteed, and the stability and reliability of the server system can be improved; at the same time, the alarm information can be recorded, and the indicator light corresponding to the faulty NVMe hard disk can be lit, which provides a basis for subsequent troubleshooting and processing, which can effectively improve the efficiency and accuracy of fault handling, and provide better protection for the operation of the server system and the security of server data.
[0087] It can be understood that the hard disk fault handling method provided in the embodiment of the present application is, for example, a monitoring program implemented by python (a programming language). Based on the mdadm provided by the Linux operating system, the python monitoring program is run to monitor the operating status of the NVMe hard disk in the software RAID in real time, automatically diagnose and process potential faults, and can effectively improve the stability and reliability of the NVMe hard disk operation in the server, realize automated monitoring and fault handling, and provide better protection for the operation of the server system and the security of server data;At the same time, a set of detailed alarm notifications and fault handling processes are provided, which can greatly improve the accuracy and efficiency of fault handling. Among them, the python monitoring program (such as mng_mon_service.sh) can be started or stopped manually. For example, the python monitoring program can be started by executing the following instructions: bashmng_mon_service.sh start;The python monitoring program can be stopped by executing the following instructions: bash mng_mon_service.sh stop.
[0088] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0089] Figure 4 This is a schematic diagram of the structure of a hard disk failure processing device provided by an embodiment of the present application. Figure 4 As shown, the hard disk failure processing device 400 of the embodiment of the present application includes: a monitoring module 401, a determination module 402 and a processing module 403. Among them:
[0090] The monitoring module 401 is used to monitor the operating status of the NVMe hard disk in the software RAID, where the software RAID is obtained by building the NVMe hard disk.
[0091] The determination module 402 is used to determine whether there is a faulty NVMe hard disk in the software RAID based on the operating status.
[0092] Processing module 403 is used to, if so, issue an alarm for the faulty NVMe hard disk and perform fault processing.
[0093] In some embodiments, the determination module 402 can be specifically used to: obtain monitoring information based on the running status, the monitoring information including at least one of the system log, the scheduled script execution results of the software RAID management tool, and the self-monitoring analysis and reporting technical log of the NVMe hard disk; determine whether the monitoring information contains a preset abnormal key field; if so, determine that there is a faulty NVMe hard disk in the software RAID; if not, determine that there is no faulty NVMe hard disk in the software RAID.
[0094] In some embodiments, when the processing module 403 is used to issue an alarm for a faulty NVMe hard drive, it can be specifically used to: obtain alarm information based on monitoring information, the alarm information including at least the drive letter, slot number and serial number SN number of the faulty NVMe hard drive; output alarm information to issue an alarm for the faulty NVMe hard drive.
[0095] Optionally, the processing module 403 can also be used to: after an alarm is issued for the faulty NVMe hard disk, in response to an execution instruction to light up the indicator light corresponding to the faulty NVMe hard disk, light up the indicator light according to the slot number.
[0096] Optionally, the processing module 403 can also be used to: after lighting up the indicator light according to the slot number, determine the drive letter of the target NVMe hard disk based on a preset comparison method, the target NVMe hard disk is a new NVMe hard disk after replacing the faulty NVMe hard disk, and the preset comparison method includes checking the drive letter against the SN number of the target NVMe hard disk, comparing the drive letter changes before and after replacing the target NVMe hard disk, and comparing at least one of the NVMe hard disks that are not included in the software RAID and can be recognized by the system.
[0097] Optionally, the processing module 403 can also be used to: after determining the drive letter of the target NVMe hard drive based on a preset comparison method, in response to an add execution instruction for the target NVMe hard drive, add the target NVMe hard drive to the software RAID according to the drive letter of the target NVMe hard drive; in response to a turn off execution instruction for the indicator light, turn off the indicator light.
[0098] Optionally, the hard disk fault handling device 400 may further include an acquisition module (not shown in the figure) for obtaining the software RAID in the following manner: determining that the NVMe hard disk meets the formation conditions, the formation conditions at least include that the NVMe hard disk is not included in other software RAIDs, the NVMe hard disk is not mounted to the file system, the NVMe hard disk does not contain partition information, and the capacity of the NVMe hard disks is the same; based on the NVMe hard disk, the software RAID is formed through a preset script.
[0099] The hard disk failure processing device of the embodiment of the present application can be used to execute the technical solution of any of the above-mentioned method embodiments. Its implementation principle and technical effect are similar and will not be repeated here.
[0100] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 500 may include: at least one processor 501 and a memory 502 .
[0101] The memory 502 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.
[0102] The memory 502 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0103] The processor 501 is used to execute the computer-executable instructions stored in the memory 502 to implement the hard disk fault processing method described in the aforementioned method embodiment. The processor 501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. Specifically, when implementing the hard disk fault processing method described in the aforementioned method embodiment, the electronic device may be, for example, an electronic device with processing functions such as a server.
[0104] Optionally, the electronic device 500 may further include a communication interface 503. In a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are implemented independently, the communication interface 503, the memory 502 and the processor 501 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0105] Optionally, in a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are integrated on a chip, the communication interface 503, the memory 502 and the processor 501 can communicate through an internal interface.
[0106] The electronic device is used to execute the hard disk failure processing method in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0107] The present application also provides a computer-readable storage medium, in which computer program instructions are stored. When a processor executes the computer program instructions, the above hard disk failure processing method is implemented.
[0108] The present application also provides a computer program product, including a computer program, which implements the above hard disk failure processing method when executed by a processor.
[0109] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0110] An exemplary readable storage medium is coupled to the processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in a dedicated integrated circuit. Of course, the processor and the readable storage medium can also exist as discrete components in the hard disk fault processing device.
[0111] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0114] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory (RAM), a disk or an optical disk.
[0115] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0116] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application, are not limited to the precise structures described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A hard disk failure processing method, characterized in that: include: Monitoring the running status of a non-volatile memory host controller interface specification NVMe hard disk in a software redundant array of independent hard disks RAID, where the software RAID is obtained by building the NVMe hard disk; Based on the running status, determining whether there is a faulty NVMe hard disk in the software RAID; If so, an alarm is issued for the faulty NVMe hard drive and the fault is handled.
2. The hard disk failure processing method according to claim 1, characterized in that: The determining, based on the running status, whether there is a faulty NVMe hard disk in the software RAID includes: Based on the running status, monitoring information is obtained, where the monitoring information includes at least one of a system log, a scheduled script execution result of the software RAID management tool, and a self-monitoring analysis and reporting technology log of the NVMe hard disk; Determining whether the monitoring information contains a preset abnormal key field; If yes, it is determined that there is a faulty NVMe hard disk in the software RAID; If not, it is determined that there is no faulty NVMe hard disk in the software RAID.
3. The hard disk failure processing method according to claim 2, characterized in that: The alarming for the faulty NVMe hard disk includes: Based on the monitoring information, obtain alarm information, where the alarm information includes at least the drive letter, slot number and serial number SN number of the faulty NVMe hard disk; Output the alarm information to warn the faulty NVMe hard disk.
4. The hard disk failure processing method according to claim 3, characterized in that: After the alarm is issued for the faulty NVMe hard disk, the method further includes: In response to an execution instruction to light up the indicator light corresponding to the faulty NVMe hard disk, the indicator light is lit according to the slot number.
5. The hard disk failure processing method according to claim 4, characterized in that: After lighting up the indicator light according to the slot number, the method further includes: The drive letter of the target NVMe hard drive is determined based on a preset comparison method. The target NVMe hard drive is a new NVMe hard drive that replaces the faulty NVMe hard drive. The preset comparison method includes checking the drive letter against the SN number of the target NVMe hard drive, comparing the drive letter changes before and after replacing the target NVMe hard drive, and comparing at least one of the NVMe hard drives that are not included in the software RAID and can be recognized by the system.
6. The hard disk failure processing method according to claim 5, characterized in that: After determining the drive letter of the target NVMe hard disk based on the preset comparison method, the method further includes: In response to an add execution instruction for the target NVMe hard disk, adding the target NVMe hard disk to the software RAID according to the drive letter of the target NVMe hard disk; In response to a turn-off execution instruction for the indicator light, the indicator light is turned off.
7. The hard disk failure processing method according to any one of claims 1 to 6, characterized in that: The software RAID is obtained in the following way: Determine that the NVMe hard disk meets the assembly conditions, and the assembly conditions at least include that the NVMe hard disk is not included in other software RAIDs, the NVMe hard disk is not mounted to the file system, the NVMe hard disk does not contain partition information, and the capacities of the NVMe hard disks are the same; Based on the NVMe hard disk, the software RAID is established through a preset script.
8. A hard disk fault processing device, characterized in that: include: A monitoring module, used to monitor the operating status of a non-volatile memory host controller interface specification NVMe hard disk in a software independent hard disk redundant array RAID, where the software RAID is obtained by building the NVMe hard disk; A determination module, used to determine whether there is a faulty NVMe hard disk in the software RAID based on the operating status; The processing module is used to, if so, issue an alarm for the faulty NVMe hard disk and perform fault processing.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the hard disk failure processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the hard disk failure processing method according to any one of claims 1 to 7 is implemented.