Background technology
Along with the explosive increase of data, the cluster storing mass data arises at the historic moment.Because the data volume stored in cluster is very large, what have reaches PB level, and synchronization may have a large amount of data accesses.Therefore, whether the deposit position of data is reasonable, directly has influence on the access delay of data.
Data Migration, refers to the data mobile between different storage mediums.Complete Data Migration, system needs to consume certain resource (comprising hardware resource, bandwidth etc.).
In the cluster storing mass data, need the situation of Data Migration, the backup/restoration of main systematic upgrading, data, and the dynamic conditioning etc. of data in hierarchical stor.Wherein the upgrading of system is large-scale, disposable; The backup/restoration of data is based on security consideration; Under normal circumstances, the number of times that the migration of this two class occurs is little, and be mostly at a time must to complete.
But the Data Dynamic adjustment in hierarchical stor, its objective is to make the position of data obtain the configuration rationalized.Classification stores, and is according to data activity degree " sixteen principles ": namely the data of 20% are in active state, and the data of 80% are in disabled state, and server is divided into different storage hierarchy by hardware performance, and storage hierarchy is higher, and performance is better.The target of hierarchical stor alive data is stored in the high storage of level, but the liveness of data can change along with the change of time, even if so certain data configuration is once rational, but after a period of time, this configuration also can factor data liveness change and seem outdated, therefore in order to reach the target of data rationalisation configuration, just need to carry out Data Migration.
But migration needs consumes resources, if migration number of times is very few, just cannot give full play to the advantage of hierarchical stor, if migration number of times is too much, system has too much resource for in-fighting, likely reduces system to the service quality of other business.The choose opportunities of therefore moving is very important, should guarantee to play the advantage of hierarchical stor, can not have again too much resource for in-fighting.
At present, the method that two kinds are determined migration opportunity is had.One is fixed-period planning, and namely hierarchical stor after some time, can carry out Data Migration, and do not consider other situations; Another kind is that remaining space monitors method, namely monitors and if remaining space is not enough, then starts migration by the remaining space that one-level stores.
But these two kinds of methods have deficiency: the cycle set by fixed-period planning, if long, be difficult to the advantage playing classification storage; If too short, the resource of system can be frequent for in-fighting.And the load of cluster is in dynamic change, the situation of different application access data is different, and the reasonable period of an all application scenarios of adaptation, be non-existent, that is, fixed-period planning is difficult to the dynamic change of adaptive system load.
Remaining space monitors method, can play effect when having mass data to write in the cluster, but in a lot of situation, can no longer include data write and have digital independent frequently, but the liveness of data is constantly changing in cluster.Under this situation, hierarchical stor just can not carry out Data Migration, does not also accomplish rational data configuration, does not play its due effect.
Therefore, the method need determining migration opportunity needs to rationalize, want the dynamic change of energy adaptive system load on the one hand, on the other hand, data can be made again to deposit on suitable node, the efficiency of system when processing alive data being improved, finally make the access performance of data improve, and the access delay of entirety reducing.
Summary of the invention
The embodiment of the present invention provides a kind of method and apparatus determining data migration time, be intended to solve current cannot the suitable data migration time of Dynamic Selection, both guaranteed to play the advantage of hierarchical stor, do not had again the problem of too much resource for in-fighting.
For this reason, following technical scheme is embodiments provided:
Determine a device for data migration time, comprising:
Monitoring module, is connected with judge module, for starting two-wire journey, monitors the space utilization rate that in hierarchical stor, one-level stores and Data Migration cycle respectively;
Judge module, is connected with Data Migration module with described monitoring module respectively, for by described two-wire journey, regularly judges that whether described Data Migration condition is satisfied;
Data Migration module, for performing described Data Migration;
Adjusting module, is connected with described Data Migration module, for adjusting the described Data Migration cycle.
The embodiment of the present invention additionally provides a kind of method determining data migration time, comprising:
A: start two-wire journey, monitors the space utilization rate that in hierarchical stor, one-level stores and Data Migration cycle respectively;
B: described two-wire journey, regularly judges that whether described Data Migration condition is satisfied, if not, then judges after waiting for the identical time again, until judge that described Data Migration condition is satisfied, if so, then performs step C;
C: perform described Data Migration;
D: according to the situation of described migration, adjusts the described Data Migration cycle;
E: after described Data Migration period modulation, described two-wire journey reads parameter again, continues next round and monitors.
Compared with prior art, embodiments of the invention tool has the following advantages:
The embodiment of the present invention is by starting two-wire journey, monitor the space utilization rate that in hierarchical stor, one-level stores and Data Migration cycle respectively, and regularly judge that whether described Data Migration condition is satisfied, and according to meeting the reason of transition condition, adjust the described Data Migration cycle.Ensure that the data migration time of selection, thus not only can make full use of the space of the one-level storage in hierarchical stor, also can ensure that system adjusts Data Position timely, make the access performance of system reach best.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that described herein is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all belongs to the scope of protection of the invention.
Fig. 1 is the method flow diagram that first embodiment of the invention provides the opportunity of given data migration really, for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
As shown in Figure 1, the method comprises the following steps:
Step 101, starts two-wire journey, monitors the space utilization rate that in hierarchical stor, one-level stores and Data Migration cycle respectively.
Step 102, described two-wire journey, regularly judges that whether described Data Migration condition is satisfied, if not, then judges after waiting for the identical time again, until judge that described Data Migration condition is satisfied, if so, then performs step 103.
Concrete, described described Data Migration condition, comprise space utilization rate that in described hierarchical stor, one-level stores exceed setting threshold or, the Data Migration cycle arrives.
Concrete, when judging that the space utilization rate that in hierarchical stor, one-level stores does not exceed setting threshold, when the Data Migration cycle does not arrive yet, then not trigger data migration, judges after the by the time identical time interval again.When judging that the space utilization rate that in hierarchical stor, one-level stores exceedes setting threshold, or, when the Data Migration cycle arrives, then trigger migration.
Step 103, performs described Data Migration.
Preferably, if trigger migration, it is the migration triggered by which kind of background thread that system can record, and chooses migrating objects, completes migration.
Step 104, according to the situation of described migration, adjusts the described Data Migration cycle.
Concrete, when the space utilization rate that the reason triggering migration is one-level storage in hierarchical stor exceedes setting threshold, that is: due to the migration of one-level storage fragmentation deficiency initiation, illustrate now there is a large amount of data writes, timely adjustment to be made to Data Position, shorten the described Data Migration cycle, as the new described Data Migration cycle.
Concrete, due to the migration that migration approach exhaustion cycle time causes, but but do not have actual data mobile to occur, illustrative system does not have significant read-write operation within this cycle, extends the migration cycle, as the new described Data Migration cycle.
Concrete, due to the migration that migration cycle approach exhaustion causes, have normal data mobile to occur, then original migration cycle is constant.
Preferably, be the described Data Migration cycle, higher limit and lower limit are set.When the result in shortening described Data Migration cycle is lower than described lower limit, using described lower limit as the new described Data Migration cycle, or, when the result in prolongation described Data Migration cycle is higher than described higher limit, using described higher limit as the new described Data Migration cycle.
Step 105, after described Data Migration period modulation, described two-wire journey reads parameter again, continues next round and monitors.
Preferably, after Data Migration period modulation, described two-wire journey reads the Data Migration cycle parameter after renewal again, again monitors whether Data Migration condition reaches.
Based on identical design, second embodiment of the invention also provides a kind of device determining data migration time, and as shown in Figure 2, this device comprises monitoring module 201, judge module 202, Data Migration module 203 and adjusting module 204.
Monitoring module 201 is connected with judge module 202, for starting two-wire journey, monitors the space utilization rate that in hierarchical stor, one-level stores and Data Migration cycle respectively.
Judge module 202 is connected with Data Migration module 203 with described monitoring module 201 respectively, for by described two-wire journey, regularly judges that whether described Data Migration condition is satisfied.
Concrete, described Data Migration condition comprise space utilization rate that in described hierarchical stor, one-level stores exceed setting threshold or, the Data Migration cycle arrives.
Concrete, when judging that the space utilization rate that in hierarchical stor, one-level stores does not exceed setting threshold, when the Data Migration cycle does not arrive yet, then not trigger data migration, judges after the by the time identical time interval again.When judging that the space utilization rate that in hierarchical stor, one-level stores exceedes setting threshold, or, when the Data Migration cycle arrives, then trigger migration.
Data Migration module 203 is for performing described Data Migration.
Preferably, if trigger migration, it is the migration triggered by which kind of background thread that system can record, and chooses migrating objects, completes migration.
Adjusting module 204 is connected with described Data Migration module 203, for adjusting the described Data Migration cycle.
Concrete, when the space utilization rate that the reason triggering migration is one-level storage in hierarchical stor exceedes setting threshold, that is: due to the migration of one-level storage fragmentation deficiency initiation, illustrate now there is a large amount of data writes, timely adjustment to be made to Data Position, shorten the described Data Migration cycle, as the new described Data Migration cycle.
Concrete, due to the migration that migration approach exhaustion cycle time causes, but but do not have actual data mobile to occur, illustrative system does not have significant read-write operation within this cycle, extends the migration cycle, as the new described Data Migration cycle.
Concrete, due to the migration that migration cycle approach exhaustion causes, have normal data mobile to occur, then original migration cycle is constant.
Preferably, be the described Data Migration cycle, higher limit and lower limit are set.When the result in shortening described Data Migration cycle is lower than described lower limit, using described lower limit as the new described Data Migration cycle, or, when the result in prolongation described Data Migration cycle is higher than described higher limit, using described higher limit as the new described Data Migration cycle.
Preferably, described adjusting module 204 is connected with described monitoring module 201, after again reading parameter, starts two-wire journey for described two-wire journey, monitor the space utilization rate that in hierarchical stor, arbitrary grade stores and Data Migration cycle respectively, namely return the step 101 in the first embodiment.
Preferably, after Data Migration period modulation, described two-wire journey reads the Data Migration cycle parameter after renewal again, again monitors whether Data Migration condition reaches.
The embodiment of the present invention provides a kind of method and apparatus determining data migration time, be intended to solve current cannot the suitable data migration time of Dynamic Selection, both guaranteed to play the advantage of hierarchical stor, do not have again the problem of too much resource for in-fighting, not only can make full use of the space that the one-level in hierarchical stor stores, also can ensure that system adjusts Data Position timely, make the access performance of system reach best.
It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) perform method described in each embodiment of the present invention.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.