CN106331046A - Cluster main node voting method and device - Google Patents

Cluster main node voting method and device Download PDF

Info

Publication number
CN106331046A
CN106331046A CN201510381889.7A CN201510381889A CN106331046A CN 106331046 A CN106331046 A CN 106331046A CN 201510381889 A CN201510381889 A CN 201510381889A CN 106331046 A CN106331046 A CN 106331046A
Authority
CN
China
Prior art keywords
node
cluster
requestor
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.)
Withdrawn
Application number
CN201510381889.7A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510381889.7A priority Critical patent/CN106331046A/en
Priority to PCT/CN2016/081429 priority patent/WO2017000666A1/en
Publication of CN106331046A publication Critical patent/CN106331046A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Abstract

The invention discloses a cluster main node voting method. The voting method comprises following steps that: a requester node in a cluster initiates a main node vote so as to allow the nodes in the cluster to vote for the requester node; the requester node receives the votes of the nodes in the cluster and judges whether the requester node is a main node currently; if the requester node is a main node currently, the requester node increases the acquired votes; and the requester node determines whether the requester node is the main node in a preset leasing time according to the acquired votes in total. The invention also discloses a cluster main node voting device. According to the invention, the current main node in the cluster is enabled to acquire enough votes when the vote is initiated, and the position of the main node is kept, so a problem that when a small IP node is added in the cluster, the current main node will lose the position of the main node due to failure to acquire enough votes is avoided, and stability and reliability of the cluster main node are ensured.

Description

