Hard disk fault detection method, device and equipment and readable storage medium

By filtering out target hard drives with high failure probability from the server cluster and obtaining their SMART logs for detection, the problem of low hard drive failure detection efficiency is solved, and more efficient fault identification and handling are achieved.

CN113077835BActive Publication Date: 2025-12-19CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110380576.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-09
Publication Date
2025-12-19
Estimated Expiration
2041-04-09

AI Technical Summary

Technical Problem

In server clusters, hard drive failure detection is inefficient, especially when the hard drives are 100% busy most of the time. Existing technologies rely on obtaining the SMART logs of each hard drive for fault handling, which is not timely.

Method used

By obtaining the operation logs of each server node in the server cluster, the frequency of occurrence of preset indicator items is determined, the target hard drive is filtered out, and only the SMART logs of the target hard drive are obtained for fault detection. The target hard drive is the hard drive with a failure probability greater than a preset threshold.

Benefits of technology

This improves the efficiency of hard drive fault detection, avoids the problem of untimely fault handling caused by the long time required to obtain SMART logs, and achieves faster fault identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113077835B_ABST
    Figure CN113077835B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a hard disk fault detection method, device and equipment, and a readable storage medium. The method comprises the following steps: obtaining the running logs of each server node in a server cluster; determining the occurrence number of each preset index item of each server node according to the running logs; and taking the hard disk of the server node as a target hard disk if the occurrence number of at least one preset index item of the server node is not less than the preset number threshold corresponding to the preset index item. The preset number threshold corresponding to each preset index item is configured according to the probability of the hard disk of the server node failing. Further, the method only needs to obtain the SMART log of the target hard disk and detect whether the target hard disk fails according to the SMART log of the target hard disk. The method does not need to obtain the SMART log of the hard disk of each server node, avoids the delay in failure handling due to the long time required for obtaining the SMART log, and improves the efficiency of hard disk fault detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the computer technical field, and particularly relates to a hard disk fault detection method, device and equipment and a readable storage medium. BACKGROUND

[0002] With the rapid development of computer technology, in order to meet the increasing demand for computing and storing massive data, the existing technology increases the capacity of a single hard disk on one hand, and increases the number of hard disks mounted by a server cluster on the other hand by using server cluster technology. In the actual operation and maintenance of a server cluster, the index items in the S.M.A.R.T (Self-Monitoring Analysis and Reporting Technology) log (referred to as SMART log) of each hard disk are usually captured to make fault judgment and processing. However, for a server cluster with an increasingly large scale, the access amount of a business system to a hard disk increases geometrically, and the hard disk is in a 100% busy state most of the time, so the fault rate of the hard disk is greatly increased. Obviously, the method of collecting the SMART log of each fault hard disk for fault processing is time-consuming, which often leads to untimely fault processing, and the efficiency of hard disk fault detection needs to be improved. SUMMARY

[0003] The present application provides a hard disk fault detection method, device, equipment and readable storage medium, aiming to improve the efficiency of obtaining fault information of a hard disk, as follows:

[0004] A hard disk fault detection method, comprising:

[0005] obtaining the running log of each server node in a server cluster;

[0006] determining the occurrence number of a preset index item of each server node according to the running log of each server node;

[0007] if the occurrence number of at least one preset index item of the server node is not less than the preset number threshold corresponding to the preset index item, the hard disk of the server node is regarded as a target hard disk; the preset number threshold corresponding to the preset index item is configured according to the probability of the hard disk of the server node failing, and when the occurrence number of the preset index item in the historical running log of the server node is not less than the preset number threshold corresponding to the preset index item, the probability of the hard disk of the server node failing is greater than a first preset probability threshold;

[0008] obtaining the SMART log of the target hard disk;

[0009] Detecting whether the target hard disk is faulty according to a SMART log of the target hard disk.

[0010] Optionally, the preset index items include a strongly related index item and a weakly related index item, the preset number threshold corresponding to the strongly related index item is equal to 1, and the preset number threshold corresponding to the weakly related index item is greater than 1.

[0011] Optionally, if the number of occurrences of at least one of the preset index items of the server node is greater than the preset number threshold corresponding to the preset index item, the hard disk of the server node is taken as the target hard disk, including:

[0012] If the strongly related index item exists in the running log, the hard disk of the server node is taken as the target hard disk.

[0013] If the strongly related index item does not exist in the running log, it is judged whether the number of occurrences of each weakly related index item is greater than the preset number threshold corresponding to the weakly related index item.

[0014] If the number of occurrences of at least one of the weakly related index items is greater than the preset number threshold corresponding to the weakly related index item, it is determined that the hard disk of the server node is the target hard disk.

[0015] Optionally, detecting whether the target hard disk is faulty according to a SMART log of the target hard disk, including:

[0016] According to the SMART log of the target hard disk, the values of preset hard disk index items are determined.

[0017] If the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset hard disk index item, it is determined that the target hard disk is faulty, the preset failure condition corresponding to the value of each preset index item is configured according to the probability of the target hard disk being faulty, and when the value of the preset hard disk index item meets the preset failure condition corresponding to the preset hard disk index item in the historical SMART log of the target hard disk, the probability of the target hard disk being faulty is greater than a second preset probability threshold.

[0018] Optionally, the preset hard disk index items include a first preset hard disk index item, a second preset hard disk index item, a third preset hard disk index item, and a fourth preset hard disk index item.

[0019] The preset failure condition corresponding to the first preset hard disk index item is that the value of the first preset hard disk index item is not 0.

[0020] The preset failure condition corresponding to the second preset hard disk index item is that the value of the second preset hard disk index item is equal to a preset failure value.

[0021] the third preset hard disk index item is not equal to a preset normal value;

[0022] the fourth preset hard disk index item is greater than a preset value threshold.

[0023] Optionally, if the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset index item, it is determined that the target hard disk has a failure, including:

[0024] if at least one of the following conditions is met: the value of at least one of the first preset hard disk index items is not 0, the value of at least one of the second preset hard disk index items is equal to a first preset value, the value of at least one of the third preset hard disk index items is not equal to a second preset value, and the value of at least one of the fourth preset hard disk index items is greater than a preset value threshold, it is determined that the target hard disk has a failure.

[0025] A hard disk failure detection device, comprising:

[0026] a first log acquisition unit configured to acquire running logs of each server node in a server cluster;

[0027] a frequency acquisition unit configured to determine, according to the running log of each server node, the occurrence frequency of a preset index item of each server node;

[0028] a target hard disk determination unit configured to, if the occurrence frequency of at least one of the preset index items of the server node is not less than a preset frequency threshold corresponding to the preset index item, take the hard disk of the server node as a target hard disk; the preset frequency threshold corresponding to the preset index item is configured according to the probability of failure of the hard disk of the server node; when the occurrence frequency of the preset index item in the historical running log of the server node is not less than the preset frequency threshold corresponding to the preset index item, the probability of failure of the hard disk of the server node is greater than a first preset probability threshold;

[0029] a second log acquisition unit configured to acquire a SMART log of the target hard disk;

[0030] a failure determination unit configured to detect, according to the SMART log of the target hard disk, whether the target hard disk has a failure.

[0031] Optionally, the failure determination unit is configured to detect, according to the SMART log of the target hard disk, whether the target hard disk has a failure, including that the failure determination unit is specifically configured to:

[0032] According to the SMART log of the target hard disk, determine the value of each preset hard disk index item;

[0033] If the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset hard disk index item, it is determined that the target hard disk has failed. The preset failure condition corresponding to the value of each preset index item is configured according to the probability of failure of the target hard disk. In the historical SMART log of the target hard disk, when the value of the preset hard disk index item meets the preset failure condition corresponding to the preset hard disk index item, the probability of failure of the target hard disk is greater than a second preset probability threshold.

[0034] A hard disk failure detection device, comprising a memory and a processor;

[0035] The memory is configured to store a program.

[0036] The processor is configured to execute the program to implement each step of the hard disk failure detection method.

[0037] A readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements each step of the hard disk failure detection method.

[0038] As can be seen from the above technical solutions, the hard disk failure detection method, device, equipment and readable storage medium provided by the embodiments of the present application obtain the running log of each server node in the server cluster, determine the occurrence frequency of each preset index item of each server node according to the running log, and if the occurrence frequency of at least one preset index item of the server node is not less than the preset frequency threshold corresponding to the preset index item, the hard disk of the server node is taken as a target hard disk. Since in the historical running log of the server node, when the occurrence frequency of the preset index item is not less than the preset frequency threshold corresponding to the preset index item, the probability of failure of the hard disk of the server node is greater than a first preset probability threshold, the target hard disk is a hard disk with a probability of failure greater than the first preset probability threshold. Therefore, the present method only needs to obtain the SMART log of the target hard disk and detect whether the target hard disk has failed according to the SMART log of the target hard disk. Since obtaining the running log of the server node is time-consuming and efficient, the present method does not need to obtain the SMART log of the hard disk of each server node, avoiding the delay in failure handling due to the long time-consuming of obtaining the SMART log, that is, the present method improves the efficiency of hard disk failure detection. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0040] Figure 1 A flowchart of a specific embodiment of a hard disk fault detection method provided by the embodiment of the present application is shown in the figure.

[0041] Figure 2 A flowchart of a specific embodiment of a hard disk fault detection method provided by the embodiment of the present application is shown in the figure.

[0042] Figure 3 A structural diagram of a hard disk fault detection device provided by the embodiment of the present application is shown in the figure.

[0043] Figure 4 A structural diagram of a hard disk fault detection device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0045] The hard disk fault detection method provided by the embodiment of the present application is applied to, but not limited to, obtaining fault information of hard disks deployed in a server cluster. The purpose is to be timely, wherein the server cluster includes at least two server nodes. In actual application, the number of nodes of the server cluster is large. In the present embodiment, N represents the number of server nodes in the server cluster. It should be noted that at least one hard disk is deployed in each server node. The type of hard disk includes but is not limited to solid state disk, and the working mode of hard disk includes but is not limited to pass-through mode and RAID (Redundant Arrays of Independent Disks) mode.

[0046] Figure 1 A flowchart of a specific embodiment of a hard disk fault detection method provided by the embodiment of the present application is shown in the figure, which specifically includes:

[0047] S101, obtaining the running log of each server node.

[0048] In this embodiment, the operation log of any server node includes, but is not limited to, the operating system log of the server node in a preset time period.

[0049] The method for obtaining the operation log can refer to the prior art.

[0050] According to the operation log of each server node, it is determined whether the hard disk of the server node is a target hard disk, the target hard disk refers to a hard disk with a probability of failure greater than a first preset probability threshold. It should be noted that in this embodiment, the method for determining whether the hard disk of each server node is a target hard disk is the same, and the following S102-S104 take the first server node as an example to describe the method for determining whether the hard disk of the server node is a target hard disk.

[0051] S102, in the operation log of the first server node, it is determined whether a preset strong correlation index item appears.

[0052] In this embodiment, the strong correlation index item is pre-configured according to the historical operation log. In the historical operation log, if the strong correlation index item appears, the probability of failure of the hard disk is greater than the first preset probability threshold. The strong correlation index item includes, but is not limited to: Unrecovered read error, NCQ fail, I / O error, Device offlined, SCSI error, and file system read-only.

[0053] It should be noted that each strong correlation index item indicates that the server node has a running error corresponding to the strong correlation index item in the running process. Usually, the strong correlation index item is a preset script expression of the running error. The corresponding relationship between the strong correlation index item and the running error can refer to the prior art, for example, the strong correlation index item "Unrecovered read error" corresponds to the running error "unrecoverable error". The running error corresponding to each strong correlation index item can refer to the prior art, which will not be described here.

[0054] S103, if any of the strong correlation index items appears, it is determined that the hard disk of the first server node is a target hard disk.

[0055] In this embodiment, the presence of at least one strong correlation index item is used as a first preset condition. When the first preset condition is met, it is determined that the hard disk of the first server node is a target hard disk.

[0056] In this embodiment, if the running log of the first server node satisfies at least one of (11) there is an Unrecovered reader error, (12) there is an NCQ fail, (13) there is an I / O error, (14) there is a Device offlined, (15) there is an SCSI error, and (16) there is a file system read-only, it is determined that the running log of the server node satisfies the second preset condition.

[0057] It should be noted that the configuration condition of the strongly related index item is determined according to the historical running log, the strongly related index item can further include other multiple index items, and the strongly related index item is updated in real time according to the historical running log, which will not be described herein.

[0058] S104, according to the running log of the first server node, the occurrence times of each preset secondary related index item are determined.

[0059] In this embodiment, the method for determining the occurrence times of each preset secondary related index item can refer to the prior art. Alternatively, the occurrence times of the keywords indicating the existence of the secondary related index item are searched as the occurrence times of the secondary related index item.

[0060] In this embodiment, each primary related index item is pre-configured according to the historical running log. In the historical running log, the more the occurrence times of the secondary related index item, the greater the probability of the hard disk failure. When the occurrence times of the secondary related index item are greater than the preset number threshold corresponding to the secondary related index item, the probability of the hard disk failure is greater than the first preset probability threshold. The preset number threshold is greater than 1.

[0061] Alternatively, the secondary related index item includes but is not limited to Lun reset, Reset logical, Unrecovered read error, and Unrecovered write error. It should be noted that each secondary related index item indicates that the server node appears the running error corresponding to the secondary related index item in the running process. Usually, the secondary related index item is a preset script expression of the running error. For example, the running error corresponding to the secondary related index item "Reset logical" is logical volume reset. The running error corresponding to each primary related index item can refer to the prior art, which will not be described herein.

[0062] S105, if the occurrence times of at least one secondary related index item are greater than the preset number threshold corresponding to the secondary related index item, the hard disk of the first server node is taken as the target hard disk.

[0063] In this embodiment, the number of occurrences of at least one secondary correlation index item is greater than the preset number threshold corresponding to the secondary correlation index item as a second preset condition. When the second preset condition is met, it is determined that the hard disk of the first server node is the target hard disk. Specifically, if the running log of the first server node satisfies at least one of (11) the number of occurrences of Lun reset is greater than a preset first value, (12) the number of occurrences of Reset logical is greater than a preset second value, (13) the number of occurrences of Unrecovered read error is greater than a preset third value, and (14) the number of occurrences of Unrecovered write error is greater than a fourth value, it is determined that the running log of the server node satisfies the first preset condition.

