Method and apparatus for disk detection
By identifying the set of disks to be updated in a distributed storage system, selecting target disks, and performing information comparison and operational testing, the problem of data loss caused by hot-plugging errors of storage hardware in server clusters is solved, achieving efficient disk maintenance and data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2026-03-27
AI Technical Summary
When replacing storage hardware in a server cluster, hot-plug errors can lead to data corruption and loss. Existing technologies cannot effectively guarantee data security and stable storage services.
By identifying the set of disks to be updated in the distributed storage system, selecting the target disk, detecting and comparing disk information, updating disk maintenance information based on the comparison results, and performing operational checks, we can ensure the timely detection and handling of insertion and removal errors.
It improves the efficiency of disk maintenance, ensures data security, provides stable storage services, and reduces the risk of data loss and hardware overhead.
Smart Images

Figure CN114741242B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of data storage, and in particular to a disk detection method and device. BACKGROUND
[0002] With the development of Internet technology, server clusters can provide secure and reliable elastic computing services, and with the deepening of the digital process, it has become increasingly common to use server clusters to provide computing service support for user groups. In the prior art, in the maintenance process of the server cluster, in order to avoid wasting too much time in the change process, the hot plug technical means is often used for the change of storage hardware. However, when the hot plug of the storage hardware fails, the data stored in the storage hardware with plug error may be called, overwritten or deleted, causing data confusion and loss, etc. Problems, cannot provide stable storage services, and cannot guarantee data security, therefore, a disk detection method is needed to solve the above problems. SUMMARY
[0003] Therefore, the embodiments of the present specification provide a disk detection method. One or more embodiments of the present specification also relate to a disk detection device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects in the prior art.
[0004] According to a first aspect of the embodiments of the present specification, a disk detection method is provided, comprising:
[0005] determining a set of disks to be updated in a distributed storage system in response to a disk update instruction;
[0006] selecting a target disk in the set of disks to be updated, and determining disk information of the target disk;
[0007] in the case of detecting disk change information corresponding to the distributed storage system, comparing the disk change information with the disk information, and updating the disk maintenance information according to the comparison result;
[0008] performing running detection on the distributed storage system based on the disk change information, and performing data update on the disk maintenance information according to the running detection result.
[0009] According to a second aspect of the embodiments of the present specification, a disk detection device is provided, comprising:
[0010] a response module configured to determine a set of disks to be updated in a distributed storage system in response to a disk update instruction;
[0011] The selecting module is configured to select a target disk in the set of disks to be updated, and determine disk information of the target disk;
[0012] The comparing module is configured to, in a case where disk change information corresponding to the distributed storage system is detected, compare the disk change information with the disk information, and update disk maintenance information according to a comparison result;
[0013] The detecting module is configured to perform operation detection on the distributed storage system based on the disk change information, and update disk maintenance information according to an operation detection result.
[0014] According to a third aspect of an embodiment of the present specification, a computing device is provided, comprising:
[0015] a memory and a processor;
[0016] The memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions:
[0017] determine a set of disks to be updated in a distributed storage system in response to a disk update instruction;
[0018] select a target disk in the set of disks to be updated, and determine disk information of the target disk;
[0019] in a case where disk change information corresponding to the distributed storage system is detected, compare the disk change information with the disk information, and update disk maintenance information according to a comparison result;
[0020] perform operation detection on the distributed storage system based on the disk change information, and update disk maintenance information according to an operation detection result.
[0021] According to a fourth aspect of an embodiment of the present specification, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement steps of any one of the disk detection methods.
[0022] According to a fifth aspect of an embodiment of the present specification, a computer program is provided, and when the computer program is executed in a computer, the computer is caused to perform steps of the above-mentioned disk detection method.
[0023] One embodiment of the present specification realizes determining a set of disks that need to be updated according to the disk update instruction, selecting one disk in the set as a target disk, determining the disk information of the target disk, then comparing the disk change information corresponding to the distributed storage system with the disk information of the target disk when detecting the disk change information, updating the disk maintenance information according to the comparison result, then performing operation detection on the distributed storage system, and updating the disk maintenance information again according to the detection result. By this method, the disk replacement plug-in error can be found in time, the influence range caused by the plug-in error is reduced, the efficiency of hard disk maintenance is improved, prompt can be given quickly when the disk plug-in error occurs, stable storage service is provided, and the safety of data is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0024] Figure 1 is a flow chart of a disk detection method provided by one embodiment of the present specification;
[0025] Figure 2 is a fault sensing flow chart in a disk detection method provided by one embodiment of the present specification;
[0026] Figure 3 is a role confirmation flow chart in a disk detection method provided by one embodiment of the present specification;
[0027] Figure 4 is a processing process flow chart of a disk detection method provided by one embodiment of the present specification;
[0028] Figure 5 is an information interaction schematic diagram of a disk detection method provided by one embodiment of the present specification;
[0029] Figure 6 is a structural schematic diagram of a disk detection device provided by one embodiment of the present specification;
[0030] Figure 7 is a structural block diagram of a computing device provided by one embodiment of the present specification. DETAILED DESCRIPTION
[0031] In the following description, many specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced in many different ways from those described herein, and the skilled in the art can make similar substitutions without departing from the scope of the present specification, so the present specification is not limited to the specific implementation disclosed below.
[0032] The terminology used in this disclosure, one or more embodiments of the present specification, is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in this disclosure and the appended claims herein, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or," as used in this disclosure, refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0033] It will be understood that, although the terms first, second, etc. can be employed in this disclosure, one or more embodiments of the present specification, to describe various information, these information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information. For example, a first can also be referred to as a second, and similarly, a second can also be referred to as a first, without departing from the scope of one or more embodiments of the present specification. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining".
[0034] First, the noun terms related to one or more embodiments of the present specification are explained.
[0035] Hybrid cloud: refers to a hybrid computing, storage and service environment composed of internal infrastructure, private cloud services and public cloud, and each platform is arranged to run. The public cloud and the private cloud are mixed and matched to achieve good results. This personalized solution achieves the purpose of saving money and safety.
[0036] Hot plug: refers to the flexibility of computer expansion peripherals that allows users to plug in and remove devices without cutting off power and shutting down the system. In this scheme, hot plugging a disk refers to manually or mechanically plugging a disk from a server while the computer is running, and inserting another disk to complete the replacement process.
[0037] Distributed storage system: is to store data on multiple independent devices. Traditional network storage systems use centralized storage servers to store all data, and the storage server becomes the bottleneck of system performance and the focus of reliability and security, which cannot meet the needs of large-scale storage applications. Distributed network storage system uses scalable system structure, uses multiple storage servers to share storage load, and uses location server to locate storage information. It not only improves the reliability, availability and access efficiency of the system, but also is easy to expand.
[0038] In the specification, a disk detection method is provided, and the specification also relates to a disk detection device, a computing device, and a computer readable storage medium, which are described in the following embodiments one by one.
[0039] In actual application, in the process of replacing storage hardware in a server cluster, especially in the process of plugging and unplugging hard disks, if an error occurs in the process of unplugging a hard disk, a process error and data loss may occur in a user currently using the hard disk space; if an error occurs in the process of plugging a hard disk, since the first step of starting work of a distributed storage system is to format the hard disk, the data in the plugged hard disk will be emptied in this case, so that the recovery opportunity is completely lost. In this case, the most direct way is to back up all the stored data in the server cluster, so that the situation of data loss and irretrievability does not occur, but the hardware cost is unacceptable to most server cluster maintainers.
[0040] The disk detection method provided in the specification selects one disk as a target disk in a set of disks to be updated, ensures that only one disk is processed at a time when the disk is plugged and unplugged, and tolerates single disk damage or data loss due to the existence of multiple copies in the distributed storage system. This ensures that the data loss caused by the error in the process of plugging and unplugging the disk does not exceed the bearing range of the distributed storage system, and the data loss is irreversible. Moreover, the hardware cost of this method is much smaller than that of backing up all the data, which saves storage resources and reduces costs.
[0041] Figure 1 A flowchart of a disk detection method provided according to an embodiment of the specification is shown, and the method specifically includes the following steps.
[0042] Step S102: determining a set of disks to be updated in the distributed storage system in response to a disk update instruction.
[0043] The disk updating instruction can be understood as an instruction indicating the server to perform disk updating. It should be noted that the source of the disk updating instruction can be manually entered or automatically uploaded by the distributed storage system. The source of the disk updating instruction is determined by the actual use scenario, and the present embodiment does not limit. In the case of manually uploading the disk updating instruction, the user can use the corresponding interactive interface of the distributed storage system to enter the disk updating instruction when the user needs to replace the disk in the distributed storage system. The disk updating instruction contains the relevant information of the disk to be replaced. In addition, according to the case of automatically uploading the disk updating instruction by the distributed storage system, the distributed storage system detects its own running condition, and automatically uploads the disk updating instruction when the preset condition is met, such as finding a damaged disk, insufficient disk storage space, etc. The distributed storage system can be understood as the same as the distributed storage system, but mainly applied to the system of storing data function; the set of disks to be updated can be understood as a set composed of disks to be updated.
[0044] Based on this, the disks to be updated are determined in the distributed storage system through the indication of the disk updating instruction. These disks collectively form the set of disks to be updated. It should be noted that the acquisition of the disk updating instruction is divided into two different ways. Among them, the automatic uploading of the distributed storage system is based on the bad disk management function of the distributed storage system.
[0045] In order to ensure that the distributed storage system can perceive the occurrence of bad disks in the first time and copy the data on the bad disks to other normal disks, the bad disk management function has become one of the basic functions of the distributed storage system. In actual application scenarios, in order to ensure the security of data, the upper application will not directly write data into the disk, but upload it to the distributed storage system, and then write the data by the distributed storage system. Therefore, the distributed disk system can use most of the disks, which makes the distributed storage system can monitor the related state of the disk data writing and data deletion of the probe file. This way of detecting the state of the disk is a specific embodiment of the bad disk management function.
[0046] However, in actual application scenarios, since the bad disk management function of the distributed storage system detects the disk according to the writing and reading of the monitoring probe file on the disk, in this case, if there is a bad block in the disk, but the probe file does not write to this bad block position, which leads to the distributed storage system will not issue a disk updating instruction in this case. However, the relevant maintenance personnel will find that the write and delete duration of the disk with bad blocks is not normal during the maintenance process, and then deduce that the disk needs to be changed. Therefore, in addition to the automatic uploading of the disk updating instruction by the distributed storage system, the manually uploading of the disk updating instruction is also included.Figure 2 The fault awareness flowchart in one of the disk detection methods shown, wherein the handling method for the bad disk is shown in the case of the occurrence of a bad disk in the distributed storage system, and for the bad disk existing in the distributed storage system, both automatic reporting of the bad disk and manual entry of the bad disk are used, followed by detection of the bad disk, and the way to handle the bad disk problem is determined through the detection result.
[0047] Further, in the case where there is no relevant information indicating the disk to be updated, the distributed storage system cannot determine the set of disks to be updated. In order to determine the set of disks to be updated, in the embodiment, the specific implementation is as follows:
[0048] The disk update instruction uploaded to the distributed storage system is received; the disk update instruction is parsed to obtain at least one to-be-updated identifier; at least one to-be-updated disk is determined in the distributed storage system according to the at least one to-be-updated identifier, and a set of to-be-updated disks is constructed.
[0049] Wherein, the to-be-updated identifier can be understood as an identifier corresponding to the disk that needs to be updated, and the relevant disk can be determined through the to-be-updated identifier; the to-be-updated disk can be understood as the disk that needs to be updated in the distributed storage system. It should be noted that the situation that needs to be updated includes the situation of disk damage, insufficient storage space, etc. In this case, the disk needs to be pulled out, in addition, there are situations such as inserting a new disk into an empty slot, and the specific update content is determined by the actual use scene, which is not limited in this embodiment.
[0050] Based on this, the disk update instruction for instructing the distributed storage system to perform the disk update task is received, the disk update instruction is parsed to obtain the to-be-updated identifier carried therein, and the corresponding disk is searched in the distributed storage system according to the indication of the to-be-updated identifier. These searched disks are the to-be-processed disks, and all the searched disks are collected to obtain the set of to-be-updated disks.
[0051] For example, in the public cloud scenario, the relevant machine room will have professional personnel of the public cloud maintenance party stationed, and there is a perfect maintenance guarantee process, which can guarantee the correctness of the disk insertion and extraction in the disk maintenance process. In the private cloud and hybrid cloud scenarios, in order to meet the needs of different forms of customers, various different operation and maintenance forms are adopted, the system used for management of assets in the machine room and the level of maintenance personnel are uneven, and in the disk hot insertion and extraction process, disk insertion and extraction errors caused by various mistakes are likely to occur. Typical scenarios include pulling out the wrong disk from the wrong server, which may be called by the upper-layer application, resulting in data risk; and inserting the wrong disk into the server, resulting in deletion of the data of the related disk or data confusion affecting data security.
[0052] To solve the above problems, the mixed cloud receives a disk update instruction A uploaded by a distributed storage system, then parses A to obtain three to-be-updated identifiers, identifiers a1, a2, and a3, determines three disks C1, C2, and C3 that need to be updated in the distributed storage system according to the three identifiers, and constructs a to-be-updated disk set according to C1, C2, and C3.
[0053] In summary, the above method can quickly and accurately determine the disks that need to be updated, ensure that the disk update task in the distributed storage system is carried out in the first time, and avoid data security problems caused by processing delays.
[0054] Step S104: Select a target disk in the to-be-updated disk set and determine the disk information of the target disk.
[0055] Specifically, after determining the set of disks that need to be processed, a target disk needs to be selected from the set for processing.
[0056] The target disk can be understood as one of the disks that need to be processed at the current time, and the target disk information contains relevant information of the target disk before processing.
[0057] Based on this, one of the disks in the to-be-updated disk set is selected as the disk to be processed, and the relevant information of the selected disk is then determined. By processing only one disk in the to-be-updated disk set at a time, if an error occurs during disk processing, the error can be contained within this disk. Because the distributed storage system has a multi-copy feature, an error in a disk can be tolerated and remedied within the distributed storage system, effectively ensuring data security. In addition, after determining the target disk to be processed, the disk information of the target disk can be fed back to the device of the maintenance personnel of the distributed storage system. The maintenance personnel updates the target disk in the distributed storage system according to the information, and the update content includes removing the target disk from the distributed storage system and inserting the target disk into the distributed storage system.
[0058] Further, during the process of changing the target disk, the identifier and the position information corresponding to the target disk need to be obtained to ensure that the error cause can be determined according to the information in the case of processing error. In this embodiment, the specific implementation is as follows:
[0059] Determine the identifier information, slot information, and mounting point information of the target disk; and determine the disk information of the target disk according to the identifier information, slot information, and mounting point information.
[0060] The identification information can be understood as information recording the unique identification corresponding to the disk, such as the serial number, ID, etc. of the disk; the slot information can be understood as information storing the physical location of the disk on the server, such as the first row and the first column of the disk slot on the 14th server; and the mounting point information can be understood as the location information of data writing when the disk is used for data writing.
[0061] Therefore, the identification information uniquely corresponding to the target disk, the slot information indicating the location of the target disk, and the mounting point information corresponding to the data writing location are determined, and the disk information is obtained by combining the identification information, the slot information, and the mounting point information. It should be noted that in the case of updating the target disk, the slot information corresponds to the specific physical location of the target disk in the server of the distributed storage system at this time, and the slot information can further include a pull-out identifier indicating that the target disk needs to be pulled out. In the case of inserting the target disk, the slot information corresponds to the specific physical location of the target disk to be inserted into the server of the distributed storage system, and the slot information can further include an insertion identifier indicating that the target disk needs to be inserted. In addition, in the distributed storage system, if only a disk needs to be inserted into a certain empty slot, the identification information and the mounting point information corresponding to the target disk can be set in a preset form to indicate that the target disk is not limited in identification and mounting point.
[0062] In the above example, the disk C1 is determined as the target disk, and then the disk serial number b1 "12345" of C1 is obtained by using the lsblk-nodeps-no serial / dev / sda or hdparm command. The slot information b2 "14:0:0" of C1 is obtained by using the sudo lsscsi command, and the mounting point information b3 of C1 is determined. The disk information B of C1 is determined according to the obtained b1, b2, and b3.
[0063] In summary, by determining the unique identification, location, and mounting point of the target disk, the maintenance personnel can be better instructed to insert and pull out the target disk. The disk information can also be used as the record of the related information of the target disk, as the comparison evidence after maintenance and update, and to quickly determine whether the insertion and pulling out of the target disk is correct.
[0064] Step S106: In the case of detecting the disk change information corresponding to the distributed storage system, the disk change information is compared with the disk information, and the state of the disk maintenance information is updated according to the comparison result.
[0065] Specifically, after the disk information of the target disk is determined and the target disk is changed, the relevant information after the change needs to be obtained to determine the correctness of plugging the target disk during the change. It should be noted that after the disk information of the target disk is determined and the disk information is fed back to the maintenance node, the maintenance node needs to confirm the change of the target disk before the role deployed on the target disk confirms the change; because in the distributed storage system, the system cannot determine which upper-layer application is using a disk, at this time, all roles on the server need to call the interface of the distributed storage system to determine the plugging of the disk in the server, and in the case where the role does not confirm, it means that the role may still be using the disk in the server, and if the disk in the server is plugged at this time, it may cause the task of the role to be forced to interrupt and cause the problem of data loss. For example Figure 3 As shown in a role confirmation flowchart in a disk detection method, which shows the confirmation process of the role on the server, including starting the offline task; the user on the server confirms the task, wherein the task is sent to all users of the distributed storage system, and the user copies and migrates the data corresponding to the user according to the changed disk and data impact in the task to ensure that the data of the role is not affected in the case of disk change; then the disk is unloaded and the disk is silenced, the disk is silenced through the buffer time caused by the silence to ensure that the data on the disk is not used; finally, the work order of the disk to be changed is determined, which records the disk to be processed.
[0066] Among them, the disk change information can be understood as the information recorded when the disk in the distributed storage system changes; the disk maintenance information can be understood as indicating the relationship between the disk change in the distributed storage system and the expected change, which is used to record whether the disk plugging is correct in the disk maintenance work, and to indicate the subsequent processing of the maintenance personnel when the plugging is wrong.
[0067] Based on this, after the disk change information of the distributed storage system is detected, it means that the disk plugging action in the distributed storage system occurs. At this time, the disk change information is compared with the disk information of the target disk to determine whether the disk plugged is the target disk, and the disk maintenance information is updated based on the comparison result.
[0068] Further, according to the disk change information received after the disk change and the disk information of the target disk before the disk change, the two need to be compared to determine whether the disk change is correct, and in this embodiment, the specific implementation manner is as follows:
[0069] The disk change information is parsed to obtain change identification information, change slot information, and change mounting point information; and the change identification information, the change slot information, and the change mounting point information are compared with the identification information, the slot information, and the mounting point information, respectively.
[0070] The change identification information can be understood as information storing the unique corresponding identification of the changed disk in the distributed storage system. The change slot information can be understood as information storing the position of the changed disk. It should be noted that there are two forms of disk change, one is that a disk in the distributed storage system is pulled out, and the other is that a disk is inserted into the distributed storage system. In the first case, the change slot information can include a pull-out identifier and the position information of the pulled-out disk before being pulled out. In the second case, the change slot information can include an insertion identifier and the position information of the inserted disk after being inserted. The mounting point information can be understood as information recording the mounting point of the changed disk.
[0071] Based on this, the disk change information is parsed to obtain the unique corresponding identification of the changed disk in the distributed storage system, the corresponding position information, and the mounting point information of the written data. The unique corresponding identification of the changed disk is compared with the unique corresponding identification of the target disk. The slot information of the changed disk is compared with the slot information of the target disk. Whether the changed disk and the target disk are both inserted or both pulled out is compared. After determining the same, whether the position information is the same is compared. Finally, whether the mounting point of the changed disk and the mounting point of the target disk are the same is compared. It should be noted that when the identification information and the mounting point information of the target disk are in a predetermined specific form, the comparison of the identification information and the mounting point information between the changed disk and the target disk is ignored, or the comparison result of the two is directly regarded as the same.
[0072] In the above example, the disk change information D is parsed to obtain the change identification information d1, the change slot information d2, and the change mounting point information d3. c1 and d1, c2 and d2, and c3 and d3 are compared.
[0073] In summary, through this comparison method, it can be verified whether the changed disk in the distributed storage system is the target disk, and whether the change is made in the predetermined manner. Through such verification, it can be ensured that whether there is an error when the disk in the distributed storage system is changed can be known in the first time.
[0074] Further, after the disk change information is compared with the disk information of the target disk, different comparison results correspond to different disk change situations, and different disk change situations need to be processed in different ways. In this embodiment, the specific implementation manner is as follows:
[0075] determining whether the disk change information is same as the disk information; if yes, writing the disk change information into the disk maintenance information, and updating the disk maintenance information to a normal state according to the writing result; if no, determining disk abnormal information, writing the disk abnormal information into the disk maintenance information, and updating the disk maintenance information to an abnormal state according to the writing result.
[0076] The disk maintenance information can be understood as information recording a disk change result, and can indicate whether an error occurs during the insertion or removal process of the disk, and a specific error type when the error occurs, and is used to guide the maintenance personnel to perform targeted maintenance. The disk abnormal information can be understood as information obtained by comparing the disk change information with the disk information.
[0077] Based on this, after determining the disk change information and the disk information, if they are the same, it means that the target disk in the distributed storage system has been changed. In this case, the disk change information is written into the disk maintenance information, which is used to leave a record of the relevant change, and the state identifier in the disk maintenance information after writing is determined as a normal state. If they are different, it means that the target disk in the distributed storage system has not been changed, including that the changed disk is not the target disk, or the target disk is inserted or removed at different positions. In this case, the difference between the disk change information and the disk information is determined as abnormal information, and the abnormal information is written into the disk maintenance information, and the state identifier in the disk maintenance information after writing is determined as an abnormal state. It should be noted that the distinction between the normal state and the abnormal state can be to set different preset bytes at the corresponding byte positions of the disk maintenance information, for example, “1” for the normal state and “0” for the abnormal state, or to insert a preset byte at a preset position, such as inserting byte “000” for the normal state and not inserting byte for the abnormal state. As long as the normal state and the abnormal state can be distinguished, the specific distinction method is determined by the actual use scenario, and the embodiment is not limited.
[0078] Continuing with the above example, it is determined whether the disk information B and the disk change information D are the same. In the case of being the same, B or D is written into the disk maintenance information E, and E is updated to a normal state according to the writing result. In the case of being different, the difference between B and D is compared to determine abnormal information F, F is written into E, and E is updated to an abnormal state according to the writing result.
[0079] In summary, by comparing the disk information and the disk change information, the disk maintenance information is updated accordingly, which can realize different processing methods in different disk replacement scenarios and expand the application range of the disk detection method.
[0080] Further, in the disk detection process, the target disk needs to be run for detection, and the time consumed by the run detection is relatively long. The detection result of waiting for the run detection results in low detection efficiency. To solve this problem, in the embodiment, the implementation is as follows:
[0081] determine a target cluster corresponding to the target disk in the current detection period; determine a distinguished cluster different from the target cluster in the set of disks to be updated; select a target disk in the next detection period in the distinguished cluster, and perform the step of determining the disk information of the target disk.
[0082] The cluster is a group of independent computers interconnected through a high-speed network. The cluster constitutes a group and is managed in a single system mode, and the cluster is usually distributed in one or more machine rooms. The same processing event is basically not jointly undertaken by different clusters. Even if it is jointly undertaken, the data processing in different clusters will not affect each other.
[0083] Based on this, before the target disk is run for detection, the cluster corresponding to the target disk in the distributed network is determined. Then another disk different from the cluster in the set of disks to be updated is determined as a new target disk. Then the original target disk continues to perform the run detection, and the new target disk starts a new round of detection task.
[0084] In the above example, before C1 is run for detection, the cluster corresponding to C1 is determined. A cluster different from the cluster corresponding to C1 in B is selected. A new disk C2 in the different cluster is selected as a new target disk to start a new round of detection. It should be noted that the method of selecting the disk in the different cluster includes random selection, selection according to a preset disk slot number sequence, etc. The method of selecting the new target disk is determined by the actual application scenario, and the embodiment is not limited.
[0085] Step S108: performing run detection on the distributed storage system based on the disk change information, and updating the disk maintenance information according to the run detection result.
[0086] Specifically, after the disk maintenance information is determined, it is also necessary to judge the running state of the distributed storage system after the target disk is changed, so as to ensure that the change of the target disk will not cause the running error of the distributed network.
[0087] The run detection can be understood as the detection of the running process of the distributed storage system in the running state.
[0088] Based on this, after the target disk is changed, the distributed storage system is run, and then the running state of the distributed storage system is dynamically detected, and the disk maintenance information is updated according to the detection result.
[0089] There are two states for changing the disk in the distributed storage system, one is inserting the disk into the distributed storage system, and the other is pulling out the disk from the distributed storage system.
[0090] (1) In the insertion state, the inserted disk includes two cases, respectively, the disk stores data information and the disk does not store data information, and the detection methods of the two cases are different, and the specific implementation manner is as follows in the embodiment:
[0091] In the case that the disk change information is disk insertion information, the inserted disk is determined based on the disk insertion information; the storage data contained in the inserted disk is detected, and the disk usage information of the inserted disk is determined according to the detection result; the distributed storage system is abnormally detected according to the disk usage information, and abnormal detection information is obtained; and the disk maintenance information is updated according to the abnormal detection information.
[0092] Among them, the disk insertion information can be understood as the disk change information corresponding to the disk when the specific way of the disk change is insertion; the inserted disk can be understood as the disk inserted into the distributed storage system during the disk change process; the disk usage information can be understood as the usage of the inserted disk, which is divided into two cases: used and unused, and it should be noted that the disk usage information can include a special identifier to indicate whether the inserted disk is empty, or the memory of the inserted disk can be recorded. The storage space occupied by the disk usage information only needs to indicate whether the storage space in the inserted disk stores data, and the specific information type stored in the disk usage information is determined by the actual use scene, and the embodiment is not limited. The abnormal detection information can be understood as the information containing the abnormal detection result, and it should be noted that the abnormal detection is the detection of the running state of the distributed network after the disk is inserted, which is used to detect whether the distributed network will have an error when running after the disk is inserted, and to give a conclusion whether the insertion of the inserted disk is correct.
[0093] Based on this, when the disk change information is disk insertion information, it is explained that the changed disk performs disk insertion in the distributed storage system; then the disk inserted into the distributed storage system is determined through the disk insertion information, whether the inserted disk stores data is detected, and whether the inserted disk is a used disk before is determined in this way; then corresponding abnormal detection methods are used for detection according to the difference of the disk use information, and the disk maintenance information is updated according to the detection result.
[0094] In the above example, when B is disk insertion information, C1 corresponding to B is determined to be the inserted disk, whether data is stored in C1 is detected, disk use information H is obtained, corresponding detection of the distributed network is performed according to H, and disk maintenance information is updated according to abnormal detection information M obtained by detection.
[0095] In summary, whether the disk has been used is determined by whether the disk stores information, and corresponding detection methods are used according to the use of the disk, which can more targetedly determine whether the disk change process is correct, ensure that problems are found in time, and improve detection efficiency.
[0096] (2) In the pulled-out state, the disk is detected, and in the embodiment, the specific implementation manner is as follows:
[0097] In the case that the disk change information is disk pull-out information, the pulled-out disk corresponding to the disk pull-out information is determined; the distributed storage system without the pulled-out disk is detected in the running state, abnormal detection information is determined according to the running state detection result; and the disk maintenance information is updated according to the abnormal detection information.
[0098] Among them, the pulled-out disk can be understood as the disk pulled out from the distributed storage system when the disk change is performed in the distributed storage system.
[0099] Based on this, in the case that the disk change information is disk pull-out information, the disk corresponding to the disk pull-out information is determined to be the pulled-out disk, after the pulled-out disk is unloaded from the distributed storage system, the distributed storage system is run, and whether the disk in the system will appear error condition is detected in the running state of the distributed storage system, and in the case that the error condition appears, it is indicated that the disk pulled out from the distributed storage system has an impact on the running of the distributed storage system. In this case, abnormal detection information is determined according to the detection result in the running state of the distributed storage system, and the disk maintenance information is updated based on the abnormal detection information, and the maintenance personnel is instructed to perform maintenance work on the disk in the distributed storage system.
[0100] In the above example, in the case that C1 is pulled out, after C1 is pulled out from the distributed storage system, the distributed storage system is run, and whether an error occurs in the distributed storage system is checked. If no error occurs, it is determined that the exception detection information is empty. In the case that an error occurs, the error information is written into the exception detection information, and the exception detection information updates the disk maintenance information.
[0101] In summary, since the pulled-out disk has been separated from the distributed storage system, it cannot be directly detected, but whether the operation of the pulled-out disk is correct can be determined by whether other disks in the distributed storage system have problems after the distributed storage system is run.
[0102] Further, whether the inserted disk is used is determined. In the embodiment, the specific implementation manner is as follows:
[0103] The storage space of the inserted disk is detected, and whether the storage space includes stored data is determined. If not, the empty disk information is used as the disk usage information. If yes, the loaded disk information is used as the disk usage information.
[0104] The empty disk information can be understood as information recording that the storage space of the inserted disk does not store data. Correspondingly, the loaded disk information can be understood as information recording that the storage space of the inserted disk stores data. It should be noted that the loaded disk information can only have an exclusive identifier for recording whether the inserted disk stores data, or the loaded disk information can record the data amount stored in the inserted disk, or the data stored in the storage space of the inserted disk is recorded. It is only required that the inserted disk stores data can be determined through the loaded disk information, and the specific storage content is determined by the actual use scenario. The embodiment is not limited.
[0105] Based on this, the storage space of the inserted disk is detected. At this time, the storage space of the inserted disk can be checked through the mounting point of the inserted disk, or the use of the internal storage space recorded by the disk itself is called through a corresponding instruction. In the case that the inserted disk does not store data, the empty disk information recording this result is used as the disk usage information. Correspondingly, in the case that the inserted disk stores data, the loaded disk information recording this result is used as the disk usage information.
[0106] In the above example, the storage space of the disk C1 is detected, and whether the C1 stores data is determined. In the case that the C1 stores data, the loaded disk information G1 is used as the disk usage information H. Conversely, in the case that the C1 does not store data, the empty disk information G2 is used as the disk usage information H.
[0107] In summary, whether the disk stores data is determined by detecting the storage space of the disk, and it is further known whether the disk has been used. The subsequent detection task is further developed according to the use of the disk, and the detection is carried out in a targeted manner.
[0108] Further, for the case that the disk is not used, a corresponding mode needs to be selected for subsequent detection. In the embodiment, the specific implementation manner is as follows:
[0109] In the case that the disk usage information is empty disk information, the inserted disk is formatted; the running state of the distributed storage system containing the inserted disk after the formatting is detected, and the abnormal detection information is determined according to the detection result.
[0110] It should be noted that, if the used disk is completely cleared, the disk can be regarded as not being used when it is finally detected that no data is stored in the disk during the detection process. Especially in the case of disk change, if the disk does not include data, the disk will not have the risk of data loss.
[0111] Based on this, in the case that the disk usage information is empty disk information, the inserted disk is formatted, and then the running state of the distributed storage system is detected to determine whether an error disk appears in the distributed storage system in the running state, and the abnormal detection information is determined according to the detection result.
[0112] In the above example, in the case that H is G2, C1 is formatted, the distributed storage system is run, and then it is detected whether other disks in the distributed storage system appear in the ERROR state during the process. If yes, it indicates that C1 is inserted normally, and if no, it indicates that the insertion of C1 has a risk, and the information M is determined according to the detection result.
[0113] In summary, through the detection of the distributed storage system in the running state, it can be judged whether the insertion of the disk is correct and whether it affects the running of the distributed storage system in the case that the source of the inserted disk is the distributed storage system.
[0114] Further, for the case that the disk is not used, a corresponding mode needs to be selected for subsequent detection. In the embodiment, the specific implementation manner is as follows:
[0115] In the case that the disk usage information is empty disk information, the inserted disk is formatted; the running state of the distributed storage system containing the inserted disk after the formatting is detected, and the abnormal detection information is determined according to the detection result.
[0110] It should be noted that, if the used disk is completely cleared, the disk can be regarded as not being used when it is finally detected that no data is stored in the disk during the detection process. Especially in the case of disk change, if the disk does not include data, the disk will not have the risk of data loss.
[0111] Based on this, in the case that the disk usage information is empty disk information, the inserted disk is formatted, and then the running state of the distributed storage system is detected to determine whether an error disk appears in the distributed storage system in the running state, and the abnormal detection information is determined according to the detection result.
[0112] In the above example, in the case that H is G2, C1 is formatted, the distributed storage system is run, and then it is detected whether other disks in the distributed storage system appear in the ERROR state during the process. If yes, it indicates that C1 is inserted normally, and if no, it indicates that the insertion of C1 has a risk, and the information M is determined according to the detection result.
[0113] In summary, through the detection of the distributed storage system in the running state, it can be judged whether the insertion of the disk is correct and whether it affects the running of the distributed storage system in the case that the source of the inserted disk is the distributed storage system.
[0114] Further, for the case that the disk is not used, a corresponding mode needs to be selected for subsequent detection. In the embodiment, the specific implementation manner is as follows:
[0115] In the case that the disk usage information is empty disk information, the inserted disk is formatted; the running state of the distributed storage system containing the inserted disk after the formatting is detected, and the abnormal detection information is determined according to the detection result.
[0110] It should be noted that, if the used disk is completely cleared, the disk can be regarded as not being used when it is finally detected that no data is stored in the disk during the detection process. Especially in the case of disk change, if the disk does not include data, the disk will not have the risk of data loss.
[0111] Based on this, in the case that the disk usage information is empty disk information, the inserted disk is formatted, and then the running state of the distributed storage system is detected to determine whether an error disk appears in the distributed storage system in the running state, and the abnormal detection information is determined according to the detection result.
[0112] In the above example, in the case that H is G2, C1 is formatted, the distributed storage system is run, and then it is detected whether other disks in the distributed storage system appear in the ERROR state during the process. If yes, it indicates that C1 is inserted normally, and if no, it indicates that the insertion of C1 has a risk, and the information M is determined according to the detection result.
[0113] In summary, through the detection of the distributed storage system in the running state, it can be judged whether the insertion of the disk is correct and whether it affects the running of the distributed storage system in the case that the source of the inserted disk is the distributed storage system.
[0116] The silence time can be understood as a time in which the distributed storage system does not call the data in the disk.
[0117] Based on this, in the case that the disk usage information is the load disk information, the time when the data inserted into the disk is last called is queried to obtain the silence time, and then the silence time is compared with the preset time threshold, and the corresponding abnormal detection information is determined according to the comparison result.
[0118] In summary, by querying the silence time of the inserted disk, it is determined whether the data stored in the inserted disk still has use value. The disk in which the data without use value is often has a long silence time. Through such detection, it is ensured that the data inserted into the disk has no use value and will not be called by the user, so such disk will not be lost due to misplug, ensuring safety.
[0119] Further, after judging the size relationship between the silence time and the preset time threshold, corresponding tests need to be performed according to different situations. In the embodiment, the specific implementation manner is as follows:
[0120] It is judged whether the silence time is greater than the time threshold. If yes, the step of formatting the inserted disk is performed. If no, the abnormal detection information is generated according to the silence time.
[0121] In the case that the silence time is greater than the preset time threshold, it is indicated that the inserted disk has been "abandoned" for a long time, and the storage value of the data in the inserted disk is greatly reduced. In the case that the silence time is less than or equal to the preset time threshold, it is indicated that the data in the inserted disk is called by the distributed storage system not long ago, and the data in the inserted disk has a greater probability of being used again by the upper application. At this time, the data in the inserted disk cannot be deleted.
[0122] In the case that H is G1, the silence time t of C1 is queried, t is compared with the preset time threshold T, in the case that t>T, C1 is formatted, and then it is tested whether each disk in the running state of the distributed storage system will appear an error; in the case that t<=T, the abnormal storage information M is generated according to t.
[0123] In summary, different tests are performed after different comparison results of the silence time, and the disk change is tested in a targeted manner to ensure information security.
[0124] From the above content, it can be known that for the detection of the inserted disk, the following can also be performed:
[0125] The storage space of disk C1 is checked to determine whether data is stored in C1. If data is stored in C1, the loaded disk information G1 is used as the disk usage information H. Conversely, if no data is stored in C1, the unloaded disk information G2 is used as the disk usage information H.
[0126] When H is G2, C1 is formatted and the distributed storage system is run. Then, it is checked whether any other disks in the distributed storage system have encountered an ERROR state during this process. If so, it means that the insertion of C1 is normal; otherwise, it means that the insertion of C1 is risky. Based on the result of this check, information M is determined.
[0127] When H is G1, query the silent time t of C1, compare t with the preset time threshold T. If t > T, perform the formatting step on C1, and then check whether each disk in the distributed storage system in the running state will report an error; if t <= T, generate abnormal storage information M based on t at this time.
[0128] In summary, the above steps provide a more comprehensive assessment of whether the maintenance personnel made the correct changes to the inserted disks, thus providing users with a stable storage environment.
[0129] One embodiment of this specification implements a method to determine a set of disks that need to be updated based on disk update instructions, select one disk from the set as the target disk, determine the disk information of the target disk, and then, when disk change information corresponding to the distributed storage system is detected, compare the disk change information with the disk information of the target disk, update the disk maintenance information based on the comparison result, and then perform an operational test on the distributed storage system, updating the disk maintenance information again based on the test result. This method can promptly detect disk insertion / removal errors, reduce the impact of such errors, improve hard drive maintenance efficiency, quickly provide prompts when disk insertion / removal errors occur, provide stable storage services, and thus ensure data security.
[0130] The following is in conjunction with the appendix Figure 4 Taking the application of the disk testing method provided in this manual in computer room maintenance as an example, the disk testing method will be further explained. Figure 4 The present specification shows a flowchart of a disk detection method according to an embodiment, which includes the following steps.
[0131] Step S402: Receive the disk update command uploaded to the distributed storage system.
[0132] Specifically, the computing device of a certain research institution adopts the architecture of a distributed storage system. And based on the distributed storage system, a corresponding automated operation and maintenance system is built to monitor and maintain the distributed storage system. When it is necessary to update the disks in the corresponding machine room of the distributed storage system, the automated operation and maintenance system receives a disk update instruction.
[0133] Step S404: Analyze the disk update instruction to obtain at least one to-be-updated identifier.
[0134] Specifically, the parsed disk update instruction obtains the to-be-updated identifiers x1, x2, x3, and x4 carried in the disk update instruction.
[0135] Step S406: According to the at least one to-be-updated identifier, determine at least one to-be-updated disk in the distributed storage system, and construct a to-be-updated disk set.
[0136] Specifically, according to the identifiers x1, x2, x3, and x4, the corresponding to-be-updated disks X1, X2, X3, and X4 are determined, and a to-be-updated disk set is constructed based on the four disks.
[0137] Step S408: Select a target disk in the to-be-updated disk set.
[0138] Specifically, the automated operation and maintenance system selects X1 as the target disk.
[0139] Step S410: Determine the identifier information, slot information, and mounting point information of the target disk.
[0140] Specifically, the identifier information of X1 is determined to be "000", the slot information is "11:11:11-22:22:22", and the mounting point information. It should be noted that in addition to indicating that the target disk is inserted into the distributed storage system or pulled out from the distributed storage system, the slot information can also indicate that the target disk is pulled out from one position in the distributed storage system and inserted into another position. For example, the slot information indicates that the target disk is pulled out from the A slot "11:11:11" and inserted into the B slot "22:22:22" in the distributed storage network.
[0141] Step S412: Determine the disk information of the target disk according to the identifier information, the slot information, and the mounting point information.
[0142] Step S414: Analyze the disk change information to obtain change identifier information, change slot information, and change mounting point information.
[0143] Specifically, the identifier information, slot information, and mounting point information of X1 are displayed to the on-site personnel, and the on-site personnel performs insertion and extraction processing on the disks in the distributed network according to these information. For example,Figure 5 Fig. 1 is a schematic diagram of information interaction in a disk detection method.
[0144] After the on-site personnel inserts or removes the disk in the distributed storage system, the distributed storage system obtains disk change information corresponding to the inserted or removed disk, parses the disk change information, and obtains changed disk corresponding change identification information "000", change slot information "11:11:11", and change mounting point information. As shown in Figure 5 Fig. 2 is a schematic diagram of information interaction in a disk detection method.
[0145] Step S416: Comparing the change identification information with the identification information, the change slot information with the slot information, and the change mounting point information with the mounting point information respectively, and updating the disk maintenance information according to the comparison result.
[0146] Specifically, the change identification information is compared with the identification information, the change slot information is compared with the slot information, and the change mounting point information is compared with the mounting point information. The same result of the three comparisons is taken as one case, and the other result is taken as another case. The disk maintenance information is updated, and after the update, it is displayed whether the disk insertion or removal performed by the on-site personnel is the same as the insertion or removal of the specified target disk. That is, it is displayed whether the disk inserted or removed by the on-site personnel is the insertion or removal of the target disk, and whether the position of the insertion or removal is correct. As shown in Figure 5 Figs. 3 and 4 are schematic diagrams of information interaction in a disk detection method. Through the comparison between the change slot information and the slot information, it is realized that 3 confirms that the old disk is offline and a new disk is found, that is, through the change of the slot information, it is detected whether the disk is inserted or removed. Through the comparison between the change identification information and the identification information, it is realized that 4 queries whether the new disk already exists in the database, that is, through the identification information of the target disk, it is determined whether the disk is an existing disk.
[0147] Step S418: Detecting the storage space of the inserted disk, and judging whether the storage space includes stored data.
[0148] Specifically, after the disk maintenance information is updated, the result is that the on-site personnel removes X1 from position A and inserts it into position B, which is consistent with the disk information of the target disk. Then, the storage space of X1 is checked to determine whether data is stored in X1. If not, step S420 is performed; if yes, step S422 is performed.
[0149] Step S420: Taking the empty disk information as the disk usage information.
[0150] Step S422: Taking the loaded disk information as the disk usage information.
[0151] Step S424: formatting the inserted disk, and performing a running state detection on the distributed storage system containing the formatted inserted disk, and determining abnormal detection information according to the running detection result.
[0152] Specifically, in the case of the disk usage information being the empty disk information, X1 is formatted, as shown in 5 of the information interaction schematic diagram of the disk detection method. Then, it is detected whether an error occurs in the running distributed storage system, and the detection result is taken as the abnormal detection information. As shown in 6 and 7 of the information interaction schematic diagram of the disk detection method. Figure 5 It should be noted that the time required for detecting whether an error occurs in the running distributed storage system is relatively long. In this case, the next disk which is not in the same cluster as X1 can be detected at the same time as the running detection. Since the disks are not in the same cluster, the changes between the two disks will not affect each other, and the detection can be performed in parallel. Figure 5
[0153] Step S426: querying the quiet time of the inserted disk.
[0154] Specifically, in the case of the disk usage information being the loaded disk information, the quiet time of X1 is queried to be 15 hours.
[0155] Step S428: determining whether the quiet time is greater than the time threshold.
[0156] Specifically, it is determined whether the quiet time of X1 is greater than the preset time threshold. If yes, step S424 is performed; if no, step S430 is performed.
[0157] Step S430: generating the abnormal detection information according to the quiet time.
[0158] Specifically, if the quiet time 15h is less than the preset time threshold, it indicates that X1 is still in the active period and is frequently called by the distributed storage system. In this case, it also indicates that the upper program is still using X1 to perform related data processing. In this case, X1 is pulled out, which will affect the execution of the related processes of the upper program.
[0159] Step S432: performing data update on the disk maintenance information according to the abnormal detection information.
[0160] Specifically, based on the information contained in the abnormality detection information, the disk maintenance information is updated. After the disk recorded in the distributed storage system is changed, the influence on the running of the distributed storage system is recorded. If the influence of the disk change on the running of the distributed storage system reaches a preset degree, such as inserting a disk into a wrong slot, pulling out a disk that is not expected to be pulled out, etc., which can cause data security risks of the distributed storage system, these situations need to be reflected in the disk maintenance information, so that the maintenance personnel can maintain and remedy the error insertion and pulling of the disk.
[0161] One embodiment of the present specification realizes that according to the disk update instruction, the set of disks that need to be updated is determined, one disk in the set is selected as a target disk, the disk information of the target disk is determined, then in the case of detecting the disk change information corresponding to the distributed storage system, the disk change information is compared with the disk information of the target disk, the disk maintenance information is updated according to the comparison result, then the distributed storage system is detected, and the disk maintenance information is updated again according to the detection result. Through this method, the insertion and pulling error of disk replacement can be found in time, the influence range of the insertion and pulling error is reduced, the efficiency of hard disk maintenance is improved, prompt can be given quickly when the disk insertion and pulling error occurs, stable storage service is provided, and the safety of data is further ensured.
[0162] Corresponding to the above method embodiment, the present specification also provides a disk detection device embodiment, Figure 6 A structure schematic diagram of a disk detection device provided by one embodiment of the present specification is shown. As shown in the figure, Figure 6 The device comprises:
[0163] The response module 602 is configured to determine a set of disks to be updated in the distributed storage system in response to a disk update instruction;
[0164] The selection module 604 is configured to select a target disk in the set of disks to be updated, and determine the disk information of the target disk;
[0165] The comparison module 606 is configured to compare the disk change information with the disk information in the case of detecting the disk change information corresponding to the distributed storage system, and update the state of the disk maintenance information according to the comparison result;
[0166] The detection module 608 is configured to detect the running of the distributed storage system based on the disk change information, and update the data of the disk maintenance information according to the running detection result.
[0167] In one optional embodiment, the response module 602 is further configured to:
[0168] receiving the disk update instruction uploaded by the distributed storage system; parsing the disk update instruction to obtain at least one to-be-updated identifier; determining at least one to-be-updated disk in the distributed storage system according to the at least one to-be-updated identifier, and constructing a to-be-updated disk set.
[0169] In an optional embodiment, the selection module 604 is further configured to:
[0170] determining the identification information, the slot information, and the mounting point information of the target disk; and determining the disk information of the target disk according to the identification information, the slot information, and the mounting point information.
[0171] In an optional embodiment, the comparison module 606 is further configured to:
[0172] determining whether the disk change information is the same as the disk information; if yes, writing the disk change information into the disk maintenance information, and updating the disk maintenance information to a normal state according to a writing result; and if no, determining disk abnormal information, writing the disk abnormal information into the disk maintenance information, and updating the disk maintenance information to an abnormal state according to a writing result.
[0173] In an optional embodiment, the comparison module 606 is further configured to:
[0174] parsing the disk change information to obtain change identification information, change slot information, and change mounting point information; and comparing the change identification information with the identification information, the change slot information with the slot information, and the change mounting point information with the mounting point information, respectively.
[0175] In an optional embodiment, the detection module 608 is further configured to:
[0176] in a case where the disk change information is disk insertion information, determining an inserted disk based on the disk insertion information; detecting storage data contained in the inserted disk, and determining disk usage information of the inserted disk according to a detection result; performing abnormality detection on the distributed storage system according to the disk usage information to obtain abnormality detection information; and performing data update on the disk maintenance information according to the abnormality detection information.
[0177] In an optional embodiment, the detection module 608 is further configured to:
[0178] detecting a storage space of the inserted disk, and determining whether the storage space includes storage data; if no, taking empty-disk information as the disk usage information; and if yes, taking loaded-disk information as the disk usage information.
[0179] In an optional embodiment, the detection module 608 is further configured to:
[0180] In the case that the disk usage information is the idle disk information, performing a formatting process on the inserted disk; performing a running state detection on the distributed storage system containing the inserted disk after the formatting process, and determining the abnormal detection information according to the running detection result.
[0181] In an optional embodiment, the detection module 608 is further configured to:
[0182] In the case that the disk usage information is the loaded disk information, querying a silent time of the inserted disk; comparing the silent time with a preset time threshold, and determining the abnormal detection information according to the time comparison result.
[0183] In an optional embodiment, the detection module 608 is further configured to:
[0184] determining whether the silent time is greater than the time threshold; if yes, performing the step of performing a formatting process on the inserted disk; and if no, generating the abnormal detection information according to the silent time.
[0185] In an optional embodiment, the disk detection apparatus further comprises:
[0186] a cluster module configured to determine a target cluster corresponding to the target disk in a current detection period; determine a distinguished cluster different from the target cluster in the set of disks to be updated; select a target disk in a next detection period from the distinguished cluster, and perform the step of determining the disk information of the target disk.
[0187] The disk detection apparatus provided by one embodiment of the present specification can timely find a plugging error in disk replacement, reduce the impact range of the plugging error, improve the efficiency of hard disk maintenance, quickly provide a prompt in the case of disk plugging error, provide stable storage services, and further ensure the safety of data.
[0188] The above is a schematic scheme of the disk detection apparatus of the present embodiment. It should be noted that the technical scheme of the disk detection apparatus and the technical scheme of the disk detection method described above belong to the same concept, and the details of the technical scheme of the disk detection apparatus that are not described in detail can be referred to the description of the technical scheme of the disk detection method.
[0189] Figure 7A structural block diagram of a computing device 700 according to one embodiment of the present specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected with the memory 710 through a bus 730, and a database 750 is used to save data.
[0190] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include the public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like, either wired or wireless.
[0191] In one embodiment of the present specification, the above-mentioned components of the computing device 700 and other components not shown in the above-mentioned components can be connected with each other, for example, through a bus. It should be understood that, Figure 7 Figure 7 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Other components can be added or replaced as needed by those skilled in the art.
[0192] The computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. The computing device 700 can also be a mobile or stationary server.
[0193] The processor 720 is configured to execute computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned disk detection method.
[0194] The above is a schematic scheme of a computing device according to one embodiment of the present specification. It should be noted that the technical scheme of the computing device belongs to the same concept as the technical scheme of the above-mentioned disk detection method, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the above-mentioned disk detection method.
[0195] The embodiment of the present specification also provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions realize the steps of the disk detection method when executed by a processor.
[0196] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the disk detection method belong to the same concept, and the details of the technical scheme of the storage medium which are not described in detail can be referred to the description of the technical scheme of the disk detection method.
[0197] The embodiment of the present specification also provides a computer program, which causes a computer to execute the steps of the disk detection method when the computer program is executed in the computer.
[0198] The above is a schematic scheme of the computer program of the embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the disk detection method belong to the same concept, and the details of the technical scheme of the computer program which are not described in detail can be referred to the description of the technical scheme of the disk detection method.
[0199] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0200] The computer instructions include computer program code, which can be in the form of source code, object code, executable code, or some intermediate form. The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0201] It should be noted that, for the aforementioned method embodiments, the sequences of the described actions are not necessarily required to implement the present application, and certain actions can be performed in other sequences, or even at the same time, in accordance with the present application. Furthermore, certain actions can not be required to implement the present application. Additionally, the described embodiments are not necessarily the only possible implementation of the present application.
[0202] In the above embodiments, the description of each embodiment is focused on a certain aspect, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0203] The preferred embodiments of the present application disclosed above are only used to help explain the present application. Alternative embodiments do not describe all the details of the present application, and the present application is not limited to the specific embodiments described. Obviously, according to the content of the present application, many modifications and changes can be made. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and use the present application. The present application is limited by the claims and their full scope and equivalents.
Claims
1. A disk detection method, comprising: receiving a disk update instruction uploaded for a distributed storage system, parsing the disk update instruction, obtaining at least one to-be-updated identifier, determining at least one to-be-updated disk in the distributed storage system according to the at least one to-be-updated identifier, and constructing a to-be-updated disk set, wherein the to-be-updated disk set is a set of disks that need to be updated; determining identification information, slot information, and mounting point information of a target disk, and determining disk information of the target disk according to the identification information, the slot information, and the mounting point information; in a case where disk change information corresponding to the distributed storage system is detected, comparing the disk change information with the disk information, and updating disk maintenance information according to a comparison result, wherein a preset byte is arranged at a corresponding byte position of the disk maintenance information, and the preset byte is used to record a disk change result; in a case where the disk change information is disk insertion information, determining an inserted disk based on the disk insertion information, detecting storage data contained in the inserted disk, determining disk usage information of the inserted disk according to a detection result, performing abnormality detection on the distributed storage system according to the disk usage information, obtaining abnormality detection information, and performing data update on the disk maintenance information according to the abnormality detection information, wherein the abnormality detection information is used to determine whether insertion of the disk is correct.
2. The method of claim 1, wherein, The comparison of the disk change information with the disk information and the state update of the disk maintenance information according to a comparison result, comprises: determining whether the disk change information is same as the disk information; if yes, writing the disk change information into the disk maintenance information, and updating the disk maintenance information to a normal state according to a writing result; if no, determining disk abnormality information, writing the disk abnormality information into the disk maintenance information, and updating the disk maintenance information to an abnormal state according to a writing result.
3. The method of claim 2, wherein, The comparison of the disk change information with the disk information, comprises: parsing the disk change information to obtain change identification information, change slot information, and change mounting point information; respectively comparing the change identification information with the identification information, the change slot information with the slot information, and the change mounting point information with the mounting point information.
4. The method of claim 1, wherein, The detection of storage data contained in the inserted disk and the determination of disk usage information of the inserted disk according to a detection result, comprises: detecting a storage space of the inserted disk, and determining whether the storage space includes storage data; if no, taking empty-disk information as the disk usage information; if yes, taking loaded-disk information as the disk usage information.
5. The method of claim 1, wherein, The abnormality detection on the distributed storage system according to the disk usage information and the obtaining of abnormality detection information, comprises: in a case where the disk usage information is empty-disk information, performing format processing on the inserted disk; The running state of the distributed storage system containing the inserted disk after formatting processing is detected, and abnormal detection information is determined according to the running state detection result.
6. The method of claim 1, wherein, The abnormal detection of the distributed storage system according to the disk usage information includes: In the case that the disk usage information is the load disk information, the silent time of the inserted disk is queried; The silent time is compared with a preset time threshold, and abnormal detection information is determined according to the time comparison result.
7. The method of claim 6, wherein, The abnormal detection information is determined according to the time comparison result, including: It is judged whether the silent time is greater than the time threshold; If yes, the step of performing formatting processing on the inserted disk is executed; If no, the abnormal detection information is generated according to the silent time.
8. The method of claim 1, wherein, After the state of the disk maintenance information is updated according to the comparison result, it further includes: A target cluster corresponding to the target disk in the current detection period is determined; A different distinguished cluster is determined in the set of disks to be updated; In the distinguished cluster, the target disk in the next detection period is selected, and the step of determining the disk information of the target disk is executed. 9.A disk detection apparatus, comprising: a response module configured to receive a disk update instruction uploaded to a distributed storage system, parse the disk update instruction, obtain at least one to-be-updated identifier, determine at least one to-be-updated disk in the distributed storage system according to the at least one to-be-updated identifier, and construct a set of to-be-updated disks, wherein the set of to-be-updated disks is a set of disks that need to be updated; a selection module configured to determine identifier information, slot information, and mounting point information of a target disk, and determine disk information of the target disk according to the identifier information, the slot information, and the mounting point information; a comparison module configured to compare disk change information corresponding to the distributed storage system with the disk information when the disk change information is detected, and update the state of disk maintenance information according to a comparison result, wherein a preset byte is arranged at a corresponding byte position of the disk maintenance information, and the preset byte is used to record a disk change result; a detection module configured to determine an inserted disk based on disk insertion information when the disk change information is the disk insertion information, detect storage data contained in the inserted disk, determine disk usage information of the inserted disk according to a detection result, perform abnormal detection of the distributed storage system according to the disk usage information, obtain abnormal detection information, and perform data update on the disk maintenance information according to the abnormal detection information, wherein the abnormal detection information is used to judge whether the insertion of the disk is correct. 10.A computing device, comprising: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions, which, when executed by the processor, implement the steps of the disk detection method in any one of claims 1 to 8.
11. A computer readable storage medium storing computer executable instructions which, when executed by a processor, implement the steps of the method of claim 1 to 8.
Citation Information
Patent Citations
Disk management method of distributed file system
CN105278882A
Intelligent replacement method and system based on RAID fault member disks
CN111857573A