Disk detection and alarm method and related device for distributed storage system
By comparing disk information and detecting utilization, the problem of false positives and false negatives of abnormal disk operations in distributed storage systems is solved, and accurate detection of disk status and utilization is achieved to avoid data anomalies.
Patent Information
- Application Number
- CN202210885291.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-07-26
AI Technical Summary
In distributed storage systems, there are false positives and missed positives when disks operate abnormally, and there is a lack of real-time detection of disk utilization, which leads to data anomalies.
By obtaining the latest disk information and comparing it with the disk information cache file, disk status alarm information is constructed, and disk utilization is detected. According to the comparison results and the comparison between the utilization and the threshold, corresponding alarm information is constructed.
Improves the accuracy of abnormal disk operation detection, timely obtains disk usage status, and avoids data anomalies.
Smart Images

Figure CN115145490B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a disk detection and alarm method for a distributed storage system; and also to a disk detection and alarm device, equipment, and computer-readable storage medium for a distributed storage system. Background Art
[0002] In distributed storage systems, disks, as the physical medium for storing data, play a crucial role in data storage. Currently, disk alarms are prone to false positives and false negatives when abnormal operations such as swapping disk slots or removing disks occur. Furthermore, as data volume increases, disk utilization fluctuates. However, the current lack of disk utilization monitoring prevents timely monitoring of disk usage, leading to data anomalies. Therefore, resolving these technical deficiencies has become a pressing technical challenge for those skilled in the art. Summary of the Invention
[0003] The purpose of this application is to provide a disk detection and alarm method for a distributed storage system, which can improve the accuracy of abnormal disk operation detection and alarm. By detecting disk utilization, disk usage can be promptly monitored to avoid data anomalies. Another purpose of this application is to provide a disk detection and alarm device, equipment, and computer-readable storage medium for a distributed storage system, all of which have the above-mentioned technical effects.
[0004] To solve the above technical problems, the present application provides a disk detection and alarm method for a distributed storage system, comprising:
[0005] Get the latest disk information and disk information in the disk information cache file;
[0006] Comparing the latest disk information with the disk information in the disk information cache file, and constructing disk status alarm information according to the comparison result;
[0007] Get disk utilization;
[0008] The utilization of the disk is compared with a threshold, and disk utilization alarm information is constructed according to the comparison result.
[0009] Optionally, get the latest disk information including:
[0010] Obtaining first disk information of the disk through the array card tool interface; the first disk information includes a serial number, a slot number, and a disk type;
[0011] Use the smartctl command to query the second disk information of the disk; the second disk information includes the serial number, disk letter and disk health status;
[0012] The first disk information and the second disk information are associated with each other according to the serial number to obtain the disk information.
[0013] Optionally, comparing the latest disk information with the disk information in the disk information cache file and constructing disk status alarm information according to the comparison result includes:
[0014] Intersecting the latest slot information list with the slot information list in the disk information cache file to obtain a list of in-place disks;
[0015] Filtering the in-place disk information list from the slot information list table in the disk information cache file to obtain an unplugged disk information list;
[0016] If the unplugged disk information list is not empty, traverse the unplugged disk slot list and construct abnormal alarm information;
[0017] If the unplugged disk information is empty, the latest disk information list is traversed, and when the disk health status is abnormal, abnormal alarm information is constructed, and when the disk health status is normal, recovery alarm information is constructed.
[0018] Optionally, obtaining disk utilization includes:
[0019] Query the utilization of the OSD under the disk letter;
[0020] If the disk drive letter corresponds to one OSD, the utilization rate of the OSD is the utilization rate of the disk;
[0021] If the disk drive letter corresponds to multiple OSDs, the utilization rates of the OSDs are accumulated to obtain the utilization rate of the disk.
[0022] Optionally, comparing the disk utilization with a threshold and constructing disk utilization alarm information according to the comparison result includes:
[0023] If the utilization of the disk is higher than the threshold, an abnormal alarm message is generated;
[0024] If the utilization of the disk is not higher than the threshold, a recovery alarm message is constructed.
[0025] Optionally, also include:
[0026] Report the disk status alarm information and the disk utilization alarm information.
[0027] Optionally, the reporting of the disk status alarm information and the disk utilization alarm information includes:
[0028] The disk status alarm information and the disk utilization alarm information are added to the alarm pool of the agent process, and the agent process uploads the disk status alarm information and the disk utilization alarm information that pass the consistency check to the master process.
[0029] To solve the above technical problems, the present application also provides a disk detection and alarm device for a distributed storage system, comprising:
[0030] The disk information acquisition module is used to obtain the latest disk information and the disk information in the disk information cache file;
[0031] a disk status detection module, configured to compare the latest disk information with the disk information in the disk information cache file, and construct disk status alarm information according to the comparison result;
[0032] Disk utilization acquisition module, used to obtain disk utilization;
[0033] The disk utilization detection module is used to compare the utilization of the disk with a threshold value and construct disk utilization alarm information according to the comparison result.
[0034] To solve the above technical problems, the present application also provides a disk detection and alarm device for a distributed storage system, comprising:
[0035] memory for storing computer programs;
[0036] A processor is configured to implement the steps of the disk detection and alarm method for a distributed storage system as described in any one of the above items when executing the computer program.
[0037] To solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the disk detection and alarm method of the distributed storage system as described in any of the above items are implemented.
[0038] The disk detection and alarm method for a distributed storage system provided in the present application includes: obtaining the latest disk information and the disk information in the disk information cache file; comparing the latest disk information with the disk information in the disk information cache file, and constructing disk status alarm information based on the comparison result; obtaining disk utilization; comparing the disk utilization with a threshold value, and constructing disk utilization alarm information based on the comparison result.
[0039] As can be seen, the disk detection and alarm method for a distributed storage system provided by this application detects disk status by comparing the latest disk information with the disk information in the cache file, which can effectively improve the accuracy of disk status detection. In addition, the disk detection and alarm method provided by this application detects disk utilization and generates alarm information, which can timely understand disk usage and avoid data anomalies.
[0040] The disk detection and alarm device, equipment and computer-readable storage medium of the distributed storage system provided in this application all have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the prior art and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 A flowchart of a disk detection and alarm method for a distributed storage system provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a cache information acquisition method provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of a disk status detection provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of a disk utilization detection provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of a disk alarm provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of a disk detection and alarm device for a distributed storage system provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of a disk detection and alarm device for a distributed storage system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The core of this application is to provide a disk detection and alarm method for a distributed storage system, which can improve the accuracy of abnormal disk operation detection and alarm. By detecting disk utilization, disk usage can be promptly monitored to avoid data anomalies. Another core of this application is to provide a disk detection and alarm device, equipment, and computer-readable storage medium for a distributed storage system, all of which have the above-mentioned technical effects.
[0050] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0051] Please refer to Figure 1 , Figure 1 A flow chart of a method for detecting and warning a disk in a distributed storage system provided by an embodiment of the present application is provided. Figure 1 As shown, the method includes:
[0052] S101: Obtain the latest disk information and disk information in the disk information cache file;
[0053] If no abnormalities such as disk swapping or unplugging occur, the latest disk information and the disk information in the disk information cache file should be the same. If abnormalities such as disk swapping or unplugging occur, the latest disk information and the disk information in the disk information cache file may differ.
[0054] In some embodiments, obtaining the latest disk information may include:
[0055] Obtaining first disk information of the disk through the array card tool interface; the first disk information includes a serial number, a slot number, and a disk type;
[0056] Use the smartctl command to query the second disk information of the disk; the second disk information includes the serial number, disk letter and disk health status;
[0057] The first disk information and the second disk information are associated with each other according to the serial number to obtain the disk information.
[0058] Different disk arrays in a distributed storage system have corresponding disk management tools, and different disk management tools provide different interfaces, namely array card tool interfaces. Therefore, you can obtain the disk serial number, slot number, and disk type through the interface provided by the disk management tool. For example, Figure 2As shown, the serial number, slot number, and disk type of a PMC card can be obtained through the sg_ses interface, the serial number, slot number, and disk type of a SAS (Serial Attached SCSI) card can be obtained through the sas3ircu or sas2ircu interface, and the serial number, slot number, and disk type of a RAID (Redundant Arrays of Independent Disks) card can be obtained through the storcli64 interface.
[0059] In addition, you can use the smartctl command to obtain the disk letter, disk health status, and serial number of an HDD (Hard Disk Drive), SSD (Solid State Disk), or NVME (Non-Volatile Memory Express) disk based on the disk matching rules in / sys / block.
[0060] The slot numbers obtained through the disk management tool's interface must be further numbered according to the product name, which can be used to determine the total number of slots. HDD slot numbers can start at 1, while SSD and NVME slot numbers can be numbered using the disk type followed by a number, for example, NVME1.
[0061] The serial number, slot number, and disk type obtained through the interface provided by the disk management tool are associated with the serial number, disk letter, and disk health status obtained through the smartctl command through the serial number to obtain disk information. The disk information can be stored in the form of a list (hereinafter referred to as the disk information list).
[0062] In this embodiment, disk information is retrieved through a command-line interface (CLI) called the Disk Information Interface. The return format is a list of node, disk_id, disk_status, serial_no, and slot. node, disk_id, disk_status, serial_no, and slot represent the node name, disk letter, disk health status, serial number, and slot number, respectively.
[0063] In this embodiment, the disk information interface is adaptable to a variety of disk arrays and is scalable. By calling the disk information interface, the serial number, slot number, and disk type can be obtained through the interface provided by the disk management tool corresponding to the adapted disk array, and the disk letter, disk health status, and serial number can be obtained through the smartctl command.
[0064] S102: Compare the latest disk information with the disk information in the disk information cache file, and construct disk status alarm information according to the comparison result;
[0065] In some embodiments, comparing the latest disk information with the disk information in the disk information cache file and constructing disk status warning information according to the comparison result includes:
[0066] Intersecting the latest slot information list with the slot information list in the disk information cache file to obtain a list of in-place disks;
[0067] Filtering the in-place disk information list from the slot information list table in the disk information cache file to obtain an unplugged disk information list;
[0068] If the unplugged disk information list is not empty, traverse the unplugged disk slot list and construct abnormal alarm information;
[0069] If the unplugged disk information is empty, the latest disk information list is traversed, and when the disk health status is abnormal, abnormal alarm information is constructed, and when the disk health status is normal, recovery alarm information is constructed.
[0070] You can use RabbitMQ to send a disk information query command and call the disk information interface to query disk information. If the return value is empty, skip this check. If the return value is not empty, retrieve the latest slot information list from the returned information. Additionally, retrieve the disk information cache file and the slot information list from the disk information cache file. Intersect the latest slot information list with the slot information list in the disk information cache file to obtain a list of active disks. Furthermore, filter the list of active disks from the slot information list in the disk information cache file to obtain a list of unplugged disk slots. If the unplugged disk slot list is not empty, iterate through the unplugged disk slot list, generate an exception alarm, and set the corresponding disk's health status to down (indicates an abnormality). If the unplugged disk slot list is empty, iterate through the latest disk information list. If the disk health status is down, generate an abnormal disk health status alarm. This abnormal disk health status alarm includes the health status, slot number, and alarm level. If the disk health status is not down, generate a recovery alarm. Recovery alarm information refers to the alarm information generated when the disk health status recovers from abnormal to normal.
[0071] refer to Figure 3 As shown in the following example, before checking the disk status, you can first use ipmitoolfru to obtain the product name and determine whether the product is a non-standard product. If the product is a non-standard product, skip this test. If the product is not a non-standard product, perform this test.
[0072] In addition, reference Figure 3 As shown in the figure, after checking the disk status, you can also update the disk information cache file. The update rule is as follows: the latest disk information list is updated to the disk information cache file node_disk_info.json. The data of removed disks remains unchanged, and the disk information of newly inserted disks is appended to the disk information cache file. Updates are all performed using the slot keyword as the key.
[0073] The disk status test can be performed cyclically according to a preset period, such as 1 minute. By comparing, updating, and cyclically testing the disk information, the accuracy of the test can be guaranteed.
[0074] S103: Obtain disk utilization;
[0075] In some embodiments, obtaining disk utilization includes:
[0076] Query the utilization of the OSD (Object-based Storage Device) under the disk drive letter;
[0077] If the disk drive letter corresponds to one OSD, the utilization rate of the OSD is the utilization rate of the disk;
[0078] If the disk drive letter corresponds to multiple OSDs, the utilization rates of the OSDs are accumulated to obtain the utilization rate of the disk.
[0079] Specifically, refer to Figure 4 As shown, the detection module calls the disk information interface to obtain the latest disk information list. Traverse the latest disk information list, obtain the OSD information under the disk letter according to the disk letter, and store the disk letter and OSD information in the form of key-value pairs: key, value. The key value is the disk letter, and the value value is the OSD set under the letter. HDD disks generally use the entire disk as OSD, so one HDD disk corresponds to one OSD; NVME can be used as multiple OSDs, so one NVME disk can correspond to multiple OSDs. Therefore, the disk letter is traversed, and in each traversal, the osd df command is called to query the OSD utilization. If there is an OSD under the disk letter, the OSD utilization is the disk utilization. If there are multiple OSDs under the disk letter, the utilization of each OSD is accumulated to obtain the disk utilization.
[0080] S104: Compare the disk utilization with a threshold, and construct disk utilization alarm information according to the comparison result.
[0081] The detection module retrieves threshold information by querying a threshold table. It compares disk utilization with the threshold and generates disk utilization alarm information based on the comparison result. A graphical user interface (GUI) allows you to set disk utilization thresholds. This visual threshold setting interface makes threshold configuration more flexible and convenient.
[0082] In some embodiments, comparing the disk utilization with a threshold and constructing disk utilization alarm information according to the comparison result includes:
[0083] If the disk utilization is higher than the threshold, generating a disk utilization abnormality alarm message;
[0084] If the disk utilization is not higher than the threshold, disk utilization recovery alarm information is constructed.
[0085] Furthermore, based on the above embodiment, the present invention further includes:
[0086] Report the disk status alarm information and the disk utilization alarm information.
[0087] The reporting of the disk status alarm information and the disk utilization alarm information includes:
[0088] The disk status alarm information and the disk utilization alarm information are added to the alarm pool of the agent process, and the agent process uploads the disk status alarm information and the disk utilization alarm information that pass the consistency check to the master process.
[0089] refer to Figure 5 As shown, this embodiment adopts the master and agent modes to process the alarm information generated by the disk status and disk utilization detection, which can ensure the reliability of the alarm and the stability of the system operation.
[0090] After cluster deployment is complete, the alarm service is started. This service consists of a master process and an agent process. The management node runs the master process to prevent virtual IP address drift, which could affect alarm generation and recovery. Each node in the cluster runs the agent process, which reports alarm information. The detection module can configure a detection switch or detection period and transmits the switch identifier or period value to the agent process. If the detection module does not set a detection period, the agent process's period is used. The agent process obtains the switch and detection period values, joins the scheduled task, and starts RabbitMQ to receive alarm information. When disk detection on each node generates an alarm, the alarm information is sent to the agent process's alarm pool. The alarm pool performs a consistency check on the alarm information to prevent duplicate alarm reporting. After the alarm consistency check passes, the alarm information is added to the alarm queue and reported to the master process.
[0091] The master process processes the alarm information reported by each node. It queries the alarm table based on the alarm ID to see if the alarm exists. If not, it inserts the alarm into the database. If it exists, it determines the alarm status. If it is an abnormal alarm, it is discarded. If it is a recovery alarm, it is deleted from the current alarm table and a historical alarm is inserted into the historical alarm table.
[0092] During the alarm process, the reliability of the alarm can be guaranteed by collecting, analyzing, comparing and storing the alarm information.
[0093] In summary, the disk detection and alarm method for a distributed storage system provided by this application detects disk status by comparing the latest disk information with the disk information in the cache file, which can effectively improve the accuracy of disk status detection. In addition, the disk detection and alarm method provided by this application detects disk utilization and generates alarm information, which can timely understand disk usage and avoid data anomalies.
[0094] This application also provides a disk detection and alarm device for a distributed storage system. The device described below can be referenced in conjunction with the method described above. Figure 6 , Figure 6 A schematic diagram of a disk detection and alarm device for a distributed storage system provided in an embodiment of the present application, combined with Figure 6 As shown, the device includes:
[0095] The disk information acquisition module 10 is used to obtain the latest disk information and the disk information in the disk information cache file;
[0096] The disk status detection module 20 is used to compare the latest disk information with the disk information in the disk information cache file, and construct disk status warning information according to the comparison result;
[0097] The disk utilization acquisition module 30 is used to obtain the utilization of the disk;
[0098] The disk utilization detection module 40 is configured to compare the utilization of the disk with a threshold value and construct disk utilization alarm information according to the comparison result.
[0099] Based on the above embodiment, as a specific implementation method, the disk information acquisition module 10 includes:
[0100] A first obtaining unit is configured to obtain first disk information of the disk through the array card tool interface; the first disk information includes a serial number, a slot number, and a disk type;
[0101] A second obtaining unit is configured to query second disk information of the disk through a smartctl command; the second disk information includes a serial number, a disk letter, and a disk health status;
[0102] An associating unit is used to associate the first disk information with the second disk information according to the serial number to obtain the disk information.
[0103] Based on the above embodiment, as a specific implementation method, the disk status detection module 20 includes:
[0104] An intersection unit, configured to intersect the latest slot information list with the slot information list in the disk information cache file to obtain an in-place disk list;
[0105] a filtering unit, configured to filter the in-place disk information list from the slot information list table in the disk information cache file to obtain an unplugged disk information list;
[0106] A first construction unit is configured to traverse the unplugged disk slot list and construct abnormal alarm information if the unplugged disk information list is not empty;
[0107] The second construction unit is used to traverse the latest disk information list if the unplugged disk information is empty, and to construct abnormal alarm information when the disk health status is abnormal, and to construct recovery alarm information when the disk health status is normal.
[0108] Based on the above embodiment, as a specific implementation method, the disk utilization acquisition module 30 includes:
[0109] The query unit is used to query the utilization of the OSD under the disk letter;
[0110] A first obtaining unit is configured to: if the disk drive letter corresponds to one OSD, then the utilization rate of the OSD is the utilization rate of the disk;
[0111] The second obtaining unit is configured to accumulate the utilization rates of the OSDs to obtain the utilization rate of the disk if the disk drive letter corresponds to a plurality of OSDs.
[0112] Based on the above embodiment, as a specific implementation method, the disk utilization detection module 40 includes:
[0113] a first alarm information constructing unit, configured to construct abnormal alarm information if the utilization of the disk is higher than the threshold;
[0114] The second alarm information constructing unit is configured to construct recovery alarm information if the utilization of the disk is not higher than the threshold.
[0115] Based on the above embodiment, as a specific implementation method, the following is also included:
[0116] The alarm information reporting module is used to report the disk status alarm information and the disk utilization alarm information.
[0117] Based on the above embodiment, as a specific implementation method, the alarm information reporting module is specifically used to:
[0118] The disk status alarm information and the disk utilization alarm information are added to the alarm pool of the agent process, and the agent process uploads the disk status alarm information and the disk utilization alarm information that pass the consistency check to the master process.
[0119] The disk detection and alarm device for a distributed storage system provided by this application detects disk status by comparing the latest disk information with the disk information in the disk information cache file, effectively improving the accuracy of disk status detection. Furthermore, the disk detection and alarm method provided by this application detects disk utilization and generates alarm information, enabling timely notification of disk usage and preventing data anomalies.
[0120] This application also provides a disk detection and alarm device for a distributed storage system, refer to Figure 7 As shown, the device includes a memory 1 and a processor 2 .
[0121] Memory 1, for storing computer programs;
[0122] Processor 2 is configured to execute a computer program to implement the following steps:
[0123] Obtain the latest disk information and the disk information in the disk information cache file; compare the latest disk information with the disk information in the disk information cache file, and construct disk status alarm information based on the comparison result; obtain disk utilization; compare the disk utilization with a threshold, and construct disk utilization alarm information based on the comparison result.
[0124] For an introduction to the equipment provided in this application, please refer to the above method embodiments, and this application will not go into details here.
[0125] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following steps can be implemented:
[0126] Obtain the latest disk information and the disk information in the disk information cache file; compare the latest disk information with the disk information in the disk information cache file, and construct disk status alarm information based on the comparison result; obtain disk utilization; compare the disk utilization with a threshold, and construct disk utilization alarm information based on the comparison result.
[0127] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.
[0128] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0129] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. References to the common and similar parts between the various embodiments are sufficient. The devices, apparatuses, and computer-readable storage media disclosed in the embodiments are described briefly because they correspond to the methods disclosed in the embodiments. For relevant details, refer to the description of the methods.
[0130] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0131] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0132] The above is a detailed introduction to the disk detection and alarm method, device, equipment, and computer-readable storage medium for the distributed storage system provided by this application. Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only intended to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A disk detection and alarm method for a distributed storage system, characterized in that: include: Get the latest disk information and disk information in the disk information cache file; Comparing the latest disk information with the disk information in the disk information cache file, and constructing disk status alarm information according to the comparison result; Get disk utilization; Comparing the utilization of the disk with a threshold, and constructing disk utilization alarm information according to the comparison result; The step of comparing the latest disk information with the disk information in the disk information cache file and constructing disk status alarm information according to the comparison result includes: Intersecting the slot information list in the latest disk information with the slot information list in the disk information cache file to obtain a list of in-place disks; Filtering the in-place disk information list from the slot information list table in the disk information cache file to obtain an unplugged disk information list; If the unplugged disk information list is not empty, traverse the unplugged disk slot list and construct abnormal alarm information; If the unplugged disk information is empty, the latest disk information list is traversed, and when the disk health status is abnormal, abnormal alarm information is constructed, and when the disk health status is normal, recovery alarm information is constructed.
2. The disk detection and alarm method according to claim 1, characterized in that: Get the latest disk information including: Obtaining first disk information of the disk through the array card tool interface; the first disk information includes a serial number, a slot number, and a disk type; Use the smartctl command to query the second disk information of the disk; the second disk information includes the serial number, disk letter and disk health status; The first disk information and the second disk information are associated with each other according to the serial number to obtain the disk information.
3. The disk detection and alarm method according to claim 1, characterized in that: Obtaining disk utilization includes: Query the utilization of the OSD under the disk letter; If the disk drive letter corresponds to one OSD, the utilization rate of the OSD is the utilization rate of the disk; If the disk drive letter corresponds to multiple OSDs, the utilization rates of the OSDs are accumulated to obtain the utilization rate of the disk.
4. The disk detection and alarm method according to claim 1, characterized in that: The step of comparing the disk utilization with a threshold and constructing disk utilization alarm information according to the comparison result includes: If the utilization of the disk is higher than the threshold, an abnormal alarm message is generated; If the utilization of the disk is not higher than the threshold, a recovery alarm message is constructed.
5. The disk detection and alarm method according to claim 1, characterized in that: Also includes: Report the disk status alarm information and the disk utilization alarm information.
6. The disk detection and alarm method according to claim 5, characterized in that: The reporting of the disk status alarm information and the disk utilization alarm information includes: The disk status alarm information and the disk utilization alarm information are added to the alarm pool of the agent process, and the agent process uploads the disk status alarm information and the disk utilization alarm information that pass the consistency check to the master process.
7. A disk detection and alarm device for a distributed storage system, characterized in that: include: The disk information acquisition module is used to obtain the latest disk information and the disk information in the disk information cache file; A disk status detection module, configured to compare the latest disk information with the disk information in the disk information cache file, and construct disk status alarm information based on the comparison result; wherein, comparing the latest disk information with the disk information in the disk information cache file, and constructing disk status alarm information based on the comparison result includes: intersecting the slot information list in the latest disk information with the slot information list in the disk information cache file to obtain an in-place disk list; filtering the in-place disk information list from the slot information list in the disk information cache file to obtain an unplugged disk information list; if the unplugged disk information list is not empty, traversing the unplugged disk slot list to construct abnormal alarm information; if the unplugged disk information is empty, traversing the latest disk information list, and when the disk health status is abnormal, constructing abnormal alarm information, and when the disk health status is normal, constructing recovery alarm information; Disk utilization acquisition module, used to obtain disk utilization; The disk utilization detection module is used to compare the utilization of the disk with a threshold value and construct disk utilization alarm information according to the comparison result.
8. A disk detection and alarm device for a distributed storage system, characterized in that: include: memory for storing computer programs; A processor is configured to implement the steps of the disk detection and alarm method of the distributed storage system according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the disk detection and alarm method of the distributed storage system according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Disk utilization rate monitoring method, device and system and medium
CN111782480A
Disk alarm method and device
CN112084097A
Disk information query method, device and equipment, and medium
CN112684980A