CN104679614B - A kind of Database Disaster Backup/Recover - Google Patents

A kind of Database Disaster Backup/Recover Download PDF

Info

Publication number
CN104679614B
CN104679614B CN201510147765.2A CN201510147765A CN104679614B CN 104679614 B CN104679614 B CN 104679614B CN 201510147765 A CN201510147765 A CN 201510147765A CN 104679614 B CN104679614 B CN 104679614B
Authority
CN
China
Prior art keywords
server
master server
database
snapshot
data
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.)
Active
Application number
CN201510147765.2A
Other languages
Chinese (zh)
Other versions
CN104679614A (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.)
Civil And Military Information Technology Co Ltd In Chengdu
Original Assignee
Civil And Military Information Technology Co Ltd In Chengdu
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 Civil And Military Information Technology Co Ltd In Chengdu filed Critical Civil And Military Information Technology Co Ltd In Chengdu
Priority to CN201510147765.2A priority Critical patent/CN104679614B/en
Publication of CN104679614A publication Critical patent/CN104679614A/en
Application granted granted Critical
Publication of CN104679614B publication Critical patent/CN104679614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The present invention relates to database field, more particularly to a kind of Database Disaster Backup/Recover.Including master server and the snapshot for including database from server, the master server and from server;During database normal operation, master server and from server be respectively separated preset time or according to instruction to database carry out snapshot;When master server breaks down, by being operated from server generation for master server;When master server recovers data, its data is first returned into the specified snapshot before failure occurs, then the data duplication not having in the specified snapshot to master server, master server is rejoined into cluster from from server;The present invention can be the time window backed up at any time using creating for not possessing BACKUP TIME window, and do not influence the normal operation of database and application, and can solve the problems, such as the generation of daily record branch, the present invention can also rapidly be integrated into current application environment and be used to test, and do not influence current system and continue to run with.

Description

