Summary of the invention
The object of the present invention is to provide a kind of method and apparatus of migrated file data, it has solved the problem that need take the network bandwidth, more time of cost in the prior art from twice transmission on the network and increase the internal control server load when carrying out the data migration.
For realizing the method for a kind of migrated file data that the object of the invention provides, comprise step: A. has judged whether that file satisfies by transition condition; If, startup file data migrator then; Otherwise continue to judge; Described is that file is employed the frequency that server reads and surpasses predeterminated frequency by transition condition, and described file is deposited in the low speed hard disk; B. obtain by the source storage address information of migrated file from the low speed hard disk; C. obtain the memory space of available quick hard disk, and record will deposit by the purpose storage address information of migrated file in; D. according to by the mapping relations of the source storage address information of migrated file and purpose storage address information, the data of the file that the control chip of described low speed hard disk will move send the control chip of the quick hard disk of purpose to by switch, and the data that the control chip of described purpose hard disk will be moved write the assigned address of quick hard disk.
Wherein, described steps A comprises: A1. monitors each file in real time and is read frequency; Whether that A2. judges each file is read frequency above predeterminated frequency; If, execution in step A3 then; Otherwise execution in step A1; A3. judge whether be read the file that frequency surpasses predeterminated frequency leaves the low speed hard disk in; If, execution in step A4 then; Otherwise execution in step A1; A4. startup file migrator.
Wherein, described source storage address information is described by the source IP address of migrated file on the low speed hard disk and the source LBA tabulation of data block; Described purpose storage address information is will deposit on the quick hard disk describedly to be tabulated by the purpose LBA of the purpose IP address of migrated file and data block.
Wherein, described step C comprises: C1. checks the residual memory space of quick hard disk; C2. judge that quick hard disk residual memory space is whether more than or equal to by the required memory space of migrated file; If, execution in step C3 then; Otherwise execution in step C4; C3. be arranged in the tabulation of purpose LBA depositing on the quick hard disk, and record in the lump on the IPSAN Control Server with depositing by the purpose IP address of migrated file by the LBA of the data block of migrated file; Enter step D; C4. searching one, to be read frequency on quick hard disk minimum and be lower than the file of predeterminated frequency, with the file deletion that finds to discharge memory space; Enter step C1.
Wherein, described step D comprises: D1. is carried out man-to-man mapping by the source LBA tabulation and the source IP address of migrated file together with newly-built purpose LBA tabulation and purpose IP address; The migration command synchronization that D2. will include mapping relations sends to the control chip of multiple source low speed hard disk; D3. the control chip of source low speed hard disk receives and resolves described migration order, and the data of the file that will move are sent to the control chip of the quick hard disk of purpose by fast ethernet switch; The data that the control chip of D4. described purpose hard disk will be moved write the assigned address of the quick hard disk of purpose.
Wherein, also comprise step after the described step D: E. source low speed hard disk sends a status command to the IPSAN Control Server after the file data migration is finished, described status command includes the successful information that whether sends.
Wherein, also comprise step after the described step e: the purpose LBA of the file that the F.IPSAN Control Server will successful be moved is with related by migrated file.
Wherein, described step F comprises: the F1.IPSAN Control Server read the status command passed back of active low speed hard disk; F2. if all low speed hard disks have all been finished the data migration, then with related by migrated file, flow process finishes the IPSAN Control Server with the tabulation of purpose LBA; F3. if not all low speed hard disks have all been finished the data migration, then to represent in the data migration process of part low speed hard disk mistake to have taken place, the IPSAN Control Server carries out corresponding repair process according to the type of mistake.
Wherein, described step F 3 comprises step: under the situation that the control chip of F3-1. source low speed hard disk lost efficacy or source low speed hard disk lost efficacy, the IPSAN Control Server will select the mirror drive of this piece low-speed discs to resend the migration order, enter step D; F3-2. under the situation that the control chip of the quick hard disk of purpose lost efficacy or the quick hard disk of purpose lost efficacy, the IPSAN Control Server will redefine other destination address and resend the migration order, enter step D.
The present invention also provides a kind of device of migrated file data, comprises IPSAN Control Server, switch, low speed hard disk and quick hard disk, it is characterized in that described IPSAN Control Server comprises startup module, preparation module and relating module; Be equipped with control chip on described low speed hard disk and the described quick hard disk.
Described startup module is used to judge whether that file satisfies by transition condition; If, startup file data migrator then; Otherwise continue to judge; Described preparation module is used for obtaining by the source storage address information of migrated file and obtain the memory space of available quick hard disk from the low speed hard disk, and record will deposit in by the purpose storage address information of migrated file simultaneously; Described relating module, be used for will the file that moved of success the purpose LBA with related by migrated file; The control chip of described low speed hard disk is used for according to by the mapping relations of the source storage address information of migrated file and purpose storage address information, and the data of the file that will move send the control chip of the quick hard disk of purpose to by switch; The data that the control chip of described quick hard disk is used for being moved write the assigned address of quick hard disk.
The invention has the beneficial effects as follows: the method for a kind of migrated file data that the present invention describes, utilizing control chip on the low speed hard disk that data are transferred to specific objective by switch coils fast, do not passed through the IPSAN Control Server by the transmission of migration data, avoid the migration of factor certificate and the resource and the bandwidth of Consumption Control server, realize the instant migration of data block.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the method and apparatus of a kind of migrated file data of the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
As shown in Figure 1, the method for a kind of file data migration of the present invention comprises step:
A. judged whether that file satisfies by transition condition, if, startup file data migrator then, otherwise continue to judge.
Because the price of hard disk is comparatively expensive fast, cause the resource of quick hard disk in the storage system generally very limited, for Limited resources is utilized fully, some files of often being visited need be placed in the quick hard disk, improve the processing speed of storage system.
Before moving, will judge whether that at first file satisfies by transition condition, described is that file is employed the frequency that server reads and surpasses predeterminated frequency by transition condition, and described file is deposited in the low speed hard disk.Predeterminated frequency is decided according to actual conditions by those skilled in the art, need consider the type of application, fast multiple factor such as the capacity of hard disk and accounting and rule of thumb value set.For example for the application of video request program or electronic reading class, do not considering to coil fast under the situation of capacity, predeterminated frequency can be set at: per hour program request or frequency of reading are 100 times.When the accessed frequency of a certain file surpasses predeterminated frequency, then defining this document often is accessed file, and if the hard disk low speed hard disk at the current place of file, the hard disk of then this document being put into quick response is to promote the response performance of storage system.Predeterminated frequency can be provided with when the system initialization by the interface that is provided with that the IPSAN Control Server provides.
B. obtain by the source storage address information of migrated file from the low speed hard disk.
Migrator will determine that at first the file that is moved leaves on which or which hard disk, find the information of depositing, be that all of IP address and hard disk are deposited the value by the LBA of migrated file (Logical Block Address, LBA), be designated as source storage address information.
C. obtain the memory space of available quick hard disk, and record will deposit by the purpose storage address information of migrated file in.
If will successfully realize the data migration, must guarantee is having enough memory spaces in the hard disk fast, therefore before migration data, should prepare the memory space of available quick hard disk, and need clearly be used for depositing, be designated as purpose storage address information by the IP address of the memory space of migrated file and LBA value.
Steps A-C is all finished by the IPSAN Control Server, and purpose is to obtain by the source storage address information of migration data and purpose storage address information when needs carry out the data migration.
D. according to by the mapping relations of the source storage address information of migrated file and purpose storage address information, the data of the file that the control chip of described low speed hard disk will move send the control chip of the quick hard disk of purpose to by switch, and the data that the control chip of described purpose hard disk will be moved write the assigned address of quick hard disk.
The IPSAN Control Server is source storage address information and purpose storage address information mapping, and mapping relations are sent to by the control chip of the source low speed hard disk of migration data.Control chip is read data and be transmitted to the quick hard disk of purpose according to mapping relations.Hard disk is provided with the prerequisite that control chip is a technical scheme of the present invention, promptly should be provided with the control chip with data transport functions on the hard disk.
Technical scheme provided by the invention can avoid the data between the hard disk to move the problem that takies the Control Server resource and the network bandwidth and increase the internal control server load.
As shown in Figure 2, Fig. 2 is the structural representation that can use a kind of storage system of technical solution of the present invention.In the described enterprise-level storage system of Fig. 2, each piece iSCSI of system (Internet Small Computer System Interface, small computer system interface network) disk is all interconnected by the high speed Ethernet exchange machine.ISCSI destination (Target) control chip of the special use of being adopted has the data forwarding logic function, this makes and can carry out the clog-free communication of port to port by Ethernet switch between the iscsi disk, realizes the directed instant data migration of data under the instruction of IPSAN Control Server.
As shown in Figure 3, as a kind of embodiment, technical scheme of the present invention is applied to this storage system comprises step:
A1. monitor the frequency that each file is read in real time.
A2. whether the frequency that is read of judging each file surpasses predeterminated frequency, if, execution in step A3 then, otherwise execution in step A1.
The IPSAN Control Server is read frequency by each file of real-time monitoring, and compares with predeterminated frequency, if the current frequency that is read of file is higher than predeterminated frequency, then defines this document and is frequent accessed file.
A3. judge whether be read the file that frequency surpasses predeterminated frequency leaves the low speed hard disk in, if, execution in step A4 then, otherwise execution in step A1.
Accessed file has been stored in quick hard disk if often be defined as, and does not then obviously need to move, and therefore also needs the memory location of this document is made a decision.If be placed in the fireballing hard disk, it is not carried out other operation; If find to leave in the low speed hard disk, then IPSAN Control Server log-on data piece migrator.
A4. startup file migrator.
B. obtain by the source storage address information of migrated file from the low speed hard disk.
Described source storage address information is described by the source IP address of migrated file on the low speed hard disk and the source LBA tabulation of data block.
C1. check the residual memory space of quick hard disk.
C2. judge that quick hard disk has residual memory space whether more than or equal to by the required memory space of migrated file, if, execution in step C3 then, otherwise execution in step C4.
C3. be arranged in the tabulation of purpose LBA depositing on the quick hard disk, and record in the lump on the IPSAN Control Server with depositing by the purpose IP address of migrated file by the LBA of the data block of migrated file; Enter step D;
C4. searching one, to be read frequency on quick hard disk minimum and be lower than the file of predeterminated frequency, with the file deletion that finds to discharge memory space; Enter step C1.
For realizing the smooth migration of data, on the quick hard disk of purpose, should prepare enough memory spaces.The IPSAN Control Server need check earlier whether the remaining space of quick hard disk is enough, if fast the residual memory space of hard disk is not enough or do not have a residual memory space, then the IPSAN Control Server at first will be determined a sluggish file on quick hard disk, from the IPSAN Control Server, the address list of this file on quick hard disk deleted, and it is standby that wherein LBA is put into empty memory space LBA tabulation, and then continue to check deleted an inactive file after, whether remaining memory space is enough, if not enough, then need the IPSAN Control Server to continue to select inactive file to delete.
D1. newly-built purpose LBA tabulation and purpose IP address are carried out man-to-man mapping by the source LBA tabulation and the source IP address of migrated file together.
The IPSAN Control Server is undertaken man-to-man mapping to the purpose LBA table and the IP that newly build up by the LBA of migrated file and IP together, and mapping relations are preserved.
The migration command synchronization that D2. will include mapping relations sends to the control chip of multiple source low speed hard disk.
The USER COMMAND order of the good corresponding relation of mapping by iSCSI sent to coiled by migration accordingly, just source low speed hard disk.
D3. the control chip of source low speed hard disk receives and resolves described migration order, and the data of the file that will move are sent to the control chip of the quick hard disk of purpose by fast ethernet switch.
Source low speed hard disk is understood the USER COMMAND order of iSCSI by control chip, and the data block that will move sends to the quick hard disk of purpose by order or the host-host protocol of formulating, and the file data that is moved still is retained in source low speed hard disk.
The data that the control chip of D4. described purpose hard disk will be moved write the assigned address of the quick hard disk of purpose.
E. low speed hard disk in source sends a status command to the IPSAN Control Server after the file data migration is finished, and described status command includes the successful information that whether sends.
When carrying out the data migration between source low speed hard disk and the quick hard disk of purpose, if fail, four kinds of possible situations once mainly can appear, 1, the IPSAN Control Server is not received the report of certain source low speed hard disk control chip, and this explanation source low speed hard disk control chip lost efficacy or link interruption; 2, source low speed hard disk control chip report source low speed hard disk lost efficacy; 3, the source low speed hard disk control chip report response of not receiving the target control chip; 4, not response of source low speed hard disk control chip reporting objectives high speed hard-disk.Therefore no matter finally whether migration is successful, and the IPSAN Control Server can both be known the migration results of each source low speed hard disk.
The F1.IPSAN Control Server read the status command passed back of active low speed hard disk.
F2. if all low speed hard disks have all been finished the data migration, then with related by migrated file, flow process finishes the IPSAN Control Server with the tabulation of purpose LBA.
F3. if not all low speed hard disks have all been finished the data migration, then to represent in the data migration process of part low speed hard disk mistake to have taken place, the IPSAN Control Server carries out corresponding repair process according to the type of mistake.
F3-1. under the situation that the control chip of source low speed hard disk lost efficacy or source low speed hard disk lost efficacy, the IPSAN Control Server will select the mirror drive of this piece low-speed discs to resend the migration order, enter step D.
F3-2. under the situation that the control chip of purpose high speed hard-disk lost efficacy or the purpose high speed hard-disk lost efficacy, the IPSAN Control Server will redefine the corresponding target address and resend the migration order, enter step D.
The IPSAN Control Server judge the transmission result that passes back of active low speed hard disk, if all completed successfully the data migration, on the IPSAN Control Server, new LBA tabulation (purpose LBA table) is tabulated side by side and file association with original file LBA, and then write down a sign, when application server will read this file later on, the IPSAN Control Server offered application server to this LBA that coils fast tabulation.
Delay and resource occupation that present embodiment can avoid data to cause by Control Server storage and forwarding.
The present invention also provides a kind of device of migrated file data, comprises IPSAN Control Server, switch, low speed hard disk and quick hard disk.The IPSAN Control Server comprises startup module, preparation module and relating module; Be equipped with control chip on low speed hard disk and the quick hard disk.
Start module, be used to judge whether that file satisfies by transition condition; If, startup file data migrator then; Otherwise continue to judge.
Preparation module is used for obtaining by the source storage address information of migrated file and obtain the memory space of available quick hard disk from the low speed hard disk, and record will deposit in by the purpose storage address information of migrated file simultaneously.
Relating module, be used for will the file that moved of success the purpose LBA with related by migrated file.
The control chip of low speed hard disk is used for according to by the mapping relations of the source storage address information of migrated file and purpose storage address information, and the data of the file that will move send the control chip of the quick hard disk of purpose to by switch.The data that the control chip of quick hard disk is used for being moved write the assigned address of quick hard disk.
Should be noted that at last that obviously those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these revise and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification.