Mirror image disk fault member elimination method and device and medium
By obtaining and analyzing the input and output statistics, hard disk health information and link information of the mirrored disk, and judging and eliminating the faulty member disk in the RAID1 logical disk, the problem of the RAID card being unable to eliminate the faulty members caused by the file system read-only, realizing the problem of the file system being read-only Write blocking of RAID1 logical disks is handled in time.
Patent Information
- Application Number
- CN202411382789.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-06
AI Technical Summary
The RAID card cannot remove the problem that the RAID1 failed member causes the file system to enter a read-only state.
By obtaining the input and output statistics of the mirror disk, we judge whether it has entered a write blocking state, and judge whether the member disk is faulty based on the hard disk health information and link information, and eliminate the faulty member disk. The specific steps include: querying the number of written data sectors, key parameters of hard disk health and number of links based on preset cycles, comparing parameter thresholds and changes, determining the faulty disk and closing its physical port.
It effectively avoids I/O timeouts and other problems in RAID1 single-member disks, and promptly discovers and eliminates faulty member disks to prevent the file system from entering a read-only state.
Smart Images

Figure CN119088321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a method, device and medium for removing a failed member of a mirror disk. Background Art
[0002] In the storage field, in order to ensure the integrity and security of system disk data, the system is generally installed in a logical disk that uses two hard disks to form a mirror disk (RAID1). The advantage of RAID1 logical disk is that if one member disk fails, the other member disk can still operate normally.
[0003] Based on the way RAID1 writes data, RAID1 is considered to be written successfully only when data is written to two member disks at the same time and successfully. In addition, some disk arrays (Redundant Arrays of Independent Disks, RAID) cards can only remove the faulty hard disk when a member disk of RAID1 has a physical failure. Therefore, when a single member disk of RAID1 has input / output (I / O) timeout and other problems, the RAID card does not have the ability to diagnose the health status of the member disk of RAID1 and does not remove the faulty member disk. At this time, the system fails to return the written data to RAID1, causing the file system to enter a read-only state.
[0004] Therefore, technicians in this field now urgently need a method for removing failed members of mirror disks to solve the problem that the current RAID card cannot remove failed RAID1 members, causing the file system to enter a read-only state. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device and medium for removing a mirror disk fault member, so as to solve the problem that the current RAID card cannot remove the RAID1 fault member, causing the file system to enter a read-only state.
[0006] In order to solve the above technical problems, the present invention provides a method for removing a mirror disk fault member, comprising:
[0007] Get the input and output statistics of the mirror disk;
[0008] Determine whether the mirror disk enters a write blocking state according to the input and output statistical information;
[0009] If yes, determining whether each member disk is faulty according to the hard disk health information and / or hard disk link information of each member disk in the mirror disk;
[0010] Remove the faulty member disk.
[0011] In a possible embodiment, the input-output statistical information includes: the number of sectors where data is written;
[0012] Judging whether the mirror disk enters a write-blocking state according to the input-output statistical information includes:
[0013] Regularly querying the number of written data sectors of the mirror disk based on a preset first cycle;
[0014] If the number of written data sectors does not change within a preset number of consecutive first cycles, it is determined that the mirror disk enters a write blocking state.
[0015] In a possible embodiment, the hard disk health information includes: a plurality of hard disk health key parameters;
[0016] Then judging whether each member disk in the mirror disk is faulty according to the hard disk health information of each member disk includes:
[0017] Regularly querying the hard disk health key parameters of each member disk based on a preset second period;
[0018] Compare the hard disk health key parameters obtained in two cycles before and after the mirror disk enters the write blocking state with a preset parameter threshold or increment threshold; wherein each hard disk key parameter corresponds to the parameter threshold or the change threshold one by one;
[0019] If there is no member disk with any of the hard disk health key parameters exceeding the corresponding parameter threshold, or the change amount of any of the hard disk health key parameters exceeds the corresponding change amount threshold, this operation is recorded in the log;
[0020] If there is only one member disk whose any hard disk health key parameter exceeds the corresponding parameter threshold, or the change amount of any hard disk health key parameter exceeds the corresponding change amount threshold, then the member disk is determined to be faulty;
[0021] If any of the hard disk health key parameters of the two member disks exceeds the corresponding parameter threshold, or the change amount of any of the hard disk health key parameters exceeds the corresponding change amount threshold, this operation is recorded in the log.
[0022] In a possible embodiment, after regularly querying the hard disk health key parameters of each member disk based on the preset second cycle, the method further includes:
[0023] If the hard disk health key parameters are queried for both member disks, the step of comparing the hard disk health key parameters obtained in two cycles before and after the mirror disk enters the write blocking state with a preset parameter threshold or increment threshold is entered;
[0024] If there is only one member disk for which the key hard disk health parameter is not queried, it is determined that the member disk is faulty;
[0025] If the hard disk health key parameter is not found in the two member disks, this operation is recorded in the log.
[0026] In a possible embodiment, the hard disk link information includes: the number of times the link is connected and disconnected;
[0027] Then judging whether each member disk is faulty according to the hard disk link information of each member disk in the mirror disk includes:
[0028] Based on a preset third period, regularly query the link connection and disconnection times of each physical port of the expander corresponding to each member disk;
[0029] According to the link on / off times obtained in two cycles before and after the mirror disk enters the write blocking state, it is determined whether the two link on / off times corresponding to each physical port show an increasing trend;
[0030] If the link up / down times corresponding to any of the physical ports of the two member disks do not show an increasing trend, this operation is recorded in the log;
[0031] If there is only one member disk in which the link up / down times corresponding to any one of the physical ports show an increasing trend, it is determined that the member disk is faulty;
[0032] If the link up / down times corresponding to any of the physical ports of the two member disks show an increasing trend, this operation is recorded in the log.
[0033] In a possible embodiment, removing the faulty member disk includes:
[0034] The physical port corresponding to the failed member disk on the corresponding expander is closed.
[0035] In a possible embodiment, the method further includes:
[0036] Regularly querying the in-place status of the slots corresponding to each of the member disks according to a preset fourth period;
[0037] If the slot corresponding to the member disk is not in place, query whether the physical port corresponding to the member disk is closed;
[0038] If the corresponding physical port is closed, reopen the physical port.
[0039] In order to solve the above technical problems, the present invention also provides a device for removing a mirror disk fault member, comprising:
[0040] An information acquisition module is used to obtain input and output statistics of the mirror disk;
[0041] A blocking judgment module, used for judging whether the mirror disk enters a write blocking state according to the input and output statistical information, and if so, triggering a fault judgment module;
[0042] The fault judgment module is used to judge whether each member disk in the mirror disk has a fault according to the hard disk health information and / or hard disk link information of each member disk;
[0043] The fault elimination module is used to eliminate the faulty member disk.
[0044] In order to solve the above technical problems, the present invention also provides a device for removing a mirror disk fault member, comprising:
[0045] Memory for storing computer programs;
[0046] The processor is used to implement the steps of the method for removing a failed member of a mirror disk as described above when executing the computer program.
[0047] To solve the above technical problem, the present invention further provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for removing a failed member of a mirror disk as described above are implemented.
[0048] The present invention provides a method for removing faulty members of mirror disks. When a logical disk in RAID1 is blocked from writing data, the method determines whether each member disk is faulty based on the hard disk health information and / or hard disk link information of each member disk in RAID1, and removes the faulty member disk. The method provides a method for fault judgment when a single member disk in RAID1 is blocked from writing data, thereby solving the problem that the RAID card has no ability to diagnose the health status of RAID1 member disks, so that even when a single member disk in RAID1 has an I / O timeout or other problem, the problem can be discovered in time and the faulty member disk can be removed, effectively preventing the file system from entering a read-only state.
[0049] The mirror disk fault member removal device and non-volatile storage medium provided by the present invention correspond to the above method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] FIG1 is a flow chart of a method for removing a mirror disk fault member provided by an embodiment of the present invention;
[0052] FIG2 is a flow chart of another method for removing a failed member of a mirror disk provided by an embodiment of the present invention;
[0053] 3 is a structural diagram of a device for removing a failed member of a mirror disk provided by an embodiment of the present invention;
[0054] FIG. 4 is a structural diagram of another device for removing a failed member of a mirror disk provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] The core of the present invention is to provide a method, device and medium for removing a mirror disk fault member.
[0057] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0058] The logical disk of mirror disk (RAID1) consists of two hard disks, which has the advantage that if one member disk fails, the other member disk can still operate normally. Therefore, in the current storage field, in order to ensure the integrity and security of system disk data, system programs are generally installed in the logical disk of RAID1.
[0059] However, due to the writing mechanism of RAID1, when writing data to the logical disk of RAID1, only when the data is successfully written to two member disks at the same time, the writing to the logical disk of RAID1 is considered successful. Based on this, if any member disk fails, if it cannot be solved in time, it will cause the problem that even if the other member disk is still running normally, it will not be possible to write data to the logical disk of RAID1 normally. At present, the disk array (Redundant Arrays of Independent Disks, RAID) card does not have the ability to diagnose the health status of RAID1 member disks. Only some RAID cards can remove the faulty hard disk when a physical failure occurs in a member disk of RAID1. That is, if a member disk of RAID1 has a non-physical failure problem such as input and output (I / O) timeout, the member disk cannot be removed, which will cause the system installed in the logical disk of RAID1 to enter a read-only state.
[0060] In order to solve the above problems, the present invention provides a method for removing a mirror disk fault member, as shown in FIG1 , comprising:
[0061] S11: Obtain input and output statistics of the mirror disk.
[0062] S12: Determine whether the mirror disk has entered a write blocking state according to the input and output statistical information. If so, go to step S13.
[0063] S13: Determine whether each member disk in the mirror disk is faulty according to the hard disk health information and / or hard disk link information of each member disk.
[0064] S14: Remove the faulty member disk.
[0065] For step S11, it can be implemented by obtaining the command of disk I / O statistics based on the logical drive letter of the RAID1 logical disk. Exemplarily, in a system based on Linux (an operating system kernel), the acquisition of disk I / O statistics can be implemented by cat / proc / diskstats. Among them, / proc / diskstats is a file that stores storage device I / O statistics information in the Linux system. The I / O statistics include: read and write times, merging of read and write requests, number of read and write sectors, read and write time, and other statistical information.
[0066] For step S12, it is the step of determining whether the RAID1 logical disk has entered the write block state according to the disk I / O statistical information obtained in step S11. Specifically, the disk I / O statistical information includes various I / O statistical information about disk read and write. Since this step mainly focuses on the write state of the disk, we can focus on the part of the statistical information in the disk I / O statistical information that can reflect the write state of the disk, so as to determine whether the RAID1 logical disk has a write block.
[0067] Exemplarily, this embodiment provides a possible implementation scheme for the specific implementation of step S12. The above I / O statistical information specifically includes: the number of written data sectors.
[0068] Correspondingly, step S12 specifically includes:
[0069] S121: Regularly query the number of written data sectors of the mirror disk based on a preset first period.
[0070] S122: If the number of written data sectors does not change within a preset number of consecutive first periods, it is determined that the mirror disk has entered the write block state.
[0071] It should be noted that as described above, the disk I / O statistical information not only includes the number of written data sectors, but also includes other statistical information. However, in this embodiment, the determination of whether the RAID1 logical disk has entered the write block state can be achieved only through the number of written data sectors, so other I / O statistical information is not concerned.
[0072] Furthermore, the logic for this embodiment to determine whether the RAID1 logical disk has entered the write block state through the number of written data sectors is: regularly query the number of written data sectors of the RAID1 logical disk based on the first period; if the number of written data sectors has not changed within N consecutive periods, it means that the RAID1 logical disk has entered the write block state, otherwise it has not entered the write block state.
[0073] It should also be noted that this embodiment does not limit the specific duration of the first period and the specific value of the preset number, and appropriate values can be freely selected according to different actual needs. However, this embodiment provides a possible implementation scheme. The above first period can be set to 5s, and the preset number can be set to 10 periods. That is, when the RAID1 logical disk enters the write block state, it can be recognized within 1min (50s < t < 55s, t is the recognition required time).
[0074] Afterwards, step S13 and step S14 are to determine whether it is necessary to remove the faulty member disk according to the preset kicking condition when judging that the RAID1 logical disk enters the write blocking state. Among them, step S13 focuses on judging whether each member disk is faulty, and step S14 is used to perform a specific faulty member disk removal operation.
[0075] For step S13, the method provides two data bases for determining whether a member disk is faulty: hard disk health information and hard disk link information. Among them, in the relevant technology, the current common solution for determining the health status of a hard disk is implemented through Self-Monitoring Analysis and Report Technology (SMART, or SMART), so the hard disk health information here can specifically be the SMART information of the hard disk in actual applications. Similarly, in application scenarios such as servers and computers, the hardware link of the hard disk is mostly implemented based on the Serial Attached SCSI (SAS), so the hard disk link information here can specifically be the SAS link information of the hard disk in actual applications.
[0076] It should be noted that the hard disk health information and hard disk link information represent the health status and link status of the hard disk, that is, whether the member disk is faulty is determined by determining whether the hard disk itself is healthy and whether the hard disk connection is normal. In this method, any one of the hard disk health information and hard disk link information can be used to independently determine whether a member disk is faulty, or in another possible embodiment, in order to improve the accuracy of fault determination, the hard disk health information and hard disk link information can be combined to jointly determine whether a member disk is faulty, which is not limited in this embodiment.
[0077] To further illustrate the method for removing a mirror disk fault member provided by the present invention, the present invention also provides specific embodiments for hard disk health information and hard disk link information. First, for determining whether a member disk is faulty based on hard disk health information, this embodiment provides a possible implementation plan:
[0078] Hard disk health information includes: multiple key hard disk health parameters.
[0079] As shown in FIG. 2 , step S13 specifically includes:
[0080] S131-A: Query the key hard disk health parameters of each member disk based on the preset second period.
[0081] S132-A: Compare the key health parameters of each hard disk obtained in two cycles before and after the mirror disk enters the write blocking state with a preset parameter threshold or increment threshold.
[0082] Among them, each hard disk key parameter corresponds to a parameter threshold or a change threshold one by one.
[0083] S133-A: If there is no member disk with any hard disk health key parameter exceeding the corresponding parameter threshold, or the change amount of any hard disk health key parameter exceeds the corresponding change amount threshold, this operation is recorded in the log.
[0084] S134-A: If there is only one member disk with any hard disk health key parameter exceeding the corresponding parameter threshold, or the change amount of any hard disk health key parameter exceeds the corresponding change amount threshold, then the member disk is determined to be faulty.
[0085] S135-A: If any hard disk health key parameter of the two member disks exceeds the corresponding parameter threshold, or the change amount of any hard disk health key parameter exceeds the corresponding change amount threshold, this operation is recorded in the log.
[0086] It should be noted that the hard disk health information of this embodiment is as described in the above embodiment, and can be SMART information. SMART information includes multiple hard disk health key parameters. Depending on the hard disk type, the hard disk health key parameters contained in the corresponding SMART information may be different. Exemplarily, as shown in Tables 1 and 2 below, Table 1 shows the hard disk health key parameters corresponding to the solid-state disk (SSD) using the Serial Advanced Technology Attachment (SATA) interface specification and their corresponding parameter thresholds or change thresholds. Table 2 shows the hard disk health key parameters corresponding to the mechanical hard disk (Hard Disk Drive, HDD) using the SAS interface specification and their corresponding parameter thresholds or change thresholds.
[0087] Table 1 Comparison table of key hard disk health parameters and their thresholds for SATA SSDs
[0088] Hard disk health key parameters Threshold temperature The threshold is 70 degrees (parameter threshold) Backup sector usage The threshold is 0 (change threshold) Number of mapping errors between internal logical block addresses and real physical addresses (end to end error) The threshold is 0 (change threshold) An uncorrectable hardware error occurred (187 reported uncorrected) The threshold is 0 (change threshold) Total power-on time Brand A SSD: 26,000 hours (parameter threshold); Brand B SSD: 43,000 hours (parameter threshold); ...
[0089] Table 2 Comparison table of key hard disk health parameters and their thresholds for SAS HDDs
[0090] Hard disk health key parameters Threshold Read error rate <3 / 100 000 (change threshold) Write error rate <3 / 100 000 (change threshold) Device temperature <60 degrees (parameter threshold) Spin up time <25 seconds (change threshold) Number of remain alternate sectors <1000 (change threshold)
[0091] Based on the hard disk health key parameters and their corresponding parameter thresholds or change thresholds provided in Tables 1 and 2 above, it is possible to determine whether a member disk is faulty according to S131-A~S135-A. It should be noted that, in the kicking conditions provided in this embodiment, some hard disk health key parameters correspond to change thresholds, that is, whether a member disk is faulty is determined based on the change in parameters. Therefore, in this embodiment, it is necessary to obtain the parameter values of each hard disk health key parameter in two cycles (the second cycle) before and after entering the write congestion state to simultaneously meet the comparison requirements of the parameter threshold and the change threshold.
[0092] It should be noted that the reason why the parameter values of the two cycles before and after the RAID1 logical disk enters the write-blocked state are selected as the basis for judging the member disk in this embodiment is that the parameters of these two cycles can best reflect the hard disk health status of the RAID1 logical disk when it enters the write-blocked state, thereby improving the accuracy of fault judgment. It is easy to understand that the second cycle in this embodiment can be the same as or different from the first cycle described above. In a possible embodiment, the second cycle can be 1 minute.
[0093] It should also be noted that there are three possible branches in the kicking conditions provided in this embodiment:
[0094] First, the parameters of both member disks do not exceed the corresponding thresholds. This means that both member disks are normal (this is the normal condition determined by the kicking condition. If there are other conditions for raising the disk, it can be further judged, which does not mean that both member disks are definitely normal). Therefore, the member disks are not removed, and only this operation is recorded in the log for subsequent analysis.
[0095] Second, if only one member disk has parameters exceeding the corresponding threshold, it means that a single disk failure occurs in the RAID1 logical disk. This corresponds to the failure scenario in which the system enters a read-only state in the above description. Therefore, this embodiment determines that the member disk whose parameters exceed the corresponding threshold is a failed disk, so as to be removed in the subsequent step S14.
[0096] Third, the parameters of both member disks exceed the corresponding thresholds. This indicates that both member disks may be abnormal, that is, the RAID1 logical disk has a double disk failure. At this time, the RAID1 logical disk failure is serious and cannot be solved by simply removing the faulty disk. Therefore, this embodiment does not remove the faulty disk, but only records this operation in the log for subsequent problem investigation, analysis, and processing.
[0097] Based on the kicking conditions provided in this embodiment, it is possible to determine whether a member disk is faulty through hard disk health information. For a faulty member disk, a kicking operation is performed to prevent the system from entering a read-only state.
[0098] Further, based on the above embodiment, this embodiment also provides a further implementation scheme. After step S131-A and before step S132-A, as shown in FIG2 , the method further includes:
[0099] S136-A: If the key hard disk health parameters are queried for both member disks, proceed to step S132-A.
[0100] S137-A: If there is only one member disk for which the key hard disk health parameters are not queried, it is determined that the member disk is faulty.
[0101] S138-A: If the key hard disk health parameters are not found in the two member disks, this operation is recorded in the log.
[0102] Similar to the above embodiment, the kicking condition given in this embodiment is to determine whether a member disk is faulty based on whether the two member disks have queried the key parameters of hard disk health. And this embodiment also has three branches, corresponding to the three situations of normal RAID1 logical disk, single disk failure and double disk failure. Similar to the above, when the RAID1 logical disk is normal or a double disk failure occurs, the member disk is not removed, and only the log is recorded for subsequent analysis. When a single disk failure occurs in the RAID1 logical disk, the faulty disk is removed to prevent the system from entering a read-only state. It should be noted that this embodiment and the previous embodiment are both kicking conditions for determining whether a member disk is faulty through hard disk health information. The two embodiments can complement each other and be implemented together.
[0103] In addition, this embodiment also provides a possible implementation scheme for the kicking condition based on the hard disk link information:
[0104] The hard disk link information includes: link connection count.
[0105] Correspondingly, as shown in FIG2 , step S13 specifically includes:
[0106] S131-B: Based on the preset third period, the link connection and disconnection times of each physical port of the expander corresponding to each member disk are periodically queried.
[0107] S132-B: According to the link on / off times obtained in two cycles before and after the mirror disk enters the write blocking state, it is determined whether the two link on / off times corresponding to each physical port show an increasing trend.
[0108] S133-B: If the link up / down times corresponding to any physical port of the two member disks do not show an increasing trend, this operation is recorded in the log.
[0109] S134-B: If there is only one member disk where the number of link up / down times corresponding to any physical port shows an increasing trend, it is determined that the member disk is faulty.
[0110] S135-B: If the number of link up / down times corresponding to any physical port of both member disks shows an increasing trend, this operation is recorded in the log.
[0111] It should be noted that the hard disk link information in this embodiment is as described in the above embodiment, taking the common hard disk implemented by SAS as an example, so the hard disk link information here is also the SAS link information. However, it should be noted that the SAS link information that can be obtained in actual applications not only includes the link on-off times mentioned in this embodiment, but also includes information such as link errors. It is just that in this embodiment, the judgment of whether a member disk is faulty is mainly based on the link on-off times in the SAS link information. In other embodiments, the judgment of member disk failure can also be realized through other SAS link information, and this embodiment does not limit this.
[0112] In addition, in this embodiment, the judgment result also has three branches, corresponding to the three situations of normal RAID1 logical disk, single disk failure and double disk failure. Similarly to the above, when it is judged that both member disks are normal or abnormal, the member disks are not removed, and only logs are recorded for subsequent analysis. When only one member disk fails, it means that the single disk failure problem that this method is designed to solve has occurred. At this time, the faulty member disk needs to be removed to prevent the system from entering a read-only state.
[0113] It is particularly important to note that there is no conflict or dependency between the kicking conditions provided in this embodiment and the above embodiments. Several embodiments can be implemented separately or together to complement each other to improve the accuracy of determining whether a member disk is faulty, and this embodiment does not limit this.
[0114] On the other hand, based on the same idea as the above-mentioned operation log of recording the normal state of the RAID1 logical disk and the failure of two disks, this embodiment also provides another possible implementation scheme:
[0115] After obtaining the input and output statistics, hard disk health information, and hard disk link information, the above steps retain the sampling data of the most recent preset time length.
[0116] It should be noted that this embodiment does not limit the specific value of the preset time, but provides a possible implementation scheme, and the preset time is 1 hour. In this embodiment, various information required for the method to determine whether a single disk failure occurs in the RAID1 logical disk is retained for a preset time, so that when a problem occurs, relevant personnel can analyze the recent operating status of the RAID1 logical disk through the retained data, providing data support for relevant personnel.
[0117] On the other hand, with respect to how to propose a failed member disk after determining that a single disk failure occurs in the RAID 1 logical disk through the solution provided in the above embodiment, this embodiment also provides a possible implementation scheme, and the above step S14 is specifically as follows:
[0118] Shut down the physical port corresponding to the failed member disk on the corresponding expander.
[0119] It should be noted that most hard disks in the storage system are connected through expanders. The hard disk corresponds to a physical port connection (phy) of the expander. When the corresponding physical port is closed, it is equivalent to the hard disk being removed. Therefore, based on the above principle, when removing a faulty member disk, this embodiment adopts the method of closing the physical port corresponding to the faulty member disk connected to the expander.
[0120] Furthermore, before closing the physical port, this embodiment also provides a RAID1 hardware information query solution that needs to be performed in the preparation phase or the initialization phase, as shown in FIG2 , and the method further includes:
[0121] S21: Query the SAS address information (SAS Address) corresponding to the two member disks in RAID1.
[0122] S22: According to the SAS address information of the member disk, query the port number (phy id) of the physical port connected to the expander corresponding to the member disk.
[0123] S23: Query the SAS address information of the expander corresponding to the member disk.
[0124] Based on the hardware information query steps provided above, the hardware information required for the subsequent determination of whether a member disk is faulty and the removal of a faulty member disk can be obtained. The subsequent method can complete the acquisition of data such as hard disk health information and hard disk link information based on the hardware information obtained in this embodiment to ensure the smooth progress of the method. It should be noted that since the member disks of RAID1 are fixed in hardware connection and will not change unless in extremely special circumstances, the hardware information process provided above in this embodiment generally only needs to be run once and does not need to be repeated.
[0125] On the other hand, this embodiment also provides a solution for how to restore the tasks of the removed member disk if the failed disk is replaced after the failed member disk is removed. The method further includes:
[0126] S31: Query the in-place status of the corresponding slot of each member disk regularly according to the preset fourth cycle.
[0127] S32: If a slot corresponding to a member disk is not in place, check whether the physical port corresponding to the member disk is closed.
[0128] S33: If the corresponding physical port is closed, reopen the physical port.
[0129] Specifically, it can be seen from the above embodiments that the present invention provides a method for removing a faulty member disk by closing the physical port corresponding to the faulty member disk on the expander. Based on this, the relevant personnel can unplug the faulty disk from the expander and replace it with a new hard disk as the member disk. However, before the new hard disk is connected to the expander, the corresponding physical port needs to be opened first, otherwise the newly inserted hard disk cannot be recognized, that is, the task of the removed member disk cannot be restored. Based on this, this embodiment periodically queries the slot position status of each member disk based on the fourth cycle. If the slot is in place, it means that the member disk has not been unplugged (corresponding to the two possible scenarios that the normal member disk is still working, or the removed faulty disk has not been unplugged), and no operation is performed at this time. When the slot is not in place, this embodiment further determines whether the physical port of the member disk is also closed. If so, it means that this member disk is a faulty disk that is determined and removed by this method through the above steps, and has been unplugged, waiting to be replaced with a new hard disk to restore the task. Therefore, this embodiment restarts the physical port corresponding to the member disk so that the operation and maintenance personnel can promptly identify the hard disk after reinserting the hard disk as a member disk recovery task.
[0130] In the above embodiment, a method for removing a mirror disk fault member is described in detail, and the present invention also provides a corresponding embodiment of a mirror disk fault member removal device. It should be noted that the present invention describes the embodiment of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0131] From the perspective of functional modules, as shown in FIG3 , this embodiment provides a device for removing a mirror disk fault member, including:
[0132] The information acquisition module 11 is used to obtain the input and output statistics of the mirror disk;
[0133] A blocking judgment module 12 is used to judge whether the mirror disk enters a write blocking state according to the input and output statistical information, and if so, trigger a fault judgment module;
[0134] A fault judgment module 13 is used to judge whether each member disk in the mirror disk has a fault according to the hard disk health information and / or hard disk link information of each member disk;
[0135] The fault elimination module 14 is used to eliminate the faulty member disk.
[0136] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0137] FIG4 is a structural diagram of a mirror disk fault member removal device provided by another embodiment of the present invention. As shown in FIG4 , a mirror disk fault member removal device includes: a memory 20 for storing a computer program;
[0138] The processor 21 is used to implement the steps of a method for removing a failed member of a mirror disk in the above embodiment when executing a computer program.
[0139] The device for removing a mirror disk fault member provided in this embodiment may include but is not limited to a mobile terminal, a personal computer, a workstation, etc.
[0140] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0141] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of a method for removing a mirror disk fault member disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, a method for removing a mirror disk fault member, etc.
[0142] In some embodiments, a device for removing a mirror disk fault member may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0143] Those skilled in the art will appreciate that the structure shown in FIG. 4 does not constitute a limitation on a device for removing a failed member of a mirror disk, and may include more or fewer components than those shown in the figure.
[0144] An embodiment of the present invention provides a device for removing a mirror disk fault member, comprising a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a method for removing a mirror disk fault member.
[0145] In addition to the embodiments of the method and device for removing a mirror disk fault member provided in the above embodiments, the present invention also provides an embodiment corresponding to a computer program product. A computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the method for removing a mirror disk fault member as described in any of the above embodiments can be implemented.
[0146] Since the embodiments of the computer program product part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the computer program product part, which will not be repeated here.
[0147] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0148] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0149] The above is a detailed introduction to a method, device and medium for removing a failed member of a mirror disk provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and 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 method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0150] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for removing a mirror disk fault member, characterized in that: include: Get the input and output statistics of the mirror disk; Determine whether the mirror disk enters a write blocking state according to the input and output statistical information; If yes, determining whether each member disk is faulty according to the hard disk health information and / or hard disk link information of each member disk in the mirror disk; Remove the faulty member disk.
2. The method for removing a mirror disk fault member according to claim 1, characterized in that: The input and output statistical information includes: the number of sectors where data is written; Judging whether the mirror disk enters a write-blocking state according to the input-output statistical information includes: Regularly querying the number of written data sectors of the mirror disk based on a preset first cycle; If the number of written data sectors does not change within a preset number of consecutive first cycles, it is determined that the mirror disk enters a write blocking state.
3. The method for removing a mirror disk fault member according to claim 1, characterized in that: The hard disk health information includes: a plurality of hard disk health key parameters; Then judging whether each member disk in the mirror disk is faulty according to the hard disk health information of each member disk includes: Regularly querying the hard disk health key parameters of each member disk based on a preset second period; Compare the hard disk health key parameters obtained in two cycles before and after the mirror disk enters the write blocking state with a preset parameter threshold or increment threshold; wherein each hard disk key parameter corresponds to the parameter threshold or the change threshold one by one; If there is no member disk with any of the hard disk health key parameters exceeding the corresponding parameter threshold, or the change amount of any of the hard disk health key parameters exceeds the corresponding change amount threshold, this operation is recorded in the log; If there is only one member disk whose any hard disk health key parameter exceeds the corresponding parameter threshold, or the change amount of any hard disk health key parameter exceeds the corresponding change amount threshold, then the member disk is determined to be faulty; If any of the hard disk health key parameters of the two member disks exceeds the corresponding parameter threshold, or the change amount of any of the hard disk health key parameters exceeds the corresponding change amount threshold, this operation is recorded in the log.
4. The method for removing a mirror disk fault member according to claim 3, characterized in that: After querying the hard disk health key parameters of each member disk based on the preset second period, the method further includes: If the hard disk health key parameters are queried for both member disks, the step of comparing the hard disk health key parameters obtained in two cycles before and after the mirror disk enters the write blocking state with a preset parameter threshold or increment threshold is entered; If there is only one member disk for which the key hard disk health parameter is not queried, it is determined that the member disk is faulty; If the hard disk health key parameter is not found in the two member disks, this operation is recorded in the log.
5. The method for removing a mirror disk fault member according to claim 1, characterized in that: The hard disk link information includes: link on / off times; Then judging whether each member disk is faulty according to the hard disk link information of each member disk in the mirror disk includes: Based on a preset third period, regularly query the link connection and disconnection times of each physical port of the expander corresponding to each member disk; According to the link on / off times obtained in two cycles before and after the mirror disk enters the write blocking state, it is determined whether the two link on / off times corresponding to each physical port show an increasing trend; If the link up / down times corresponding to any of the physical ports of the two member disks do not show an increasing trend, this operation is recorded in the log; If there is only one member disk in which the link up / down times corresponding to any one of the physical ports show an increasing trend, it is determined that the member disk is faulty; If the link up / down times corresponding to any of the physical ports of the two member disks show an increasing trend, this operation is recorded in the log.
6. The method for removing a mirror disk fault member according to any one of claims 1 to 5, characterized in that: The member disk that removes the fault includes: The physical port corresponding to the failed member disk on the corresponding expander is closed.
7. The method for removing a mirror disk fault member according to claim 6, characterized in that: The method further comprises: Regularly querying the in-place status of the slots corresponding to each of the member disks according to a preset fourth period; If the slot corresponding to the member disk is not in place, query whether the physical port corresponding to the member disk is closed; If the corresponding physical port is closed, reopen the physical port.
8. A device for removing a mirror disk fault member, characterized in that: include: An information acquisition module is used to obtain input and output statistics of the mirror disk; A blocking judgment module, used for judging whether the mirror disk enters a write blocking state according to the input and output statistical information, and if so, triggering a fault judgment module; The fault judgment module is used to judge whether each member disk in the mirror disk has a fault according to the hard disk health information and / or hard disk link information of each member disk; The fault elimination module is used to eliminate the faulty member disk.
9. A device for removing a mirror disk fault member, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the method for removing a failed member of a mirror disk as described in any one of claims 1 to 7 when executing the computer program.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for removing a failed member of a mirror disk as claimed in any one of claims 1 to 7 are implemented.