A kind of Database Disaster Backup/Recover
Technical field
The present invention relates to database field, more particularly to a kind of Database Disaster Backup/Recover.
Background technology
Database is the core of all IT systems, saves the partial data run in operation system, and Database Systems are set The journal recovery of database concerns important during standby collapse.At present, the calamity of reply Database Systems equipment collapse is mostly such as device Shown in Fig. 1, by two server groups into master server primary, from server standalone, under normal circumstances by main clothes Business device externally provides service, receives the operations such as application program Du ﹑ Xie ﹑ Geng Gai ﹑ deletions, and standalone provides read-only operation;Such as Shown in Fig. 2, the data of master server are copied to from server in real time, and the data of master server are received from server, and its is extensive Multiple to arrive out of database, the data that master server follows server have certain residual quantity t ' all the time.
And when master server is delayed machine, continue offer service from server, will occurrence log branch situation, that is, from The daily record of server is not the newest daily record of database on master server, but master server is delayed, machine reception arrives last Brought into operation at daily record, so causing daily record that branch occurs, as shown in Figure 3.
This can not be returned in cluster after resulting in master server reparation.
Existing solution method is the backup by recovering last time, it is returned to the time of last time backup Point, because last time BACKUP TIME point is certainly than the time point of normal mode is switched to from server old (more earlier), institute The database after backup can be added into cluster.But it is huge the time required to backup database, such as 20T data volume, according to Main flow optical fiber 8Gb is calculated at present, 20T=20*1024*1024M=20971520M, 8Gb=8Gb/8=1GB=1024MB, by In optical fiber packet header bag tail and transmission efficiency factor, the speed 1024*0.8=819.2MB really transmitted is also converted to, so Recovery time ideally needs 20*1024*1024/819.2 about to need 7.1 hour recovery time.Such case for It is unacceptable for key business.
The content of the invention
The problem of it is an object of the invention to overcome current Database Disaster Backup/Recover data recovery to need overlong time, there is provided A kind of extremely short Database Disaster Backup/Recover of recovery time, including master server with from server, the master server and from service Include the snapshot of database in device.
During database normal operation, master server and from server be respectively separated preset time or according to instruction to database Carry out snapshot.
When master server breaks down, by being operated from server generation for master server.
When master server recovers data, its data is first returned into the specified snapshot before failure occurs, then from from service The data duplication not having in the specified snapshot to master server, master server is rejoined into cluster in device.
Further, during database normal operation, from server data be master server in data by optical fiber or with Too net replicates in real time.
Further, during database normal operation, master server externally receives reading and writing, changes and deletion action;From service Device only externally provides read-only operation.
Further, when master server is not normally functioning, immediately by externally providing reading and writing from server, changing and delete Division operation.
Preferably, the snapshot is to be stored using ZFS file system or vxfs file system.
Compared with prior art, beneficial effects of the present invention:
Due to taking snapping technique to be backed up for master and slave server, therefore the present invention can be by arbitrarily setting snapshot Interval time is the application for not possessing BACKUP TIME window, creates the time window backed up at any time, and do not influence Database and the normal operation of application.Simultaneously when database is recovered, by way of selecting to recover to specified snapshot It is quick to solve the problems, such as the generation of daily record branch.The present invention can be achieved only to do smaller change (increase to traditional database calamity for equipment Database snapshot) current application environment both can be rapidly integrated into for testing, and do not influence current system and continue to run with.
Brief description of the drawings:
Fig. 1 is traditional disaster recovery and backup systems schematic diagram.
Fig. 2 is traditional disaster recovery and backup systems principal and subordinate's server transaction data storage schematic diagram.
Fig. 3 be traditional disaster recovery and backup systems delay progress data recovery after machine when occurrence log branch schematic diagram.
Fig. 4 is Database Disaster Backup/Recover schematic diagram provided by the invention.
Principal and subordinate's snapshot server schematic diagram in Fig. 5 embodiment of the present invention 1.
Fig. 6 is that master server recovers schematic diagram data in the embodiment of the present invention 1.
Principal and subordinate's snapshot server schematic diagram in Fig. 7 embodiment of the present invention 2.
Fig. 8 is that master server recovers schematic diagram data in the embodiment of the present invention 2.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment the present invention is described in further detail.But this should not be interpreted as to this The scope for inventing above-mentioned theme is only limitted to following embodiment, all to belong to the present invention based on the technology that present invention is realized Scope.
Embodiment 1:It is an object of the invention to overcome current Database Disaster Backup/Recover data recovery to need overlong time Problem, there is provided a kind of extremely short Database Disaster Backup/Recover of recovery time, as shown in figure 4, including master server with from server, institute State master server and include the snapshot of database from server;(it is noted that in this area, host node, main service Device refers both to same technological concept, similar, is also same technological concept from server, standby server, from node) master server With being linked together from optional between server by optical fiber or Ethernet, the snapshot of database may be selected to use ZFS files System or vxfs file system.
During database normal operation, data are that data are multiple in real time by optical fiber or Ethernet in master server from server System;Now, master server externally receives reading and writing to database, changed and deletion action;Only externally provided from server read-only Operation.
Master server and it is respectively separated preset time from server or itself data-base content is carried out according to instruction fast According to, it is necessary to illustrate, being conducted due to data from master server to from server needs the regular hour, therefore with for the moment Carve, master server with from server data certain residual quantity t ' (as shown in Figure 2) all the time be present, therefore, even if master server With carrying out snapshot to its data in synchronization all the time from server, the snapshot contents of its synchronization also differ;Therefore, Master server and the snapshot interval time from server, the snapshot of master server can be set according to being actually needed respectively completely Interval time can be identical with the snapshot interval time from server, can also it is entirely different (i.e. master server may be selected with from Server carries out snapshot in the same time all the time, also can carry out snapshot in different time).
In the present embodiment, master server and snapshot (i.e. main service is carried out respectively from server using identical interval time Device and from server all the time the same time carry out snapshot), set server normal operation when, master server, from server 4 The snapshot of individual different time is respectively T1, T2, T3, T4 and T1 ', T2 ', T3 ', T4 ', now, master server snapshot as shown in Figure 5 With residual quantity t ' be present from snapshot server content, i.e., for snapshot T1 and T1 ', T2 and the T2 ' of synchronization, T3 and T3 ', Residual quantity t ' be present in T4 and T4 '.When master server breaks down (machine of such as delaying) after snapshot T4, from a moment occurs by failure, It is operated from server generation for master server;When i.e. master server is not normally functioning, immediately by externally being provided from server Database reading and writing, change and deletion action, and still carry out snapshot according to former default interval time from server and produce fast According to T5 ' (as shown in Figure 6).
And, it is necessary to rejoin cluster after master server reparation, now need first to carry out data recovery to main service, recover Step is as follows:
(1) master server its data is first returned into the specified snapshot before failure occurs, because failure occurs in snapshot After T4, any one in T1, T2, T3, T4 may be selected in theory and recovered, but because the Snapshot time that selection recovers more leans on Before, then the data recovery time needed is longer, and select recover Snapshot time too close to fault time when, such as return to T4 When, due to the presence of data residual quantity t ' between T4 and T4 ', it is impossible to eliminate daily record branch problem.Therefore selected in the present embodiment extensive Arrive snapshot T2 again, that is, when ensureing snapshot data content that selection recovers earlier than master server failure from server in data Appearance.
(2) by master server snapshot data compared with the snapshot data from server, and will from server T2 it is fast Master server is returned according to the data duplication after the moment, master server rejoins cluster.
It is mainly that master server returns to using the data recovery time needed for Database Disaster Backup/Recover provided by the invention After specifying snapshot (being snapshot T2 in the present embodiment), master server replicates this from from server and specifies caused number after snapshot According to;Compared with traditional disaster recovery and backup systems need whole database data carrying out duplication, after only replicating before failure sometime Data obviously spend the time much less.
Embodiment 2:The present embodiment is with the difference of embodiment 1, master server with it is each pre- according to itself from server If time carry out snapshot, as shown in fig. 7, within the same period, the snapshot that sets master server be respectively T1, T2, T3, T4, T5, it is T1 ', T2 ', T3 ', T4 ' from the snapshot of server.
In the present embodiment, and now needed first to main service, it is necessary to when rejoining cluster after master server fault restoration Data recovery is carried out, recovering step is as follows:
(1) master server its data is first returned into the specified snapshot before failure occurs, it is assumed that master server is in snapshot Broken down after T5, to eliminate daily record branch problem, when ensureing the snapshot data content of selection recovery earlier than master server failure The data content from server, therefore master server is recovered to snapshot T3 (as shown in Figure 8) in the present embodiment.
(2) by master server snapshot data compared with the snapshot data from server, and will from server T3 it is fast Master server is returned according to the data duplication after the moment, master server rejoins cluster.