[0064] It should be noted that the preset number threshold corresponding to the secondary correlation index item is determined according to the historical running log, and the values of the first value to the fourth value can be the same or different. The secondary correlation index item can also include other multiple index items, and the secondary correlation index item is updated in real time according to the historical running log, which is not described in detail in this embodiment. The application does not limit the execution order of S102-S103 and S104-S105, that is, when the running log of the first server node satisfies at least one of the first preset condition and the second preset condition, it is determined that the hard disk of the server node is the target hard disk.

[0065] As can be seen from the above, since in the historical running log, if the strong correlation index item appears, the probability of failure of the hard disk is greater than the first preset probability threshold, and when there is at least one strong correlation index item in the running log of the server, the probability of failure of the hard disk of the server is greater than the first preset probability threshold, and when the number of occurrences of the secondary correlation index item is greater than the preset number threshold corresponding to the secondary correlation index item, the probability of failure of the hard disk is greater than the first preset probability threshold, so when the number of occurrences of at least one secondary correlation index item in the running log of the server is greater than the preset number threshold corresponding to the secondary correlation index item, the probability of failure of the hard disk of the server is greater than the first preset probability threshold. Therefore, when the running log of the first server node satisfies at least one of the first preset condition and the second preset condition, it is determined that the hard disk of the server node is the target hard disk. It can be seen that the target hard disk determined by the method is the hard disk whose probability of failure is greater than the first preset probability threshold according to the running log.

[0066] In this embodiment, whether the hard disk of each server node is the target hard disk is determined through S102-S105 described above, so as to obtain at least one target hard disk. S106-S109 illustrates a specific implementation process of determining whether the target hard disk fails.

[0067] S106, obtain the value of the first preset hard disk index item in the SMART log of the target hard disk, and if the value of the first preset hard disk index item is not 0, it is determined that the target hard disk has a fault.

[0068] In this embodiment, the first preset hard disk index item is an index item pre-configured according to historical running logs, and the configuration condition is that when the value of the first preset hard disk index item is not 0, the probability of the target hard disk having a fault is greater than a second preset probability threshold.

[0069] S107, obtain the value of the second preset hard disk index item in the SMART log of the target hard disk, and if the value of the second preset hard disk index item is equal to a preset fault value of the second preset hard disk index item, it is determined that the target hard disk has a fault.

[0070] In this embodiment, the second preset hard disk index item is an index item pre-configured according to historical running logs, and the configuration condition is that when the value of the second preset hard disk index item is equal to a preset fault value of the second preset hard disk index item, the probability of the target hard disk having a fault is greater than a second preset probability threshold.

[0071] S108, obtain the value of the third preset hard disk index item in the SMART log of the target hard disk, and if the value of the third preset hard disk index item is not equal to a preset normal value of the third preset hard disk index item, it is determined that the target hard disk has a fault.

[0072] In this embodiment, the third preset hard disk index item is an index item pre-configured according to historical running logs, and the configuration condition is that when the value of the third preset hard disk index item is not equal to a preset normal value of the third preset hard disk index item, the probability of the target hard disk having a fault is greater than a second preset probability threshold.

[0073] S109, obtain the value of the fourth preset hard disk index item in the SMART log of the target hard disk, and if the value of the fourth preset hard disk index item exceeds a preset value threshold corresponding to the fourth preset hard disk index item, it is determined that the target hard disk has a fault.

[0074] In this embodiment, the fourth preset hard disk index item is an index item pre-configured according to historical running logs, and the configuration condition is that when the value of the fourth preset hard disk index item exceeds a preset value threshold corresponding to the fourth preset hard disk index item, the probability of the target hard disk having a fault is greater than a second preset probability threshold.

[0075] It should be noted that the above four types of hard disk index items are index items pre-configured through historical running logs and related to whether the target hard disk has a fault, and Table 1 shows the correspondence between the specific index item contents of the four types of hard disk index items and the preset fault conditions in actual application.

[0076] Table 1, correspondence

[0077]

[0078]

[0079]

[0080] The application does not limit the execution order of S106-S109. When any one of S106-S109 determines whether the target hard disk fails, the process ends.

[0081] As can be seen from the above technical solution, the first to fourth preset hard disk index items are preset hard disk index items pre-configured according to historical running logs. The configuration condition is that when the value of the preset hard disk index item meets the preset failure condition corresponding to the value of the preset hard disk index item, the probability of failure of the target hard disk is greater than the second preset probability threshold. Therefore, the method has high accuracy in determining the failure of the target hard disk when the value of at least one preset hard disk index item meets the preset failure condition corresponding to the value of the preset hard disk index item according to the SMART log of the target hard disk.

[0082] It should be noted that the specific configuration condition of each preset hard disk index item is described in the above embodiments.

[0083] Figure 1 The flowchart shown is only one specific implementation of the hard disk failure detection method provided by the application. The application also includes other specific implementations.

[0084] For example, the strongly related index item and the less related index item are preset index items determined according to historical running logs. The specific preset index items are not limited to the index items shown in Table 1 in the above embodiments, and can also include other index items.

[0085] For another example, S106-S109 are a specific implementation method for determining whether the target hard disk fails according to the SMART log of the target hard disk. The application also includes other implementation methods, which can be specifically referred to in the prior art.

[0086] In summary, the hard disk failure detection method provided by the application is summarized as follows: Figure 2 The flowchart shown can specifically include:

[0087] S201, obtaining the running logs of each server node in the server cluster.

[0088] In the embodiment, the server cluster includes a plurality of server nodes, at least one hard disk runs on each server node, and the method for obtaining the running log of each server node can be completed by extracting the running log in a preset time period from the log storage space of the server. For details, refer to the prior art.

[0089] S202. Determine the occurrence number of each preset index item of each server node according to the running log.

[0090] It should be noted that there are various methods for determining the occurrence number of the preset index item, and for details, refer to the above embodiment.

[0091] S203. If the occurrence number of at least one preset index item of the server node is greater than the preset number threshold corresponding to the preset index item, the hard disk of the server node is taken as a target hard disk.

[0092] In the embodiment, the preset number threshold corresponding to each preset index item is determined according to the probability of failure of the hard disk of the server node. Moreover, in the historical running log of the server node, when the occurrence number of the preset index item is not less than the preset number threshold corresponding to the preset index item, the probability of failure of the hard disk of the server node is greater than a first preset probability threshold.

[0093] It should be noted that the configuration method of the preset index item and the specific method for determining the preset number threshold corresponding to the preset index item can refer to the prior art.

[0094] S204. Obtain the SMART log of the target hard disk.

[0095] S205. Detect whether the target hard disk fails according to the SMART log of the target hard disk.

[0096] It can be seen from the technical solution that the method obtains the running logs of the server nodes in the server cluster, determines the occurrence times of the preset index items of the server nodes according to the running logs, and takes the hard disk of the server node as a target hard disk if the occurrence times of at least one preset index item of the server node are not less than the preset number threshold corresponding to the preset index item. Since the probability that the hard disk of the server node fails is greater than the first preset probability threshold when the occurrence times of the preset index item are not less than the preset number threshold corresponding to the preset index item in the historical running logs of the server node, the target hard disk is the hard disk whose failure probability is greater than the first preset probability threshold. Therefore, the method only needs to obtain the SMART log of the target hard disk and detect whether the target hard disk fails according to the SMART log of the target hard disk. Since the time consumption for obtaining the running logs of the server nodes is short and the efficiency is high, the method does not need to obtain the SMART log of the hard disk of each server node, avoids the failure processing not being timely due to the long time consumption for obtaining the SMART log, that is, the method improves the efficiency of hard disk failure detection.

[0097] Figure 3 A structure diagram of a hard disk failure detection device provided by an embodiment of the application is shown, as shown in Figure 3 The device can include:

[0098] A first log obtaining unit 301 is configured to obtain the running logs of the server nodes in the server cluster.

[0099] A number obtaining unit 302 is configured to determine the occurrence times of the preset index items of each server node according to the running logs of each server node.

[0100] A target hard disk determining unit 303 is configured to take the hard disk of the server node as a target hard disk if the occurrence times of at least one preset index item of the server node are not less than the preset number threshold corresponding to the preset index item. The preset number threshold corresponding to the preset index item is configured according to the probability that the hard disk of the server node fails. When the occurrence times of the preset index item are not less than the preset number threshold corresponding to the preset index item in the historical running logs of the server node, the probability that the hard disk of the server node fails is greater than the first preset probability threshold.

[0101] A second log obtaining unit 304 is configured to obtain the SMART log of the target hard disk.

[0102] A failure determining unit 305 is configured to detect whether the target hard disk fails according to the SMART log of the target hard disk.

[0103] Optionally, the preset index items comprise a strongly related index item and a weakly related index item, the preset number threshold corresponding to the strongly related index item is equal to 1, and the preset number threshold corresponding to the weakly related index item is greater than 1.

[0104] Optionally, the target hard disk determination unit is configured to determine the hard disk of the server node as a target hard disk if the number of occurrences of at least one of the preset index items of the server node is not less than the preset number threshold corresponding to the preset index item, and the target hard disk determination unit is specifically configured to:

[0105] determine the hard disk of the server node as a target hard disk if at least one of the strongly related index items exists in the running log;

[0106] determine the hard disk of the server node as a target hard disk if at least one of the weakly related index items exists in the running log;

[0107] determine the hard disk of the server node as a target hard disk if the number of occurrences of at least one of the weakly related index items is greater than the preset number threshold corresponding to the weakly related index item.

[0108] Optionally, the fault determination unit is configured to detect whether the target hard disk has a fault according to the SMART log of the target hard disk, and the fault determination unit is specifically configured to:

[0109] determine the values of preset hard disk index items according to the SMART log of the target hard disk;

