Cluster oscillation optimization method and system
By detecting and migrating disk data using pre-fault diagnosis tools, the problem of cluster flapping caused by disk failures in distributed storage systems is solved, stability and performance are improved, and data loss is avoided.
Patent Information
- Application Number
- CN202410945125.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-01
AI Technical Summary
When a disk failure occurs in a distributed storage system, it causes cluster oscillation, affecting stability and performance. Existing technologies are difficult to effectively prevent and handle disk failures, leading to data loss or damage.
Use pre-fault diagnosis tools to detect target disk failures and migrate data to non-faulty disks by obtaining service identifiers to avoid data loss or damage and optimize cluster operating status.
By discovering potential hard disk problems and failures in advance, timely measures can be taken to avoid data loss or damage, improve the stability and performance of the cluster, and reduce the cost and time of manual intervention.
Smart Images

Figure CN118733320A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a cluster oscillation optimization method and system. Background Art
[0002] With the advent of the era of cloud computing and big data, distributed storage systems are gradually replacing traditional storage systems with excellent storage performance and low construction costs. Distributed storage systems generally store data in different nodes, and use redundancy strategies to ensure data security. When data errors occur, fault-tolerant mechanisms are used to restore failed data; and when data is updated, data is stored in different physical server nodes through redundancy strategies. There are multiple HDD disks and 1-2 NVMe solid-state disks on each physical server node. As the server running time increases, the disk read and write time increases, and the probability of disk failure also increases. However, disk failure is not achieved overnight. It usually starts with some bad sectors. If the number of bad sectors is not handled in time, it will continue to increase, causing the entire disk to be unavailable. Therefore, distributed storage systems generally replace the faulty disk in advance. However, if the bad sectors of the faulty disk are frequently accessed before replacement, the faulty disk service will frequently go up and down, causing the cluster to be in a state of data synchronization recovery. Therefore, how to better optimize cluster shock has become an urgent problem to be solved. Summary of the invention
[0003] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a cluster oscillation optimization method and system, which optimizes the operation state of the cluster and improves the stability and performance of the cluster.
[0004] The first aspect of the present invention proposes a cluster shock optimization method, including: S1, obtaining a target disk managed by distributed storage; S2, judging whether there is a fault in the target disk based on a pre-fault diagnosis tool, and in the event of a fault in the target disk, obtaining the service identifier of the target disk; S3, when it is determined that the service of the target disk can be stopped, migrating the data of the target disk to a non-faulty disk based on the service identifier.
[0005] Further, judging whether there is a fault in the target disk based on a pre-fault diagnosis tool includes: judging whether there is a bad sector in the target disk based on the pre-fault diagnosis tool; judging whether there is a fault in the target disk according to whether there is a bad sector in the target disk.
[0006] Further, judging whether there are bad sectors in the target disk based on a pre-fault diagnosis tool includes: determining, based on the pre-fault diagnosis tool, a reallocated sector count, a current number of mapped sectors or a current number of suspended sectors, the number of errors that failed to be successfully repaired after error correction, the number of errors that cannot be automatically recovered, and a timeout period of a specific command in the target disk; judging whether there are bad sectors in the target disk based on the reallocated sector count, the current number of mapped sectors or the current number of suspended sectors, the number of errors that failed to be successfully repaired after error correction, the number of errors that cannot be automatically recovered, the timeout period of the specific command, and a target threshold; wherein the target threshold includes a first threshold, a second threshold, a third threshold, a fourth threshold, and a fifth threshold, and when the reallocated sector count is greater than the first threshold, and / or the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, and / or the number of errors that failed to be successfully repaired after error correction is greater than the third threshold, and / or the number of errors that cannot be automatically recovered is greater than the fourth threshold, and / or the timeout period of the specific command is greater than the fifth threshold, it is determined that there are bad sectors in the target disk.
[0007] Further, when the target number of conditions are met, including the reallocated sector count being greater than the first threshold, the current number of mapped sectors or the current number of suspended sectors being greater than the second threshold, the number of errors that cannot be successfully repaired after error correction being greater than the third threshold, the number of errors that cannot be automatically recovered being greater than the fourth threshold, and the timeout period of the specific command being greater than the fifth threshold, it is determined that the target disk is faulty.
[0008] Further, obtaining the service identification of the target disk includes: receiving an identification query request; and obtaining the service identification of the target disk according to the identification query request.
[0009] Further, determining that the service of the target disk can be stopped includes: obtaining an associated disk of the target disk; determining whether the associated disk has a fault; and determining that the service of the target disk can be stopped if the associated disk has no fault.
[0010] Further, obtaining the associated disk of the target disk includes: according to the target data of the target disk, obtaining the disk having the target data among other disks in the distributed storage management; and taking the disk having the target data as the associated disk.
[0011] The second aspect of the present invention proposes a cluster shock optimization system, including: an acquisition module, used to acquire a target disk managed by distributed storage; a judgment module, used to determine whether there is a fault in the target disk based on a pre-fault diagnosis tool, and in the event of a fault in the target disk, obtain the service identifier of the target disk; a migration module, used to migrate the data of the target disk to a non-faulty disk based on the service identifier when it is determined that the service of the target disk can be stopped.
[0012] According to a third aspect of the present invention, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described in the first aspect of the present invention.
[0013] According to a fourth aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to the first aspect of the present invention.
[0014] The beneficial effects of the present invention are as follows:
[0015] The cluster shock optimization method and system of the present invention obtains the target disk managed by distributed storage; determines whether there is a fault in the target disk based on a pre-fault diagnosis tool, and obtains the service identifier of the target disk in the case of a fault in the target disk; and migrates the data of the target disk to a non-faulty disk based on the service identifier when it is determined that the service of the target disk can be stopped. The method detects the target disk using a pre-fault diagnosis tool, and can detect potential hard disk problems and faults in advance, so as to take timely measures to avoid data loss or damage; after the fault is discovered, the data can be migrated to a non-faulty disk in a timely manner, thereby optimizing the running state of the cluster and improving the stability and performance of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0017] Figure 1 is a flow chart of a cluster oscillation optimization method according to an embodiment of the present invention;
[0018] Figure 2is a flow chart of a cluster oscillation optimization method according to a specific embodiment of the present invention;
[0019] Figure 3 is a structural block diagram of a cluster oscillation optimization system according to an embodiment of the present invention;
[0020] Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0022] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0023] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0025] With the advent of the era of cloud computing and big data, distributed storage systems are gradually replacing traditional storage systems with excellent storage performance and low construction costs. Distributed storage systems generally store data in different nodes, and use redundancy strategies to ensure data security. When data errors occur, fault-tolerant mechanisms are used to restore invalid data; and when data is updated, data is stored in different physical server nodes through redundancy strategies. There are multiple HDD disks and 1-2 NVMe solid-state disks on each physical server node. As the server running time increases, the disk read and write time increases, and the probability of disk failure also increases. However, disk failure is not achieved overnight. It usually starts with some bad sectors. If the number of bad sectors is not handled in time, it will continue to increase, causing the entire disk to be unavailable. Distributed storage systems can generally replace disks that are about to fail in advance by monitoring the smart-related information of the disks. However, there are the following problems before replacing the failed disks: (1) When the upper-layer business reads and writes to a disk with bad sectors and accesses the bad sectors, the read and write time will be prolonged, resulting in a very high instantaneous delay of the business, thus affecting the business; (2) The distributed monitoring program will also temporarily mark the disk service osd with bad sectors as down. Since the disk only has a small number of bad sectors, it will not cause the osd service to be completely unavailable. After a period of time, the osd server will come up normally again. If the time from down to up is long, the cluster will redistribute data on different nodes for data security, resulting in cluster performance being affected; (3) When the read and write frequently access the bad sectors of the disk, the disk service osd will frequently go up and down, causing the cluster to be in a state of oscillation of data synchronization recovery.
[0026] To this end, the present invention proposes a cluster oscillation optimization method, system and related equipment. Specifically, the cluster oscillation optimization method, system and related equipment of the embodiments of the present invention are described below with reference to the accompanying drawings.
[0027] Figure 1 1 is a flow chart of a cluster oscillation optimization method according to an embodiment of the present invention. It should be noted that the cluster oscillation optimization method of the embodiment of the present invention can be applied to the cluster oscillation optimization system of the embodiment of the present invention. The cluster oscillation optimization system can be configured on an electronic device or in a server. This embodiment of the present application does not limit this.
[0028] like Figure 1 As shown in the figure, the optimization methods for cluster oscillation include:
[0029] S110, obtaining a target disk managed by distributed storage.
[0030] In an embodiment of the present invention, the cluster oscillation optimization method is applied in a cluster oscillation optimization system, and all disks managed by distributed storage (i.e., target disks) on the cluster oscillation optimization system nodes can be selected, and then the target disks managed by distributed storage can be obtained.
[0031] S120, judging whether there is a fault in the target disk based on the pre-fault diagnosis tool, and obtaining a service identifier of the target disk if there is a fault in the target disk.
[0032] Among them, the pre-failure diagnosis tool may be SMART. Among them, SMART can not only warn the user of potential hard disk problems in advance, but also help with data security management and storage device maintenance.
[0033] In an embodiment of the present invention, when a target disk is obtained, it is determined whether there are bad sectors in the target disk based on a pre-fault diagnosis tool; and it is determined whether there is a fault in the target disk based on whether there are bad sectors in the target disk. In the case of a fault in the target disk, a service identifier of the target disk is obtained. For specific implementation methods, reference may be made to subsequent embodiments.
[0034] S130: When it is determined that the service of the target disk can be stopped, migrate the data of the target disk to a non-faulty disk based on the service identifier.
[0035] In an embodiment of the present invention, whether the service of the target disk can be stopped can be determined based on whether the disk associated with the target disk is faulty, and if it is determined that the service of the target disk can be stopped, the data of the target disk can be migrated to a non-faulty disk based on the service identifier. That is, the service of the target disk is controlled based on the service identifier.
[0036] According to the cluster oscillation optimization method of the embodiment of the present invention, a target disk managed by distributed storage is obtained; based on a pre-fault diagnosis tool, it is determined whether there is a fault in the target disk, and in the case of a fault in the target disk, the service identifier of the target disk is obtained; when it is determined that the service of the target disk can be stopped, the data of the target disk is migrated to a non-faulty disk based on the service identifier. By using a pre-fault diagnosis tool to detect the target disk, the method can detect potential hard disk problems and faults in advance, so as to take timely measures to avoid data loss or damage; after the fault is discovered, the data can be migrated to a non-faulty disk in a timely manner, thereby optimizing the operation status of the cluster and improving the stability and performance of the cluster.
[0037] In order to make it easier for those skilled in the art to understand the present invention, Figure 2 is a cluster oscillation optimization method according to a specific embodiment of the present invention, such as Figure 2 As shown, the cluster oscillation optimization method includes:
[0038] S210, obtaining a target disk managed by distributed storage.
[0039] S220: Determine whether there are bad sectors in the target disk based on the pre-failure diagnosis tool.
[0040] In an embodiment of the present invention, based on a pre-fault diagnosis tool, the reallocated sector count, the current number of mapped sectors or the current number of suspended sectors, the number of errors that could not be successfully repaired after error correction, the number of errors that could not be automatically recovered, and the timeout period of a specific command in the target disk are determined; based on the reallocated sector count, the current number of mapped sectors or the current number of suspended sectors, the number of errors that could not be successfully repaired after error correction, the number of errors that could not be automatically recovered, the timeout period of a specific command and the target threshold, it is determined whether there are bad sectors in the target disk.
[0041] Among them, the reallocated sector count indicates the number of times the hard disk reallocated some sectors to spare sectors because it found some sectors to be faulty; the current number of mapped sectors or the current number of pending sectors indicates how many data blocks are currently in an unavailable state, waiting to be remapped or repaired; the number of errors that failed to be successfully repaired after error correction indicates the number of errors that failed to be successfully repaired after error correction was attempted in an offline state; the number of errors that cannot be automatically recovered indicates the number of errors detected by the hard disk but cannot be automatically repaired; the timeout time of a specific command refers to when the hard disk executes a specific command, if the operation is not completed within the specified time, it will be judged as a timeout, that is, the timeout time is determined.
[0042] Among them, the target threshold includes a first threshold, a second threshold, a third threshold, a fourth threshold and a fifth threshold. When the reallocated sector count is greater than the first threshold, and / or the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, and / or the number of errors that cannot be successfully repaired after error correction is greater than the third threshold, and / or the number of errors that cannot be automatically recovered is greater than the fourth threshold, and / or the timeout period of a specific command is greater than the fifth threshold, it is determined that there are bad sectors in the target disk.
[0043] S230, judging whether there is a fault in the target disk according to whether there is a bad sector in the target disk.
[0044] To ensure accurate detection, in an embodiment of the present invention, when the target number of conditions is met, including the reallocated sector count being greater than a first threshold, the current number of mapped sectors or the current number of suspended sectors being greater than a second threshold, the number of errors that cannot be successfully repaired after error correction being greater than a third threshold, the number of errors that cannot be automatically recovered being greater than a fourth threshold, and the timeout period of a specific command being greater than a fifth threshold, it is determined that the target disk is faulty.
[0045] For example, when two of the following conditions are met: the reallocated sector count is greater than the first threshold, the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, the number of errors that cannot be successfully repaired after error correction is greater than the third threshold, the number of errors that cannot be automatically recovered is greater than the fourth threshold, and the timeout period of a specific command is greater than the fifth threshold, it can be determined that the target disk is faulty.
[0046] S240: When a target disk fails, obtain a service identifier of the target disk.
[0047] In an embodiment of the present invention, when a target disk fails, an identification query request may be received; and a service identification of the target disk may be acquired according to the identification query request.
[0048] Among them, the service identifier is unique.
[0049] S250, determining whether the service of the target disk can be stopped.
[0050] In an embodiment of the present invention, the associated disks of the target disk may be determined, and whether the service of the target disk can be stopped may be determined based on whether the associated disks have failures.
[0051] According to the target data of the target disk, a disk having the target data among other disks in the distributed storage management is obtained; and the disk having the target data is used as an associated disk.
[0052] That is to say, the cluster oscillation optimization method uses a distributed cluster oscillation optimization system, which has a certain redundancy safety ratio. The redundancy of the cluster oscillation optimization system is set to three copies, that is, one piece of data must be written to three different disks to ensure data security. When judging whether the target disk service can be stopped, it depends on whether the services of other disks (i.e., associated disks) that form three copies with this disk also have faults. If other disk services are normal, the target disk service can be stopped. If other disk services are abnormal, the target disk service cannot be stopped.
[0053] S260: When it is determined that the service of the target disk can be stopped, migrate the data of the target disk to a non-faulty disk based on the service identifier.
[0054] In the embodiment of the present invention, when it is determined that the associated disk has a fault, it may be determined that the service of the target disk may be stopped.
[0055] S270: When it is determined that the service of the target disk cannot be stopped, the detection is terminated.
[0056] That is to say, if it is determined that the service of the target disk cannot be stopped, it means that the cluster is degraded at this time. The timing program will make a judgment and stop it next time, and this detection can be exited.
[0057] According to the cluster oscillation optimization method of the embodiment of the present invention, by using a pre-fault diagnosis tool to perform bad sector detection and fault judgment on the target disk, bad sectors and potential faults in the disk can be discovered in time, thereby improving the accuracy and efficiency of fault detection; when it is determined that the target disk has a fault, the data of the target disk is migrated to a non-faulty disk according to the service identifier, thereby avoiding data loss and damage and improving data reliability and security; by judging whether the associated disk has a fault to decide whether to stop the service of the target disk, the oscillation of the entire cluster caused by a single disk failure is avoided, thereby ensuring the stability and availability of the cluster; and the method can automatically handle disk failures, reduce the cost and time of manual intervention, improve operation and maintenance efficiency, and can be applied to distributed storage systems of different scales and configurations, with good flexibility and scalability.
[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0059] According to one aspect of an embodiment of the present invention, a cluster oscillation optimization system is also proposed. Figure 3 is a structural block diagram of a cluster oscillation optimization system according to an embodiment of the present invention; Figure 3 As shown, including:
[0060] An acquisition module 310 is used to acquire a target disk managed by distributed storage;
[0061] A determination module 320 is used to determine whether there is a fault in the target disk based on a pre-fault diagnosis tool, and to obtain a service identifier of the target disk if there is a fault in the target disk;
[0062] The migration module 330 is configured to migrate the data of the target disk to a non-faulty disk based on the service identifier when it is determined that the service of the target disk can be stopped.
[0063] According to an embodiment of the present invention, the cluster shock optimization system includes: obtaining a target disk managed by distributed storage; judging whether there is a fault in the target disk based on a pre-fault diagnosis tool, and obtaining the service identifier of the target disk in the case of a fault in the target disk; and migrating the data of the target disk to a non-faulty disk based on the service identifier when it is determined that the service of the target disk can be stopped. Thus, by using the pre-fault diagnosis tool to detect the target disk, potential hard disk problems and faults can be discovered in advance, so that timely measures can be taken to avoid data loss or damage; after the fault is discovered, the data can be migrated to a non-faulty disk in a timely manner, thereby optimizing the operation status of the cluster and improving the stability and performance of the cluster.
[0064] Optionally, the judgment module 320 is specifically configured to judge whether there are bad sectors in the target disk based on a pre-fault diagnosis tool; and judge whether there is a fault in the target disk according to whether there are bad sectors in the target disk.
[0065] Optionally, the judgment module 320 is specifically used to determine, based on a pre-fault diagnosis tool, a reallocated sector count, a current number of mapped sectors or a current number of suspended sectors, the number of errors that failed to be successfully repaired after error correction, the number of errors that cannot be automatically recovered, and a timeout period of a specific command in the target disk; and to determine whether there are bad sectors in the target disk according to the reallocated sector count, the current number of mapped sectors or the current number of suspended sectors, the number of errors that failed to be successfully repaired after error correction, the number of errors that cannot be automatically recovered, the timeout period of the specific command, and a target threshold; wherein the target threshold includes a first threshold, a second threshold, a third threshold, a fourth threshold, and a fifth threshold, and when the reallocated sector count is greater than the first threshold, and / or the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, and / or the number of errors that failed to be successfully repaired after error correction is greater than the third threshold, and / or the number of errors that cannot be automatically recovered is greater than the fourth threshold, and / or the timeout period of the specific command is greater than the fifth threshold, it is determined that there are bad sectors in the target disk.
[0066] Optionally, the judgment module 320 is specifically used to determine that the target disk is faulty when the target number of conditions are met: the reallocated sector count is greater than the first threshold, the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, the number of errors that cannot be successfully repaired after error correction is greater than the third threshold, the number of errors that cannot be automatically recovered is greater than the fourth threshold, and the timeout period of the specific command is greater than the fifth threshold.
[0067] Optionally, the judgment module 320 is specifically configured to receive an identification query request; and obtain the service identification of the target disk according to the identification query request.
[0068] Optionally, the migration module 330 is specifically configured to obtain an associated disk of the target disk; determine whether the associated disk has a fault; and if the associated disk has no fault, determine that the service of the target disk can be stopped.
[0069] Optionally, the migration module 330 is specifically configured to obtain, according to the target data of the target disk, a disk having the target data among other disks in the distributed storage management; and use the disk having the target data as an associated disk.
[0070] According to one aspect of an embodiment of the present invention, an electronic device is provided.
[0071] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 4 As shown, the electronic device may include one or more ( Figure 4 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the electronic device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only and does not limit the structure of the above terminal device. Figure 4 More or fewer components as shown, or with Figure 4 Equivalent functions or comparisons shown Figure 4 A different configuration with more features is shown.
[0072] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the cluster oscillation optimization method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0073] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the switching device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0074] The present invention provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a cluster oscillation optimization method.
[0075] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0076] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0077] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A cluster oscillation optimization method, characterized in that: include: S1, obtain the target disk managed by distributed storage; S2, judging whether there is a fault in the target disk based on a pre-fault diagnosis tool, and obtaining a service identifier of the target disk when the target disk fails; S3: When it is determined that the service of the target disk can be stopped, migrate the data of the target disk to a non-faulty disk based on the service identifier.
2. The cluster oscillation optimization method according to claim 1, characterized in that: Determining whether there is a fault in the target disk based on a pre-failure diagnosis tool includes: Determining whether there are bad sectors in the target disk based on a pre-fault diagnosis tool; Whether there is a fault in the target disk is determined according to whether there is a bad sector in the target disk.
3. The cluster oscillation optimization method according to claim 2, characterized in that: Determining whether there are bad sectors in the target disk based on a pre-failure diagnosis tool includes: Based on the pre-fault diagnosis tool, determining the reallocated sector count, the current number of mapped sectors or the current number of pending sectors in the target disk, the number of errors that could not be successfully repaired after error correction, the number of errors that could not be automatically recovered, and the timeout period of a specific command; According to the reallocated sector count, the current number of mapped sectors or the current number of suspended sectors, the number of errors that cannot be successfully repaired after error correction, the number of errors that cannot be automatically recovered, the timeout period of the specific command and the target threshold, it is determined whether there are bad sectors in the target disk; wherein the target threshold includes a first threshold, a second threshold, a third threshold, a fourth threshold and a fifth threshold, When the reallocated sector count is greater than the first threshold, and / or the current number of mapped sectors or the current number of suspended sectors is greater than the second threshold, and / or the number of errors that cannot be successfully repaired after error correction is greater than the third threshold, and / or the number of errors that cannot be automatically recovered is greater than the fourth threshold, and / or the timeout period of the specific command is greater than the fifth threshold, it is determined that bad sectors exist in the target disk.
4. The cluster oscillation optimization method according to claim 3, characterized in that: If the target number of conditions is met, including the reallocated sector count being greater than the first threshold, the current number of mapped sectors or the current number of suspended sectors being greater than the second threshold, the number of errors that cannot be successfully repaired after error correction being greater than the third threshold, the number of errors that cannot be automatically recovered being greater than the fourth threshold, and the timeout period of the specific command being greater than the fifth threshold, it is determined that the target disk is faulty.
5. The cluster oscillation optimization method according to claim 1, characterized in that: Obtaining the service identifier of the target disk includes: receiving an identification query request; The service identifier of the target disk is obtained according to the identifier query request.
6. The cluster oscillation optimization method according to claim 1, characterized in that: Determine if the target disk's services can be stopped, including: Obtaining the associated disk of the target disk; Determine whether the associated disk has a fault; In the case that the associated disk is not faulty, it is determined that the service of the target disk can be stopped.
7. The cluster oscillation optimization method according to claim 6, characterized in that: Obtaining the associated disk of the target disk includes: According to the target data of the target disk, obtaining a disk having the target data from other disks in the distributed storage management; The disk where the target data is stored is regarded as an associated disk.
8. A cluster oscillation optimization system, characterized in that: include: An acquisition module, used to acquire a target disk managed by distributed storage; A judgment module, used for judging whether there is a fault in the target disk based on a pre-fault diagnosis tool, and obtaining a service identifier of the target disk when the target disk fails; The migration module is used to migrate the data of the target disk to a non-faulty disk based on the service identifier when it is determined that the service of the target disk can be stopped.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.
