CN106557543A - Node switching method and system - Google Patents
Node switching method and system Download PDFInfo
- Publication number
- CN106557543A CN106557543A CN201610899618.5A CN201610899618A CN106557543A CN 106557543 A CN106557543 A CN 106557543A CN 201610899618 A CN201610899618 A CN 201610899618A CN 106557543 A CN106557543 A CN 106557543A
- Authority
- CN
- China
- Prior art keywords
- node
- cluster
- city
- host node
- logical block
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000004519 manufacturing process Methods 0.000 claims abstract description 61
- 230000003111 delayed effect Effects 0.000 claims description 9
- 238000001514 detection method Methods 0.000 claims description 6
- IJJVMEJXYNJXOJ-UHFFFAOYSA-N fluquinconazole Chemical compound C=1C=C(Cl)C=C(Cl)C=1N1C(=O)C2=CC(F)=CC=C2N=C1N1C=NC=N1 IJJVMEJXYNJXOJ-UHFFFAOYSA-N 0.000 description 18
- 238000010586 diagram Methods 0.000 description 8
- 230000001360 synchronised effect Effects 0.000 description 6
- 238000011084 recovery Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000010076 replication Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1479—Generic software techniques for error detection or fault masking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
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 node switching method, which is applied to a same-city production cluster, wherein the same-city production cluster comprises a main node and a standby node, a data synchronization mode is set between the main node and the standby node, and the node switching method comprises the following steps: when a main node with a logic unit in a production cluster in the same city is down, determining a standby node associated with the main node; and switching the logic unit from the main node to the standby node so that the standby node updates and provides data read-write service for the main node. The invention also discloses a node switching system. The main nodes and the standby nodes of the same-city production cluster adopt data synchronization, and the main nodes can be quickly switched to the standby nodes to continuously provide data read-write service even if the main nodes are down, so that the data loss condition is avoided.
Description
Technical field
The present invention relates to data-base cluster technical field, more particularly to a kind of node switching method and system.
Background technology
In the traditional IT of bank (Information Technology, information technology) framework, database schema is general
Follow the framework principle at three center of two places, including same castellan's central database, with city in central database and across city disaster tolerance
Heart data base.Wherein, it is production data base used with castellan's central database, is same castellan center for central database with city
The backup database of data base, for backing up the data with castellan's central database.Break down in same castellan's central database
In the case of, the request of operation system can be switched to same city for central database, to provide number from same castellan's central database
According to the service of read-write.
As existing same city is two independent data bases for central database and with castellan's central database, two numbers
There is no synchronization or asynchronous and synchronous according to the data between storehouse, so when same castellan's central database delays machine, being switched to same city standby
Central database carries out reading and writing data, needs to spend longer time by the data copy at main center to standby center, could be by standby
The read-write service of center continuation offer data, and during this period of time, if other data are reported, due to cannot respond to the number
According to so as to cause the loss of data.
The content of the invention
Present invention is primarily targeted at proposing a kind of node switching method and system, it is intended to solve from main central database
The machine of delaying switches to standby central database and carries out reading and writing data process, needs to take a long time, is easily caused the loss of data
Technical problem.
For achieving the above object, a kind of node switching method that the present invention is provided, is applied in same city production cluster, described
Include host node and slave node with city production cluster, between the host node and the slave node, be set to data syn-chronization mode,
The node switching method includes:
Same city produce cluster in have logical block host node delay machine when, it is determined that standby with what the host node was associated
Node;
The logical block is switched in the slave node from the host node, is saved based on being updated by the slave node
Point provides reading and writing data service.
Preferably, the host node association slave node include multiple slave nodes when, it is described by the logical block from
The step that the host node is switched in the slave node includes:
Determine the switching priority of each slave node;
In the slave node that the logical block is switched to highest priority from the host node.
Preferably, it is described same city produce cluster in have logical block host node delay machine when, it is determined that with the master
After the step of slave node of node association, the machine if slave node of the detection host node association is also delayed, the node are cut
Changing method also includes:
It is determined that across the city disaster tolerance cluster associated with the same city production cluster;
Host node in across city disaster tolerance cluster described in obtaining;
The logical block is generated in the host node of cluster from the same city, across the city disaster tolerance cluster is switched to
Host node in.
Preferably, it is described that the logical block is generated in the host node of cluster from the same city, switch to described
After the step in the host node of city disaster tolerance cluster, if detect the host node across city disaster tolerance cluster also delaying
Machine, the node switching method also include:
The slave node associated with the host node in across city disaster tolerance cluster described in obtaining;
By the logical block from described in the host node of city disaster tolerance cluster, switch to across the city disaster tolerance cluster
The slave node in.
Preferably, the logical block carries out the time control of node switching within a preset time interval.
Additionally, for achieving the above object, the present invention also proposes a kind of node switched system, is applied to same city production cluster
In, the same city production cluster includes host node and slave node, is set to data same between the host node and the slave node
Step mode, the node switched system include:
First determining module, for same city produce cluster in have logical block host node delay machine when, it is determined that with
The slave node of the host node association;
First handover module, for the logical block is switched in the slave node from the host node, with by institute
State slave node and host node offer reading and writing data service is provided.
Preferably, when the slave node in host node association includes multiple slave nodes, first handover module includes:
Determining unit, for determining the switching priority of each slave node;
Switch unit, for the logical block is switched to into highest priority from the host node slave node in.
Preferably, the machine if slave node of the detection host node association is also delayed, the node switched system also include:
Second determining module, for determining across the city disaster tolerance cluster associated with the same city production cluster;
First acquisition module, for obtaining the host node in across the city disaster tolerance cluster;
Second handover module, for the logical block is generated in the host node of cluster from the same city, switching
It is extremely described in the host node of city disaster tolerance cluster.
Preferably, also delay machine if detecting the host node across city disaster tolerance cluster, the node switching system
System also includes:
Second acquisition module, for obtaining the slave node associated with the host node in across the city disaster tolerance cluster;
3rd handover module, for by the logical block from described in the host node of city disaster tolerance cluster, switching
It is extremely described in the slave node of city disaster tolerance cluster.
Preferably, the logical block carries out the time control of node switching within a preset time interval.
Node switching method proposed by the present invention and system, are applied in same city production cluster, and the same city produces cluster
Including host node and slave node, data syn-chronization mode between the host node and the slave node, is set to, the production in same city collects
Group in have logical block host node delay machine when, first determine the slave node associated with the host node, then patrol described
Collect unit to switch in the slave node from the host node, provide reading and writing data clothes host node is updated to by the slave node
Business, as host node and slave node are in same production cluster, adopts data between each node in the production cluster
The method of synchronization, therefore, logical block is switched in slave node from host node, slave node may be updated as host node and provide data
Read-write service, need not take a long time and switch over, even if currently there is data to upload, it is also possible to respond at once, so as to avoid
The situation of loss of data.
Description of the drawings
Fig. 1 is traditional database schema figure;
Fig. 2 is the schematic flow sheet of node switching method first embodiment of the present invention;
Fig. 3 is the stream that the logical block is switched to the present invention preferred embodiment in the slave node from the host node
Journey schematic diagram;
Fig. 4 is the schematic flow sheet of node switching method second embodiment of the present invention;
Fig. 5 is the schematic flow sheet of node switching method 3rd embodiment of the present invention;
Fig. 6 is the present invention preferably implement scene schematic diagram;
Fig. 7 is the high-level schematic functional block diagram of node switched system first embodiment of the present invention;
Fig. 8 is the refinement high-level schematic functional block diagram of the first handover module in Fig. 7;
Fig. 9 is the high-level schematic functional block diagram of node switched system second embodiment of the present invention;
Figure 10 is the high-level schematic functional block diagram of node switched system 3rd embodiment of the present invention.
The realization of the object of the invention, functional characteristics and advantage will be described further in conjunction with the embodiments referring to the drawings.
Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The solution of the embodiment of the present invention is mainly:The host node and slave node same city produced in cluster is set to number
According to the method for synchronization, the host node for having logical block in same city produces cluster delay machine when, first determine and host node pass
Then the logical block is switched in the slave node by the slave node of connection from the host node, with by the slave node more
Newly reading and writing data service is provided for host node, need not take a long time and switch over, even if currently there are data to upload, it is also possible to
Respond at once, so as to avoid the situation of loss of data.
The technical term being related in the present invention includes:
Relevant database:Relational database, the data base being built upon on the basis of relational model, by means of algebra of sets
Deng the data that mathematical concept and method come in processing data storehouse.
RTO:Recovery Time Object (target recovery time), after referring to that disaster occurs, delay machine from Database Systems
Cause the quarter of service pause, recover to can support that all departments operate to Database Systems, when business recovery is runed, this
Time period between 2 points.
RPO:Recovery Point Object (recovery point objectives), refers to a past time point.When disaster generation
When, the time point that data can be returned to.
SET:The logical block of the technical program data-base cluster, a logical block are the minimum of a data-base cluster
Allocation unit, multiple logical blocks constitute a cluster.
It is appreciated that in the IT architecture of traditional bank, database schema typically follows the framework principle at three center of two places,
Its deployment Organization Chart is as shown in figure 1, concrete deployment way:
It is production data base used with castellan's central database, all operation systems are directed to data base's read request asks with writing
Ask;
General for central database with city and be deployed in same city with castellan's central database, physical distance is tens
Within kilometer, for the DB Backup in same city, read-write service is not externally provided.Break down in same castellan's central database
When, the request of operation system can be switched to same city for central database, and with city for center and with adopting between castellan center
With data asynchronous and synchronous mode;
Across city disaster recovery center database portion is deployed on another city, scope of the physical distance in hundreds of kilometer, for across city
Strange land data disaster tolerance.Across city disaster recovery center data base and with asynchronous equally using data between the data of castellan's central database
The method of synchronization.
The database schema at traditional three center of two places is always the technical scheme of banking internal standard.In traditional main flow
In framework, mostly using this kind of technical scheme carrying out framework and deployment, but this deployment way has the disadvantage that:
(1) due to same castellan's central database and with city for central database, with castellan's central database and across city disaster tolerance
Data asynchronous and synchronous mode is all arranged between central database, thus with castellan's central database service delay machine when, it is impossible to
Ensure with city for central database and the RPO=0 of across city disaster recovery center data base, have the risk of loss of data.
(2) active-standby switch is carried out with castellan's central database and synchronous standby central database, generally require artificial participation and cut
Change of current journey, switch step are complex, and risk is higher, and RTO switching times are longer.
The problem that the present invention is present for three center framework of two places, based on the database software increased income, realizes same city many
Living and across metropolitan area long-distance disaster data-base cluster framework more than data center so that with castellan's central database service delay machine when, together
City active-standby switch automatization, and RPO=0 is can guarantee that, RTO is completed in second level.It should be noted that present invention is preferably applicable to
Bank's scene similarly hereinafter living more than many machine rooms in city and across city long-distance disaster data-base cluster framework.
Specifically, the present invention provides a kind of node switching method.
With reference to Fig. 2, Fig. 2 is the schematic flow sheet of node switching method first embodiment of the present invention.
In the present embodiment, it is applied in same city production cluster, the same city production cluster includes host node and slave node,
Data syn-chronization mode is set between the host node and the slave node, the node switching method includes:
Step S10, same city produce cluster in have logical block host node delay machine when, it is determined that with the host node
The slave node of association;
Step S20, the logical block is switched in the slave node from the host node, with by the slave node more
Newly reading and writing data service is provided for host node.
In the present embodiment, same city production cluster is preferably applied to, this includes host node and slave node with city production cluster,
As the same city production cluster is an overall architecture, therefore, this produces host node and the slave node in cluster with city
Between be set to data syn-chronization mode, same city produce cluster in have logical block host node delay machine when, first determine and
The slave node of the host node association, when then the slave node in host node association only includes a slave node, you can will
The logical block is switched in the slave node from the host node, provides data to be updated to host node by the slave node
Read-write service.
In the present embodiment, in order to improve the intelligent of node switching, include in the slave node of host node association many
During individual slave node, with reference to Fig. 3, step S20 includes:
Step S21, determines the switching priority of each slave node;
Step S22, in the slave node that the logical block is switched to highest priority from the host node.
I.e. when slave node includes multiple, switching priority highest slave node, in the present embodiment, the switching are first determined
The determination mode of priority is preferably:Each slave node of current normal operation is obtained, it is then determined that updating in each slave node
Data type, and the data type by the data type updated in each slave node with the logical block compares, most
The data type for updating at last immediate slave node with the data type of the logical block, as switching priority highest
Slave node.In the slave node that the logical block is switched to highest priority from the host node again
In the present embodiment, it is after the logical block being switched to the slave node from the host node, now, described
Slave node may be updated as host node turn-on data read-write service, to carry out the read-write of data.
Further, in the present embodiment, the same city production cluster can dispose multiple logical blocks, multiple to distribute to
Operation system is used, also, the node in each logical block can carry out free replacement, freely increase and decrease, and is not interfered with same
City produces the availability of cluster, and specific replacement and increase and decrease mode can be configured as the case may be, not limit herein.
It is understood that the present invention is the equal of for central database and with castellan's central database by traditional same city
Integrated one produces cluster with city, and as this produces the cluster data base complete equivalent to city, therefore this is produced with city
In cluster, each node could be arranged to data syn-chronization mode, overcome traditional same city for central database and with city for center
Between data base, the nonsynchronous problem of data so that host node delay machine when, you can carry out data reading in being rapidly switched to slave node
Write service.
The node switching method that the present embodiment is proposed, is applied in same city production cluster, and the same city production cluster includes
Host node and slave node, are set to data syn-chronization mode between the host node and the slave node, in same city production cluster
The host node for having logical block delay machine when, first determine the slave node associated with the host node, then by the logic list
Unit is switched in the slave node from the host node, provides reading and writing data service to be updated to host node by the slave node,
As host node and slave node are in same production cluster, data syn-chronization is adopted between each node in the production cluster
Mode, therefore, logical block is switched in slave node from host node, slave node may be updated as host node and provide reading and writing data
Service, need not take a long time and switch over, even if currently there is data to upload, it is also possible to respond at once, so as to avoid number
According to situation about losing.
Further, in order to improve the intelligent of node switching, node switching side of the present invention is proposed based on first embodiment
The second embodiment of method, in the present embodiment, with reference to Fig. 4, after step S10, if the detection host node association is standby
Node is also delayed machine, and the node switching method also includes:
Step S30, it is determined that across the city disaster tolerance cluster associated with the same city production cluster;
Step S40, obtains the host node in across the city disaster tolerance cluster;
Step S50, the logical block is generated in the host node of cluster from the same city, is switched to described across city
In the host node of disaster tolerance cluster.
In the present embodiment, the host node for having logical block in same city produces cluster is delayed machine, and the host node
The slave node of association also delay machine when, now, first determine across the city disaster tolerance cluster associated with the same city production cluster, then
Acquisition host node in across the city disaster tolerance cluster, and the logical block is generated into the described main section of cluster from the same city
In point, switch to it is described in the host node of city disaster tolerance cluster, to carry out data reading by the host node across city disaster tolerance cluster
Write service.
Further, in order to improve the intelligent of node switching, node switching side of the present invention is proposed based on second embodiment
The 3rd embodiment of method, in the present embodiment, with reference to Fig. 5, after step S50, if detecting across the city disaster tolerance cluster
The host node also delay machine, the node switching method also includes:
Step S60, the slave node associated with the host node in obtaining across the city disaster tolerance cluster;
Step S70, by the logical block from described in the host node of city disaster tolerance cluster, switch to described across city
In the slave node of disaster tolerance cluster.
In the present embodiment, logical block is being switched to into across the city appearance from the host node of same city generation cluster
After in the host node of calamity cluster, if detect the host node across city disaster tolerance cluster also delaying machine, now, then obtain
The slave node associated with the host node in taking across the city disaster tolerance cluster, and by the logical block from across the city disaster tolerance collection
In the host node of group, switch to it is described in the slave node of city disaster tolerance cluster, with by described across city disaster tolerance cluster
Slave node carries out reading and writing data service.
It should be noted that may include in the slave node associated with the host node in across the city disaster tolerance cluster one or
It is multiple, when slave node includes multiple, equally can first determine that switching priority is switched over again, the determination switching priority
Mode it is consistent with the above, here is omitted.
Further, in first, second, and third embodiment, the logical block carries out the time of node switching and all controls
Make within a preset time interval, such as in 10 seconds, to prevent the long and caused loss of data of node switching time.
In the present invention, in order to be best understood from whole scheme, citing application scenarios are as follows:
With reference to Fig. 6, overall architecture is divided into same city production cluster and across city disaster tolerance cluster two large divisions;Wherein, produce with city
As a example by disposing 3 production machine rooms, as a example by disposing 2 production machine rooms, each machine room represents one to across city disaster tolerance cluster to cluster
Node, produces from same city and finds out in cluster and across city disaster tolerance cluster, all only includes a host node.
The smallest allocation unit produced in cluster and across city disaster tolerance cluster in same city is logical block, produces cluster with city,
Each logical block has three physical servers, and this three physical servers are distributed in three machine rooms of the cluster of same city production;
Across city disaster tolerance cluster, each logical block have two physical servers, and this two physical servers are distributed in across city disaster tolerance cluster
Two production machine rooms.
Cluster is produced with city, 3 nodes of each logical block constitute a master two for structure, wherein host node and slave node
Between data syn-chronization mode be strongly consistent synchronization, across the machine room deployment of 3 nodes of logical block realizes the same of data-base cluster
Framework living more than many machine rooms in city.Across city disaster tolerance cluster, 2 nodes of each logical block constitute a master one for structure, wherein main section
Data syn-chronization mode between point and slave node is strongly consistent synchronization, produces cluster across the logical block of city disaster tolerance cluster and with city
Logical block between, data are set to asynchronous and synchronous mode.It is appreciated that producing cluster due to across city disaster tolerance cluster and with city
Relatively far apart, therefore, remain set to the mode of data asynchronous and synchronous, but can be control logic from same city production cluster switching
During to across city disaster tolerance cluster, switching time keeps within a preset time interval.
In the present invention, the main-standby nodes strongly consistent synchronization replication technology for being provided based on PostgreSQL database TDSQL, Neng Goubao
Demonstrate,prove in same logical block, the data between main-standby nodes are completely the same, even if there is the main-standby nodes switching in logical block,
The risk for losing data is there will not be, RPO=0 is ensure that, it will be appreciated that during RPO=0, just be can guarantee that between main-standby nodes
Synchronicity, so as to ensure that data are not lost.Across city disaster tolerance cluster asynchronous replication produces the data of cluster with city, it is therefore intended that real
Existing long-distance disaster.(neither can use with three, city production machine room) in the case where same city production cluster occurs bust, can
Database service is provided by across city disaster tolerance cluster, but there is the risk for losing data, it is impossible to ensure RPO=0, but can be
Control logic from same city production cluster switch to across city disaster tolerance cluster when, switching time keep within a preset time interval, so as to
Avoid a large amount of loss of data.
Further, in the present invention, the host node only produced with city in the logical block of cluster can provide data base
Read-write service;The main-standby nodes of the slave node in the logical block of cluster and the logical block across city disaster tolerance cluster are produced with city
Reading service can be provided readable not writeable;The machine if host node produced in the logical block of cluster with city is delayed, logical block
Interior to trigger automatic active-standby switch, system can automatically select a suitable slave node, as new host node, externally provide reading
Service is write, switching time is within 10 seconds, it is ensured that the availability of this logical block;If the machine room 1 for producing cluster with city goes out
Now whole machine room is unavailable, then all of logical block can all trigger active-standby switch, and each logical block can automatically select one
The suitable slave node of platform, as new host node, externally provides read-write service, and overall switching time is within 10 seconds, it is ensured that whole
The availability of individual cluster.
In technical scheme, by data-base cluster framework living more than same city multicenter, can realize that same city is more
The RPO=0 of central fault switching, and RTO switched in second level.Meanwhile, in same city there is calamitous event in production cluster
(neither can use with three, city production machine room) in the case of barrier, database service can be provided by across city disaster tolerance cluster, but be deposited
In the risk for losing data, it is impossible to ensure RPO=0, but can be that control logic switches to across city disaster tolerance from same city production cluster
During cluster, switching time is kept within a preset time interval, so as to avoid a large amount of loss of data.
The present invention further provides a kind of node switched system.
With reference to Fig. 7, Fig. 7 is the high-level schematic functional block diagram of node switched system first embodiment of the present invention.
It is emphasized that it will be apparent to those skilled in the art that functional block diagram shown in Fig. 7 is only one preferably real
The exemplary plot of example is applied, functional module of the those skilled in the art around the node switched system shown in Fig. 7 can be carried out new easily
Functional module supplement;The title of each functional module is self-defined title, is only used for aiding in understanding the node switched system
Each program function block, is not used in restriction technical scheme, and the core of technical solution of the present invention is, each self-defined title
Functional module function to be reached.
In the present embodiment, it is applied in same city production cluster, the same city production cluster includes host node and slave node,
Data syn-chronization mode is set between the host node and the slave node, the node switched system includes:
First determining module 10, for same city produce cluster in have logical block host node delay machine when, it is determined that
The slave node associated with the host node;
First handover module 20, for the logical block is switched in the slave node from the host node, with by
The slave node is updated to host node and provides reading and writing data service.
In the present embodiment, same city production cluster is preferably applied to, this includes host node and slave node with city production cluster,
As the same city production cluster is an overall architecture, therefore, this produces host node and the slave node in cluster with city
Between adopt data syn-chronization mode, same city produce cluster in have logical block host node delay machine when, first determination mould
Block 10 first determines the slave node associated with the host node, and then the slave node in host node association only includes a standby section
During point, the logical block can be switched in the slave node by the first handover module 20 from the host node, with by described
Slave node is updated to host node and provides reading and writing data service.
In the present embodiment, in order to improve the intelligent of node switching, include in the slave node of host node association many
During individual slave node, with reference to Fig. 8, first handover module 20 includes:
Determining unit 21, for determining the switching priority of each slave node;
Switch unit 22, for the logical block is switched to into highest priority from the host node slave node in.
I.e. when slave node includes multiple, determining unit 21 first determines switching priority highest slave node, the present embodiment
In, the determining unit 21 determines that the mode of switching priority is preferably:Each slave node of current normal operation is obtained, then
The data type updated in determining each slave node, and by the data type updated in each slave node and the logical block
Data type is compared, the data type for most updating at last immediate slave node with the data type of the logical block,
As switching priority highest slave node.The logical block is switched to priority from the host node by switch unit 22 again
In highest slave node.
In the present embodiment, switch unit 22 by the logical block from the host node switch to the slave node it
Afterwards, now, the slave node may be updated as host node turn-on data read-write service, to carry out the read-write of data.
Further, in the present embodiment, it is multiple to distribute to that the same city production cluster can dispose multiple logical blocks
Operation system is used, also, the node in each logical block can carry out free replacement, freely increase and decrease, and is not interfered with same
City produces the availability of cluster, and specific replacement and increase and decrease mode can be configured as the case may be, not limit herein.
It is understood that the present invention is the equal of for central database and with castellan's central database by traditional same city
Integrated one produces cluster with city, and as this produces the cluster data base complete equivalent to city, therefore this is produced with city
In cluster, each node could be arranged to data syn-chronization mode, overcome traditional same city for central database and with city for center
Between data base, the nonsynchronous problem of data so that host node delay machine when, you can carry out data reading in being rapidly switched to slave node
Write service.
The node switched system that the present embodiment is proposed, is applied in same city production cluster, and the same city production cluster includes
Host node and slave node, are set to data syn-chronization mode between the host node and the slave node, in same city production cluster
The host node for having logical block delay machine when, first determine the slave node associated with the host node, then by the logic list
Unit is switched in the slave node from the host node, provides reading and writing data service to be updated to host node by the slave node,
As host node and slave node are in same production cluster, data syn-chronization is adopted between each node in the production cluster
Mode, therefore, logical block is switched in slave node from host node, slave node may be updated as host node and provide reading and writing data
Service, need not take a long time and switch over, even if currently there is data to upload, it is also possible to respond at once, so as to avoid number
According to situation about losing.
Further, in order to improve the intelligent of node switching, node switching system of the present invention is proposed based on first embodiment
The second embodiment of system, in the present embodiment, the machine if slave node of the detection host node association is also delayed, with reference to Fig. 9, institute
Stating node switched system also includes:
Second determining module 30, for determining across the city disaster tolerance cluster associated with the same city production cluster;
First acquisition module 40, for obtaining the host node in across the city disaster tolerance cluster;
Second handover module 50, for the logical block is generated in the host node of cluster from the same city, cuts
Shift to described in the host node of city disaster tolerance cluster.
In the present embodiment, the host node for having logical block in same city produces cluster is delayed machine, and the host node
The slave node of association also delay machine when, now, the second determining module 30 first determine associate with the same city production cluster across
City disaster tolerance cluster, then acquisition host node of first acquisition module 40 in across the city disaster tolerance cluster, the second handover module 50
The logical block is generated in the host node of cluster from the same city, the host node across city disaster tolerance cluster is switched to
In, to carry out reading and writing data service by the host node across city disaster tolerance cluster.
Further, in order to improve the intelligent of node switching, node switching system of the present invention is proposed based on second embodiment
The 3rd embodiment of system, in the present embodiment, if detect the host node across city disaster tolerance cluster also delaying machine, ginseng
According to Figure 10, the node switched system also includes:
Second acquisition module 60, for obtaining the slave node associated with the host node in across the city disaster tolerance cluster;
3rd handover module 70, for by the logical block from described in the host node of city disaster tolerance cluster, cut
Shift to described in the slave node of city disaster tolerance cluster.
In the present embodiment, logical block is generated from same city in the second handover module 50 and is cut in the host node of cluster
Shift to it is described in the host node of city disaster tolerance cluster after, if detect the host node across city disaster tolerance cluster also occurring
Delay machine, now, the slave node that the second acquisition module 60 is associated with the host node in obtaining across the city disaster tolerance cluster again, the 3rd
Handover module 70 by the logical block from described in the host node of city disaster tolerance cluster, switch to across the city disaster tolerance collection
In the slave node of group, to carry out reading and writing data service by the slave node across city disaster tolerance cluster.
It should be noted that may include in the slave node associated with the host node in across the city disaster tolerance cluster one or
It is multiple, when slave node includes multiple, equally can first determine that switching priority is switched over again, the determination switching priority
Mode it is consistent with the above, here is omitted.
Further, in first, second, and third embodiment, the logical block carries out the time of node switching and all controls
Make within a preset time interval, such as in 10 seconds, to prevent the long and caused loss of data of node switching time.
It should be noted that herein, term " including ", "comprising" or its any other variant are intended to non-row
His property is included, so that a series of process, method, article or device including key elements not only include those key elements, and
And also include other key elements being not expressly set out, or also include for this process, method, article or device institute inherently
Key element.In the absence of more restrictions, the key element for being limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
Also there is other identical element in the process of key element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words
The part for going out contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), use so that a station terminal equipment including some instructions (can be mobile phone, computer, clothes
Business device, air-conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using this
Equivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of node switching method, it is characterised in that be applied in same city production cluster, the same city production cluster includes master
Node and slave node, are set to data syn-chronization mode, the node switching method bag between the host node and the slave node
Include:
Same city produce cluster in have logical block host node delay machine when, it is determined that the standby section associated with the host node
Point;
The logical block is switched in the slave node from the host node, is carried with host node being updated to by the slave node
For reading and writing data service.
2. node switching method as claimed in claim 1, it is characterised in that include in the slave node of host node association many
It is during individual slave node, described the logical block is switched to into the step in the slave node from the host node to include:
Determine the switching priority of each slave node;
In the slave node that the logical block is switched to highest priority from the host node.
3. node switching method as claimed in claim 1, it is characterised in that described to have logical block in same city production cluster
Host node delay machine when, it is determined that associate with the host node slave node the step of after, if the detection host node is closed
The slave node of connection is also delayed machine, and the node switching method also includes:
It is determined that across the city disaster tolerance cluster associated with the same city production cluster;
Host node in across city disaster tolerance cluster described in obtaining;
The logical block is generated in the host node of cluster from the same city, the master across city disaster tolerance cluster is switched to
In node.
4. node switching method as claimed in claim 3, it is characterised in that described that the logical block is given birth to from the same city
Into in the host node of cluster, switch to it is described after the step in the host node of city disaster tolerance cluster, if detecting described
Also delay machine across the host node of city disaster tolerance cluster, the node switching method also includes:
The slave node associated with the host node in across city disaster tolerance cluster described in obtaining;
By the logical block from described in the host node of city disaster tolerance cluster, switch to the institute across city disaster tolerance cluster
State in slave node.
5. the node switching method as described in any one of claim 1-4, it is characterised in that the logical block carries out node and cuts
The time control changed is within a preset time interval.
6. a kind of node switched system, it is characterised in that be applied in same city production cluster, the same city production cluster includes master
Node and slave node, are set to data syn-chronization mode, the node switched system bag between the host node and the slave node
Include:
First determining module, for same city produce cluster in have logical block host node delay machine when, it is determined that with it is described
The slave node of host node association;
First handover module, for the logical block is switched in the slave node from the host node, with by described standby
Node updates provide reading and writing data service for host node.
7. node switched system as claimed in claim 6, it is characterised in that include in the slave node of host node association many
During individual slave node, first handover module includes:
Determining unit, for determining the switching priority of each slave node;
Switch unit, for the logical block is switched to into highest priority from the host node slave node in.
8. node switched system as claimed in claim 6, it is characterised in that if the slave node of the detection host node association
Delay machine, the node switched system also includes:
Second determining module, for determining across the city disaster tolerance cluster associated with the same city production cluster;
First acquisition module, for obtaining the host node in across the city disaster tolerance cluster;
Second handover module, for the logical block is generated in the host node of cluster from the same city, switches to institute
State in the host node of city disaster tolerance cluster.
9. node switched system as claimed in claim 8, it is characterised in that if detecting described across described in the disaster tolerance cluster of city
Host node is also delayed machine, and the node switched system also includes:
Second acquisition module, for obtaining the slave node associated with the host node in across the city disaster tolerance cluster;
3rd handover module, for by the logical block from described in the host node of city disaster tolerance cluster, switch to institute
State in the slave node of city disaster tolerance cluster.
10. the node switched system as described in any one of claim 6-9, it is characterised in that the logical block carries out node
The time control of switching is within a preset time interval.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610899618.5A CN106557543A (en) | 2016-10-14 | 2016-10-14 | Node switching method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610899618.5A CN106557543A (en) | 2016-10-14 | 2016-10-14 | Node switching method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106557543A true CN106557543A (en) | 2017-04-05 |
Family
ID=58443246
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610899618.5A Pending CN106557543A (en) | 2016-10-14 | 2016-10-14 | Node switching method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106557543A (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106911524A (en) * | 2017-04-27 | 2017-06-30 | 紫光华山信息技术有限公司 | A kind of HA implementation methods and device |
CN106960060A (en) * | 2017-04-10 | 2017-07-18 | 聚好看科技股份有限公司 | The management method and device of a kind of data-base cluster |
CN108964948A (en) * | 2017-05-19 | 2018-12-07 | 北京金山云网络技术有限公司 | Principal and subordinate's service system, host node fault recovery method and device |
CN108984602A (en) * | 2018-06-05 | 2018-12-11 | 网易(杭州)网络有限公司 | A kind of database control method and Database Systems |
CN109726046A (en) * | 2018-11-23 | 2019-05-07 | 网联清算有限公司 | Computer room switching method and switching device |
CN109819004A (en) * | 2017-11-22 | 2019-05-28 | 中国人寿保险股份有限公司 | For disposing the method and system at more live data centers |
CN109995554A (en) * | 2017-12-29 | 2019-07-09 | 中国移动通信集团吉林有限公司 | The control method and cloud dispatch control device of multi-stage data center active-standby switch |
CN110149366A (en) * | 2019-04-16 | 2019-08-20 | 平安科技(深圳)有限公司 | Improve the method, apparatus and computer equipment of group system availability |
CN110493252A (en) * | 2019-08-30 | 2019-11-22 | 深圳前海微众银行股份有限公司 | Overseas small routine cut-in method, device, equipment and medium |
CN112287398A (en) * | 2020-12-29 | 2021-01-29 | 江苏荣泽信息科技股份有限公司 | Block chain network node switching system based on safe storage hardware |
CN114285864A (en) * | 2021-12-24 | 2022-04-05 | 中国建设银行股份有限公司 | Switching method and device for multiple active data centers |
CN114500525A (en) * | 2021-12-24 | 2022-05-13 | 天翼云科技有限公司 | Method, device, computer equipment and medium for updating nodes in distributed system |
CN116112347A (en) * | 2023-02-14 | 2023-05-12 | 北京人大金仓信息技术股份有限公司 | Database system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103701661A (en) * | 2013-12-23 | 2014-04-02 | 浪潮(北京)电子信息产业有限公司 | Method and system for realizing node monitoring |
CN103795553A (en) * | 2012-10-29 | 2014-05-14 | 中国银联股份有限公司 | Switching of main and standby servers on the basis of monitoring |
CN103840961A (en) * | 2012-11-23 | 2014-06-04 | 景幂机械(上海)有限公司 | Dual-computer hot backup system |
CN104679604A (en) * | 2015-02-12 | 2015-06-03 | 大唐移动通信设备有限公司 | Method and device for switching between master node and standby node |
-
2016
- 2016-10-14 CN CN201610899618.5A patent/CN106557543A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103795553A (en) * | 2012-10-29 | 2014-05-14 | 中国银联股份有限公司 | Switching of main and standby servers on the basis of monitoring |
CN103840961A (en) * | 2012-11-23 | 2014-06-04 | 景幂机械(上海)有限公司 | Dual-computer hot backup system |
CN103701661A (en) * | 2013-12-23 | 2014-04-02 | 浪潮(北京)电子信息产业有限公司 | Method and system for realizing node monitoring |
CN104679604A (en) * | 2015-02-12 | 2015-06-03 | 大唐移动通信设备有限公司 | Method and device for switching between master node and standby node |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106960060A (en) * | 2017-04-10 | 2017-07-18 | 聚好看科技股份有限公司 | The management method and device of a kind of data-base cluster |
CN106960060B (en) * | 2017-04-10 | 2020-07-31 | 聚好看科技股份有限公司 | Database cluster management method and device |
CN106911524A (en) * | 2017-04-27 | 2017-06-30 | 紫光华山信息技术有限公司 | A kind of HA implementation methods and device |
CN108964948A (en) * | 2017-05-19 | 2018-12-07 | 北京金山云网络技术有限公司 | Principal and subordinate's service system, host node fault recovery method and device |
CN109819004B (en) * | 2017-11-22 | 2021-11-02 | 中国人寿保险股份有限公司 | Method and system for deploying multi-activity data centers |
CN109819004A (en) * | 2017-11-22 | 2019-05-28 | 中国人寿保险股份有限公司 | For disposing the method and system at more live data centers |
CN109995554A (en) * | 2017-12-29 | 2019-07-09 | 中国移动通信集团吉林有限公司 | The control method and cloud dispatch control device of multi-stage data center active-standby switch |
CN108984602A (en) * | 2018-06-05 | 2018-12-11 | 网易(杭州)网络有限公司 | A kind of database control method and Database Systems |
CN108984602B (en) * | 2018-06-05 | 2021-04-16 | 网易(杭州)网络有限公司 | Database control method and database system |
CN109726046A (en) * | 2018-11-23 | 2019-05-07 | 网联清算有限公司 | Computer room switching method and switching device |
CN110149366A (en) * | 2019-04-16 | 2019-08-20 | 平安科技(深圳)有限公司 | Improve the method, apparatus and computer equipment of group system availability |
CN110149366B (en) * | 2019-04-16 | 2022-03-18 | 平安科技(深圳)有限公司 | Method and device for improving availability of cluster system and computer equipment |
CN110493252A (en) * | 2019-08-30 | 2019-11-22 | 深圳前海微众银行股份有限公司 | Overseas small routine cut-in method, device, equipment and medium |
CN112287398B (en) * | 2020-12-29 | 2021-04-20 | 江苏荣泽信息科技股份有限公司 | Block chain network node switching system based on safe storage hardware |
CN112287398A (en) * | 2020-12-29 | 2021-01-29 | 江苏荣泽信息科技股份有限公司 | Block chain network node switching system based on safe storage hardware |
CN114285864A (en) * | 2021-12-24 | 2022-04-05 | 中国建设银行股份有限公司 | Switching method and device for multiple active data centers |
CN114500525A (en) * | 2021-12-24 | 2022-05-13 | 天翼云科技有限公司 | Method, device, computer equipment and medium for updating nodes in distributed system |
CN114500525B (en) * | 2021-12-24 | 2024-04-26 | 天翼云科技有限公司 | Method, device, computer equipment and medium for updating nodes in distributed system |
CN116112347A (en) * | 2023-02-14 | 2023-05-12 | 北京人大金仓信息技术股份有限公司 | Database system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106557543A (en) | Node switching method and system | |
US10713135B2 (en) | Data disaster recovery method, device and system | |
CN106777225B (en) | Data migration method and system | |
CN106254094A (en) | A kind of method of data synchronization and system | |
CN109995835A (en) | Host node electoral machinery, device and distributed memory system | |
CN104618127A (en) | Master and standby storage node switching method and system | |
WO2021103499A1 (en) | Multi-active data center-based traffic switching method and device | |
CN106156318A (en) | A kind of system and method realizing multinode data base's High Availabitity | |
CN106354548A (en) | Virtual cluster creating and management method and device in distributed database system | |
CN102170460A (en) | Cluster storage system and data storage method thereof | |
CN103605617B (en) | The method and device that a kind of records store data changes | |
CN104767794A (en) | Node election method in distributed system and nodes in distributed system | |
CN106202365A (en) | Method, system and the data-base cluster that database update synchronizes | |
CN109783468A (en) | Database switching method and system, medium and computer system | |
CN107066480A (en) | Management method, system and its equipment in master/slave data storehouse | |
CN115134257A (en) | Network management and control method and system, network system and storage medium | |
CN108710550B (en) | Double-data-center disaster tolerance system for public security traffic management inspection and control system | |
CN1992632B (en) | Communication network warning method and warning system | |
CN109657000B (en) | Real-time data synchronization method and device of rail transit comprehensive monitoring system | |
EP2905982B1 (en) | Network data rollback method and device | |
CN108228725A (en) | GIS application systems based on distributed data base | |
CN108595485A (en) | A kind of data-updating method and system at Double Data center | |
CN107220280B (en) | Disaster information acquisition and reporting method and system based on zoning mapping | |
CN103281313A (en) | Distribution-based authority management method for rail transportation integrated monitoring and controlling system | |
CN109088937A (en) | A kind of cluster authorization method and device based on unified management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170405 |
|
RJ01 | Rejection of invention patent application after publication |