[0110] determine that the target hard disk has a fault if the value of at least one of the preset hard disk index items satisfies a preset fault condition corresponding to the preset hard disk index item, and the preset fault condition corresponding to the value of each preset index item is configured according to the probability of the target hard disk having a fault, and the probability of the target hard disk having a fault is greater than a second preset probability threshold when the value of the preset hard disk index item satisfies the preset fault condition corresponding to the preset hard disk index item in the historical SMART log of the target hard disk.

[0111] Optionally, the preset hard disk index items comprise a first preset hard disk index item, a second preset hard disk index item, a third preset hard disk index item, and a fourth preset hard disk index item.

[0112] the preset fault condition corresponding to the first preset hard disk index item is that the value of the first preset hard disk index item is not 0;

[0113] the preset fault condition corresponding to the second preset hard disk index item is that the value of the second preset hard disk index item is equal to a preset fault value;

[0114] The preset fault condition corresponding to the third preset hard disk index item is that the value of the third preset hard disk index item is not equal to a preset normal value.

[0115] The preset fault condition corresponding to the fourth preset hard disk index item is that the value of the fourth preset hard disk index item exceeds a preset value threshold.

[0116] Optionally, the fault determination unit is configured to determine that the target hard disk is faulty if the value of at least one of the preset hard disk index items satisfies the preset fault condition corresponding to the preset index item, and the fault determination unit is specifically configured to:

[0117] If at least one of the following conditions is satisfied: the value of at least one of the first preset hard disk index items is not 0, the value of at least one of the second preset hard disk index items is equal to the first preset value, the value of at least one of the third preset hard disk index items is not equal to the second preset value, and the value of at least one of the fourth preset hard disk index items exceeds the preset value threshold, it is determined that the target hard disk is faulty.

[0118] Figure 4 A structural diagram of a hard disk fault detection device is shown, which can include at least one processor 401, at least one communication interface 402, at least one memory 403, and at least one communication bus 404;

[0119] In the embodiments of the present application, the number of processors 401, communication interfaces 402, memories 403, and communication buses 404 is at least one, and the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404;

[0120] The processor 401 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application, etc.

[0121] The memory 403 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.

[0122] The memory stores a program, and the processor can execute the program stored in the memory to implement each step of the hard disk fault detection method provided by the embodiments of the present application, as follows:

[0123] A hard disk fault detection method includes:

[0124] Obtaining the running logs of each server node in the server cluster;

[0125] determining, according to the running log of each server node, the occurrence number of each preset index item of each server node;

[0126] if the occurrence number of at least one preset index item of the server node is not less than the preset number threshold corresponding to the preset index item, taking the hard disk of the server node as a target hard disk; the preset number threshold corresponding to the preset index item is configured according to the probability of failure of the hard disk of the server node, and when the occurrence number of the preset index item is not less than the preset number threshold corresponding to the preset index item in the historical running log of the server node, the probability of failure of the hard disk of the server node is greater than a first preset probability threshold;

[0127] obtaining the SMART log of the target hard disk;

[0128] detecting whether the target hard disk fails according to the SMART log of the target hard disk.

[0129] Optionally, the preset index items include strong correlation index items and secondary correlation index items, the preset number threshold corresponding to the strong correlation index item is equal to 1, and the preset number threshold corresponding to the secondary correlation index item is greater than 1.

[0130] Optionally, if the occurrence number of at least one preset index item of the server node is greater than the preset number threshold corresponding to the preset index item, the hard disk of the server node is taken as a target hard disk, including:

[0131] if at least one strong correlation index item exists in the running log, the hard disk of the server node is taken as a target hard disk;

[0132] if the strong correlation index item does not exist in the running log, it is judged whether the occurrence number of each secondary correlation index item is greater than the preset number threshold corresponding to the secondary correlation index item;

[0133] if the occurrence number of at least one secondary correlation index item is greater than the preset number threshold corresponding to the secondary correlation index item, it is determined that the hard disk of the server node is a target hard disk.

[0134] Optionally, detecting whether the target hard disk fails according to the SMART log of the target hard disk, including:

[0135] determining the value of a preset hard disk index item according to the SMART log of the target hard disk;

[0136] If the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset hard disk index item, it is determined that the target hard disk has a failure. The preset failure condition corresponding to the value of each preset index item is configured according to the probability of the target hard disk having a failure. When the value of the preset hard disk index item meets the preset failure condition corresponding to the preset hard disk index item, the probability of the target hard disk having a failure is greater than a second preset probability threshold.

[0137] Optionally, the preset hard disk index items include a first preset hard disk index item, a second preset hard disk index item, a third preset hard disk index item, and a fourth preset hard disk index item.

[0138] The preset failure condition corresponding to the first preset hard disk index item is that the value of the first preset hard disk index item is not 0.

[0139] The preset failure condition corresponding to the second preset hard disk index item is that the value of the second preset hard disk index item is equal to a preset failure value.

[0140] The preset failure condition corresponding to the third preset hard disk index item is that the value of the third preset hard disk index item is not equal to a preset normal value.

[0141] The preset failure condition corresponding to the fourth preset hard disk index item is that the value of the fourth preset hard disk index item exceeds a preset value threshold.