Claims (5)

  1. A kind of 1. Database Disaster Backup/Recover, it is characterised in that including master server with from server, the master server and from clothes Include the snapshot of database in business device;
    During database normal operation, master server and from server be respectively separated preset time or according to instruction to database carry out Snapshot;The snapshot interval time of master server is identical with the snapshot interval time from server, or different;
    When master server breaks down, by being operated from server generation for master server;
    When master server recovers data, its data is first returned into the specified snapshot before failure occurs, then from from server The data duplication not having in the specified snapshot to master server, master server is rejoined into cluster.
  2. 2. Database Disaster Backup/Recover as claimed in claim 1, it is characterised in that during database normal operation, from server Data are that data are replicated in real time by optical fiber or Ethernet in master server.
  3. 3. Database Disaster Backup/Recover as claimed in claim 1, it is characterised in that during database normal operation, master server pair It is outer to receive reading and writing, change and deletion action;Read-only operation is only externally provided from server.
  4. 4. Database Disaster Backup/Recover as claimed in claim 1, it is characterised in that when master server is not normally functioning, immediately By externally providing reading and writing from server, changing and deletion action.
  5. 5. Database Disaster Backup/Recover as claimed in claim 1, it is characterised in that the snapshot be using ZFS file system or Vxfs file system stores.
CN201510147765.2A 2015-03-31 2015-03-31 A kind of Database Disaster Backup/Recover Active CN104679614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510147765.2A CN104679614B (en) 2015-03-31 2015-03-31 A kind of Database Disaster Backup/Recover

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510147765.2A CN104679614B (en) 2015-03-31 2015-03-31 A kind of Database Disaster Backup/Recover

Publications (2)

Publication Number Publication Date
CN104679614A CN104679614A (en) 2015-06-03
CN104679614B true CN104679614B (en) 2018-03-27

Family

ID=53314704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510147765.2A Active CN104679614B (en) 2015-03-31 2015-03-31 A kind of Database Disaster Backup/Recover

Country Status (1)