Cluster host node electoral machinery and device
Technical field
The present invention relates to distributed system field, particularly relate to a kind of cluster host node electoral machinery and device.
Background technology
In a distributed system, the node that an IP address can be elected from cluster minimum is host node, will The amendment of all data of cluster is all submitted to by this host node, to ensure that all nodes in cluster perform phase Same command sequence.
In existing distributed system, the little IP node being newly added in there is cluster is main in making cluster The problem of node switching.In cluster in host node election process, when the votes that requestor's node obtains Equal to the clustered node number of preset ratio, this requestor obtains host node authority.When new little IP node adds When entering cluster, clustered node number increases, and the node being newly added will not be voted within a certain period of time to cluster Interior current host node, therefore, the votes that host node current in cluster is obtained in that will not become, and Clustered node number increases, and the votes that current primary node obtains is less than the clustered node number of preset ratio, Current primary node will lose host node position when lease time expires.Owing in cluster, host node is lost, Cluster re-elects, and can be new host node by the little IP node election being newly added so that the master in cluster Node produces switching.
Such as: initiate the votes of requestor's node acquisition of election in cluster equal to described cluster interior nodes Number 1/2 time, described requestor's node obtain host node position.When being newly added a little IP joint in cluster During point, when this host node initiates election again, owing to the nodes in cluster adds one, and newly add The little IP node entered will not be voted to any node in the longest time-out time (9 seconds), therefore, and should The votes that the person's of asking node obtains is less than 1/2 that described cluster internal segment is counted, and described host node will be at Lease Lease time (6 seconds) arrives after date, loses host node position, and in cluster, host node is lost.Due in cluster There is not host node, the little IP node being newly added can be thrown when the longest time-out time (9 seconds) reach Oneself is given by ticket, and then makes this little IP node being newly added obtain host node position.Make the master in cluster Node switches.
For cluster, due to all of distributed operation, including all configuration data, plan target, Distributed information logs etc. are required for host node, and requirement of real-time is high, therefore, does not allow host node at will to cut Change.In host node handoff procedure, it is to have regular hour gap before that the newest host node elects , at this moment between in section cluster there is no host node, the distributed increase of cluster, delete, updating operation will Can not use.Therefore, in existing cluster host node election process, there is the little IP node being newly added will The host node that cluster can be made current can not get enough ballots and loses host node position, and is newly added Little IP node then can in cluster without host node time be elected as new host node, and then cause the main joint of cluster The problem of some switching.
Foregoing is only used for auxiliary and understands technical scheme, does not represent and recognizes that foregoing is Prior art.
Summary of the invention
Present invention is primarily targeted in the existing cluster host node election process of solution, exist and be newly added Little IP node host node that cluster will be made current can not get enough ballots and lose host node position Put, the little IP node being newly added then can in cluster without host node time be elected as new host node, enter And cause the problem that cluster host node switches.
For achieving the above object, the present invention provides a kind of cluster host node electoral machinery, the main joint of described cluster Point electoral machinery comprises the following steps:
Requestor's node in cluster initiates host node election, saves described requestor for cluster interior nodes Point is voted;
Described requestor's node receives the ballot of described cluster interior nodes, and judges that described requestor's node is worked as Before whether be host node;
The most described requestor's node increases the votes obtained;
Described requestor's node, according to the ballot sum obtained, determines that described requestor's node is default Whether lease time section is host node.
Preferably, the step of the votes that the increase of described requestor's node is obtained includes:
All nodes in cluster described in described requestor's node traverses, check described cluster interior nodes and institute State the connection status of requestor's node;
Described requestor's node when the connection finding cluster interior nodes and described requestor's node is normal, Increase to described requestor's node and preset poll, until all nodes in having checked described cluster are with described The connection status of requestor's node.
Preferably, described requestor's node receives the ballot of described cluster interior nodes, and judges described request The most whether person's node is that the step of host node includes:
Described requestor's node receives the ballot of described cluster interior nodes, and will receive in Preset Time The clustered node number of votes and preset ratio is compared;
The votes that described requestor's node receives in Preset Time is less than the cluster of described preset ratio During nodes, it is judged that the most described requestor's node is host node.
Preferably, described requestor's node receives the ballot of described cluster interior nodes, and by Preset Time After the step that the clustered node number of the votes received and preset ratio is compared, also include:
The votes that described requestor's node receives in Preset Time is more than or equal to described default ratio During the clustered node number of example, determine described requestor's node in described lease time section for host node.
Preferably, described requestor's node, according to the ballot sum obtained, determines described requestor's node Include in the step whether default lease time section is host node:
The ballot sum that described requestor's node statistics is obtained;
Described requestor's node judges whether described ballot sum is more than or equal to the clustered node of preset ratio Number;
If, it is determined that described requestor's node is host node in described lease time section;
If not, it is determined that described requestor's node is not host node in described lease time section.
Additionally, for achieving the above object, the present invention also provides for a kind of cluster host node voting device, described Cluster host node voting device includes:
Initiation module, is used for initiating host node election, enters described requestor's node for cluster interior nodes Row ballot;
Judge module, for receiving the ballot of described cluster interior nodes, and judges that described requestor's node is worked as Before whether be host node;
Increasing vote module, if being currently host node for described requestor's node, the most described requestor saves Point increases the votes obtained;
Determine module, for according to the ballot sum obtained, determining that described requestor's node is default Whether lease time section is host node.
Preferably, described increase vote module includes checking unit and increasing ballot unit;
Described check unit, for traveling through all nodes in described cluster, check described cluster interior nodes Connection status with described requestor's node;
Described increase ballot unit, in the connection finding cluster interior nodes and described requestor's node Time normal, increase to described requestor's node and preset poll, until all joints in having checked described cluster Put the connection status with described requestor's node.
Preferably, described judge module, it is additionally operable to receive the ballot of described cluster interior nodes, and will preset The clustered node number of the votes received in the time and preset ratio is compared;
Described judge module, the votes being additionally operable to receive in Preset Time is less than described preset ratio Clustered node number time, it is judged that the most described requestor's node is host node.
Preferably, described judge module, be additionally operable to the votes that receives in Preset Time more than or During equal to the clustered node number of described preset ratio, determine that described requestor's node is in described lease time section Interior is host node.
Preferably, described determine that module includes statistic unit, judging unit and determines unit;
Described statistic unit, the ballot sum obtained for statistics;
Described judging unit, for judging whether described ballot sum is more than or equal to the cluster of preset ratio Nodes;
Described determine unit, if for described ballot sum whether more than or equal to the cluster joint of preset ratio Count, it is determined that described requestor's node is host node in described lease time section;
Described determine unit, if being additionally operable to described ballot sum whether less than the clustered node number of preset ratio, Then determine that described requestor's node is not host node in described lease time section.
The present invention is in group document host node election process, if described requestor's node is currently host node, Then by increasing to the ballot of described requestor's node so that host node current in cluster is initiating election Time be obtained in that enough ballots, and keep host node position, effectively avoid when there being little IP in cluster Node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, protects Stability and the reliability of cluster host node are demonstrate,proved.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the first embodiment of group document host node electoral machinery of the present invention;
Fig. 2 is the schematic flow sheet of the second embodiment of group document host node electoral machinery of the present invention;
Fig. 3 is the schematic flow sheet of the 3rd embodiment of group document host node electoral machinery of the present invention;
Fig. 4 is the schematic flow sheet of the 4th embodiment of group document host node electoral machinery of the present invention;
Fig. 5 is the high-level schematic functional block diagram of the first embodiment of group document host node voting device of the present invention;
Fig. 6 is the high-level schematic functional block diagram of the second embodiment of group document host node voting device of the present invention;
Fig. 7 is the high-level schematic functional block diagram of the 4th embodiment of group document host node voting device of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further Explanation.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit Determine the present invention.
The primary solutions of the embodiment of the present invention is: the requestor's node in cluster initiates host node election, For all nodes in cluster, described requestor's node is voted;Described requestor's node is being preset When the votes received in time is less than the clustered node number of preset ratio, it is judged that described requestor's node Whether current is host node;The most then increase to the votes of described requestor's node;Described requestor Node, according to the ballot sum obtained, determines that in default lease time section whether described requestor's node For host node.
Owing to, in existing cluster host node election process, there is the little IP node being newly added and will make collection The current host node of group can not get enough ballots and loses host node position, and the little IP node being newly added Then can in cluster without host node time be elected as new host node, and then cause cluster host node to switch Problem.
Based on the problems referred to above, the present invention provides a kind of cluster host node electoral machinery.
Schematic flow sheet with reference to the first embodiment that Fig. 1, Fig. 1 are cluster host node electoral machinery of the present invention.
In the present embodiment, described cluster host node electoral machinery includes:
Step S10, the requestor's node in cluster initiates host node election, for cluster interior nodes to described Requestor's node is voted;
Described cluster can be ceph (Linux PB level distributed file system) cluster, NAS (network Attached storage) cluster, SAN (storage area network) cluster, unified storage cluster etc. need to use The cluster of host node.Requestor's node in described cluster is by owning in transmission request message to cluster Node initiates host node election, and the node receiving described request message in cluster is receiver's node, Described requestor's node, when receiving described request message, is voted by described receiver's node, and Voting results are sent to described requestor's node.Described requestor's node and described receiver's node Think all nodes in described cluster.Described requestor's node can be host node current in cluster, Or can also be other node beyond host node current in cluster.Described requestor's node is initiated Host node is elected, and this section point can also be voted by described requestor's node.
Preferably, all nodes in described requestor's node transmission request message to cluster, for reception To the node of described request message described requestor's node voted and return response message;Described please The person's of asking node receives described response message, and determines the votes of acquisition according to described response message.Described Response message can be polling response or not polling response.
The process that described requestor's node is voted by the node in described cluster, can be by such as lower section Formula is implemented: the node in described cluster is when receiving request message, it is judged that whether there is main joint in cluster Point;If cluster memory is at host node, then judge whether described requestor's node is host node;The most then Vote to described requestor's node;If it is not, vote the most to described requestor's node;If not depositing in cluster At host node, then judge that whether described requestor's node is the minimum IP node in cluster, the most then give Described requestor's node is voted;If it is not, vote the most to described requestor's node.
Step S20, described requestor's node receives the ballot of described cluster interior nodes, and judges described request The most whether person's node is host node;
Preferably, described requestor's node receives the ballot of described cluster interior nodes, when reaching to set the time, Judge the most whether this node is host node, increase, according to judged result, the votes that host node obtains;Enter Row ballot statistics, determines whether described requestor's node is host node at default lease time.
Or, described requestor's node can also receive the ballot of described cluster interior nodes, is reaching default During the time, carry out ballot statistics, determine whether described requestor's node is main joint at default lease time Point, the most then election terminates;If it is not, then judge the most described requestor's node is host node, Determine according to judged result and increase the votes that host node obtains;Carry out ballot statistics again, determine described asking Whether the person's of asking node is host node at default lease time.
Step S30, the most described requestor's node increases the votes obtained;
If described requestor's node is currently host node, the most described requestor's node increases to described requestor The votes of node, during so that the host node of current cluster initiates host node election, it is possible to obtain enough Ballot keeps the position of host node, will not lose master because the node being newly added can not get enough ballot papers The position of node.
Step S40, described requestor's node, according to the ballot sum obtained, determines described requestor's node Whether it is host node in default lease time section.
Described default lease time is the lease time that described election is corresponding, and lease time is cluster internal segment Point election every time obtains the time limit of host node position.Described requestor's node can be by asking described The ballot sum of the acquisition of the person's of asking node is compared with the clustered node number of preset ratio, if described request The ballot sum that person's node obtains is more than or equal to the clustered node number of described preset ratio, it is determined that described Requestor's node is host node in described lease time section;If the ballot sum that described requestor's node obtains Clustered node number less than described preset ratio, it is determined that described requestor's node is in described lease time section It it not host node.The clustered node number of described preset ratio can be the 1/2 of described clustered node number, described The 1/3 of clustered node number or the 1/4 of described clustered node number etc..
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
Schematic flow sheet with reference to the second embodiment that Fig. 2, Fig. 2 are cluster host node electoral machinery of the present invention. First embodiment based on above-mentioned cluster host node electoral machinery, described step S30 includes:
Step S31, all nodes in cluster described in described requestor's node traverses, in checking described cluster Node and the connection status of described requestor's node;
Described requestor's node determine this node currently for host node time, described requestor's node traverses institute State all nodes in cluster, check the connection status of described cluster interior nodes and described requestor's node.
Step S32, described requestor's node is finding the connection of cluster interior nodes and described requestor's node Time normal, increase to described requestor's node and preset poll, until all joints in having checked described cluster Put the connection status with described requestor's node.
Described default poll is preferably a ticket, and described requestor's node is finding cluster interior nodes with described When the connection of requestor's node is normal, often finds one and be connected normal node with described requestor's node, Increase by a ticket to described requestor's node, until all nodes in having checked described cluster and described request The connection status of person's node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by the connection status of traversal cluster interior nodes with requestor's node, the normal node of each connection Increase then to described requestor's node and preset poll so that host node current in cluster is when initiating election It is obtained in that enough ballots, and keeps host node position, effectively avoid when there being little IP to save in cluster Point adds fashionable, current host node and can not get enough ballots and the problem that loses host node position, it is ensured that The stability of cluster host node and reliability.
Schematic flow sheet with reference to the 3rd embodiment that Fig. 3, Fig. 3 are cluster host node electoral machinery of the present invention. First embodiment based on above-mentioned cluster host node electoral machinery, described step S20 includes:
Step S21, described requestor's node receives the ballot of described cluster interior nodes, and by Preset Time The clustered node number of the votes received and preset ratio is compared;
Step S22, the votes that described requestor's node receives in Preset Time is less than described default ratio During the clustered node number of example, it is judged that the most described requestor's node is host node.
The election of host node that described requestor's node is initiated by described cluster interior nodes is voted, described please The person's of asking node receives the ballot of described cluster interior nodes, and by the votes that receives in Preset Time with pre- If the clustered node number of ratio is compared;The ballot that described requestor's node receives in Preset Time When number is less than the clustered node number of described preset ratio, it is judged that the most whether this node is host node.
Described Preset Time can be the lease time in described cluster, and described lease time is preferably arranged to 6 Second;Or, described Preset Time can also be the longest time-out time in described cluster, described the longest super Time the time be preferably arranged to 9 seconds;Or, described Preset Time can also be the main joint of initiation in described cluster The interval time of some election, the interval time of described host node election is preferably arranged to 3 seconds.
The votes that described requestor's node receives in Preset Time is more than or equal to described default ratio During the clustered node number of example, determine described requestor's node in described lease time section for host node.
Such as: described requestor's node receives the ballot of described cluster interior nodes, if default the longest super Time 9 seconds time in, the votes received more than or equal to described clustered node number 1/2, it is determined that institute State requestor's node in described lease time section for host node, if default the longest time-out time 9 seconds In, the votes received less than the 1/2 of described clustered node number, then determines whether that described requestor saves Whether point is host node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
Schematic flow sheet with reference to the 4th embodiment that Fig. 4, Fig. 4 are cluster host node electoral machinery of the present invention. First embodiment based on above-mentioned cluster host node electoral machinery, described step S40 includes:
Step S41, the ballot sum that described requestor's node statistics is obtained;
Step S42, described requestor's node judges that whether described ballot sum is more than or equal to preset ratio Clustered node number;
Step S43, if, it is determined that described requestor's node is host node in described lease time section;
Step S44, if not, it is determined that described requestor's node is not host node in described lease time section.
The ballot sum that described requestor's node statistics is obtained;Described requestor's node judges described ballot Whether sum is more than or equal to the clustered node number of preset ratio;If, it is determined that described requestor's node It is host node in described lease time section;If not, it is determined that described requestor's node is at described lease time Section is not host node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
The present invention further provides a kind of device cluster host node voting device.
Functional module with reference to the first embodiment that Fig. 5, Fig. 5 are cluster host node voting device of the present invention is shown It is intended to.
In the present embodiment, described cluster host node voting device includes: initiation module 10, judge module 20, increase vote module 30 and determine module 40.
Described initiation module 10, is used for initiating host node election, for cluster interior nodes to described requestor Node is voted;
Described cluster can be ceph (Linux PB level distributed file system) cluster, NAS (network Attached storage) cluster, SAN (storage area network) cluster, unified storage cluster etc. need to use The cluster of host node.Requestor's node in described cluster is by owning in transmission request message to cluster Node initiates host node election, and the node receiving described request message in cluster is receiver's node, Described requestor's node, when receiving described request message, is voted by described receiver's node, and Voting results are sent to described requestor's node.Described requestor's node and described receiver's node Think all nodes in described cluster.Described requestor's node can be host node current in cluster, Or can also be other node beyond host node current in cluster.Described requestor's node is initiated Host node is elected, and this section point can also be voted by described requestor's node.
Preferably, all nodes in described requestor's node transmission request message to cluster, for reception To the node of described request message described requestor's node voted and return response message;Described please The person's of asking node receives described response message, and determines the votes of acquisition according to described response message.Described Response message can be polling response or not polling response.
The process that described requestor's node is voted by the node in described cluster, can be by such as lower section Formula is implemented: the node in described cluster is when receiving request message, it is judged that whether there is main joint in cluster Point;If cluster memory is at host node, then judge whether described requestor's node is host node;The most then Vote to described requestor's node;If it is not, vote the most to described requestor's node;If not depositing in cluster At host node, then judge that whether described requestor's node is the minimum IP node in cluster, the most then give Described requestor's node is voted;If it is not, vote the most to described requestor's node.
Described judge module 20, for receiving the ballot of described cluster interior nodes, and judges described requestor The most whether node is host node;
Preferably, described requestor's node receives the ballot of described cluster interior nodes, when reaching to set the time, Judge the most whether this node is host node, increase, according to judged result, the votes that host node obtains;Enter Row ballot statistics, determines whether described requestor's node is host node at default lease time.
Or, described requestor's node can also receive the ballot of described cluster interior nodes, is reaching default During the time, carry out ballot statistics, determine whether described requestor's node is main joint at default lease time Point, the most then election terminates;If it is not, then judge the most described requestor's node is host node, Determine according to judged result and increase the votes that host node obtains;Carry out ballot statistics again, determine described asking Whether the person's of asking node is host node at default lease time.
Described increase vote module 30, if be currently host node for described requestor's node, then described asks The person's of asking node increases the votes obtained;
If described requestor's node is currently host node, the most described requestor's node increases to described requestor The votes of node, during so that the host node of current cluster initiates host node election, it is possible to obtain enough Ballot keeps the position of host node, will not lose master because the node being newly added can not get enough ballot papers The position of node.
Described determine module 40, for according to the ballot sum obtained, determining that described requestor's node exists Whether the lease time section preset is host node.
Described default lease time is the lease time that described election is corresponding, and lease time is cluster internal segment Point election every time obtains the time limit of host node position.Described requestor's node can be by asking described The ballot sum of the acquisition of the person's of asking node is compared with the clustered node number of preset ratio, if described request The ballot sum that person's node obtains is more than or equal to the clustered node number of described preset ratio, it is determined that described Requestor's node is host node in described lease time section;If the ballot sum that described requestor's node obtains Clustered node number less than described preset ratio, it is determined that described requestor's node is in described lease time section It it not host node.The clustered node number of described preset ratio can be the 1/2 of described clustered node number, described The 1/3 of clustered node number or the 1/4 of described clustered node number etc..
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
Functional module with reference to the second embodiment that Fig. 6, Fig. 6 are cluster host node voting device of the present invention is shown It is intended to.First embodiment based on above-mentioned cluster host node voting device, described increase vote module 30 is wrapped Include and check unit 31 and increase ballot unit 32;
Described check unit 31, for traveling through all nodes in described cluster, check described cluster internal segment Put the connection status with described requestor's node;
Described requestor's node determine this node currently for host node time, described requestor's node traverses institute State all nodes in cluster, check the connection status of described cluster interior nodes and described requestor's node.
Described increase ballot unit 32, in the company finding cluster interior nodes and described requestor's node When connecing normal, increase to described requestor's node and preset poll, until owning in having checked described cluster Node and the connection status of described requestor's node.
Described default poll is preferably a ticket, and described requestor's node is finding cluster interior nodes with described When the connection of requestor's node is normal, often finds one and be connected normal node with described requestor's node, Increase by a ticket to described requestor's node, until all nodes in having checked described cluster and described request The connection status of person's node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by the connection status of traversal cluster interior nodes with requestor's node, the normal node of each connection Increase then to described requestor's node and preset poll so that host node current in cluster is when initiating election It is obtained in that enough ballots, and keeps host node position, effectively avoid when there being little IP to save in cluster Point adds fashionable, current host node and can not get enough ballots and the problem that loses host node position, it is ensured that The stability of cluster host node and reliability.
Further, described judge module 20, it is additionally operable to receive the ballot of described cluster interior nodes, and will The clustered node number of the votes received in Preset Time and preset ratio is compared;
Described judge module 20, the votes being additionally operable to receive in Preset Time is less than described default ratio During the clustered node number of example, it is judged that the most described requestor's node is host node.
The election of host node that described requestor's node is initiated by described cluster interior nodes is voted, described please The person's of asking node receives the ballot of described cluster interior nodes, and by the votes that receives in Preset Time with pre- If the clustered node number of ratio is compared;The ballot that described requestor's node receives in Preset Time When number is less than the clustered node number of described preset ratio, it is judged that the most whether this node is host node.
Described Preset Time can be the lease time in described cluster, and described lease time is preferably arranged to 6 Second;Or, described Preset Time can also be the longest time-out time in described cluster, described the longest super Time the time be preferably arranged to 9 seconds;Or, described Preset Time can also be the main joint of initiation in described cluster The interval time of some election, the interval time of described host node election is preferably arranged to 3 seconds.
The votes that described requestor's node receives in Preset Time is more than or equal to described default ratio During the clustered node number of example, determine described requestor's node in described lease time section for host node.
Described judge module 20, the votes being additionally operable to receive in Preset Time is more than or equal to institute When stating the clustered node number of preset ratio, determine that described requestor's node is main in described lease time section Node.Such as: described requestor's node receives the ballot of described cluster interior nodes, if default the longest In time-out time 9 seconds, the votes received is more than or equal to the 1/2 of described clustered node number, it is determined that Described requestor's node is host node in described lease time section, if at default the longest time-out time 9 In second, the votes received less than the 1/2 of described clustered node number, then determines whether described requestor Whether node is host node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
Functional module with reference to the 4th embodiment that Fig. 7, Fig. 7 are cluster host node voting device of the present invention is shown It is intended to.First embodiment based on above-mentioned cluster host node voting device, described determine module 40 include system Count unit 41, judging unit 42 and determine unit 43;
Described statistic unit 41, the ballot sum obtained for statistics;
Described judging unit 42, for judging whether described ballot sum is more than or equal to the collection of preset ratio Group node number;
Described determine unit 43, if for described ballot sum whether more than or equal to the cluster of preset ratio Nodes, it is determined that described requestor's node is host node in described lease time section;
Described determine unit 44, if being additionally operable to described ballot sum whether less than the clustered node of preset ratio Number, it is determined that described requestor's node is not host node in described lease time section.
The ballot sum that described requestor's node statistics is obtained;Described requestor's node judges described ballot Whether sum is more than or equal to the clustered node number of preset ratio;If, it is determined that described requestor's node It is host node in described lease time section;If not, it is determined that described requestor's node is at described lease time Section is not host node.
The present embodiment is in group document host node election process, if described requestor's node is currently main joint Point, then by increasing to the ballot of described requestor's node so that host node current in cluster is being initiated It is obtained in that enough ballots during election, and keeps host node position, effectively avoiding when having in cluster Little IP node adds fashionable, and current host node can not get enough ballots and loses the problem of host node position, Ensure that stability and the reliability of cluster host node.
It should be noted that in this article, term " include ", " comprising " or its any other variant Be intended to comprising of nonexcludability so that include the process of a series of key element, method, article or Person's device not only includes those key elements, but also includes other key elements being not expressly set out, or also Including the key element intrinsic for this process, method, article or device.In the feelings not having more restriction Under condition, statement " including ... " key element limited, it is not excluded that include this key element process, Method, article or device there is also other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive above-mentioned Embodiment method can add the mode of required general hardware platform by software and realize, naturally it is also possible to logical Cross hardware, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the present invention's The part that prior art is contributed by technical scheme the most in other words can be with the form body of software product Revealing to come, this computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, light Dish) in, including some instructions with so that a station terminal equipment (can be mobile phone, computer, service Device, air-conditioner, or the network equipment etc.) perform the method described in each embodiment of the present invention.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every Utilize equivalent structure or equivalence flow process conversion that description of the invention and accompanying drawing content made, or directly or Connect and be used in other relevant technical fields, be the most in like manner included in the scope of patent protection of the present invention.

Claims (10)

1. a cluster host node electoral machinery, it is characterised in that described cluster host node electoral machinery bag Include following steps:
Requestor's node in cluster initiates host node election, saves described requestor for cluster interior nodes Point is voted;
Described requestor's node receives the ballot of described cluster interior nodes, and judges that described requestor's node is worked as Before whether be host node;
The most described requestor's node increases the votes obtained;
Described requestor's node, according to the ballot sum obtained, determines that described requestor's node is default Whether lease time section is host node.
2. cluster host node electoral machinery as claimed in claim 1, it is characterised in that described requestor Node increases the step of the votes obtained and includes:
All nodes in cluster described in described requestor's node traverses, check described cluster interior nodes and institute State the connection status of requestor's node;
Described requestor's node when the connection finding cluster interior nodes and described requestor's node is normal, Increase to described requestor's node and preset poll, until all nodes in having checked described cluster are with described The connection status of requestor's node.
3. cluster host node electoral machinery as claimed in claim 1, it is characterised in that described requestor Node receives the ballot of described cluster interior nodes, and judges the most described requestor's node is host node Step include:
Described requestor's node receives the ballot of described cluster interior nodes, and will receive in Preset Time The clustered node number of votes and preset ratio is compared;
The votes that described requestor's node receives in Preset Time is less than the cluster of described preset ratio During nodes, it is judged that the most described requestor's node is host node.
4. cluster host node electoral machinery as claimed in claim 3, it is characterised in that described requestor Node receives the ballot of described cluster interior nodes, and by the votes received in Preset Time and default ratio After the step that the clustered node number of example is compared, also include:
The votes that described requestor's node receives in Preset Time is more than or equal to described default ratio During the clustered node number of example, determine described requestor's node in described lease time section for host node.
5. the cluster host node electoral machinery as described in any one of Claims 1-4, it is characterised in that Described requestor's node, according to the ballot sum obtained, determines that described requestor's node is in default lease Whether the time period is that the step of host node includes:
The ballot sum that described requestor's node statistics is obtained;
Described requestor's node judges whether described ballot sum is more than or equal to the clustered node of preset ratio Number;
If, it is determined that described requestor's node is host node in described lease time section;
If not, it is determined that described requestor's node is not host node in described lease time section.
6. a cluster host node voting device, it is characterised in that described cluster host node voting device bag Include:
Initiation module, is used for initiating host node election, enters described requestor's node for cluster interior nodes Row ballot;
Judge module, for receiving the ballot of described cluster interior nodes, and judges that described requestor's node is worked as Before whether be host node;
Increasing vote module, if being currently host node for described requestor's node, the most described requestor saves Point increases the votes obtained;
Determine module, for according to the ballot sum obtained, determining that described requestor's node is default Whether lease time section is host node.
7. cluster host node voting device as claimed in claim 6, it is characterised in that described increase is thrown Ticket module includes checking unit and increasing ballot unit;
Described check unit, for traveling through all nodes in described cluster, check described cluster interior nodes Connection status with described requestor's node;
Described increase ballot unit, in the connection finding cluster interior nodes and described requestor's node Time normal, increase to described requestor's node and preset poll, until all joints in having checked described cluster Put the connection status with described requestor's node.
8. cluster host node voting device as claimed in claim 6, it is characterised in that described judgement mould Block, is additionally operable to receive the ballot of described cluster interior nodes, and by the votes that receives in Preset Time with The clustered node number of preset ratio is compared;
Described judge module, the votes being additionally operable to receive in Preset Time is less than described preset ratio Clustered node number time, it is judged that the most described requestor's node is host node.
9. cluster host node voting device as claimed in claim 8, it is characterised in that described judgement mould Block, the votes being additionally operable to receive in Preset Time is more than or equal to the cluster of described preset ratio During nodes, determine that described requestor's node is host node in described lease time section.
10. the cluster host node voting device as described in any one of claim 6 to 9, it is characterised in that Described determine that module includes statistic unit, judging unit and determines unit;
Described statistic unit, the ballot sum obtained for statistics;
Described judging unit, for judging whether described ballot sum is more than or equal to the cluster of preset ratio Nodes;
Described determine unit, if for described ballot sum whether more than or equal to the cluster joint of preset ratio Count, it is determined that described requestor's node is host node in described lease time section;
Described determine unit, if being additionally operable to described ballot sum whether less than the clustered node number of preset ratio, Then determine that described requestor's node is not host node in described lease time section.
CN201510381889.7A 2015-07-02 2015-07-02 Cluster main node voting method and device Withdrawn CN106331046A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510381889.7A CN106331046A (en) 2015-07-02 2015-07-02 Cluster main node voting method and device
PCT/CN2016/081429 WO2017000666A1 (en) 2015-07-02 2016-05-09 Cluster master node election method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510381889.7A CN106331046A (en) 2015-07-02 2015-07-02 Cluster main node voting method and device

Publications (1)

Publication Number Publication Date
CN106331046A true CN106331046A (en) 2017-01-11

Family

ID=57607679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510381889.7A Withdrawn CN106331046A (en) 2015-07-02 2015-07-02 Cluster main node voting method and device

Country Status (2)

Country Link
CN (1) CN106331046A (en)
WO (1) WO2017000666A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888261A (en) * 2017-02-27 2017-06-23 深圳市先河系统技术有限公司 A kind of distributed document transmission method, server and private clound equipment
CN106952207A (en) * 2017-03-10 2017-07-14 深圳市博信诺达经贸咨询有限公司 Monitor the electoral machinery and system of cloud platform distributed system
CN107070729A (en) * 2017-06-13 2017-08-18 深圳市伊特利网络科技有限公司 Main equipment elects method and system in network linking
CN109240840A (en) * 2017-07-11 2019-01-18 阿里巴巴集团控股有限公司 Disaster recovery method, device and the machine readable media of group system
CN109327544A (en) * 2018-11-21 2019-02-12 新华三技术有限公司 A kind of determination method and apparatus of leader node
CN111049696A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
CN111046110A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
CN112565353A (en) * 2020-11-20 2021-03-26 珠海格力电器股份有限公司 Communication method of terminal network, terminal network and controller
CN113364871A (en) * 2021-06-07 2021-09-07 杭州溪塔科技有限公司 Node election method and device based on intelligent contract and electronic equipment
CN115412419A (en) * 2022-08-29 2022-11-29 福建乐摩物联科技有限公司 Ad hoc network master node election and data synchronization method
WO2023124663A1 (en) * 2021-12-28 2023-07-06 华为技术有限公司 Cluster quorum implementation method, network device, and system

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365794B (en) * 2019-07-30 2021-09-14 四川虹魔方网络科技有限公司 Message pushing method and system based on Internet television
TWI744068B (en) * 2020-11-03 2021-10-21 啟碁科技股份有限公司 Resource management system and resource management method
CN112379845A (en) * 2020-11-30 2021-02-19 深信服科技股份有限公司 Cluster capacity expansion method and device, computing equipment and storage medium
CN113641692A (en) * 2021-08-18 2021-11-12 福建天晴数码有限公司 Scheme and system for realizing distributed cluster node participation
CN113886129A (en) * 2021-10-21 2022-01-04 联想(北京)有限公司 Information processing method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120089709A1 (en) * 2007-01-05 2012-04-12 Frank Paul R System and Method of Synchronizing Real Time Clock Values in Arbitrary Distributed Systems
CN103118084A (en) * 2013-01-21 2013-05-22 浪潮(北京)电子信息产业有限公司 Host node election method and node
CN104320459A (en) * 2014-10-24 2015-01-28 杭州华三通信技术有限公司 Node management method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2505230B (en) * 2012-08-23 2019-10-16 Metaswitch Networks Ltd Leader node appointment
CN104679796A (en) * 2013-12-03 2015-06-03 方正信息产业控股有限公司 Selecting method, selecting device and database mirror image cluster node

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120089709A1 (en) * 2007-01-05 2012-04-12 Frank Paul R System and Method of Synchronizing Real Time Clock Values in Arbitrary Distributed Systems
CN103118084A (en) * 2013-01-21 2013-05-22 浪潮(北京)电子信息产业有限公司 Host node election method and node
CN104320459A (en) * 2014-10-24 2015-01-28 杭州华三通信技术有限公司 Node management method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888261A (en) * 2017-02-27 2017-06-23 深圳市先河系统技术有限公司 A kind of distributed document transmission method, server and private clound equipment
CN106952207A (en) * 2017-03-10 2017-07-14 深圳市博信诺达经贸咨询有限公司 Monitor the electoral machinery and system of cloud platform distributed system
CN107070729A (en) * 2017-06-13 2017-08-18 深圳市伊特利网络科技有限公司 Main equipment elects method and system in network linking
CN109240840A (en) * 2017-07-11 2019-01-18 阿里巴巴集团控股有限公司 Disaster recovery method, device and the machine readable media of group system
CN109327544B (en) * 2018-11-21 2021-06-18 新华三技术有限公司 Leader node determination method and device
CN109327544A (en) * 2018-11-21 2019-02-12 新华三技术有限公司 A kind of determination method and apparatus of leader node
CN111049696A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
CN111046110A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
CN111046110B (en) * 2020-03-16 2020-06-26 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
WO2021184878A1 (en) * 2020-03-16 2021-09-23 支付宝(杭州)信息技术有限公司 Node management method for block chain system, node, and computational device
WO2021184877A1 (en) * 2020-03-16 2021-09-23 支付宝(杭州)信息技术有限公司 Node management method for blockchain system, nodes and computing device
CN112565353A (en) * 2020-11-20 2021-03-26 珠海格力电器股份有限公司 Communication method of terminal network, terminal network and controller
CN113364871A (en) * 2021-06-07 2021-09-07 杭州溪塔科技有限公司 Node election method and device based on intelligent contract and electronic equipment
WO2023124663A1 (en) * 2021-12-28 2023-07-06 华为技术有限公司 Cluster quorum implementation method, network device, and system
CN115412419A (en) * 2022-08-29 2022-11-29 福建乐摩物联科技有限公司 Ad hoc network master node election and data synchronization method

