CN106557543A - Node switching method and system - Google Patents

Node switching method and system Download PDF

Info

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
host
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
CN201610899618.5A
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201610899618.5A priority Critical patent/CN106557543A/en
Publication of CN106557543A publication Critical patent/CN106557543A/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/1479Generic software techniques for error detection or fault masking
    • 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
    • G06F16/275Synchronous 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 kind of node switching method, is applied in same city production cluster, the same city production cluster includes host node and slave node, and data syn-chronization mode is set between the host node and the slave node, and the node switching method includes: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;The logical block is switched in the slave node from the host node, provides reading and writing data service host node is updated to by the slave node.The invention also discloses a kind of node switched system.The host node and slave node of the same city production cluster in the present invention adopts data syn-chronization, the machine even if host node is delayed, it is also possible to continue offer reading and writing data service in being rapidly switched to slave node, it is to avoid the situation of loss of data.

Description

Node switching method and system
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.
CN201610899618.5A 2016-10-14 2016-10-14 Node switching method and system Pending CN106557543A (en)

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 (12)

* Cited by examiner, † Cited by third party
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

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 (18)

* Cited by examiner, † Cited by third party
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

Similar Documents

Publication Publication Date Title
CN106557543A (en) Node switching method and system
CN106254094B (en) A kind of method of data synchronization and system
CN103902617B (en) Distributed data base synchronous method and system
CN1992632B (en) Communication network warning method and warning system
CN103995868B (en) The global transaction manager and transaction methods of Based on Distributed system
CN109995835A (en) Host node electoral machinery, device and distributed memory system
CN105701204A (en) Road network based electronic map POI extraction method and display method
CN103581231B (en) UGC master/slave data synchronous method and its system
WO2021103499A1 (en) Multi-active data center-based traffic switching method and device
CN104618127A (en) Master and standby storage node switching method and system
CN105630919A (en) Storage method and system
CN102170460A (en) Cluster storage system and data storage method thereof
CN103618788A (en) System high-availability method supporting B/S structure
CN108710550B (en) Double-data-center disaster tolerance system for public security traffic management inspection and control system
CN105187548A (en) Cluster monitoring information collection method and system
CN104767794A (en) Node election method in distributed system and nodes in distributed system
CN109783468A (en) Database switching method and system, medium and computer system
CN115134257A (en) Network management and control method and system, network system and storage medium
CN109657000B (en) Real-time data synchronization method and device of rail transit comprehensive monitoring system
CN108228725A (en) GIS application systems based on distributed data base
EP2905982B1 (en) Network data rollback method and device
CN105353984B (en) High-availability cluster controller, control method and system based on soft magnetism disk array
CN106533751A (en) SDN controller cluster merging method and apparatus
CN107947999A (en) A kind of method and device of definite alarm order of occurrence
CN103281313A (en) Distribution-based authority management method for rail transportation integrated monitoring and controlling system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170405