CN105095486A - Cluster database disaster recovery method and device - Google Patents

Cluster database disaster recovery method and device Download PDF

Info

Publication number
CN105095486A
CN105095486A CN201510505439.4A CN201510505439A CN105095486A CN 105095486 A CN105095486 A CN 105095486A CN 201510505439 A CN201510505439 A CN 201510505439A CN 105095486 A CN105095486 A CN 105095486A
Authority
CN
China
Prior art keywords
node
database
current
cluster
nodes
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.)
Pending
Application number
CN201510505439.4A
Other languages
Chinese (zh)
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510505439.4A priority Critical patent/CN105095486A/en
Publication of CN105095486A publication Critical patent/CN105095486A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • G06F11/1425Reconfiguring to eliminate the error by reconfiguration of node membership
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a cluster database disaster recovery method and device. The method comprises the steps that a database is deployed on each of N nodes of a server cluster, and the databases are initialized to the same state, wherein N is a positive integer larger than 2; two nodes are selected from the nodes to be used as the master node and the slave node, the database located on the master node is used as the master database, and the database located on the slave node is the slave database kept synchronous with data of the master database; the healthy state of the master node is detected; when the master node is crashed, the slave node is used as the current master node, and another node in the server cluster is selected as the current slave node. According to the cluster database disaster recovery method and device, the specificity of the cluster environment is sufficiently utilized, the database disaster recovery scheme is in a 1+1+N pattern, and extra resource investment is saved while data safety of the databases is ensured.

Description