Country Link
CN (1) CN104679614B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117165A (en) * 2015-07-17 2015-12-02 浪潮(北京)电子信息产业有限公司 Dual-controller snapshot taking-over and switching-back method and apparatus
CN109783277B (en) * 2015-11-18 2023-12-29 华为技术有限公司 Disaster recovery end, production end and data recovery method between disaster recovery end and production end
CN106919473B (en) * 2015-12-28 2020-10-30 创新先进技术有限公司 Data disaster backup system and service processing method
CN105955989B (en) * 2015-12-31 2020-12-22 华云数据控股集团有限公司 Method for establishing master server and slave server of cloud platform database
CN107015883B (en) * 2016-01-28 2020-07-17 中国移动通信集团上海有限公司 Dynamic data backup method and device
CN107657055A (en) * 2017-10-18 2018-02-02 国网福建省电力有限公司 A kind of back-up system method of data synchronization based on distribution main website
CN108416040B (en) * 2018-03-14 2020-10-27 上海达梦数据库有限公司 Database repair method and device, terminal equipment and storage medium
CN111209139A (en) * 2019-12-29 2020-05-29 航天信息股份有限公司 Disaster recovery method and device based on version control management system
CN112445780A (en) 2020-11-27 2021-03-05 上海上讯信息技术股份有限公司 Master-slave architecture deployment method and device based on snapshot
CN112286733B (en) * 2020-12-23 2021-04-06 深圳市科力锐科技有限公司 Method, device and equipment for determining backup data recovery time and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5101492A (en) * 1989-11-03 1992-03-31 Compaq Computer Corporation Data redundancy and recovery protection
CN1642030A (en) * 2004-01-05 2005-07-20 华为技术有限公司 Method for realizing network management duoble computer disaster-tolerance back-up
CN100353331C (en) * 2006-03-10 2007-12-05 四川大学 Long-distance data fast restoring method of network information system
CN100591022C (en) * 2007-11-29 2010-02-17 上海华为技术有限公司 Method and apparatus for implementing preactivation of batch configuration
CN101668048B (en) * 2009-09-28 2012-08-22 武汉大学 Data protection method and system for supporting any time data access and modification
CN102710752B (en) * 2012-05-13 2015-12-02 徐州易存信息技术有限公司 Calamity is for storage system
CN103914359B (en) * 2012-12-31 2017-09-26 中国移动通信集团浙江有限公司 A kind of data reconstruction method and device
CN203149553U (en) * 2013-03-28 2013-08-21 中国大唐集团财务有限公司 Remote disaster recovery system with data safety verification function
CN103226502B (en) * 2013-05-21 2015-08-19 中国工商银行股份有限公司 A kind of data calamity is for control system and data reconstruction method

Also Published As

Publication number Publication date
CN104679614A (en) 2015-06-03

Similar Documents

Publication Publication Date Title
CN104679614B (en) A kind of Database Disaster Backup/Recover
CN101316184B (en) Disaster tolerance switching method, system and device
CN102891849B (en) Service data synchronization method, data recovery method, data recovery device and network device
CN110209726A (en) Distributed experiment & measurement system system, method of data synchronization and storage medium
CN105069160A (en) Autonomous controllable database based high-availability method and architecture
US20140258241A1 (en) Zero and near-zero data loss database backup and recovery
CN106815097A (en) Database disaster tolerance system and method
CN101739313B (en) Method for protecting and restoring continuous data
WO2018098972A1 (en) Log recovery method, storage device and storage node
CN105955836A (en) Cold-hot backup automatic walkthrough multifunction system
CN105302667B (en) High reliability data backup and restoration methods based on aggregated structure
CN109189860A (en) A kind of active and standby increment synchronization method of MySQL based on Kubernetes system
CN102214128A (en) Repurposable recovery environment
CN109032849A (en) Hot backup system, heat backup method and computer equipment
CN106484565A (en) Method of data synchronization between multiple data centers and relevant device
CN107229540A (en) A kind of database restoring method and system based on time point
CN101714169A (en) Method and system for transmitting data on multiple nodes
JP6511739B2 (en) Redundant system and redundant method
CN110209526A (en) A kind of accumulation layer synchronization system and storage medium
CN105956139A (en) Method for synchronizing database in two machines
CN105956207A (en) Binlog-based configurable mysql database real-time synchronization method
CN109347655B (en) Network data based fault recovery system and method and storage medium
WO2018076696A1 (en) Data synchronization method and out-of-band management device
CN106021020B (en) A kind of dual-active data station application data hanging method and device
CN112364104A (en) Distributed database capacity expansion method, distributed database system and computer readable storage medium

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