CN105138280A - Data write-in method, apparatus and system - Google Patents

Data write-in method, apparatus and system Download PDF

Info

Publication number
CN105138280A
CN105138280A CN201510468140.6A CN201510468140A CN105138280A CN 105138280 A CN105138280 A CN 105138280A CN 201510468140 A CN201510468140 A CN 201510468140A CN 105138280 A CN105138280 A CN 105138280A
Authority
CN
China
Prior art keywords
hard disk
line
data
server node
storage system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510468140.6A
Other languages
Chinese (zh)
Other versions
CN105138280B (en
Inventor
魏杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Huawei Technology Co Ltd
Original Assignee
Chengdu Huawei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Huawei Technology Co Ltd filed Critical Chengdu Huawei Technology Co Ltd
Priority to CN201510468140.6A priority Critical patent/CN105138280B/en
Publication of CN105138280A publication Critical patent/CN105138280A/en
Application granted granted Critical
Publication of CN105138280B publication Critical patent/CN105138280B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Embodiments of the present invention provide a data write-in method, apparatus and system. The data write-in method comprises: detecting whether a first hard disk of a storage system is in an offline state; if it is detected that the first hard disk is in the offline state, determining a hard disk in a normal state in the storage system as a second hard disk; writing data that is to be written into the first hard disk when the first hard disk is offline into the second hard disk, wherein that the first hard disk is in the offline state refers to that the first hard disk is in a state between the normal state and a faulty state. According to the data write-in method, apparatus and system provided by the embodiments of the present invention, when the first hard disk is offline, the data when the first hard disk is offline can still be completely written into the storage system, thereby ensuring that when the first hard disk is offline, the data written into the storage system is complete and reliable.

Description

Method for writing data, Apparatus and system
Technical field
The embodiment of the present invention relates to technical field of data storage, particularly relates to a kind of method for writing data, Apparatus and system.
Background technology
Along with the development of science and technology and the widespread use of internet, increasing data are stored in the hard disk in storage system service device node, in the process of data stored in storage system, hard disk is transferred to or server node breaks down, and can reduce the reliability that storage system carries out data storage.
When hard disk is transferred to, owing to cannot determine that hard disk of short durationly extracts or forever extract, hard disk can be made to be in off-line state; Or when server node breaks down, owing to cannot determine that server node is of short duration fault or permanent fault, all hard disks on server also can be made to be in off-line state.But, when hard disk is in off-line state, can not to the hard disk write data of off-line, make the data in write storage system imperfect, reliability reduces.
Therefore, the raising required data storing reliability along with client, becomes day by day urgent demand to the reliability of storage system write data when guaranteeing hard disk off-line.
Summary of the invention
The embodiment of the present invention provides a kind of method for writing data, Apparatus and system, can when the first hard disk off-line, by in the data after the first hard disk off-line still complete write storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
The method for writing data that embodiment of the present invention first aspect provides, comprising:
Whether the first hard disk detected in storage system is in off-line state;
If detect, described first hard disk is in off-line state, then determine one in the described storage system hard disk being in normal condition, as the second hard disk;
The data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
In conjunction with first aspect, in the first possible implementation of first aspect, described by described first hard disk off-line after should write described first hard disk data be written to described second hard disk before, also comprise:
Judge that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk;
Described the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk, comprise:
If the logic groups of described second hard disk is identical with the logic groups of described first hard disk, then the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
If the logic groups of described second hard disk is not identical with the logic groups of described first hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
In conjunction with first aspect and the first possible implementation of first aspect, in the implementation that first aspect the second is possible, described method also comprises:
In Preset Time, whether normal condition is recovered after detecting described first hard disk off-line;
If recover normal condition after described first hard disk off-line being detected in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk;
Otherwise, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct be written to described second hard disk.
In conjunction with the implementation that first aspect the second is possible, in the third possible implementation of first aspect, the data on described first hard disk of described reconstruct, comprising:
The raw data on described first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of described first hard disk.
The implementation possible in conjunction with first aspect the second and the third possible implementation of first aspect, in first aspect the 4th kind of possible implementation, whether the first hard disk in described detection storage system is in off-line state, comprising:
Whether described first hard disk detected in storage system is extracted from storage system;
If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
In conjunction with first aspect the 4th kind of possible implementation, in first aspect the 5th kind of possible implementation, in Preset Time, whether recover normal condition after the described first hard disk off-line of described detection, comprising:
In Preset Time, whether storage system is turned back to after detecting described first hard disk off-line;
If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line;
Otherwise, determine that described first hard disk breaks down.
The implementation possible in conjunction with first aspect the second and the third possible implementation of first aspect, in first aspect the 6th kind of possible implementation, whether the first hard disk in described detection storage system is in off-line state, comprising:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state.
In conjunction with first aspect the 6th kind of possible implementation, in first aspect the 7th kind of possible implementation, whether the server node at the described first hard disk place of described detection breaks down, and comprising:
Whether the server node detecting described first hard disk place sends heartbeat detection Frame;
If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then determine that the server node heartbeat at described first hard disk place is lost, the server node at described first hard disk place breaks down.
In conjunction with first aspect the 7th kind of possible implementation, in first aspect the 8th kind of possible implementation, in Preset Time, whether recover normal condition after the described first hard disk off-line of described detection, comprising:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
Embodiment of the present invention second aspect provides a kind of data transfer apparatus, comprising:
Whether detection module, be in off-line state for the first hard disk detected in storage system;
Determination module, if detect that described first hard disk is in off-line state for described detection module, then determines the hard disk of a normal condition in described storage system, as the second hard disk;
Writing module, for being written to described second hard disk by the data that should write described first hard disk after described first hard disk off-line;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
In conjunction with second aspect, in the first possible implementation of second aspect, also comprise:
Judge module, for judging that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk;
The data that should write described first hard disk after described first hard disk off-line if judge that the logic groups of described second hard disk is identical with the logic groups of described first hard disk specifically for described judge module, are then written to described second hard disk by said write module; If it is not identical with the logic groups of described first hard disk that described judge module judges the logic groups of described second hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
In conjunction with second aspect and the first possible implementation of second aspect, in the implementation that second aspect the second is possible, whether described detection module, also recover normal condition after detecting described first hard disk off-line in Preset Time;
Said write module, if recover normal condition after also described first hard disk off-line being detected for described detection module in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk; If described detection module does not recover normal condition after described first hard disk off-line being detected in Preset Time, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct are written to described second hard disk.
In conjunction with the implementation that second aspect the second is possible, in the third possible implementation of second aspect, said write module specifically for: adopt reconstruct data algorithm to calculate raw data on described first hard disk according to the Backup Data of described first hard disk.
The implementation possible in conjunction with second aspect the second and the third possible implementation of second aspect, in second aspect the 4th kind of possible implementation, described detection module specifically for: whether described first hard disk detected in storage system is extracted from storage system; If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
In conjunction with second aspect the 4th kind of possible implementation, in second aspect the 5th kind of possible implementation, described detection module specifically for: in Preset Time, whether turn back to storage system after detecting described first hard disk off-line; If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line; Otherwise, determine that described first hard disk breaks down.
The implementation possible in conjunction with second aspect the second and the third possible implementation of second aspect, in second aspect the 6th kind of possible implementation, described detection module specifically for:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state;
Wherein, whether described detection module, send heartbeat detection Frame specifically for the server node detecting described first hard disk place; If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then the server node heartbeat at described first hard disk place is lost, and determines that the server node at described first hard disk place breaks down.
In conjunction with second aspect the 6th kind of possible implementation, in second aspect the 7th kind of possible implementation, described detection module specifically for:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
The storage system that the embodiment of the present invention third aspect provides, comprising: master controller and at least one server node;
Server node described in each comprises at least one hard disk;
Whether described master controller, be in off-line state for the first hard disk detected in described storage system, and described first hard disk is the arbitrary hard disk in described storage system; If detect, described first hard disk is in off-line state, then determine the hard disk of a normal condition in described storage system, as the second hard disk; The data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
In conjunction with the third aspect, in the first possible implementation of the third aspect, the data of described master controller also for writing described first hard disk after by described first hard disk off-line judge that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk before being written to described second hard disk; If the logic groups of described second hard disk is identical with the logic groups of described first hard disk, then the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk; If judge, the logic groups of described second hard disk is not identical with the logic groups of described first hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
In conjunction with the third aspect and the first possible implementation of the third aspect, in the implementation that third aspect the second is possible, described master controller also for:
In Preset Time, whether normal condition is recovered after detecting described first hard disk off-line;
If recover normal condition after described first hard disk off-line being detected in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk;
Otherwise, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct be written to described second hard disk.
In conjunction with the implementation that third aspect the second is possible, in the third possible implementation of the third aspect, described master controller specifically for::
The raw data on described first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of described first hard disk.
The implementation possible in conjunction with third aspect the second and the third possible implementation of the third aspect, in the third aspect the 4th kind of possible implementation, described master controller specifically for:
Whether described first hard disk detected in storage system is extracted from storage system;
If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
In conjunction with the third aspect the 4th kind of possible implementation, in the third aspect the 5th kind of possible implementation, described master controller specifically for:
In Preset Time, whether storage system is turned back to after detecting described first hard disk off-line;
If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line;
Otherwise, determine that described first hard disk breaks down.
The implementation possible in conjunction with third aspect the second and the third possible implementation of the third aspect, in the third aspect the 6th kind of possible implementation, described master controller specifically for:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state;
Wherein, whether the server node at the described first hard disk place of described detection breaks down, and comprising:
Whether the server node detecting described first hard disk place sends heartbeat detection Frame;
If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then determine that the server node heartbeat at described first hard disk place is lost, the server node at described first hard disk place breaks down.
In conjunction with the third aspect the 6th kind of possible implementation, in the third aspect the 7th kind of possible implementation, described master controller specifically for:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
The method for writing data that the embodiment of the present invention provides, Apparatus and system, whether off-line state is in by the first hard disk detected in storage system, if detect, the first hard disk is in off-line state, then determine one in the storage system hard disk being in normal condition, as the second hard disk, the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk, when making the first hard disk off-line, data still can write in storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is memory system architecture schematic diagram;
The method for writing data process flow diagram that Fig. 2 provides for the embodiment of the present invention one;
The method for writing data process flow diagram that Fig. 3 provides for the embodiment of the present invention two;
The method for writing data process flow diagram that Fig. 4 provides for the embodiment of the present invention three;
The method for writing data process flow diagram that Fig. 5 provides for the embodiment of the present invention four;
Fig. 6 A is the of short duration data handling procedure schematic diagram extracted of hard disk;
Fig. 6 B is the data handling procedure schematic diagram that hard disk is forever extracted;
Method for writing data interaction diagrams during the hard disk dial-out that Fig. 7 provides for the embodiment of the present invention;
The method for writing data process flow diagram that Fig. 8 provides for the embodiment of the present invention five;
Fig. 9 A is the data handling procedure schematic diagram of the of short duration fault of server node;
Fig. 9 B is the data handling procedure schematic diagram of server node permanent fault;
Method for writing data interaction diagrams during the server node fault that Figure 10 provides for the embodiment of the present invention;
The data transfer apparatus schematic diagram that Figure 11 provides for the embodiment of the present invention one;
The data transfer apparatus schematic diagram that Figure 12 provides for the embodiment of the present invention two.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is memory system architecture schematic diagram.As shown in Figure 1, 3 server nodes are had in storage system, each server node there is multiple hard disk, each server node is provided with network interface card, master controller (CentralProcessingUnit, be called for short CPU), internal memory and Serial Attached SCSI (SAS) interface card (SerialAttachedSCSI, be called for short SAS card), hard disk is articulated in Serial Attached SCSI (SAS) interface card (SerialAttachedSCSI, be called for short SAS card) under, when user needs data to write in storage system, after in computer internet system, switch (switch) receives packet, address translation table in storage system service device node memory can be searched to determine object physical address (MediaAccessControl, be called for short MAC Address) network interface card be articulated in which port of switch, and by data packets to destination interface, and then the hard disk be sent in destination server node.It should be noted that to have a server node in storage system at least, when server node only has one, now this server node is server host node, and master controller is on this server node.When server node has multiple, using the server node of in multiple server node as server host node, now, master controller on server host node, also can be able to be distributed on multiple server node.Meanwhile, the schematic diagram of memory system architecture shown in Fig. 1 is a kind of structural representation of storage system, and storage system also can adopt other structure, and the present invention does not carry out limiting and repeating at this.
But, when the one or more hard disks in storage system are transferred to, owing to cannot determine that hard disk of short durationly extracts or forever extract, hard disk in storage system can be made to be in off-line state; Or when server node one or more in storage system breaks down, owing to cannot determine that server node is of short duration fault or permanent fault, all hard disks on server also to be made in storage system to be in off-line state.Due to when hard disk is in off-line state, can not to the hard disk write data of off-line, cause the data in write storage system imperfect, reliability reduces.
Technical matters to be solved by this invention how to avoid when hard disk is in off-line state, can not to the hard disk write data of off-line, and make the data in write storage system imperfect, reliability reduces.
Main thought of the present invention whether is in off-line state by the first hard disk detected in storage system, if detect, described first hard disk is in off-line state, then determine one in the described storage system hard disk being in normal condition, as the second hard disk, the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk, when the first hard disk off-line, by in the data after the first hard disk off-line still complete write storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
The method for writing data process flow diagram that Fig. 2 provides for the embodiment of the present invention one.As shown in Figure 2, the method that the present embodiment provides comprises:
S201: whether the first hard disk detected in storage system is in off-line state.
Concrete, whether the first hard disk that the master controller in storage system detects in storage system is in off-line state.Wherein, on master controller distribution multiple server nodes within the storage system, also can be distributed on the host node of server.Each server node comprises at least one hard disk, and the hard disk under each server node can report oneself state to primary controller when normal condition, if master controller detects that hard disk has reported data, then this hard disk is in normal condition.If master controller can't detect the data that hard disk reports, then hard disk is in off-line state.Hard disk is in off-line state two kinds of situations: one is that hard disk is transferred to, and makes hard disk be in off-line state; A kind of is that the server node at hard disk place breaks down, and makes all hard disks on server node be in off-line state.
It should be noted that, master controller in storage system the first hard disk detected in storage system whether be in off-line state be one can continuous print, repetition testing process.If after recovering normal condition after the first hard disk off-line in Preset Time, master controller can also continue to detect the first hard disk after recovering normal condition and whether be in off-line state.If after master controller the first hard disk detected in storage system is in off-line state, can also continue to detect in storage system that other needs the hard disk detected whether to be in off-line state, so be cycled to repeat down.Meanwhile, whether master controller only can be in off-line state by the hard disk detected in storage system, and whether multiple hard disks that also can detect in storage system are in off-line state, and the embodiment of the present invention does not carry out limiting and repeating at this.
Further, it should be noted that, the executive agent in the embodiment of the present invention is all the master controllers in storage system, repeats no more below.First hard disk refers in storage system the hard disk needing to detect, and can be referred to as hard disk to be detected, the present embodiment does not carry out limiting and repeating at this yet.
S202: the first hard disk is in off-line state if detect, then determine one in the storage system hard disk being in normal condition, as the second hard disk.
Concrete, the second hard disk and the first hard disk can at same server nodes, also can at different server node.The present embodiment does not carry out limiting and repeating at this.
It should be noted that, the second hard disk refers in storage system the hard disk being in normal condition, also can be referred to as normal hard disk, and the present embodiment does not carry out limiting and repeating at this.
S203: the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
Wherein, the first hard disk is in off-line state and refers to the first hard disk and be in state between normal condition and malfunction.
Concrete, when after the first hard disk off-line, the data that master controller should write the first hard disk write the second hard disk being in normal condition, when making the first hard disk off-line, data still can write in storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
The method for writing data that the embodiment of the present invention provides, whether off-line state is in by the first hard disk detected in storage system, if detect, the first hard disk is in off-line state, then determine one in the storage system hard disk being in normal condition, as the second hard disk, the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk, when making the first hard disk off-line, data still can write in storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
The method for writing data process flow diagram that Fig. 3 provides for the embodiment of the present invention two.As shown in Figure 3, the method that the present embodiment provides comprises:
S301: whether the first hard disk detected in storage system is in off-line state.
Concrete, the executive agent of the embodiment of the present invention is all the master controllers in storage system, repeats no more below.
It should be noted that; in storage system, write data has a kind of mode to be the mode write of demoting; the mode write of demoting mainly passes through the hard disk in storage system to be divided into multiple logic groups according to redundancy protecting (some parts of raw data and some parts of Backup Datas); logically be grouped into granularity by needing the data stored and write a group hard disc, each logic groups covers a certain number of hard disk.Also namely, when the mode adopting degradation to write writes data in storage system, each hard disk all belongs to a logic groups.
S302: the first hard disk is in off-line state if detect, then determine one in the storage system hard disk being in normal condition, as the second hard disk.
Concrete, the second hard disk can be identical with the logic groups of the first hard disk, also can not be identical, and the embodiment of the present invention does not limit at this.
It should be noted that, usually, the second hard disk and the first hard disk be not in same logic groups.Second hard disk and the first hard disk, not in same logic groups, make that a hard disk only has portion in the data of same logic groups, and when guaranteeing this hard disk failure, storage system only can lose a data, improves the reliability of data in storage system.
S303: judge that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk.If the logic groups of the second hard disk is identical with the logic groups of the first hard disk, perform S304; Otherwise, perform S305.
S304: the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
S305: the logic groups that increase by is identical with the first hard disk on the second hard disk, and the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
Concrete, the logic groups of master controller to the second hard disk judges, judge that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk, if master controller judges that the logic groups of the second hard disk is identical with the logic groups of the first hard disk, then the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk; If it is not identical with the logic groups of the first hard disk that master controller judges the logic groups of the second hard disk, the logic groups that then increase by is identical with the first hard disk on the second hard disk, and the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.Before the data that should write the first hard disk after by the first hard disk off-line are written to the second hard disk, by judging that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk, the data that should write the first hard disk after the first hard disk off-line are written in the second hard disk logic groups identical with the first hard disk, make it possible in storage system, write complete number raw data and redundant data, the data write in storage system when guaranteeing the first hard disk off-line are more complete, reliable.
The method for writing data that the embodiment of the present invention provides, on the basis of above-described embodiment, before the data that should write the first hard disk after by the first hard disk off-line are written to the second hard disk, by judging that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk, the data that should write the first hard disk after the first hard disk off-line are written in the second hard disk logic groups identical with the first hard disk, make it possible in storage system, write complete number raw data and redundant data, the data write in storage system when guaranteeing the first hard disk off-line are more complete, reliably.
The method for writing data process flow diagram that Fig. 4 provides for the embodiment of the present invention three.As shown in Figure 4, on the basis of above-described embodiment, the method that the present embodiment provides also comprises:
S401: whether recover normal condition after detecting the first hard disk off-line in Preset Time.
Concrete, the executive agent of the embodiment of the present invention is all the master controllers in storage system, repeats no more below.
It should be noted that, it is a kind of unsure state be within normal condition and malfunction that first hard disk is in off-line state, the first hard disk being in off-line state may recover normal condition in Preset Time, can normally use, also normal condition can not may be recovered in Preset Time, break down, cannot normally use.In Preset Time, whether recover normal condition after detecting the first hard disk off-line by master controller, determine that the first hard disk to continue normal use, still break down and cannot re-use.The length of the schedule time in the embodiment of the present invention specifically can set according to practical operation, and the embodiment of the present invention does not limit at this.
S402: if recover normal condition after the first hard disk off-line being detected in Preset Time, the data that then should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk.
Concrete, in Preset Time, normal condition is recovered after master controller detects the first hard disk off-line, the data that should write the first hard disk write the first hard disk, and directly should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk, data during the first hard disk off-line can be re-write to the first hard disk, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
It should be noted that, when the first hard disk and the grouping of the second hard disk subsistence logic, directly by store in the second hard disk with the first hard disk in the data copy of same logic groups to the first hard disk.
The data of the first hard disk after reconstruct are written to the second hard disk by S403: if do not recover normal condition after the first hard disk off-line being detected in Preset Time, then reconstruct the data on the first hard disk.
Concrete, in Preset Time, normal condition is not recovered after master controller detects the first hard disk off-line, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct are written to the second hard disk, the data before the first hard disk off-line can be recovered, data before first hard disk off-line are also written to the second hard disk, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
Optionally, reconstruct the data on the first hard disk, comprising:
The raw data on the first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of the first hard disk.
Concrete, master controller can adopt any one reconstruct data algorithm in prior art to calculate the raw data on the first hard disk according to the Backup Data of the first hard disk, and the embodiment of the present invention does not carry out limiting and repeating at this.
The method for writing data that the embodiment of the present invention provides, in Preset Time, whether normal condition is recovered after detecting the first hard disk off-line, if recover normal condition after the first hard disk off-line being detected in Preset Time, the data that then should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk; Otherwise, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct are written to the second hard disk, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
The method for writing data process flow diagram that Fig. 5 provides for the embodiment of the present invention four.As shown in Figure 5, the method that the present embodiment provides comprises:
S501: whether the first hard disk detected in storage system is extracted from storage system.
Concrete, the executive agent of the present embodiment is all master controllers, repeats no more below.
S502: the first hard disk in storage system is extracted from storage system if detect, then determine that the first hard disk is in off-line state.
S503: determine one in the storage system hard disk being in normal condition, as the second hard disk.
S504: the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
S505: whether turn back to storage system after detecting the first hard disk off-line in Preset Time.If restore storage system in Preset Time interpolation after the first hard disk off-line being detected, perform S506; Otherwise, perform S507.
S506: recover normal condition after determining the first hard disk off-line in Preset Time, performs S508.
S507: determine that the first hard disk breaks down, performs S509.
S508: the data that should write the first hard disk write the first hard disk, and the data copy of the first hard disk should be write to the first hard disk by after the first hard disk off-line stored in the second hard disk.
The data of the first hard disk after reconstruct are written to the second hard disk by S509: reconstruct the data on the first hard disk.
Concrete, the embodiment of the present invention is mainly pulled out for the first hard disk and causes the first hard disk off-line to be set forth.For example, be the of short duration data handling procedure schematic diagram extracted of hard disk for piece hard disk 1, Fig. 6 of in storage system A, as shown in Figure 6A, after the of short duration fault of hard disk refers to hard disk off-line, in Preset Time, recover normal condition.Hard disk 1 is pulled out, immediately for hard disk 1 selects one to substitute hard disk 2 temporarily, now write the data of hard disk 1, write on the interim hard disk 2 substituted, data on write hard disk 2, by after of short duration extracting, again by the node turned back in storage system, are moved back (copying) on hard disk 1 by follow-up hard disk 1, now only need to move back a small amount of data, the data lacked during hard disk 1 off-line can be recovered.Fig. 6 B is the data handling procedure schematic diagram that hard disk is forever extracted, and as shown in Figure 6B, hard disk permanent fault does not recover normal condition after referring to hard disk off-line in Preset Time.Hard disk 1 is pulled out, immediately for hard disk 1 selects one to substitute hard disk 2 temporarily, now write the data of hard disk 1, write on the interim hard disk 2 substituted, follow-up hard disk 1 long-time (in Preset Time) is not by the node turned back in storage system, data before being extracted by hard disk 1 are reconstructed, by interim for the write of the data of the reconstruct hard disk 2 substituted.
Whether the method for writing data that the embodiment of the present invention provides, extracted by the first hard disk detected in storage system, detect the first hard disk and whether be in off-line state from storage system.If detect, the first hard disk is in off-line state, determine one in the storage system hard disk being in normal condition, as the second hard disk, the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.Simultaneously, in Preset Time, whether storage system is turned back to after detecting the first hard disk off-line, if restore storage system in Preset Time interpolation after the first hard disk off-line being detected, in Preset Time, normal condition is recovered after determining the first hard disk off-line, the data that should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk; If do not turn back to storage system after the first hard disk off-line being detected in Preset Time, determine that the first hard disk breaks down, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct are written to the second hard disk, and the data write in storage system when guaranteeing the first hard disk off-line are further more complete, reliable.
Method for writing data interaction diagrams during the hard disk dial-out that Fig. 7 provides for the embodiment of the present invention.As shown in Figure 7, the method for writing data that the embodiment of the present invention provides, comprising:
S701: storage system transferred to by hard disk, hard disk off-line.
S702: off-line hard disk reports hard disk off-line event.
S703: master controller receives hard disk off-line event, perceives hard disk off-line.
S704: master controller triggers the interim normal hard disk substituted of new data write.
Concrete, in the embodiment of the present invention, new data still writes the data in storage system after referring to hard disk off-line.
S705: off-line disk recovery is normal.
Concrete, hard disk turns back to storage system, and off-line disk recovery is normal.
S706: off-line hard disk reports hard disk normal event.
S707: master controller triggers the normal hard disk of new data write recovery.
S708: the data on interim for the write normal hard disk substituted are moved back to and recovered normal hard disk by master controller.
S709: hard disk is not turned back to for a long time, putting off-line hard disk is malfunction.
S710: off-line hard disk reports hard disk failure event.
S711: the data on reconstruct faulty hard disk.
S712: by interim for the reconstruct data write normal hard disk substituted.
Concrete, the embodiment of the present invention is mainly extracted for hard disk and is caused hard disk off-line to be set forth, S705 ~ S708 is that off-line hard disk restores storage system in Preset Time interpolation, master controller and the concrete operations performed by hard disk during recovery normal condition, S709 ~ S712 is that off-line hard disk does not turn back to storage system in Preset Time, master controller and the concrete operations performed by hard disk during permanent dial-out.
The method for writing data that the embodiment of the present invention provides, storage system transferred to by hard disk, hard disk off-line, off-line hard disk reports hard disk off-line event, master controller receives hard disk off-line event, perceive hard disk off-line, master controller triggers the interim normal hard disk substituted of new data write, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.Simultaneously, hard disk turns back to storage system, and off-line disk recovery is normal, and off-line hard disk reports hard disk normal event, master controller triggers the normal hard disk of new data write recovery, and the data on interim for the write normal hard disk substituted are moved back to and recovered normal hard disk by master controller; And hard disk is not turned back to for a long time, putting off-line hard disk is malfunction, off-line hard disk reports hard disk failure event, data on reconstruct faulty hard disk, by interim for the reconstruct data write normal hard disk substituted, the data write in storage system when guaranteeing the first hard disk off-line are further more complete, reliable.
The method for writing data process flow diagram that Fig. 8 provides for the embodiment of the present invention five.As shown in Figure 8, the method that the present embodiment provides comprises:
S801: whether the server node detecting the first hard disk place sends heartbeat detection Frame.
Concrete, the executive agent of the present embodiment is all master controllers, repeats no more below.
S802: the server node at the first hard disk place does not send heartbeat detection Frame if detect, then determine that the server node heartbeat at the first hard disk place is lost, the server node at the first hard disk place breaks down.
S803: the server node at the first hard disk place breaks down if detect, then determine that the first hard disk is in off-line state.
S804: determine one in the storage system hard disk being in normal condition, as the second hard disk.
Concrete, when server node fault causes the first hard disk off-line, when being also the first hard disk off-line place server node fault, the second hard disk now determined is on other normal server node, does not belong to same server node with the first hard disk.It should be noted that, when server node fault, all hard disks on malfunctioning node are all in off-line state, the number of the second hard disk now determined is more than or equal to the number of hard disk in failed server node, and the second hard disk can be all on a server node in other normal server node, also can be distributed on the different server node in other normal server node, the embodiment of the present invention limit at this.
S805: the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
S806: whether the server node that the heartbeat detecting the first hard disk place is lost sends heartbeat detection Frame in Preset Time.If detect, the server node that the heartbeat at the first hard disk place is lost sends heartbeat detection Frame in Preset Time, then perform S807; Otherwise, perform S808.
S807: determine that the server node heartbeat at the first hard disk place is normal, all hard disks on the server node at the first hard disk place are normal condition, recover normal condition after the first hard disk off-line in Preset Time, perform S809.
S808: determine that all hard disks on the server node at the first hard disk place are malfunction, the first hard disk breaks down, performs S810.
S809: the data that should write the first hard disk write the first hard disk, and the data copy of the first hard disk should be write to the first hard disk by after the first hard disk off-line stored in the second hard disk.
The data of the first hard disk after reconstruct are written to the second hard disk by S810: reconstruct the data on the first hard disk.
Concrete, cause the first hard disk off-line to be set forth when the embodiment of the present invention mainly breaks down for the first hard disk place server node.For example, for the server node of in storage system 1, Fig. 9 A is the data handling procedure schematic diagram of the of short duration fault of server node, as shown in Figure 9 A, recovers normal condition after the of short duration fault of server node refers to server node fault in Preset Time.Server node 1 breaks down, on server node 1, all hard disks are set to off-line state, be that on server node 1, all hard disks are selected to substitute hard disk, other normal server node such as server node 2 and server node 3 on other normal server node temporarily immediately.Now need the data on all hard disks of Write fault server node 1, the interim of write normal server node substitutes hard disk, recover normal after the of short duration fault of subsequent server node 1, by write normal server node temporarily the data substituted on hard disk to move back the hard disk of server node 1, now only need to move back a small amount of data, the data lacked between server node 1 age at failure can be recovered.Fig. 9 B is the data handling procedure schematic diagram of server node permanent fault, as shown in Figure 9 B, does not recover normal after server node permanent fault refers to server node fault in Preset Time.Server node 1 breaks down, on server node 1, all hard disks are set to off-line state, be that on server node 1, all hard disks are selected to substitute hard disk, other normal server node such as server node 2 and server node 3 on other normal server node temporarily immediately.Now need the data on all hard disks of Write fault server node 1, the interim of write normal server node substitutes hard disk, subsequent server node 1 permanent fault, data before server node 1 fault are reconstructed, data reconstruction are write the hard disk that normal server node substitutes temporarily.
The method for writing data that the embodiment of the present invention provides, heartbeat detection Frame whether is sent by the server node detecting the first hard disk place, whether the server node detecting the first hard disk place in storage system breaks down, and then detects the first hard disk and whether be in off-line state.If detect, the first hard disk is in off-line state, determine one in the storage system hard disk being in normal condition, as the second hard disk, the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.Simultaneously, whether the server node that the heartbeat detecting the first hard disk place is lost sends heartbeat detection Frame in Preset Time, if detect, the server node that the heartbeat at the first hard disk place is lost sends heartbeat detection Frame in Preset Time, determine that the server node heartbeat at the first hard disk place is normal, in Preset Time, normal condition is recovered after first hard disk off-line, the data that should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk; If detect, the server node that the heartbeat at the first hard disk place is lost does not send heartbeat detection Frame in Preset Time, determine that all hard disks on the server node at a hard disk place are malfunction, first hard disk breaks down, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct are written to the second hard disk, and the data write in storage system when guaranteeing the first hard disk off-line are further more complete, reliable.
Method for writing data interaction diagrams during the server node fault that Figure 10 provides for the embodiment of the present invention.As shown in Figure 10, the method for writing data that the embodiment of the present invention provides, comprising:
S1001: keep heartbeat detection between master controller and server node.
S1002: master controller detects that the server node heartbeat of breaking down is lost, and putting all hard disks on malfunctioning node is that off-line state off-line hard disk reports hard disk off-line event.
Concrete, the server node broken down can be called malfunctioning node.
S1003: master controller triggers the normal hard disk that new data write normal node substitutes temporarily.
S1004: recover normal malfunctioning node and report heartbeat.
Concrete, malfunctioning node recovers normal, recovers normal malfunctioning node and reports heartbeat.
S1005: master controller detects that the heartbeat of malfunctioning node is normal, and putting all hard disks on server node is normal condition.
S1006: master controller triggers the normal hard disk of new data write recovery.
Concrete, in the embodiment of the present invention, new data still writes the data in storage system after referring to hard disk off-line.
S1007: the data on the normal hard disk temporarily substitute write normal node are moved back to and recovered the hard disk of normal node.
S1008: master controller detects that the long-time heartbeat of malfunctioning node is abnormal, putting off-line hard disk is malfunction.
S1009: the data on master controller reconstruct faulty hard disk.
S1010: reconstruct data is write the normal hard disk that normal node substitutes temporarily by master controller.
Concrete, the embodiment of the present invention mainly causes hard disk off-line to be set forth for server node fault, the concrete operations of S1004 ~ S1007 performed by master controller when malfunctioning node recovers normal in Preset Time and server node, S1008 ~ S1010 is that malfunctioning node does not recover normal in Preset Time, master controller and the concrete operations performed by server node when there is permanent fault.
The method for writing data that the embodiment of the present invention provides, heartbeat detection is kept between master controller and server node, master controller detects that the server node heartbeat of breaking down is lost, putting all hard disks on malfunctioning node is that off-line state off-line hard disk reports hard disk off-line event, master controller triggers the normal hard disk that new data write normal node substitutes temporarily, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.Simultaneously, recover normal malfunctioning node and report heartbeat, master controller detects that the heartbeat of malfunctioning node is normal, putting all hard disks on server node is normal condition, master controller triggers the normal hard disk of new data write recovery, and the data on the normal hard disk temporarily substitute write normal node are moved back to and recovered the hard disk of normal node; And master controller detects that the long-time heartbeat of malfunctioning node is abnormal, putting off-line hard disk is malfunction, data on master controller reconstruct faulty hard disk, reconstruct data is write the normal hard disk that normal node substitutes temporarily by master controller, and the data write in storage system when guaranteeing the first hard disk off-line are further more complete, reliable.
The data transfer apparatus schematic diagram that Figure 11 provides for the embodiment of the present invention one.As shown in figure 11, the device that the present embodiment provides comprises:
Whether detection module 1101, be in off-line state for the first hard disk detected in storage system.
Determination module 1102, if detect that the first hard disk is in off-line state for detection module, then determines the hard disk of a normal condition in storage system, as the second hard disk.
Writing module 1103, for being written to the second hard disk by the data that should write the first hard disk after the first hard disk off-line.
Wherein, the first hard disk is in off-line state and refers to the first hard disk and be in state between normal condition and malfunction.
The data transfer apparatus of the present embodiment is for performing the technical scheme of embodiment of the method shown in Fig. 2, and it realizes principle and technique effect is similar, repeats no more herein.
The data transfer apparatus schematic diagram that Figure 12 provides for the embodiment of the present invention two.As shown in figure 12, on the basis of above-described embodiment, the device that the present embodiment provides also comprises: judge module 1104.
Judge module 1104, for judging that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk.
The data that should write the first hard disk after the first hard disk off-line if judge that the logic groups of the second hard disk is identical with the logic groups of the first hard disk specifically for judge module, are then written to the second hard disk by writing module 1103; If it is not identical with the logic groups of the first hard disk that judge module judges the logic groups of the second hard disk, then on the second hard disk, increase the logic groups identical with the first hard disk, and the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
Further, in the above-described embodiments, whether detection module 1101, also recover normal condition after detecting the first hard disk off-line in Preset Time.
Writing module 1103, if recover normal condition after also the first hard disk off-line being detected for detection module in Preset Time, the data that then should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk; If detection module does not recover normal condition after the first hard disk off-line being detected in Preset Time, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct are written to the second hard disk.
The data transfer apparatus of the present embodiment is for performing the technical scheme of embodiment of the method shown in Fig. 3, and it realizes principle and technique effect is similar, repeats no more herein.
Further, in the above-described embodiments, writing module 1103 specifically for: adopt reconstruct data algorithm to calculate raw data on the first hard disk according to the Backup Data of the first hard disk.
Further, in the above-described embodiments, detection module 1101 specifically for: whether the first hard disk detected in storage system is extracted from storage system; If detect, the first hard disk in storage system is extracted from storage system, then determine that the first hard disk is in off-line state.
Further, in the above-described embodiments, survey module concrete 1101 for: in Preset Time, whether turn back to storage system after detecting the first hard disk off-line; If restore storage system in Preset Time interpolation after the first hard disk off-line being detected, then in Preset Time, recover normal condition after determining the first hard disk off-line; Otherwise, determine that the first hard disk breaks down.
Further, in the above-described embodiments, detection module 1101 specifically for:
Whether the server node detecting the first hard disk place breaks down.
If detect, the server node at the first hard disk place breaks down, then determine that the first hard disk is in off-line state.
Wherein, whether detection module 1101, send heartbeat detection Frame specifically for the server node detecting the first hard disk place; If detect, the server node at the first hard disk place does not send heartbeat detection Frame, then the server node heartbeat at the first hard disk place is lost, and determines that the server node at the first hard disk place breaks down.
Further, in the above-described embodiments, survey module concrete 1101 for:
Whether the server node that the heartbeat detecting the first hard disk place is lost sends heartbeat detection Frame in Preset Time.
If detect, the server node that the heartbeat at the first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at the first hard disk place is normal, all hard disks on the server node at the first hard disk place are normal condition, recover normal condition after the first hard disk off-line in Preset Time.
Otherwise determine that all hard disks on the server node at the first hard disk place are malfunction, the first hard disk breaks down.
Storage system provided by the invention, comprising: master controller and at least one server node;
Each server node comprises at least one hard disk.
Concrete, when server node only has one, now this server node is server host node, and master controller is on this server node.When server node has multiple, using the server node of in multiple server node as server host node, now, master controller on server host node, also can be able to be distributed on multiple server node.
Whether master controller, be in off-line state for the first hard disk detected in storage system, and the first hard disk is the arbitrary hard disk in storage system; If detect, the first hard disk is in off-line state, then determine the hard disk of a normal condition in storage system, as the second hard disk; The data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
Wherein, the first hard disk is in off-line state and refers to the first hard disk and be in state between normal condition and malfunction.
Master controller in the embodiment of the present invention in storage system is for performing the technical scheme of embodiment of the method shown in Fig. 2, and it realizes principle and technique effect is similar, repeats no more herein.
The storage system that the embodiment of the present invention provides, whether off-line state is in by the first hard disk detected in storage system, if detect, the first hard disk is in off-line state, then determine one in the storage system hard disk being in normal condition, as the second hard disk, the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk, when making the first hard disk off-line, data still can write in storage system, data integrity when guaranteeing the first hard disk off-line in write storage system, reliable.
Further, in the above-described embodiments, the data of master controller also for writing the first hard disk after by the first hard disk off-line judge that whether the logic groups of the second hard disk is identical with the logic groups of the first hard disk before being written to the second hard disk; If the logic groups of the second hard disk is identical with the logic groups of the first hard disk, then the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk; If judge, the logic groups of the second hard disk is not identical with the logic groups of the first hard disk, then the logic groups that increase by is identical with the first hard disk on the second hard disk, and the data that should write the first hard disk after the first hard disk off-line are written to the second hard disk.
Further, in the above-described embodiments, master controller also for:
In Preset Time, whether normal condition is recovered after detecting the first hard disk off-line.
If recover normal condition after the first hard disk off-line being detected in Preset Time, then the data that should write the first hard disk write the first hard disk, and should write the data copy of the first hard disk to the first hard disk by after the first hard disk off-line stored in the second hard disk.
Otherwise, reconstruct the data on the first hard disk, the data of the first hard disk after reconstruct be written to the second hard disk.
Further, in the above-described embodiments, master controller specifically for:
The raw data on the first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of the first hard disk.
Further, in the above-described embodiments, master controller specifically for:
Whether the first hard disk detected in storage system is extracted from storage system.
If detect, the first hard disk in storage system is extracted from storage system, then determine that the first hard disk is in off-line state.
Further, in the above-described embodiments, master controller specifically for:
In Preset Time, whether storage system is turned back to after detecting the first hard disk off-line.
If restore storage system in Preset Time interpolation after the first hard disk off-line being detected, then in Preset Time, recover normal condition after determining the first hard disk off-line.
Otherwise, determine that the first hard disk breaks down.
Further, in the above-described embodiments, master controller specifically for:
Whether the server node detecting the first hard disk place breaks down.
If detect, the server node at the first hard disk place breaks down, then determine that the first hard disk is in off-line state.
Wherein, whether the server node detecting the first hard disk place breaks down, and comprising:
Whether the server node detecting the first hard disk place sends heartbeat detection Frame.
If detect, the server node at the first hard disk place does not send heartbeat detection Frame, then determine that the server node heartbeat at the first hard disk place is lost, the server node at the first hard disk place breaks down.
Further, in the above-described embodiments, master controller specifically for:
Whether the server node that the heartbeat detecting the first hard disk place is lost sends heartbeat detection Frame in Preset Time.
If detect, the server node that the heartbeat at the first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at the first hard disk place is normal, all hard disks on the server node at the first hard disk place are normal condition, recover normal condition after the first hard disk off-line in Preset Time.
Otherwise determine that all hard disks on the server node at the first hard disk place are malfunction, the first hard disk breaks down.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of corresponding technical scheme depart from the scope of various embodiments of the present invention technical scheme.

Claims (25)

1. a method for writing data, is characterized in that, comprising:
Whether the first hard disk detected in storage system is in off-line state;
If detect, described first hard disk is in off-line state, then determine one in the described storage system hard disk being in normal condition, as the second hard disk;
The data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
2. method for writing data according to claim 1, is characterized in that, described by described first hard disk off-line after should write described first hard disk data be written to described second hard disk before, also comprise:
Judge that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk;
Described the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk, comprise:
If the logic groups of described second hard disk is identical with the logic groups of described first hard disk, then the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
If the logic groups of described second hard disk is not identical with the logic groups of described first hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
3. method for writing data according to claim 1 and 2, is characterized in that, described method also comprises:
In Preset Time, whether normal condition is recovered after detecting described first hard disk off-line;
If recover normal condition after described first hard disk off-line being detected in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk;
Otherwise, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct be written to described second hard disk.
4. method for writing data according to claim 3, is characterized in that, the data on described first hard disk of described reconstruct, comprising:
The raw data on described first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of described first hard disk.
5. the method for writing data according to claim 3 or 4, is characterized in that, whether the first hard disk in described detection storage system is in off-line state, comprising:
Whether described first hard disk detected in storage system is extracted from storage system;
If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
6. method for writing data according to claim 5, is characterized in that, whether recovers normal condition, comprising after the described first hard disk off-line of described detection in Preset Time:
In Preset Time, whether storage system is turned back to after detecting described first hard disk off-line;
If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line;
Otherwise, determine that described first hard disk breaks down.
7. the method for writing data according to claim 3 or 4, is characterized in that, whether the first hard disk in described detection storage system is in off-line state, comprising:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state.
8. method for writing data according to claim 7, is characterized in that, whether the server node at the described first hard disk place of described detection breaks down, and comprising:
Whether the server node detecting described first hard disk place sends heartbeat detection Frame;
If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then determine that the server node heartbeat at described first hard disk place is lost, the server node at described first hard disk place breaks down.
9. method for writing data according to claim 8, is characterized in that, whether recovers normal condition, comprising after the described first hard disk off-line of described detection in Preset Time:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
10. a data transfer apparatus, is characterized in that, comprising:
Whether detection module, be in off-line state for the first hard disk detected in storage system;
Determination module, if detect that described first hard disk is in off-line state for described detection module, then determines the hard disk of a normal condition in described storage system, as the second hard disk;
Writing module, for being written to described second hard disk by the data that should write described first hard disk after described first hard disk off-line;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
11. data transfer apparatus according to claim 10, is characterized in that, also comprise:
Judge module, for judging that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk;
The data that should write described first hard disk after described first hard disk off-line if judge that the logic groups of described second hard disk is identical with the logic groups of described first hard disk specifically for described judge module, are then written to described second hard disk by said write module; If it is not identical with the logic groups of described first hard disk that described judge module judges the logic groups of described second hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
12. data transfer apparatus according to claim 10 or 11, is characterized in that, described detection module also after detecting described first hard disk off-line, whether recover normal condition in Preset Time;
Said write module, if recover normal condition after also described first hard disk off-line being detected for described detection module in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk; If described detection module does not recover normal condition after described first hard disk off-line being detected in Preset Time, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct are written to described second hard disk.
13. data transfer apparatus according to claim 12, is characterized in that, said write module specifically for: adopt reconstruct data algorithm to calculate raw data on described first hard disk according to the Backup Data of described first hard disk.
14. data transfer apparatus according to claim 12 or 13, is characterized in that, described detection module specifically for: whether described first hard disk detected in storage system is extracted from storage system; If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
15. data transfer apparatus according to claim 14, is characterized in that, described detection module specifically for: in Preset Time, whether turn back to storage system after detecting described first hard disk off-line; If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line; Otherwise, determine that described first hard disk breaks down.
16. data transfer apparatus according to claim 12 or 13, is characterized in that, described detection module specifically for:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state;
Wherein, whether described detection module, send heartbeat detection Frame specifically for the server node detecting described first hard disk place; If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then the server node heartbeat at described first hard disk place is lost, and determines that the server node at described first hard disk place breaks down.
17. data transfer apparatus according to claim 16, is characterized in that, described detection module specifically for:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
18. 1 kinds of storage systems, is characterized in that, comprising: master controller and at least one server node;
Server node described in each comprises at least one hard disk;
Whether described master controller, be in off-line state for the first hard disk detected in described storage system, and described first hard disk is the arbitrary hard disk in described storage system; If detect, described first hard disk is in off-line state, then determine the hard disk of a normal condition in described storage system, as the second hard disk; The data that should write described first hard disk after described first hard disk off-line are written to described second hard disk;
Wherein, described first hard disk is in off-line state and refers to described first hard disk and be in state between normal condition and malfunction.
19. storage systems according to claim 18, it is characterized in that, the data of described master controller also for writing described first hard disk after by described first hard disk off-line judge that whether the logic groups of described second hard disk is identical with the logic groups of described first hard disk before being written to described second hard disk; If the logic groups of described second hard disk is identical with the logic groups of described first hard disk, then the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk; If judge, the logic groups of described second hard disk is not identical with the logic groups of described first hard disk, the logic groups that then increase by is identical with described first hard disk on described second hard disk, and the data that should write described first hard disk after described first hard disk off-line are written to described second hard disk.
20. storage systems according to claim 18 or 19, is characterized in that, described master controller also for:
In Preset Time, whether normal condition is recovered after detecting described first hard disk off-line;
If recover normal condition after described first hard disk off-line being detected in Preset Time, then should write described first hard disk of data write of described first hard disk, and the data copy of described first hard disk should be write to described first hard disk by after the described first hard disk off-line stored in described second hard disk;
Otherwise, reconstruct the data on described first hard disk, the data of described first hard disk after reconstruct be written to described second hard disk.
21. storage systems according to claim 20, is characterized in that, described master controller specifically for:
The raw data on described first hard disk is calculated according to the Backup Data employing reconstruct data algorithm of described first hard disk.
22. storage systems according to claim 20 or 21, is characterized in that, described master controller specifically for:
Whether described first hard disk detected in storage system is extracted from storage system;
If detect, described first hard disk in storage system is extracted from storage system, then determine that described first hard disk is in off-line state.
23. storage systems according to claim 22, is characterized in that, described master controller specifically for:
In Preset Time, whether storage system is turned back to after detecting described first hard disk off-line;
If restore storage system in Preset Time interpolation after described first hard disk off-line being detected, then in Preset Time, recover normal condition after determining described first hard disk off-line;
Otherwise, determine that described first hard disk breaks down.
24. storage systems according to claim 20 or 21, is characterized in that, described master controller specifically for:
Whether the server node detecting described first hard disk place breaks down;
If detect, the server node at described first hard disk place breaks down, then determine that described first hard disk is in off-line state;
Wherein, whether the server node at the described first hard disk place of described detection breaks down, and comprising:
Whether the server node detecting described first hard disk place sends heartbeat detection Frame;
If detect, the server node at described first hard disk place does not send heartbeat detection Frame, then determine that the server node heartbeat at described first hard disk place is lost, the server node at described first hard disk place breaks down.
25. storage systems according to claim 24, is characterized in that, described master controller specifically for:
Whether the server node that the heartbeat detecting described first hard disk place is lost sends heartbeat detection Frame in Preset Time;
If detect, the server node that the heartbeat at described first hard disk place is lost sends heartbeat detection Frame in Preset Time, then determine that the server node heartbeat at described first hard disk place is normal, all hard disks on the server node at described first hard disk place are normal condition, recover normal condition after described first hard disk off-line in Preset Time;
Otherwise determine that all hard disks on the server node at described first hard disk place are malfunction, described first hard disk breaks down.
CN201510468140.6A 2015-07-31 2015-07-31 Method for writing data, apparatus and system Active CN105138280B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510468140.6A CN105138280B (en) 2015-07-31 2015-07-31 Method for writing data, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510468140.6A CN105138280B (en) 2015-07-31 2015-07-31 Method for writing data, apparatus and system

Publications (2)

Publication Number Publication Date
CN105138280A true CN105138280A (en) 2015-12-09
CN105138280B CN105138280B (en) 2018-10-19

Family

ID=54723641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510468140.6A Active CN105138280B (en) 2015-07-31 2015-07-31 Method for writing data, apparatus and system

Country Status (1)

Country Link
CN (1) CN105138280B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844108A (en) * 2016-12-29 2017-06-13 成都华为技术有限公司 A kind of date storage method, server and storage system
CN109074301A (en) * 2017-03-13 2018-12-21 华为技术有限公司 A kind of data processing method and device
CN110244904A (en) * 2018-03-09 2019-09-17 杭州海康威视系统技术有限公司 A kind of data-storage system, method and device
CN111488124A (en) * 2020-04-08 2020-08-04 深信服科技股份有限公司 Data updating method and device, electronic equipment and storage medium
CN111858189A (en) * 2019-04-29 2020-10-30 伊姆西Ip控股有限责任公司 Handling of storage disk offline

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006019643A1 (en) * 2004-08-04 2006-02-23 Dot Hill Systems Corporation Performing a preemptive reconstruct of a fault-tolerant raid array
CN101017472A (en) * 2007-03-01 2007-08-15 华为技术有限公司 Hard disk hot swap system in multiple hard disks system and method
CN101281452A (en) * 2007-04-05 2008-10-08 英业达股份有限公司 Method for automatically rebuilding hard disk
CN103838521A (en) * 2014-02-28 2014-06-04 华为技术有限公司 Data processing method and data processing device
CN104572374A (en) * 2015-01-13 2015-04-29 华为技术有限公司 Storage processing method, storage processing device and storage equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006019643A1 (en) * 2004-08-04 2006-02-23 Dot Hill Systems Corporation Performing a preemptive reconstruct of a fault-tolerant raid array
CN101017472A (en) * 2007-03-01 2007-08-15 华为技术有限公司 Hard disk hot swap system in multiple hard disks system and method
CN101281452A (en) * 2007-04-05 2008-10-08 英业达股份有限公司 Method for automatically rebuilding hard disk
CN103838521A (en) * 2014-02-28 2014-06-04 华为技术有限公司 Data processing method and data processing device
CN104572374A (en) * 2015-01-13 2015-04-29 华为技术有限公司 Storage processing method, storage processing device and storage equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844108A (en) * 2016-12-29 2017-06-13 成都华为技术有限公司 A kind of date storage method, server and storage system
WO2018121456A1 (en) * 2016-12-29 2018-07-05 华为技术有限公司 Data storage method, server and storage system
CN106844108B (en) * 2016-12-29 2019-05-24 成都华为技术有限公司 A kind of date storage method, server and storage system
CN109074301A (en) * 2017-03-13 2018-12-21 华为技术有限公司 A kind of data processing method and device
CN109074301B (en) * 2017-03-13 2021-10-08 荣耀终端有限公司 Data processing method and device
CN110244904A (en) * 2018-03-09 2019-09-17 杭州海康威视系统技术有限公司 A kind of data-storage system, method and device
CN111858189A (en) * 2019-04-29 2020-10-30 伊姆西Ip控股有限责任公司 Handling of storage disk offline
CN111488124A (en) * 2020-04-08 2020-08-04 深信服科技股份有限公司 Data updating method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN105138280B (en) 2018-10-19

Similar Documents

Publication Publication Date Title
US9009526B2 (en) Rebuilding drive data
CN106776130B (en) Log recovery method, storage device and storage node
CN105138280A (en) Data write-in method, apparatus and system
JP4939174B2 (en) Method for managing failures in a mirrored system
US7103811B2 (en) Mechanisms for detecting silent errors in streaming media devices
CN103049400B (en) A kind of disk reconstructing method and device thereof
US11403181B2 (en) Systems and methods for managing replication of data to a remote storage device
CN102521058A (en) Disk data pre-migration method of RAID (Redundant Array of Independent Disks) group
CN109726036B (en) Data reconstruction method and device in storage system
CN110333971A (en) SSD bad block table backup method, device, computer equipment and storage medium
CN110442298B (en) Storage equipment abnormality detection method and device and distributed storage system
WO2013118189A1 (en) Storage device replacement method, and storage sub-system adopting storage device replacement method
CN106681865A (en) Business recovery method and device
US7260739B2 (en) Method, apparatus and program storage device for allowing continuous availability of data during volume set failures in a mirrored environment
CN108170375B (en) Overrun protection method and device in distributed storage system
US20070234107A1 (en) Dynamic storage data protection
CN104636082B (en) The control method and device of disk array RAID
CN108234465B (en) Redundancy method and device for handling exception in distributed file system
CN106648450B (en) A kind of implementation method of data safety storage
CN106933707B (en) Data recovery method and system of data storage device based on raid technology
CN105630417A (en) RAID5 (Redundant Array Of Independent Disks) system and method for continuously writing data after failure of RAID5 system
US20140325261A1 (en) Method and system of using a partition to offload pin cache from a raid controller dram
CN105159790A (en) Data rescue method and file server
CN109117317A (en) A kind of clustering fault restoration methods and relevant apparatus
CN112084097B (en) Disk alarm method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant