CN105138417B - A kind of asynchronous replication method based on zfs send - Google Patents
A kind of asynchronous replication method based on zfs send Download PDFInfo
- Publication number
- CN105138417B CN105138417B CN201510405509.9A CN201510405509A CN105138417B CN 105138417 B CN105138417 B CN 105138417B CN 201510405509 A CN201510405509 A CN 201510405509A CN 105138417 B CN105138417 B CN 105138417B
- Authority
- CN
- China
- Prior art keywords
- threads
- sets
- breakpoint
- cache
- file
- 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.)
- Expired - Fee Related
Links
Abstract
The present invention relates to a kind of asynchronous replication methods based on zfs send, including:1) copy function, client terminal start-up are executed;2) system and remote backup systems exchange initial message is locally stored;3) client sends breakpoint file, specially:Client creates sets of threads:Sets of threads is read, for reading snapshot contents and being saved in cache;Sets of threads is write, the snapshot contents for that will preserve to cache generate in breakpoint file write-in low speed disk, judge whether the cache occupied reaches maximum value;Sets of threads is sent, for the breakpoint files through network interface in cache to be sent to server-side;Message is gone into next thread and is continued with after this thread completes the work of current generation by message-driven between each sets of threads;4) server-side receives breakpoint file, and returns to duplication result.Compared with prior art, it is efficient to have many advantages, such as to be effectively ensured data consistency, backup by the present invention.
Description
Technical field
The present invention relates to memory system technologies field, more particularly, to a kind of asynchronous replication method based on zfs send,
It is the core technology in backup disaster tolerance system.
Background technology
Over the last number of years, as all trades and professions digitize the propulsion of process, the importance of data is also more and more obvious.One
In a little events, many companies are exactly to cause data to be all destroyed overnight because not having disaster tolerance system.Customer data is lost, and is damaged
Be not only company, also client.Local backup to caused by human operational error, single machine failure data corruption and
Loss is effective.But to caused by fire, earthquake etc. system and data corruption just seem helpless.If abundant
Data only back up also far from enough by the safety of safeguards system and data in local, it is necessary to be established in remote site
Another system, and include the total data backup of current production system, this just needs to use remote copy technology.
Remote copy technology is the key technology applied to remote data disaster tolerance, it by long-range strange land to important number
According to reservation one or more parts copy so that reduce the Rogue program to data when disaster occurs, while in a relatively short period of time
Restore service operation.Remote copy technology has following central factor to need to consider:
1, implementation level
Mainly there are application layer, operating system layer and accumulation layer.The data duplication of application layer refers to being realized by application software
The remote copy of data.This mode needs to upgrade existing application software, increases the complexity of application software, to whole
The performance of a operation system causes large effect.
The data duplication of operating system is the remote copy realized by the logical volume management layer of operating system.It is to deposit
The logic data block of storage carries out for unit, when the data block in some logical volume of the local production center is updated, needs this
A update operation copies in the logical volume corresponding to remote disaster tolerance center.This mode can occupy the resource of host system, shadow
Ring the operational efficiency of application software on host.
The data duplication of storage device refers to realizing copy function to store this layer, is single with volume or file system
Position.Such mode is not take up host resource, while transparent to operating system and application, substantially reduces the complexity of upper layer software (applications) design
Program.Duplication described herein is realized in this layer.
2, the method for synchronization
Mainly have two ways, such as synchronous duplication and asynchronous replication.Data duplicates refer to each in local production system
A IO is both needed to be written in remote backup system just calculate and complete;Asynchronous data replication refers to that the IO in local production system is normal
Execute, without waiting for the completion of remote copy, local creation data by later be sometime sent to remote backup system
In system.
This two kinds of modes respectively have advantage and disadvantage.Synchronous duplication is real-time, and local data and remote data are complete when disaster occurs
It is complete consistent, the inconsistent situation of data is not had.But such mode is very big by bandwidth contributions, and data transmission distance is shorter.Once
There is congestion, failure in network between two websites, then operation system can be caused unavailable.
Asynchronous replication mode is not carried out due to writing local data and transmitting data to remote backup in synchronization, to
Response speed of the host to business is not influenced, but sacrifices the stric consistency of local and remote data.Once local system
Extension, and can have partial data loss.
3, data consistency
Data consistency refers to whether the logical relation between associated data is normal and complete.In asynchronous replication process,
It will appear such a case, i.e., two times for having logical associations successively occurred, be copied to remote backup website
Later, remote backup system may only save the event occurred later, and first occurred event is without or first preserving
The event of later generation, after save first occurred event.It is inconsistent that here it is data, if local production system hangs,
Remote backup system takes over operation, and operation system will be run in this part of wrong data, cause serious consequence.Therefore,
How to ensure that the data consistency of remote backup system is an asynchronous replication problem needed to be considered.
Snapshot be to specify data set a completely available copy, the copy include corresponding data at some time point
Mapping.Based on this characteristic, snapshot can be done on source object, then copy to the corresponding all data blocks of this part of snapshot far
Cheng Zhandian, such remote backup system can be obtained by a completely available backup about production system.Then every one
It section regular time, repeats the above process, you can new data are backuped to from production system in far end system, while being ensured remote
The data at end are available.
This way can not only make full use of existing snapshot functions, additionally it is possible to fairly simple realization copy function.
4, replicative cycle
Using asynchronous replication technology, the data of local production system and the data of remote backup system can not strict conformances.
If production system hangs, it will cause partial data loss.Loss of data number, depend on the frequency replicated, i.e. period.For
Reduce loss of data, then must more frequently carry out asynchronous replication operation.Which type of neither one unified principle shows
It is frequently suitable, it needs that according to enterprise how many data degradation can be born to determine.
Invention content
It is an object of the present invention to overcome the above-mentioned drawbacks of the prior art and provide one kind being based on zfs send
Asynchronous replication method, based on zfs send orders accumulation layer realize remote copy function, be not take up host resource, to operate
System and host provide extremely strong scalability using transparent, convenient for the additional features needed in addition specific transactions ring mirror, or
Person reduces unwanted characteristic.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of asynchronous replication method based on zfs send, this method by the client that is set in the system of being locally stored and
The server-side being set in remote backup system is realized, is included the following steps:
1) copy function, client terminal start-up are executed;
2) system and remote backup systems exchange initial message is locally stored;
3) client sends breakpoint file, specially:
Client creates sets of threads:
Sets of threads is read, for reading snapshot contents and being saved in cache, hair message informing writes line after the completion of reading
Journey group;
Sets of threads is write, the snapshot contents for that will preserve to cache generate breakpoint file, judge that the high speed occupied is slow
It deposits and whether reaches maximum value, if so, by the breakpoint file write-in low speed disk of generation, it is slow that thread detection high speed is continued after
This document is read in into cache again when having free space;If it is not, then directly hair message informing sends sets of threads or by low speed
Breakpoint file in disk sends out message informing after reading in cache and sends sets of threads again;
Sets of threads is sent, for the breakpoint files through network interface in cache to be sent to server-side;
Message is gone to by next line after this thread completes the work of current generation by message-driven between each sets of threads
Journey continues with;
4) server-side receives breakpoint file, and returns to duplication result.
In the step 2), the initial message of exchange includes volume or file system name to be copied, volume to be copied
Or the size of data of file system, this feature replicated and whether resume the place being interrupted since last time.
In the step 4), server-side creates during receiving breakpoint file:
Receiving thread group generates fast for reconfiguring all breakpoint files received in remote backup system
According to.
In the step 4), server-side creates during receiving breakpoint file:
Thread is inquired, feeds back to client for result will to be replicated.
The client also creates during sending breakpoint file and service end reception breakpoint file:
Sets of threads is encrypted, for each breakpoint file to be encrypted or decrypted.
The client also creates during sending breakpoint file and service end reception breakpoint file:
Sets of threads is compressed, for each breakpoint file to be compressed or decompressed.
Compared with prior art, the invention has the advantages that:
1, realize copy function, satisfaction be not take up host resource and meanwhile on operating system and application it is transparent, do not influence to deposit
Under the premise of storing up the response speed to business, the data of local production website are backuped into remote station.Meanwhile it ensure that distal end
Data consistency in backup site can really pass by service take-over in the case where local production system hangs.Again
Secondary, when at regular intervals or the newly-increased data of object to be copied reach specified threshold, the primary new duplication of automatic trigger will
Newly-increased data copy to remote backup website.
2, high-performance, under gigabit networking ring mirror, multiple-copy rate can reach 108MB/s, under 10,000,000,000 networking ring mirrors, replicate
Rate can reach 400MB/s.
3, breakpoint transmission characteristic is provided.By the method for the invention, improving after zfs send are interrupted must just retransfer
The shortcomings that total data.When leading to reproduction process due to certain factors (such as production system abnormal power-down, network interruption etc.)
When being forced to interrupt, having been passed to the data of remote backup website need not transmit again, it is only necessary to be passed since the place of interruption
It passs.This can greatly save client's time, improve backup efficiency.
4, encryption feature is provided, ensure safety of the data in transmission over networks.Support following Encryption Algorithm:DES algorithms,
It is calculated using the 3DES algorithms of two keys, using the 3DES algorithms of three keys, DESX algorithms, RC2 algorithms, RC4 algorithms, RC5
Method, IDEA algorithms, aes algorithm, Blowfish algorithms.
5, by compression property, duplicate data transmission is reduced, data transmission efficiency is further increased.Following compression is supported to calculate
Method:Gzip, Bzip2, LZMA, XZ, LZ4, LZO algorithm.
6, expansible, the function of each thread is mutual indepedent, and is driven using message.In this manner so that
It does not interdepend between each thread.To increase some new characteristic, it is only necessary to will realize the message queue of the thread of the characteristic
It is registered in existing chain of messages;To remove some characteristic, then only need to realize the message team of the thread of the characteristic
Row are removed from chain of messages.
7, the present invention writes the snapshot contents of reading when the cache for replicating occupancy reaches a certain amount of or ratio temporarily
Into low speed disk, avoids occupying multi-cache when the snapshot data amount of reading is very big and influence system stability.
8, the present invention is all copied to snapshot long-range standby by the breakpoint processing of snapshot and reconfiguring for breakpoint file
Part terminal, ensure that the consistency of data.
Description of the drawings
Fig. 1 is the flow diagram of client of the present invention;
Fig. 2 is the flow diagram of server-side of the present invention;
Fig. 3 is that the reproduction process of the present invention interacts schematic diagram.
Specific implementation mode
The present invention is described in detail with specific embodiment below in conjunction with the accompanying drawings.The present embodiment is with technical solution of the present invention
Premised on implemented, give detailed embodiment and specific operating process, but protection scope of the present invention is not limited to
Following embodiments.
Embodiment 1
The present embodiment provides a kind of asynchronous replication methods based on zfs send, and this method is by being set to the system of being locally stored
In client (copy client) and the server-side (copy server) that is set in remote backup system realize, server-side
In resident system, the connection of client is monitored, client only can be just performed when user executes copy function.
As shown in Figure 1-Figure 3, above-mentioned asynchronous replication method specifically includes following steps:
1) copy function, client terminal start-up are executed.Copy function issues copy command to originally by user or scheduling thread
Ground storage system starts.Scheduling thread issues copy command:At regular intervals or object to be copied increases data newly and reaches
When to specified threshold, the primary new duplication of automatic trigger.
2) system and remote backup systems exchange initial message, including volume to be copied or file system name is locally stored
Word, the size of data of volume to be copied or file system, this feature replicated (ratio is such as whether support encryption, compression) and are
It is resumed the no place being interrupted since last time.
3) client sends breakpoint file, specially:
Client creates sets of threads:
Sets of threads (reader) is read, for reading snapshot contents and being saved in cache, reads and completes latecomer message
Notice writes sets of threads;
Sets of threads (writer) is write, the snapshot contents for that will preserve to cache generate breakpoint file.Judge to occupy
Cache whether reach maximum value, if so, by the breakpoint file of generation write-in low speed disk, thread inspection is continued after
It surveys cache and this document is read in into cache again when being free free space;If it is not, then directly hair message informing sends sets of threads
Or message informing is sent out after reading in the breakpoint file in low speed disk in cache again and sends sets of threads;
Sets of threads (sender) is sent, for the breakpoint files through network interface in cache to be sent to service
End.
4) server-side receives breakpoint file, and returns to duplication as a result, after data correctly copy to remote station, discharges
This replicates the resource occupied and exits, and terminates this and replicates operation.
Server-side also creates and reading sets of threads in client, to write sets of threads function identical during receiving breakpoint file
Sets of threads is also created for obtaining breakpoint file:Receiving thread group (receiver), all breakpoints for will receive
File reconfigures, and snapshot is generated in remote backup system;Thread (query) is inquired, feeds back to visitor for result will to be replicated
Family end.
It is also respectively created during client sends breakpoint file and service end receives breakpoint file:Encrypt thread
Group, for each breakpoint file to be encrypted or decrypted;Sets of threads is compressed, for each breakpoint file to be compressed or solved
Pressure.
Message is gone to by next line after this thread completes the work of current generation by message-driven between each sets of threads
Journey continues with.Design substantially increases the scalability of program in this way.As long as message not to be sent to the message team of some thread
In row, you can shield the characteristic, vice versa.Message only transmits metadata, snapshot data remain stored in cache with
Just speed up processing.
Embodiment 2
The characteristics such as encryption, compression, reference are not included in asynchronous replication method provided in this embodiment based on zfs send
Shown in Fig. 1-Fig. 3, specific reproduction process is as follows:
1. user or scheduling thread issue copy command to being locally stored in system, system is locally stored can pull-up duplication visitor
Family end process.
2. it can include mainly in following with remote backup systems exchange initial message, message that system, which is locally stored, first
Hold:Whether the size of data of volume or file system name, volume to be copied or file system to be copied was interrupted from last time
Place starts to resume.
3. three groups of threads of local replica process creation:Sets of threads is sent, for sending snapshot breakpoint file to remote station;
Thread is read, for reading snapshot contents from disk;Sets of threads is write, is written for generating breakpoint file, while by breakpoint file
Disk is read from disk.
4. after creating each sets of threads, main thread, which is just slept, waits for each thread to complete work.
5. as soon as often being read in a snapshot data to cache for breakpoint file size read thread, it is logical to send a message
Know and write thread process, then proceedes to read in the snapshot data to cache of next breakpoint file.
6. writing after thread receives and read the message that sends of thread, first judge whether the cache occupied has reached maximum
Value is that disk then is written in the breakpoint file, this document is read in cache again when subsequent cache is free free space
It is handled, otherwise directly hair message informing sends thread and this file is transmitted to remote station.
7. sending thread after receiving the message for writing thread transmission, the breakpoint file is sent to far by network interface
End station point.
8. after main thread monitors that all threads all exit, this result replicated will be inquired to remote station.
9. after data correctly copy to remote station, just discharges this and replicate the resource occupied and exit, terminate this
Secondary duplication operation.
Claims (6)
1. a kind of asynchronous replication method based on zfs send, which is characterized in that this method is by being set in the system of being locally stored
Client and the server-side that is set in remote backup system realize, include the following steps:
1) copy function, client terminal start-up are executed;
2) system and remote backup systems exchange initial message is locally stored;
3) client sends breakpoint file, specially:
Client creates sets of threads:
Sets of threads is read, for reading snapshot contents and being saved in cache, hair message informing writes sets of threads after the completion of reading;
Sets of threads is write, the snapshot contents for that will preserve to cache generate breakpoint file, judge that the cache occupied is
No to reach maximum value, if so, by the breakpoint file write-in low speed disk of generation, thread detection cache is continued after to be had
This document is read in into cache again when free space;If it is not, then directly hair message informing sends sets of threads or by low speed disk
In breakpoint file read in cache in after send out again message informing send sets of threads;
Sets of threads is sent, for the breakpoint files through network interface in cache to be sent to server-side;
By message-driven between each sets of threads, after this thread completes the work of current generation, by message go to next thread after
Continuous processing;
4) server-side receives breakpoint file, and returns to duplication result;
In the above method, when at regular intervals or the newly-increased data of object to be copied reach specified threshold, automatic trigger one
Newly-increased data are copied to remote backup website by secondary new duplication.
2. the asynchronous replication method according to claim 1 based on zfs send, which is characterized in that in the step 2),
The initial message of exchange include volume or file system name to be copied, volume to be copied or file system size of data,
This feature replicated and whether resume the place being interrupted since last time.
3. the asynchronous replication method according to claim 1 based on zfs send, which is characterized in that in the step 4),
Server-side creates during receiving breakpoint file:
Receiving thread group generates snapshot for reconfiguring all breakpoint files received in remote backup system.
4. the asynchronous replication method according to claim 1 based on zfs send, which is characterized in that in the step 4),
Server-side creates during receiving breakpoint file:
Thread is inquired, feeds back to client for result will to be replicated.
5. the asynchronous replication method according to claim 1 based on zfs send, which is characterized in that the client is sent
Breakpoint file and service end also create during receiving breakpoint file:
Sets of threads is encrypted, for each breakpoint file to be encrypted or decrypted.
6. the asynchronous replication method according to claim 1 based on zfs send, which is characterized in that the client is sent
Breakpoint file and service end also create during receiving breakpoint file:
Sets of threads is compressed, for each breakpoint file to be compressed or decompressed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510405509.9A CN105138417B (en) | 2015-07-10 | 2015-07-10 | A kind of asynchronous replication method based on zfs send |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510405509.9A CN105138417B (en) | 2015-07-10 | 2015-07-10 | A kind of asynchronous replication method based on zfs send |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105138417A CN105138417A (en) | 2015-12-09 |
CN105138417B true CN105138417B (en) | 2018-07-20 |
Family
ID=54723773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510405509.9A Expired - Fee Related CN105138417B (en) | 2015-07-10 | 2015-07-10 | A kind of asynchronous replication method based on zfs send |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105138417B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108733514B (en) * | 2018-05-24 | 2022-07-08 | 郑州云海信息技术有限公司 | Method, system and equipment for realizing snapshot between heterogeneous storages |
CN110109781A (en) * | 2019-07-02 | 2019-08-09 | 南京云信达科技有限公司 | A kind of data back up method for s3 cloud service |
CN115174596A (en) * | 2022-07-27 | 2022-10-11 | 济南浪潮数据技术有限公司 | Equipment remote copying method, device and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102801754A (en) * | 2011-05-24 | 2012-11-28 | 英业达集团(天津)电子技术有限公司 | Method and system for breakpoint transmission |
CN103164295A (en) * | 2013-03-22 | 2013-06-19 | 危子彪 | Enterprise information technology (IT) business virtualization disaster recovery method based on zettabyte file system (ZFS) and kernel-based virtual machine (KVM) kernel virtual underlying system |
CN103875229A (en) * | 2013-12-02 | 2014-06-18 | 华为技术有限公司 | Asynchronous replication method, device and system |
CN104484242A (en) * | 2014-12-10 | 2015-04-01 | 上海爱数软件有限公司 | Method for breaking-point transmission in copy-on-write snapshot backup process |
CN104503865A (en) * | 2014-12-10 | 2015-04-08 | 杭州斯凯网络科技有限公司 | Method for rapidly restoring postgreSQL to any point in time |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9424314B2 (en) * | 2012-10-19 | 2016-08-23 | Oracle International Corporation | Method and apparatus for joining read requests |
-
2015
- 2015-07-10 CN CN201510405509.9A patent/CN105138417B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102801754A (en) * | 2011-05-24 | 2012-11-28 | 英业达集团(天津)电子技术有限公司 | Method and system for breakpoint transmission |
CN103164295A (en) * | 2013-03-22 | 2013-06-19 | 危子彪 | Enterprise information technology (IT) business virtualization disaster recovery method based on zettabyte file system (ZFS) and kernel-based virtual machine (KVM) kernel virtual underlying system |
CN103875229A (en) * | 2013-12-02 | 2014-06-18 | 华为技术有限公司 | Asynchronous replication method, device and system |
CN104484242A (en) * | 2014-12-10 | 2015-04-01 | 上海爱数软件有限公司 | Method for breaking-point transmission in copy-on-write snapshot backup process |
CN104503865A (en) * | 2014-12-10 | 2015-04-08 | 杭州斯凯网络科技有限公司 | Method for rapidly restoring postgreSQL to any point in time |
Also Published As
Publication number | Publication date |
---|---|
CN105138417A (en) | 2015-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10127117B2 (en) | Online backup to an object service using bulk export | |
US7844787B2 (en) | Techniques for data replication with snapshot capabilities | |
JP4699091B2 (en) | Disaster recovery method and system | |
JP4668763B2 (en) | Storage device restore method and storage device | |
US11907561B2 (en) | Data backup method and apparatus | |
US7694177B2 (en) | Method and system for resynchronizing data between a primary and mirror data storage system | |
US10831741B2 (en) | Log-shipping data replication with early log record fetching | |
CN103116615B (en) | A kind of data index method and server based on version vector | |
CN110109778A (en) | A kind of a large amount of small data file backup methods and restoration methods | |
CN103595559A (en) | System and method for transmitting big data and service system thereof | |
CN102866935B (en) | Instant replication method and storage system based on ISCSI (internet small computer system interface) | |
CN103095843A (en) | Method and client of data backup based on version vectors | |
WO2014101409A1 (en) | Data backup method and related device and system | |
CN102014152A (en) | Long-distance duplicating system and method | |
CN105138417B (en) | A kind of asynchronous replication method based on zfs send | |
US8190947B1 (en) | Method and system for automatically constructing a replica catalog for maintaining protection relationship information between primary and secondary storage objects in a network storage system | |
CN103118104A (en) | Data restoration method based on version vector, and server | |
WO2015067073A1 (en) | Data operating method and device | |
CN101771548A (en) | File synchronizing method and system | |
US20070055834A1 (en) | Performance improvement for block span replication | |
CN103605616A (en) | Multi-controller cache data consistency guarantee method | |
CN103384266A (en) | Parastor200 management node high availability method based on real-time synchronization at file level | |
CN110417892B (en) | Message analysis-based data replication link optimization method and device | |
JP6671708B2 (en) | Backup restore system and backup restore method | |
CN103530205A (en) | Method and device for processing fault duplicate in multiple duplicates |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 201112 Shanghai, Minhang District, United Airlines route 1188, building second layer A-1 unit 8 Applicant after: SHANGHAI EISOO INFORMATION TECHNOLOGY CO., LTD. Address before: 201112 Shanghai, Minhang District, United Airlines route 1188, building second layer A-1 unit 8 Applicant before: Shanghai Eisoo Software Co.,Ltd. |
|
COR | Change of bibliographic data | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180720 Termination date: 20190710 |