CN109379238A - A kind of CTDB host node electoral machinery of distributed type assemblies, apparatus and system - Google Patents

A kind of CTDB host node electoral machinery of distributed type assemblies, apparatus and system Download PDF

Info

Publication number
CN109379238A
CN109379238A CN201811534389.2A CN201811534389A CN109379238A CN 109379238 A CN109379238 A CN 109379238A CN 201811534389 A CN201811534389 A CN 201811534389A CN 109379238 A CN109379238 A CN 109379238A
Authority
CN
China
Prior art keywords
node
election
normal
message
ctdb
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.)
Granted
Application number
CN201811534389.2A
Other languages
Chinese (zh)
Other versions
CN109379238B (en
Inventor
孙业宽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811534389.2A priority Critical patent/CN109379238B/en
Publication of CN109379238A publication Critical patent/CN109379238A/en
Application granted granted Critical
Publication of CN109379238B publication Critical patent/CN109379238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses CTDB host node electoral machinery, device, system and the computer readable storage mediums of a kind of distributed type assemblies, after being included in current primary node delay machine, target normal node sends the first election message to other each normal nodes, receives the second election message that each normal node that other initiate election is sent;Target normal node judges whether other each normal nodes are agreed to using target normal node as host node according to the election response message that other each normal nodes return;If so, sending election end message to other each normal nodes, target normal node is set as host node after receiving election end message so as to other each normal nodes;If not, then determine that the normal node for meeting election condition is host node according to preset rules and each second election message, and the election response message agreed to is returned to the normal node for meeting election condition, shorten the election time, improves election efficiency and failover efficiency.

Description

A kind of CTDB host node electoral machinery of distributed type assemblies, apparatus and system
Technical field
The present embodiments relate to distributed memory system technical fields, more particularly to a kind of CTDB of distributed type assemblies Host node electoral machinery, device, system and computer readable storage medium.
Background technique
Distributed storage is the cluster being made of multiple memory node servers, and a data is supported to be stored in multiple sections On point, the communication that each node passes through between node can get complete data, can basis when delay machine occurs in node The strategy of configuration carries out the recovery of partial data.CTDB plays the role of High Availabitity in distributed storage, wherein CTDB (clustered trivial database, lightweight Cluster Database) is used as a kind of cluster High Availabitity management software, is used for Clustered node state is monitored, the node of multiple starting CTDB constitutes a set of CTDB cluster, and all nodes can elect one in cluster A host node is used for fault recovery.
The existing election mechanism of CTDB is each node after entering election state, through consultation (including the process initiation time Point and physical node size) determine that who is host node, and need to wait 3 seconds time-out after the completion of negotiation, then could Enough to determine that election process terminates, time-consuming is difficult to tolerate in the case where seeking time harsh conditions are wanted in failover within this 3 seconds, will lead to whole A election process takes a long time, and reduces failover efficiency.
In consideration of it, how to provide it is a kind of solve above-mentioned technical problem distributed type assemblies CTDB host node electoral machinery, Device, system and computer readable storage medium become those skilled in the art's problem to be solved.
Summary of the invention
The purpose of the embodiment of the present invention is that providing a kind of CTDB host node electoral machinery of distributed type assemblies, device, system And computer readable storage medium, the election time can be greatly shortened in use, improve election efficiency and failover Efficiency.
In order to solve the above technical problems, the embodiment of the invention provides a kind of CTDB host node election sides of distributed type assemblies Method, comprising:
After current primary node delay machine, target normal node sends the first election message to other each normal nodes, And receive the second election message that each normal node that other initiate election is sent;Wherein, the destination node be it is all just Any one node in Chang Jiedian;
The target normal node receives and according to the election response message that other each normal nodes return, and sentences Whether disconnected other each normal nodes are agreed to using the target normal node as host node;
If so, send election end messages to other each normal nodes, so as to it is other it is each it is described just After Chang Jiedian receives the election end message, the target normal node is set as host node;
If it is not, then determining the normal node for meeting election condition according to preset rules and each second election message For host node, and the election response message agreed to is returned to the normal node for meeting election condition.
Optionally, further includes:
The normal node for being unsatisfactory for election condition is determined according to preset rules and each second election message, and to The normal node for being unsatisfactory for election condition returns to dissenting election response message.
Optionally, the first election message includes CTDB starting time corresponding with the target normal node and physics Node serial number;
The second election message includes CTDB starting time corresponding with corresponding normal node and physical node number.
Optionally, the foundation preset rules and each second election message are determined to meet the normal of election condition Node is the process of host node are as follows:
The CTDB starting time of each normal node for sending the second election message is compared, judges each hair Send the CTDB starting time of the normal node of the second election message whether identical, if so, sending described second from each It elects in the normal node of message and selects the smallest normal node of physics node serial number as host node;If it is not, then CTDB is opened Earliest normal node of dynamic time is host node.
Optionally, it after the target normal node sends the first election message to other each normal nodes, also wraps It includes:
It is returned when the target normal node does not receive any one other described normal node in preset duration Election response message when, execute described the step of sending election end message to other each normal nodes.
Optionally, further includes:
Check whether the target normal node sets itself to host node, if it is not, then by the target normal node Host node is revised as itself.
The embodiment of the present invention provides a kind of CTDB host node voting device of distributed type assemblies accordingly, is applied to target Normal node, the target normal node are any one node in all normal nodes;Include:
First transmission unit, for sending the first election to other each normal nodes after current primary node delay machine Message;
Receiving unit, the second election message sent for receiving each normal node that other initiate election;
Judging unit, the election response message for being returned according to other each normal nodes, judges others Whether each normal node is agreed to using the target normal node as host node;If so, triggering second sends list Member;If it is not, then triggering screening unit;
Second transmission unit, for sending election end message to other each normal nodes, so as to it After his each normal node receives the election end message, the target normal node is set as host node;
First screening unit, for determining to meet election according to preset rules and each second election message The normal node of condition is host node, and returns to the election response message agreed to the normal node for meeting election condition.
Optionally, further includes:
Second screening unit, for determining to be unsatisfactory for election item according to preset rules and each second election message The normal node of part, and dissenting election response message is returned to the normal node for being unsatisfactory for election condition.
The embodiment of the invention also provides a kind of CTDB host node election systems of distributed type assemblies, comprising:
Memory, for storing computer program;
Processor realizes the CTDB host node choosing of distributed type assemblies as described above when for executing the computer program The step of act method.
The embodiment of the invention also provides a kind of computer readable storage medium, deposited on the computer readable storage medium Computer program is contained, the computer program realizes the CTDB of distributed type assemblies as described above main section when being executed by processor The step of point electoral machinery.
The embodiment of the invention provides CTDB host node electoral machinery, device, system and the calculating of a kind of distributed type assemblies Machine readable storage medium storing program for executing, comprising: after current primary node delay machine, target normal node sends the to other each normal nodes One election message, and receive the second election message that each normal node that other initiate election is sent;Wherein, destination node is Any one node in all normal nodes;The choosing that target normal node is received and returned according to other each normal nodes Response message is lifted, judges whether other each normal nodes are agreed to using target normal node as host node;If so, to Other each normal nodes send election end message, so that other each normal nodes receive election end message Afterwards, target normal node is set as host node;If it is not, then determining to meet choosing according to preset rules and each second election message The normal node of act condition is host node, and returns to the election response message agreed to the normal node for meeting election condition.
As it can be seen that target normal node can send the first election to other normal nodes and disappear after current primary node delay machine Breath, and the second election message that other normal nodes are sent also is received, other normal nodes can normally be saved to target Point returns to election response message, when each election response message that target normal node receives is agreement, then to other Each normal node send election end message, other each normal nodes can be notified to terminate to elect, it is other each The target normal node can be set as host node by normal node, each election response message received by the target normal node In there are when dissenting response message, then target normal node will be sent from other normal nodes for initiating election received Election message in determine the normal node for meeting election condition as host node, and to the normal node return agree to choosing Response message is lifted, so that it is determined that host node out.The application avoids target by addition election response message and election end message Normal node is terminating to elect process after waiting 3 seconds time-out, to greatly shorten the election time, improves election efficiency and failure is cut Change efficiency.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to institute in the prior art and embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is a kind of process signal of CTDB host node electoral machinery of distributed type assemblies provided in an embodiment of the present invention Figure;
Fig. 2 is a kind of detailed process of the CTDB host node electoral machinery of distributed type assemblies provided in an embodiment of the present invention Figure;
Fig. 3 is a kind of structural representation of the CTDB host node voting device of distributed type assemblies provided in an embodiment of the present invention Figure.
Specific embodiment
The embodiment of the invention provides CTDB host node electoral machinery, device, system and the calculating of a kind of distributed type assemblies Machine readable storage medium storing program for executing can greatly shorten the election time in use, improve election efficiency and failover efficiency.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 1 is please referred to, Fig. 1 is a kind of CTDB host node electoral machinery of distributed type assemblies provided in an embodiment of the present invention Flow diagram.This method, comprising:
S110: after current primary node delay machine, target normal node sends the first election to other each normal nodes Message, and receive the second election message that each normal node that other initiate election is sent;Wherein, destination node be it is all just Any one node in Chang Jiedian;
It should be noted that after current primary node delay machine in systems, other normal nodes (namely normal CTDB section Point) election can be triggered, wherein it is carried out by taking the node (target normal node) in all normal nodes as an example in the present embodiment It is described in detail, it is other as sent the first election message to other each normal nodes after the triggering election of target normal node Normal node also can send the second election message to other normal nodes in addition to itself on triggering, that is, target normally saves Point can send the first election message to other normal nodes, can also receive each normal node that other initiate election and send Second election message.
S120: target normal node receives and according to the election response message that other each normal nodes return, judgement Whether other each normal nodes are agreed to using target normal node as host node;If so, into S130;If it is not, then Into S140;
Specifically, other each normal nodes can not only receive the first election message of target normal node transmission, The election message that each node that other initiate election is sent can be also received, other each normal nodes can receive this After a little election message, all election message and preset rules that can be received according to itself determine whether to agree to target just Chang Jiedian is as host node, if the target normal node meets election and requires, then other normal nodes can be normal to target Node returns to the election response message agreed to, if the target normal node is unsatisfactory for election and requires, other normal node meetings Dissenting election response message is returned to target normal node.
It should be noted that target normal node receives the election response message that other each normal nodes return Afterwards, judge whether be agreement election response message, namely other each normal node whether agree to target is normal Node is elected to be as next host node, if so, into S130.
S130: sending election end message to other each normal nodes, so that other each normal nodes receive To after election end message, target normal node is set as host node;
Specifically, when other each normal nodes are agreed to be elected to be target normal node as next host node, mesh Election end message can be sent to other each normal nodes by marking normal node, and other each normal nodes are terminating to choosing After lifting end message, it can be configured in respective node, target normal node is set as host node, wherein election terminates Message may include the identification code of target normal point, can specifically include the physical node number of target normal node.That is, After target normal node wins election, process is entirely elected into end, it is each just to others by sending election end message Chang Jiedian can the other each normal nodes of fast notification, and can also further make master set by all normal nodes Node is consistent.
It should also be noted that, other each normal nodes the election message for receiving the transmission of target normal node, And after agreeing to target normal node as host node, own node can be configured and target normal node is set as main section Point can be according to entrained in election end message after receiving the election end message of target normal node transmission again Node identification code reaffirm that set host node is target normal node, to ensure master set by all normal nodes Node is consistent.
S140: it determines to meet according to preset rules and each second election message and save based on the normal node of election condition Point, and the election response message agreed to is returned to the normal node for meeting election condition.
Specifically, target normal node is selected if existing to disagree in the election response message of other each normal nodes When message as next host node, then need to re-start election, specifically, target normal node can be according to default rule The second election message that other each normal nodes for participating in election then and received by it are sent is determined to meet election The normal node of condition, and agree to that the normal node as host node, then returns to the election response agreed to the normal node Message, so that the normal node in the election response message for receiving other normal nodes and is determining that the normal node is Election end message is sent after host node, to terminate to elect process.
The each normal node of others in the present embodiment is after the election for determining whether to agree to target normal node, to mesh It marks normal node and returns to election response message, target normal node need not wait 3 seconds just to know election results after time-out, and After determining that oneself wins election, can also send as other each normal nodes terminates election disappears target normal node Breath makes to elect time-consuming realization Millisecond, shortens fail-over time to second grade, to greatly save election institute to terminate to elect Time-consuming improves election efficiency, can also promote the High Availabitity of product and stable to a certain extent.
For example, including 4 CTDB nodes, respectively node 0, node 1, node 2 and node 3 in distributed type assemblies, work as section When 3 delay machine of point, other nodes can trigger election, be illustrated by taking node 0 as an example, specifically referring to figure 2..It is selected when node 0 triggers After act, election message ELECTION_REQ, node 1 and node 2 are sent to other normal nodes 2 and node 3 and is receiving election After message, the condition (namely whether meeting election condition) for winning election whether is met by inspection node 0, is determined whether Agree to that node 0 becomes host node, it is node 0 that host node is arranged if agreeing to, and returns to election response message to node 0 ELECTION_RESP agrees that node 0 becomes host node, is disappeared if disagreeing according to the election that node 1 and node 2 are sent Breath is re-started from node 1 and node 2 elects and elects corresponding node as host node.Node 1 and node are received when 0 After the 2 election response messages returned, if node 1 and node 2 are all agreed to, election end message is sent to node 1 and node 2 After the node of ELECTION_END, 1 and 2 receives election end message, setting host node is 0, terminates election process, finally elects Node 0 is host node.
Further, this method can also include:
The normal node for being unsatisfactory for election condition is determined according to preset rules and each second election message, and to discontented The normal node of foot election condition returns to dissenting election response message.
Target is normally saved it should be noted that existing to disagree in the election response message of other each normal nodes When clicking the message as next host node, target normal node can also its according to preset rules and received by it The second election message that each normal node that he initiates election is sent determines the normal node for being unsatisfactory for election condition, and to The normal node for being unsatisfactory for election condition returns to dissenting election response message, so that this is unsatisfactory for the normal section of election condition Point does not retransmit election message after receiving dissenting election response message.
Specifically, the first election message in the present embodiment include CTDB corresponding with the target normal node starting time and Physical node number;
Second election message includes CTDB starting time corresponding with corresponding normal node and physical node number.
That is, since each normal node all has the corresponding CTDB starting time when triggering election, and can root Start time and physical node number according to the CTDB of each normal node to determine which normal node is host node, all realities Apply the CTDB starting time and physical node number that the election message in example may include corresponding normal node, wherein physics Nodal scheme can be 0,1,2,3 etc..
Further, it determines to meet election condition according to preset rules and each second election message in above-mentioned S140 Normal node be host node process, be specifically as follows:
The CTDB starting time of each normal node for sending the second election message is compared, judge each transmission the Whether the CTDB starting time of the normal node of two election message is identical, if so, sending the second election message just from each The smallest normal node of physics node serial number is selected in Chang Jiedian as host node;If it is not, then that CTDB starting time is earliest Normal node is host node.
Specifically, after the election response message that target normal node receives the opposition of other normal nodes return, then Illustrate that the CTDB starting time of target normal node is not when initiating the CTDB of each normal node of election starting time difference It is earliest, and when the CTDB for each normal node for initiating the to elect starting time is identical, the physics of target normal node Node serial number is not the smallest, so just having normal node returns to the election response message opposed, so other initiate choosing There is one to meet election condition in each normal node lifted, target normal node can be by by received each second The entrained CTDB starting time is compared in election message, determines earliest CTDB starting time corresponding normal node (physical node number), the node which as meets election condition at this time can be to this just as host node Chang Jiedian returns to the election response message agreed to;If the entrained CTDB starting time is identical in each second election message, Then other each normal nodes for initiating election are initiated to elect simultaneously, at this point it is possible to by being taken in each second election message The physical node number of band is compared, and physics can be elected to number the smallest normal node as host node, and normal to this Node returns to the election response message agreed to.It is certainly, identical when the CTDB starting time entrained in each second election message, It is specifically chosen physical node and numbers the smallest normal node as host node, or the selection maximum normal section of physics node serial number Point can be determined according to the actual situation as host node, and the present embodiment does not do particular determination to this, can be realized the application Purpose.
It should also be noted that, after target normal node sends the first election message, it is normal there are no other are received When the election response message that node returns, target normal node is according to each normal section for having received other each participation elections The second election message that point is sent then can normally save the CTDB starting time carried in each second election message with target The CTDB starting time of point itself is compared, if the CTDB starting time of other each normal nodes for initiating election is small Start the time in the CTDB of target normal node itself, then target normal node is returned to other each normal nodes for initiating election Return the election response message opposed, when the CTDB starting time, earliest normal node was not target normal node itself, then to The CTDB starts the election response message of time earliest normal node return agreement, and each normal section of election is initiated to other Point returns to the election response message opposed.
In addition, if CTDB starting time and the target normal node itself of other each normal nodes for initiating election CTDB start the time it is all the same, then target normal node can by it is each second election message in carry physical node number with The physical node number of target normal node itself is compared, when the physical node of target normal node itself numbers minimum When, it is determined that itself it is host node, and returns to the election response message opposed to other each normal nodes for initiating election, if Target normal node itself physical node number be not it is the smallest, then from other initiate election each normal node in select Physical node numbers the smallest normal node, and the election response message agreed to is returned to the normal node, to other other hairs The each normal node for playing election returns to the election response message opposed.
Further, target normal node disappears to other each the first elections of normal nodes transmission in above-mentioned S110 After breath, this method further include:
It is rung when target normal node does not receive the election that any one other normal node returns in preset duration When answering message, the step of sending election end message to other each normal nodes is executed.
It should be noted that in order to avoid causing target normal node that cannot timely receive others due to Network Abnormal The election response message that each normal node returns leads to that the time is elected to take a long time, it is possible to target normal node to (for example, 3 seconds) target normal node does not connect in preset time after other each the first election of normal nodes transmission message Receive the election response message that other normal nodes return, then can other each normal nodes agree to that target normally saves Point is used as host node, and target normal node sends election end message to other each normal nodes at this time, to terminate to elect, And make each other normal nodes after receiving election end message, target normal node is set as host node, to make Host node set by each normal node is consistent.
Furthermore it is also possible to be returned when target normal node does not receive any one other normal node in preset duration When the election response message returned, notify that each normal node is re-elected, to elect final host node.
Further, this method further includes:
Check whether target normal node sets itself to host node, if it is not, then repairing the host node of target normal node It is changed to itself.
It should be noted that after target normal node sends election end message to other each normal nodes, also The facilities of itself can be checked, to further determine whether target normal node itself being set as host node, when It when not setting itself to host node, then modifies to setting, also is changed to for target normal node being set as by setting information Host node, it is consistent with the host node for further ensuring that set in all normal nodes.
As it can be seen that target normal node can send the first election to other normal nodes and disappear after current primary node delay machine Breath, and the second election message that other normal nodes are sent also is received, other normal nodes can normally be saved to target Point returns to election response message, when each election response message that target normal node receives is agreement, then to other Each normal node send election end message, other each normal nodes can be notified to terminate to elect, it is other each The target normal node can be set as host node by normal node, each election response message received by the target normal node In there are when dissenting response message, then target normal node will be sent from other normal nodes for initiating election received Election message in determine the normal node for meeting election condition as host node, and to the normal node return agree to choosing Response message is lifted, so that it is determined that host node out.The application avoids target by addition election response message and election end message Normal node is terminating to elect process after waiting 3 seconds time-out, to greatly shorten the election time, improves election efficiency and failure is cut Efficiency is changed, and then promotes the High Availabitity of product and stable to a certain extent.
On the basis of the above embodiments, the embodiment of the present invention provides a kind of main section of CTDB of distributed type assemblies accordingly Point voting device is applied to target normal node, and target normal node is any one node in all normal nodes, specifically Referring to Fig. 3.The device includes:
First transmission unit 31, for sending the first choosing to other each normal nodes after current primary node delay machine Lift message;
Receiving unit 32, the second election message sent for receiving each normal node that other initiate election;
Judging unit 33, the election response message for being returned according to other each normal nodes judge other each Whether a normal node is agreed to using target normal node as host node;If so, the second transmission unit 34 of triggering;If it is not, Then trigger screening unit 35;
Second transmission unit 34, for sending election end message to other each normal nodes, so as to other each After a normal node receives election end message, target normal node is set as host node;
First screening unit 35, for determining to meet election condition according to preset rules and each second election message Normal node is host node, and returns to the election response message agreed to the normal node for meeting election condition.
Further, further includes:
Second screening unit, for determining to be unsatisfactory for election condition according to preset rules and each second election message Normal node, and dissenting election response message is returned to the normal node for being unsatisfactory for election condition.
It should be noted that the CTDB host node voting device of distributed type assemblies provided in the present embodiment have with it is upper The identical beneficial effect of CTDB host node electoral machinery of distributed type assemblies provided in embodiment is stated, and for this implementation The specific introduction of the CTDB host node electoral machinery of involved distributed type assemblies please refers to above-described embodiment, the application in example Details are not described herein.
On the basis of the above embodiments, the embodiment of the invention also provides a kind of choosings of the CTDB host node of distributed type assemblies Act system, comprising:
Memory, for storing computer program;
Processor is realized when for executing computer program such as the CTDB host node electoral machinery of above-mentioned distributed type assemblies Step.
For example, processor in the present embodiment is for realizing after current primary node delay machine, target normal node to other Each normal node send first election message, and receive other initiate election each normal node send second election Message;Wherein, destination node is any one node in all normal nodes;Target normal node receives and according to others The election response message that each normal node returns, judges whether other each normal nodes are agreed to target normal node As host node;If so, election end message is sent to other each normal nodes, so as to other each normal nodes After receiving election end message, target normal node is set as host node;If it is not, then according to preset rules and each second choosing It lifts message and determines that the normal node for meeting election condition is host node, and return and agree to the normal node for meeting election condition Election response message.
On the basis of the above embodiments, the embodiment of the invention also provides a kind of computer readable storage mediums, calculate It is stored with computer program on machine readable storage medium storing program for executing, such as above-mentioned distributed type assemblies are realized when computer program is executed by processor CTDB host node electoral machinery the step of.
The computer readable storage medium may include: USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. is various to deposit Store up the medium of program code.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part It is bright.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1. a kind of CTDB host node electoral machinery of distributed type assemblies characterized by comprising
After current primary node delay machine, target normal node sends the first election message to other each normal nodes, and connects Receive the second election message that each normal node that other initiate election is sent;Wherein, the destination node is all normal sections Any one node in point;
The target normal node receives and according to the election response message that other each normal nodes return, and judges it Whether his each normal node is agreed to using the target normal node as host node;
If so, election end message is sent to other each normal nodes, so as to other each normal sections After point receives the election end message, the target normal node is set as host node;
If it is not, then determining to meet according to preset rules and each second election message based on the normal node of election condition Node, and the election response message agreed to is returned to the normal node for meeting election condition.
2. the CTDB host node electoral machinery of distributed type assemblies according to claim 1, which is characterized in that further include:
The normal node for being unsatisfactory for election condition is determined according to preset rules and each second election message, and to described The normal node for being unsatisfactory for election condition returns to dissenting election response message.
3. the CTDB host node electoral machinery of distributed type assemblies according to claim 2, which is characterized in that first choosing Lifting message includes CTDB starting time corresponding with the target normal node and physical node number;
The second election message includes CTDB starting time corresponding with corresponding normal node and physical node number.
4. the CTDB host node electoral machinery of distributed type assemblies according to claim 3, which is characterized in that the foundation is pre- If rule and each second election message determine that the normal node for meeting election condition is the process of host node are as follows:
The CTDB starting time of each normal node for sending the second election message is compared, judges each transmission institute Whether the CTDB starting time for stating the normal node of the second election message is identical, if so, sending second election from each The smallest normal node of physics node serial number is selected in the normal node of message as host node;If it is not, when then CTDB being started Between earliest normal node be host node.
5. the CTDB host node electoral machinery of distributed type assemblies according to claim 2, which is characterized in that in the target After normal node sends the first election message to other each normal nodes, further includes:
When the target normal node does not receive the choosing that any one other described normal node returns in preset duration When lifting response message, described the step of sending election end message to other each normal nodes is executed.
6. the CTDB host node electoral machinery of distributed type assemblies according to claim 1, which is characterized in that further include:
Check whether the target normal node sets itself to host node, if it is not, then by the main section of the target normal node Point is revised as itself.
7. a kind of CTDB host node voting device of distributed type assemblies is applied to target normal node, the target normal node For any one node in all normal nodes;It is characterised by comprising:
First transmission unit, for sending the first election message to other each normal nodes after current primary node delay machine;
Receiving unit, the second election message sent for receiving each normal node that other initiate election;
Judging unit, the election response message for being returned according to other each normal nodes, judges other each Whether the normal node is agreed to using the target normal node as host node;If so, the second transmission unit of triggering;If It is no, then trigger screening unit;
Second transmission unit, for sending election end message to other each normal nodes, so as to others After each normal node receives the election end message, the target normal node is set as host node;
First screening unit, for determining to meet election condition according to preset rules and each second election message Normal node be host node, and the normal node for meeting election condition to described returns to the election response message agreed to.
8. the CTDB host node voting device of distributed type assemblies according to claim 7, which is characterized in that further include:
Second screening unit, for determining to be unsatisfactory for election condition according to preset rules and each second election message Normal node, and dissenting election response message is returned to the normal node for being unsatisfactory for election condition.
9. a kind of CTDB host node election system of distributed type assemblies characterized by comprising
Memory, for storing computer program;
Processor, realizing the distributed type assemblies as described in claim 1 to 6 any one when for executing the computer program The step of CTDB host node electoral machinery.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program, realizing the distributed type assemblies as described in claim 1 to 6 any one when the computer program is executed by processor The step of CTDB host node electoral machinery.
CN201811534389.2A 2018-12-14 2018-12-14 CTDB main node election method, device and system of distributed cluster Active CN109379238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811534389.2A CN109379238B (en) 2018-12-14 2018-12-14 CTDB main node election method, device and system of distributed cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811534389.2A CN109379238B (en) 2018-12-14 2018-12-14 CTDB main node election method, device and system of distributed cluster

Publications (2)

Publication Number Publication Date
CN109379238A true CN109379238A (en) 2019-02-22
CN109379238B CN109379238B (en) 2022-06-17

Family

ID=65374513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811534389.2A Active CN109379238B (en) 2018-12-14 2018-12-14 CTDB main node election method, device and system of distributed cluster

Country Status (1)

Country Link
CN (1) CN109379238B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048898A (en) * 2019-05-14 2019-07-23 威创集团股份有限公司 A kind of distribution joined screen system method for realizing redundancy and device
CN111400112A (en) * 2020-03-18 2020-07-10 深圳市腾讯计算机***有限公司 Writing method and device of storage system of distributed cluster and readable storage medium
CN111538763A (en) * 2020-04-24 2020-08-14 咪咕文化科技有限公司 Method for determining main node in cluster, electronic equipment and storage medium
CN112003755A (en) * 2020-08-25 2020-11-27 北京浪潮数据技术有限公司 Method, device, equipment and medium for selecting cluster master nodes
CN112799867A (en) * 2021-02-03 2021-05-14 柏科数据技术(深圳)股份有限公司 Election method based on distributed storage system and distributed storage system
CN114466081A (en) * 2021-12-23 2022-05-10 东莞市李群自动化技术有限公司 Node control method, system, equipment and storage medium of real-time channel group
CN117440031A (en) * 2023-12-15 2024-01-23 广东朝歌智慧互联科技有限公司 Method for cloud platform to issue instruction to intranet equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217402A (en) * 2008-01-15 2008-07-09 杭州华三通信技术有限公司 A method to enhance the reliability of the cluster and a high reliability communication node
CN106161495A (en) * 2015-03-25 2016-11-23 中兴通讯股份有限公司 A kind of host node electoral machinery, device and storage system
CN106911728A (en) * 2015-12-22 2017-06-30 华为技术服务有限公司 The choosing method and device of host node in distributed system
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster
CN107360025A (en) * 2017-07-07 2017-11-17 郑州云海信息技术有限公司 A kind of distributed memory system cluster monitoring method and apparatus
EP3382946A1 (en) * 2017-03-30 2018-10-03 Thomson Licensing Device and method for performance monitoring
CN108810100A (en) * 2018-05-22 2018-11-13 郑州云海信息技术有限公司 A kind of electoral machinery of host node, device and equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217402A (en) * 2008-01-15 2008-07-09 杭州华三通信技术有限公司 A method to enhance the reliability of the cluster and a high reliability communication node
CN106161495A (en) * 2015-03-25 2016-11-23 中兴通讯股份有限公司 A kind of host node electoral machinery, device and storage system
CN106911728A (en) * 2015-12-22 2017-06-30 华为技术服务有限公司 The choosing method and device of host node in distributed system
EP3382946A1 (en) * 2017-03-30 2018-10-03 Thomson Licensing Device and method for performance monitoring
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster
CN107360025A (en) * 2017-07-07 2017-11-17 郑州云海信息技术有限公司 A kind of distributed memory system cluster monitoring method and apparatus
CN108810100A (en) * 2018-05-22 2018-11-13 郑州云海信息技术有限公司 A kind of electoral machinery of host node, device and equipment

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048898A (en) * 2019-05-14 2019-07-23 威创集团股份有限公司 A kind of distribution joined screen system method for realizing redundancy and device
CN111400112A (en) * 2020-03-18 2020-07-10 深圳市腾讯计算机***有限公司 Writing method and device of storage system of distributed cluster and readable storage medium
CN111538763A (en) * 2020-04-24 2020-08-14 咪咕文化科技有限公司 Method for determining main node in cluster, electronic equipment and storage medium
CN111538763B (en) * 2020-04-24 2023-08-15 咪咕文化科技有限公司 Method for determining master node in cluster, electronic equipment and storage medium
CN112003755A (en) * 2020-08-25 2020-11-27 北京浪潮数据技术有限公司 Method, device, equipment and medium for selecting cluster master nodes
CN112003755B (en) * 2020-08-25 2022-12-23 北京浪潮数据技术有限公司 Method, device, equipment and medium for selecting cluster master nodes
CN112799867A (en) * 2021-02-03 2021-05-14 柏科数据技术(深圳)股份有限公司 Election method based on distributed storage system and distributed storage system
CN114466081A (en) * 2021-12-23 2022-05-10 东莞市李群自动化技术有限公司 Node control method, system, equipment and storage medium of real-time channel group
CN114466081B (en) * 2021-12-23 2024-04-12 东莞市李群自动化技术有限公司 Method, system, equipment and storage medium for managing and controlling nodes of real-time channel group
CN117440031A (en) * 2023-12-15 2024-01-23 广东朝歌智慧互联科技有限公司 Method for cloud platform to issue instruction to intranet equipment
CN117440031B (en) * 2023-12-15 2024-04-12 广东朝歌智慧互联科技有限公司 Method for cloud platform to issue instruction to intranet equipment

Also Published As

Publication number Publication date
CN109379238B (en) 2022-06-17

Similar Documents

Publication Publication Date Title
CN109379238A (en) A kind of CTDB host node electoral machinery of distributed type assemblies, apparatus and system
CN107301536B (en) Resource transfers method and device
CN106911728B (en) The choosing method and device of host node in distributed system
WO2016150066A1 (en) Master node election method and apparatus, and storage system
JP2002324047A (en) Method and system for automated session resources cleanup in distributed client/server environment
CN113014634A (en) Cluster election processing method, device, equipment and storage medium
CN110708196B (en) Data processing method and device
CN109921942B (en) Cloud platform switching control method, device and system and electronic equipment
CN108255592A (en) A kind of Quartz clusters timing task processing system and method
WO2016177130A1 (en) Method and device for selecting communication node
CN107995029A (en) Elect control method and device, electoral machinery and device
CN110557416B (en) Multi-node collaborative blocking method and system
WO2021057514A1 (en) Task scheduling method and apparatus, computer device, and computer readable medium
CN102354296B (en) A kind of monitoring system and method that can expanding monitoring resources
CN109144748B (en) Server, distributed server cluster and state driving method thereof
CN112650812A (en) Data fragment storage method and device, computer equipment and storage medium
CN112015595B (en) Master-slave database switching method, computing device and storage medium
CN112104727B (en) Method and system for deploying simplified high-availability Zookeeper cluster
CN115102839A (en) Master-slave node election method, device, equipment and medium
CN113765690A (en) Cluster switching method, system, device, terminal, server and storage medium
CN110781039B (en) Sentinel process election method and device
CN105429795B (en) A kind of alarm monitoring system and method
CN116389385A (en) System resource processing method, device, storage medium and equipment
CN111190913A (en) Distributed lock implementation method and system
CN105874435B (en) Non- block registration in distributed transaction

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
GR01 Patent grant
GR01 Patent grant