A kind of Cluster Database disaster recovery method and device
Technical field
The present invention relates to server cluster and database disaster tolerance technology field, particularly relate to a kind of Cluster Database disaster recovery method and device.
Background technology
Traditional Cluster Database Disaster Tolerant Scheme all adopts two-shipper standby mutually, or additional configuration tape library carries out database data backup, and large enterprise more needs to adopt long-range strange land DB Backup.Its database disaster tolerance is all more fixing, or needs to drop into extra fund.Wherein, tape library needs to drop into substantial contribution and buys, and also needs to drop into extra tape library and safeguards.Then there is hidden danger in two-node cluster hot backup, when needing to ensure that standby host uses, main frame can be repaired as early as possible, otherwise database cannot ensure its safety.Strange land Disaster Preparation Center then can relate to the problem such as transmission speed and Web vector graphic cost.
Therefore, provide a kind of can reduce extra resource drop into database disaster recovery method and device be necessary.
Summary of the invention
The object of this invention is to provide a kind of Cluster Database disaster recovery method and device, object is to solve the problem that in existing database Disaster Tolerant Scheme, resource consumption is larger.
For solving the problems of the technologies described above, the invention provides a kind of Cluster Database disaster recovery method, comprising:
N number of node of server cluster disposes database respectively, and by described data base initialize to same state, described N be greater than 2 positive integer;
From described node, select two nodes respectively as host node, from node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Detect the health status of described host node;
When described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
Alternatively, described when described host node delays machine, using described from node as current primary node, and select other nodes in described server cluster to comprise from node as current:
When described host node delays machine, detect the described health status from node;
When described be normal condition from node time, using described from node as current primary node, and select other nodes in described server cluster as current from node.
Alternatively, described when described host node delays machine, using described from node as current primary node, and select other nodes in described server cluster to comprise from node as current:
When described host node delays machine, using described from node as current primary node, and to select in described service area cluster other surviving node as current from node.
Alternatively, also comprise:
Described current primary node and the described current information from node is pointed out to user.
Present invention also offers a kind of Cluster Database disaster tolerance device, comprising:
Module is set, for disposing database respectively on N number of node of server cluster, and by described data base initialize to same state, described N be greater than 2 positive integer;
Select module, for selecting two nodes respectively as host node, from node from described node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Detection module, for detecting the health status of described host node;
Disaster tolerance module, for when described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
Alternatively, described disaster tolerance module is used for when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
Described disaster tolerance module, specifically for when described host node delays machine, detects the described health status from node; When described be normal condition from node time, using described from node as current primary node, and select other nodes in described server cluster as current from node.
Alternatively, described disaster tolerance module is used for when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
Described disaster tolerance module, specifically for when described host node delays machine, using described from node as current primary node, and to select in described service area cluster other surviving node as current from node.
Alternatively, also comprise:
Reminding module, for pointing out described current primary node and the described current information from node to user.
Cluster Database disaster recovery method provided by the present invention and device, by disposing database respectively, and by data base initialize to same state on N number of node of server cluster; In node select two nodes respectively as host node, from node, the database being positioned at host node is master data base, be positioned at from the database of node be keep with master data base data syn-chronization from database; The health status of host node is detected on backstage; When described host node delays machine, will from node as current primary node, and to select in described server cluster other nodes as current from node.Cluster Database disaster recovery method provided by the present invention and device, take full advantage of the singularity of cluster environment, the Disaster Tolerant Scheme of database become the pattern of 1+1+N.While guarantee database data safety, extra resource input can be saved.In addition, at synchronization, only need to keep host node and the data syn-chronization from node, greatly reduce database synchronization data stream.
Accompanying drawing explanation
Fig. 1 is the method flow diagram of a kind of embodiment of Cluster Database disaster recovery method provided by the present invention;
Fig. 2 is the method flow diagram of the another kind of embodiment of Cluster Database disaster recovery method provided by the present invention;
Fig. 3 is the structured flowchart of a kind of embodiment of Cluster Database disaster tolerance device provided by the present invention.
Embodiment
In order to make those skilled in the art person understand the present invention program better, below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.Obviously, described embodiment is only 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 the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, the method comprises the method flow diagram of a kind of embodiment of Cluster Database disaster recovery method provided by the present invention:
Step S101: dispose database respectively on N number of node of server cluster, and by described data base initialize to same state, described N be greater than 2 positive integer;
Step S102: select two nodes respectively as host node, from node from described node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Step S103: the health status detecting described host node;
Step S104: when described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
Cluster Database disaster recovery method provided by the present invention, by disposing database respectively, and by data base initialize to same state on N number of node of server cluster; In node select two nodes respectively as host node, from node, the database being positioned at host node is master data base, be positioned at from the database of node be keep with master data base data syn-chronization from database; Detect the health status of host node; When described host node delays machine, will from node as current primary node, and to select in described server cluster other nodes as current from node.Cluster Database disaster recovery method provided by the present invention, takes full advantage of the singularity of cluster environment, the Disaster Tolerant Scheme of database is become the pattern of 1+1+N.While guarantee database data safety, extra resource input can be saved.In addition, at synchronization, only need to keep host node and the data syn-chronization from node, greatly reduce database synchronization data stream.
As shown in Figure 2, the method comprises the method flow diagram of the another kind of embodiment of Cluster Database disaster recovery method provided by the present invention:
Step S201: dispose database respectively on N number of node of server cluster, and by described data base initialize to same state, described N be greater than 2 positive integer;
Particularly, the hardware environment due to company-data disaster recovery method provided by the present invention is in cluster environment, therefore, after cluster environment has been built, assessed by user, N number of node of cluster disposes database simultaneously, and is initialised to same state.
Step S202: select two nodes respectively as host node, from node from described node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
In cluster use procedure, data are saved in master data base, simultaneously according to the Database Backup Strategy that user is arranged, by the database synchronization from the database in node and host node.
Step S203: the health status detecting described host node;
Step S204: when described host node delays machine, detects the described health status from node;
Step S205: when described be normal condition from node time, using described from node as current primary node, and select other surviving node in described server cluster as current from node.
Step S206: point out described current primary node and the described current information from node to user, and point out user to carry out database synchronization immediately.
In addition, Cluster Database disaster recovery method provided by the present invention can further include:
In machine situation of delaying from node, select other arbitrary nodes as from node, and prompting is used for carrying out database synchronization immediately.
Cluster Database disaster recovery method provided by the present invention, has broken fixing database schema, has considered the singularity of cluster environment, the disaster recovery method of database is become the pattern of 1+1+N, improve the dirigibility of database disaster tolerance.While guarantee database data safety, extra resource input can be saved and avoids extra data stream resource consumption.
As shown in Figure 3, this device comprises the structured flowchart of a kind of embodiment of Cluster Database disaster tolerance device provided by the present invention:
Module 100 is set, for disposing database respectively on N number of node of server cluster, and by described data base initialize to same state, described N be greater than 2 positive integer;
Select module 200, for selecting two nodes respectively as host node, from node from described node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Detection module 300, for detecting the health status of described host node;
Disaster tolerance module 400, for when described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
Cluster Database disaster tolerance device provided by the present invention, by disposing database respectively, and by data base initialize to same state on N number of node of server cluster; From node select two nodes respectively as host node, from node, the database being positioned at host node is master data base, be positioned at from the database of node be keep with master data base data syn-chronization from database; The health status of host node is detected on backstage; When described host node delays machine, will from node as current primary node, and to select in described server cluster other nodes as current from node.
Cluster Database disaster tolerance device provided by the present invention, takes full advantage of the singularity of cluster environment, the Disaster Tolerant Scheme of database is become the pattern of 1+1+N, improve the dirigibility of database disaster tolerance.Can while guarantee database data safety, the entirety reducing database disaster tolerance drops into, and decreases the resource consumption of data stream.
As a kind of preferred implementation, Cluster Database disaster tolerance device provided by the present invention can further include:
Reminding module 500, for pointing out described current primary node and the described current information from node to user, prompting user carries out database synchronization immediately.
Cluster Database disaster tolerance device provided by the present invention is corresponding with above-mentioned Cluster Database disaster recovery method, does not repeat them here.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiment, between each embodiment same or similar part mutually see.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (8)