Also Published As

Publication number Publication date
WO2017000666A1 (en) 2017-01-05

Similar Documents

Publication Publication Date Title
CN106331046A (en) Cluster main node voting method and device
CN106817250B (en) Dynamic election method and system
KR101988558B1 (en) Apparatus and operating method for monitoring micro controller unit having multi-core
CN110572443B (en) Long connection state updating method, server and storage medium
CN102868770B (en) A kind of method of distribution interface, equipment and system
CN105553740A (en) Data interface monitoring method and device
CN112328421A (en) System fault processing method and device, computer equipment and storage medium
CN110234132A (en) Restore method, system, server, terminal and the storage medium of network
CN115640171A (en) Database dual-node hot standby method and system without arbitration node
CN105636030A (en) Method and device for sharing access point
CN113489689B (en) Authentication method and device for access request, storage medium and electronic equipment
CN106254515A (en) A kind of load-balancing method storing system and equipment
CN104038366A (en) Cluster node failure detection method and system
US20210067824A1 (en) Video stream check method and system, computer device and storage medium
CN113765690A (en) Cluster switching method, system, device, terminal, server and storage medium
US10674337B2 (en) Method and device for processing operation for device peripheral
CN110674096A (en) Node troubleshooting method, device and equipment and computer readable storage medium
WO2010131482A1 (en) Database device, database matching system, and database matching method
CN107659510B (en) Method and device for uploading data by underground barrel terminal, storage medium and underground barrel terminal
CN113568781B (en) Database error processing method and device and database cluster access system
CN113596195A (en) Public IP address management method, device, main node and storage medium
CN102571468A (en) Method for detecting network delay
CN104714868A (en) Distributed computer automatic dial testing method
CN116388921B (en) Link point time synchronization method, device and storage medium based on precompiled contracts
CN111279653A (en) Communication method, apparatus and storage medium

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170111