[0142] Optionally, if the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset index item, it is determined that the target hard disk has a failure, including:

[0143] If at least one of the following conditions is met: at least one of the values of the first preset hard disk index items is not 0, at least one of the values of the second preset hard disk index items is equal to a first preset value, at least one of the values of the third preset hard disk index items is not equal to a second preset value, and at least one of the values of the fourth preset hard disk index items exceeds a preset value threshold, it is determined that the target hard disk has a failure.

[0144] The embodiment of the present application also provides a readable storage medium, which can store a computer program suitable for processor execution. When the computer program is executed by the processor, each step of the hard disk failure detection method provided by the embodiment of the present application is implemented, as follows:

[0145] A hard disk failure detection method, including:

[0146] Obtaining the running logs of each server node in a server cluster;

[0147] determining, according to the running log of each of the server nodes, the occurrence times of preset index items of each of the server nodes;

[0148] if the occurrence times of at least one of the preset index items of the server node are not less than a preset threshold of the preset index item, taking the hard disk of the server node as a target hard disk; the preset threshold of the preset index item is configured according to the probability of failure of the hard disk of the server node, and when the occurrence times of the preset index item in the historical running log of the server node are not less than the preset threshold of the preset index item, the probability of failure of the hard disk of the server node is greater than a first preset probability threshold;

[0149] obtaining a SMART log of the target hard disk;

[0150] detecting, according to the SMART log of the target hard disk, whether the target hard disk fails.

[0151] Optionally, the preset index items include strong correlation index items and secondary correlation index items, the preset threshold of the strong correlation index item is equal to 1, and the preset threshold of the secondary correlation index item is greater than 1.

[0152] Optionally, if the occurrence times of at least one of the preset index items of the server node are greater than the preset threshold of the preset index item, the hard disk of the server node is taken as the target hard disk, including:

[0153] if at least one of the strong correlation index items exists in the running log, the hard disk of the server node is taken as the target hard disk;

[0154] if the strong correlation index item does not exist in the running log, it is judged whether the occurrence times of each of the secondary correlation index items are greater than the preset threshold of the secondary correlation index item;

[0155] if the occurrence times of at least one of the secondary correlation index items are greater than the preset threshold of the secondary correlation index item, the hard disk of the server node is determined as the target hard disk.

[0156] Optionally, detecting, according to the SMART log of the target hard disk, whether the target hard disk fails, includes:

[0157] determining, according to the SMART log of the target hard disk, the values of preset hard disk index items;

[0158] If the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset hard disk index item, it is determined that the target hard disk has a failure. The preset failure condition corresponding to the value of each preset index item is configured according to the probability of the target hard disk having a failure. When the value of the preset hard disk index item meets the preset failure condition corresponding to the preset hard disk index item in the historical SMART log of the target hard disk, the probability of the target hard disk having a failure is greater than a second preset probability threshold.

[0159] Optionally, the preset hard disk index items include a first preset hard disk index item, a second preset hard disk index item, a third preset hard disk index item, and a fourth preset hard disk index item.

[0160] The preset failure condition corresponding to the first preset hard disk index item is that the value of the first preset hard disk index item is not 0.

[0161] The preset failure condition corresponding to the second preset hard disk index item is that the value of the second preset hard disk index item is equal to a preset failure value.

[0162] The preset failure condition corresponding to the third preset hard disk index item is that the value of the third preset hard disk index item is not equal to a preset normal value.

[0163] The preset failure condition corresponding to the fourth preset hard disk index item is that the value of the fourth preset hard disk index item exceeds a preset value threshold.

[0164] Optionally, if the value of at least one of the preset hard disk index items meets the preset failure condition corresponding to the preset index item, it is determined that the target hard disk has a failure, including:

[0165] If at least one of the following conditions is met: at least one of the values of the first preset hard disk index items is not 0, at least one of the values of the second preset hard disk index items is equal to a first preset value, at least one of the values of the third preset hard disk index items is not equal to a second preset value, and at least one of the values of the fourth preset hard disk index items exceeds a preset value threshold, it is determined that the target hard disk has a failure.

[0166] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are not intended to denote the presence of any such actual relationship or order. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0167] The various embodiments in the specification are described with progression in this order of description. Embodiments having the same or similar descriptions are referenced by the same reference numerals.