1. a Cluster Database disaster recovery method, is characterized in that, comprising:
N number of node of server cluster disposes database respectively, and by described data base initialize to same state, described N be greater than 2 positive integer;
From described node, select two nodes respectively as host node, from node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Detect the health status of described host node;
When described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
2. Cluster Database disaster recovery method as claimed in claim 1, is characterized in that, described when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
When described host node delays machine, detect the described health status from node;
When described be normal condition from node time, using described from node as current primary node, and select other nodes in described server cluster as current from node.
3. Cluster Database disaster recovery method as claimed in claim 2, is characterized in that, described when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
When described host node delays machine, using described from node as current primary node, and to select in described service area cluster other surviving node as current from node.
4. the Cluster Database disaster recovery method as described in any one of claims 1 to 3, is characterized in that, also comprise:
Described current primary node and the described current information from node is pointed out to user.
5. a Cluster Database disaster tolerance device, is characterized in that, comprising:
Module is set, for disposing database respectively on N number of node of server cluster, and by described data base initialize to same state, described N be greater than 2 positive integer;
Select module, for selecting two nodes respectively as host node, from node from described node, the database being positioned at described host node is master data base, be positioned at described from the database of node be keep with described master data base data syn-chronization from database;
Detection module, for detecting the health status of described host node;
Disaster tolerance module, for when described host node delays machine, using described from node as current primary node, and to select in described server cluster other nodes as current from node.
6. Cluster Database disaster tolerance device as claimed in claim 5, it is characterized in that, described disaster tolerance module is used for when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
Described disaster tolerance module, specifically for when described host node delays machine, detects the described health status from node; When described be normal condition from node time, using described from node as current primary node, and select other nodes in described server cluster as current from node.
7. Cluster Database disaster tolerance device as claimed in claim 6, it is characterized in that, described disaster tolerance module is used for when described host node delays machine, using described from node as current primary node, and selects other nodes in described server cluster to comprise from node as current:
Described disaster tolerance module, specifically for when described host node delays machine, using described from node as current primary node, and to select in described service area cluster other surviving node as current from node.
8. the Cluster Database disaster tolerance device as described in any one of claim 5 to 7, is characterized in that, also comprise:
Reminding module, for pointing out described current primary node and the described current information from node to user.
CN201510505439.4A 2015-08-17 2015-08-17 Cluster database disaster recovery method and device Pending CN105095486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510505439.4A CN105095486A (en) 2015-08-17 2015-08-17 Cluster database disaster recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510505439.4A CN105095486A (en) 2015-08-17 2015-08-17 Cluster database disaster recovery method and device

Publications (1)

Publication Number Publication Date
CN105095486A true CN105095486A (en) 2015-11-25

Family

ID=54575921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510505439.4A Pending CN105095486A (en) 2015-08-17 2015-08-17 Cluster database disaster recovery method and device

Country Status (1)

Country Link
CN (1) CN105095486A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021030A (en) * 2016-05-30 2016-10-12 浪潮电子信息产业股份有限公司 Database system and database fault processing method and device
CN106301938A (en) * 2016-08-25 2017-01-04 成都索贝数码科技股份有限公司 A kind of high availability and the data base cluster system of strong consistency and node administration method thereof
CN106407264A (en) * 2016-08-25 2017-02-15 成都索贝数码科技股份有限公司 High-availability and high-consistency database cluster system and command processing method thereof
CN106452864A (en) * 2016-09-30 2017-02-22 北京悦畅科技有限公司 Parking lot fault protection method, apparatus and system thereof
CN107277111A (en) * 2017-05-19 2017-10-20 腾讯科技(深圳)有限公司 A kind of company-data processing method, master node, slave node and cluster
CN109582509A (en) * 2017-09-29 2019-04-05 中兴通讯股份有限公司 Distributed file system disaster tolerance configuration method, device and readable storage medium storing program for executing
CN110389961A (en) * 2019-07-26 2019-10-29 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN110399207A (en) * 2019-06-29 2019-11-01 苏州浪潮智能科技有限公司 Timed task processing method, system and storage medium in distributed memory system
CN111459909A (en) * 2020-03-13 2020-07-28 北京许继电气有限公司 Method for constructing PostgreSQL L database cluster
CN112653734A (en) * 2020-12-11 2021-04-13 邦彦技术股份有限公司 Server cluster real-time master-slave control and data synchronization system and method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156781A1 (en) * 2006-01-05 2007-07-05 Aditya Kapoor Detecting failover in a database mirroring environment
CN101309167A (en) * 2008-06-27 2008-11-19 华中科技大学 Disaster allowable system and method based on cluster backup
CN101667181A (en) * 2008-09-05 2010-03-10 华为技术有限公司 Method, device and system for data disaster tolerance
CN103034697A (en) * 2012-12-06 2013-04-10 江苏引跑网络科技有限公司 Method for realizing high availability of distributed database
CN103209091A (en) * 2013-01-18 2013-07-17 中兴通讯股份有限公司 Hot backup method and system for clustering system
CN104516966A (en) * 2014-12-24 2015-04-15 北京奇虎科技有限公司 High-availability solving method and device of database cluster

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156781A1 (en) * 2006-01-05 2007-07-05 Aditya Kapoor Detecting failover in a database mirroring environment
CN101309167A (en) * 2008-06-27 2008-11-19 华中科技大学 Disaster allowable system and method based on cluster backup
CN101667181A (en) * 2008-09-05 2010-03-10 华为技术有限公司 Method, device and system for data disaster tolerance
CN103034697A (en) * 2012-12-06 2013-04-10 江苏引跑网络科技有限公司 Method for realizing high availability of distributed database
CN103209091A (en) * 2013-01-18 2013-07-17 中兴通讯股份有限公司 Hot backup method and system for clustering system
CN104516966A (en) * 2014-12-24 2015-04-15 北京奇虎科技有限公司 High-availability solving method and device of database cluster

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021030A (en) * 2016-05-30 2016-10-12 浪潮电子信息产业股份有限公司 Database system and database fault processing method and device
CN106301938A (en) * 2016-08-25 2017-01-04 成都索贝数码科技股份有限公司 A kind of high availability and the data base cluster system of strong consistency and node administration method thereof
CN106407264A (en) * 2016-08-25 2017-02-15 成都索贝数码科技股份有限公司 High-availability and high-consistency database cluster system and command processing method thereof
CN106452864A (en) * 2016-09-30 2017-02-22 北京悦畅科技有限公司 Parking lot fault protection method, apparatus and system thereof
CN107277111A (en) * 2017-05-19 2017-10-20 腾讯科技(深圳)有限公司 A kind of company-data processing method, master node, slave node and cluster
CN109582509A (en) * 2017-09-29 2019-04-05 中兴通讯股份有限公司 Distributed file system disaster tolerance configuration method, device and readable storage medium storing program for executing
CN110399207A (en) * 2019-06-29 2019-11-01 苏州浪潮智能科技有限公司 Timed task processing method, system and storage medium in distributed memory system
CN110389961A (en) * 2019-07-26 2019-10-29 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN111459909A (en) * 2020-03-13 2020-07-28 北京许继电气有限公司 Method for constructing PostgreSQL L database cluster
CN112653734A (en) * 2020-12-11 2021-04-13 邦彦技术股份有限公司 Server cluster real-time master-slave control and data synchronization system and method
CN112653734B (en) * 2020-12-11 2023-09-19 邦彦技术股份有限公司 Real-time master-slave control and data synchronization system and method for server cluster

Similar Documents

Publication Publication Date Title
CN105095486A (en) Cluster database disaster recovery method and device
CN103902617A (en) Distributed database synchronization method and system
CN102054035B (en) Data range-based method for synchronizing data in database
EP3493471A1 (en) Data disaster recovery method, apparatus and system
CN102629268B (en) Data synchronization method, system and date access device
CN103744724A (en) Timed task clustering method and device thereof
CN105187464B (en) Method of data synchronization, apparatus and system in a kind of distributed memory system
CN105141456A (en) Method for monitoring high-availability cluster resource
CN105024841B (en) A kind of synchronous fault processing method and system of clock and Time Synchronization Network
CN111104069B (en) Multi-region data processing method and device of distributed storage system and electronic equipment
CN106156318B (en) System and method for realizing high availability of multi-node database
CN102521297A (en) Method for achieving system dynamic expansion in shared-nothing database cluster
CN104424275A (en) Database system and data synchronization method
CN105518641A (en) Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching
CN106919473A (en) A kind of data disaster recovery and backup systems and method for processing business
CN109597718A (en) A kind of disaster recovery platform and a kind of disaster recovery method
CN104917827A (en) Method for realizing oracle load balancing cluster
CN104503868B (en) Method of data synchronization, device and system
CN106383756A (en) Method for realizing disaster recovery switching of storage without interrupting Linux system service
CN107562382B (en) Automatic dynamic disk capacity expansion method and system based on timed task
JP5944796B2 (en) Disaster recovery method and disaster recovery system
US20140164591A1 (en) Synchronization Of A Virtual Machine Across Mobile Devices
CN102841840B (en) The message logging restoration methods that Effect-based operation reorders and message number is checked
CN104536852A (en) Data recovery method and device
CN104123201B (en) The backup method of a kind of zero lost data and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151125