[0168] The above description of disclosed embodiments provides enabling teaching for a person skilled in the art to realize or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting hard disk faults, characterized in that, include: Obtain the runtime logs of each server node in the server cluster; Based on the operation log of each server node, determine the number of times the preset indicator item of each server node appears; If the number of occurrences of at least one of the preset indicator items of the server node is not less than the preset number threshold corresponding to the preset indicator item, the hard disk of the server node is used as the target hard disk. The preset frequency threshold corresponding to the preset indicator item is configured based on the probability of the hard drive of the server node failing. When the frequency of the preset indicator item in the historical operation log of the server node is not less than the preset frequency threshold corresponding to the preset indicator item, the probability of the hard drive of the server node failing is greater than the first preset probability threshold. Obtain the SMART log of the target hard drive; Based on the SMART log of the target hard drive, detect whether the target hard drive has failed; The step of detecting whether the target hard drive has failed based on the SMART log of the target hard drive includes: Based on the SMART log of the target hard drive, determine the values ​​of preset hard drive indicator items; If the value of at least one of the preset hard disk indicator items meets the preset fault condition corresponding to the preset hard disk indicator item, it is determined that the target hard disk has failed. The preset fault condition corresponding to the value of each preset indicator item is configured according to the probability of the target hard disk failing. In the historical SMART log of the target hard disk, when the value of the preset hard disk indicator item meets the preset fault condition corresponding to the preset hard disk indicator item, the probability of the target hard disk failing is greater than the second preset probability threshold.

2. The method according to claim 1, characterized in that, The preset indicator items include: strongly correlated indicator items and slightly correlated indicator items. The preset frequency threshold corresponding to the strongly correlated indicator items is equal to 1, and the preset frequency threshold corresponding to the slightly correlated indicator items is greater than 1.

3. The method according to claim 2, characterized in that, If the number of occurrences of at least one of the preset indicator items of the server node is not less than the preset number threshold corresponding to the preset indicator item, the hard drive of the server node is used as the target hard drive, including: If at least one of the strongly correlated metrics exists in the operation log, the hard drive of the server node will be used as the target hard drive. If the strongly correlated indicator item does not exist in the operation log, determine whether the occurrence frequency of each of the secondary correlated indicator items is greater than the preset frequency threshold corresponding to the secondary correlated indicator item. If the number of occurrences of at least one of the sub-related indicators is greater than the preset number threshold corresponding to the sub-related indicator, the hard drive of the server node is determined to be the target hard drive.

4. The method according to claim 1, characterized in that, The preset hard disk indicator items include a first preset hard disk indicator item, a second preset hard disk indicator item, a third preset hard disk indicator item, and a fourth preset hard disk indicator item; The preset fault condition corresponding to the first preset hard disk indicator item is: the value of the first preset hard disk indicator item is not 0; The preset fault condition corresponding to the second preset hard disk indicator item is: the value of the second preset hard disk indicator item is equal to the preset fault value; The preset fault condition corresponding to the third preset hard disk indicator is: the value of the third preset hard disk indicator is not equal to the preset normal value. The preset fault condition corresponding to the fourth preset hard disk indicator is: the value of the fourth preset hard disk indicator exceeds a preset value threshold.

5. The method according to claim 4, characterized in that, The step of determining that the target hard drive has failed if at least one of the preset hard drive indicator values ​​meets the preset fault condition corresponding to the preset indicator value includes: If at least one of the following conditions is met: the value of at least one of the first preset hard disk indicator items is not 0, the value of at least one of the second preset hard disk indicator items is equal to the first preset value, the value of at least one of the third preset hard disk indicator items is not equal to the second preset value, and the value of at least one of the fourth preset hard disk indicator items exceeds the preset value threshold, then the target hard disk is determined to be faulty.

6. A hard disk fault detection device, characterized in that, include: The first log acquisition unit is used to acquire the running logs of each server node in the server cluster; The frequency acquisition unit is used to determine the frequency of occurrence of a preset indicator item for each server node based on the operation log of each server node. The target hard disk determination unit is used to determine the hard disk of the server node as the target hard disk if the occurrence frequency of at least one of the preset indicator items of the server node is not less than the preset frequency threshold corresponding to the preset indicator item. The preset frequency threshold corresponding to the preset indicator item is configured based on the probability of the hard drive of the server node failing. When the frequency of the preset indicator item in the historical operation log of the server node is not less than the preset frequency threshold corresponding to the preset indicator item, the probability of the hard drive of the server node failing is greater than the first preset probability threshold. The second log acquisition unit is used to acquire the SMART log of the target hard disk; The fault determination unit is used to detect whether the target hard disk has a fault based on the SMART log of the target hard disk; The fault determination unit is used to detect whether the target hard drive has a fault based on the SMART log of the target hard drive, including: the fault determination unit is specifically used for: Based on the SMART log of the target hard drive, determine the values ​​of preset hard drive indicator items; If the value of at least one of the preset hard disk indicator items meets the preset fault condition corresponding to the preset hard disk indicator item, it is determined that the target hard disk has failed. The preset fault condition corresponding to the value of each preset indicator item is configured according to the probability of the target hard disk failing. In the historical SMART log of the target hard disk, when the value of the preset hard disk indicator item meets the preset fault condition corresponding to the preset hard disk indicator item, the probability of the target hard disk failing is greater than the second preset probability threshold.

7. A hard drive fault detection device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the hard disk fault detection method as described in any one of claims 1 to 5.

8. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the hard disk fault detection method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • An implementation method for SMART information monitoring

    CN106991031A