CN107124305A - node device operation method and node device - Google Patents
node device operation method and node device Download PDFInfo
- Publication number
- CN107124305A CN107124305A CN201710263587.9A CN201710263587A CN107124305A CN 107124305 A CN107124305 A CN 107124305A CN 201710263587 A CN201710263587 A CN 201710263587A CN 107124305 A CN107124305 A CN 107124305A
- Authority
- CN
- China
- Prior art keywords
- node device
- daily record
- heartbeat message
- cycle
- state
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/30—Decision processes by autonomous network management units using voting and bidding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Small-Scale Networks (AREA)
- Hardware Redundancy (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of node device operation method and node device, belong to network technique field.This method includes:Receive the heartbeat message for the node device for running on leader's state;If present node equipment runs on candidate state, cycle of operation information and newest daily record index are obtained from heartbeat message;If the cycle of operation information in heartbeat message is less than the cycle of operation information of present node equipment, and newest daily record of the newest daily record index more than or equal to present node equipment in heartbeat message is indexed, it is the cycle of operation information in heartbeat message by the cycle of operation synchronizing information of present node equipment, and switch to following state to run or keep candidate state current operating state.The present invention is by being the cycle of operation information in heartbeat message by the cycle of operation synchronizing information of present node equipment, solve the sub-cluster in system in the prior art to recover that during network connection a problem of system works can not be combined into, improve the functional reliability of system.
Description
Technical field
The present invention relates to network technique field, more particularly to a kind of node device operation method and node device.
Background technology
It is more and more universal for the mode that client provides service based on cluster with the development of network technology.In order to ensure
Being consistent property of the node device of each in cluster, node device can typically apply BFT-Raft (Byzantine when running
Fault Tolerance algorithm-Raft, Byzantine failure tolerance raft algorithm).
According to BFT-Raft, the working condition of node device can be divided into three kinds:Following state follower, candidate state
Candidate and leader's state leader.When any node equipment a runs on following state, it can be transported according in the cluster
The heartbeat message that row is broadcasted in the node device b of leader's state, determines node device b normal operations, and set based on node
Standby b instruction replication log.When node device a does not receive node device b heartbeat message within a period of time, it may be determined that
Node device b operation troubles, and switch to candidate state to run, will vote each node device of request broadcast into cluster,
Once receiving the ballot of node devices more than half in the cluster, node device a can switch to leader's state to run, and
By heartbeat message broadcast each node device into cluster, based on the interaction storage daily record with client, indicate each node
Device replication daily record.It should be noted that when the node device a for running on candidate state receives heartbeat message, if should
The cycle of operation information that heartbeat message is carried is less than node device a cycle of operation information, then node device a can ignore the heart
Hop-information.
During the present invention is realized, inventor has found that prior art at least has problems with:
Because a cluster may split into two sub-clusters that network is isolated, e.g., sub-cluster A and sub-cluster B, the son
Cluster B includes the node device a that leader's state is run in the cluster, and sub-cluster A node device quantity is less than subset
Group B node device quantity, then the node device in sub-cluster A new can not run on leader's state by voting in one
Node device, therefore sub-cluster A node device cycle of operation information with the time be incremented by, when sub-cluster A and sub-cluster B are extensive
After multiple network connection, any node equipment b in sub-cluster A can receive node device a heartbeat message, because node is set
Standby a cycle of operation information is less than node device b cycle of operation information, then node device b can ignore the heartbeat message, cause
Node device b can not add original cluster.
The content of the invention
In order to solve problem of the prior art, set the embodiments of the invention provide a kind of node device operation method and node
It is standby.The technical scheme is as follows:
On the one hand there is provided a kind of node device operation method, methods described includes:
Receive the heartbeat message for the node device for running on leader's state;
If present node equipment runs on candidate state, cycle of operation information is obtained from the heartbeat message and newest
Daily record is indexed;
If the cycle of operation information in the heartbeat message is less than the cycle of operation information of the present node equipment, and
Newest daily record of the newest daily record index more than or equal to the present node equipment in the heartbeat message is indexed, will be described current
The cycle of operation synchronizing information of node device is the cycle of operation information in the heartbeat message, and current operating state is switched
The candidate state is run or kept for following state.
On the other hand there is provided a kind of node device, the node device includes:
Receiving module, the heartbeat message for receiving the node device for running on leader's state;
Acquisition module, if running on candidate state for present node equipment, obtains operation from the heartbeat message
Cycle information and newest daily record index;
Module is run, if being less than the fortune of the present node equipment for the cycle of operation information in the heartbeat message
Newest daily record rope of the newest daily record index more than or equal to the present node equipment in line period information, and the heartbeat message
Draw, be the cycle of operation information in the heartbeat message by the cycle of operation synchronizing information of the present node equipment, and ought
Preceding working condition switches to following state to run or keep the candidate state.
The embodiment of the present invention is by when receiving heartbeat message, obtaining the cycle of operation information in heartbeat and newest daily record
Index, if the cycle of operation information obtained is less than the cycle of operation information of itself, and the newest daily record rope obtained is not less than certainly
The newest daily record index of body, then be the cycle of operation information in the heartbeat message by the cycle of operation synchronizing information of itself, and will
The working condition of itself switches to following state or keeps candidate state so that switch to the node device of following state can be straight
Connect and the work of system is combined into according to this heartbeat message and yield in the second subset group, or keep the node device of candidate state can be with
When receiving heartbeat message again, according to the cycle of operation information of itself and newest daily record index no more than in heartbeat message
Correspondence two, switch to following state to run, and then can also be combined into the work of system with yield in the second subset group, improve system
Functional reliability.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is a kind of implementation environment schematic diagram of node device operation provided in an embodiment of the present invention;
Fig. 2 is a kind of switching schematic diagram of node device working condition provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of node device operation method provided in an embodiment of the present invention;
Fig. 4 is a kind of module diagram of node device provided in an embodiment of the present invention;
Fig. 5 is a kind of module diagram of node device provided in an embodiment of the present invention;
Fig. 6 is a kind of node device structural representation provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1 is a kind of implementation environment schematic diagram of node device operation provided in an embodiment of the present invention.Referring to Fig. 1, the reality
It is a system being made up of multiple node devices to apply environment, and the system also corresponds to a cluster, and node device 2 is the system
In run on the node device of leader's state, in 2 normal operation of node device, can periodically be run on to each and follow shape
The node device broadcast heartbeat message of state, e.g., node device 3, node device 4 each run on the node device of following state
The normal operation of node device 1 can be determined when receiving heartbeat message, and resets timer (between generally 0.5-1 seconds
Random value, can so avoid the timing duration of the timer of each node device is identical from being likely to result in situation about electing repeatedly),
Wait heartbeat message next time.
In fact, the working condition of the node device of each in system can be with switching at runtime, referring to Fig. 2, the present invention is real
Example is applied there is provided a kind of switching schematic diagram of node device working condition.Once run on following state (follower) node
Equipment is not received by heartbeat message in the case of timer expiry, it may be determined that run on the node device fortune of leader's state
Row failure, and switch to candidate state (candidate) to run;And then, node device can reset timer, and broadcast ballot
Request, switches to leader's state (leader) to run until receiving ballot confirmation messages more than half in the system, or
Following state is switched to run during the heartbeat message for receiving the node device for running on leader's state, or timer expiry
In the case of keep candidate state start a new round election;Running on the node device of leader's state can find have than itself
Following state is switched to run during the node device of higher cycle of operation information (term).
When the system provides service for client, when any node equipment in the system receives the service of client
During order, the service command can be redirected to node device 2, added from node device 2 to the broadcast daily record of each node device
Plus request, daily record addition request is used to ask the service command being added in daily record, if node device 2 can be received
Each node device adds the confirmation message of request to daily record, the service command of the client can be responded, by the service command
It is added in daily record, and is instructed to each node device broadcast daily record reproduction so that each node device answers the service command
Make in daily record.In actual application scenarios, the system can be transaction system of the bottom based on block chain technology, the service
Order can be the Transaction Information of client, and the daily record that each node device is stored can correspond to a block chain, work as addition
When Transaction Information is into daily record, really by the Transaction Information storage into next block of current block, due to stored to
Data in block chain can not be changed, and effectively Transaction Information can be prevented to be tampered, and improve the security of Transaction Information.
Due to reasons such as network interruptions, each node device in the system may divide to form the son that two networks are separated by
Cluster, i.e. the first sub-cluster and yield in the second subset group, and node of the node device quantity less than yield in the second subset group of the first sub-cluster
Number of devices.Yield in the second subset group includes running on the node device 2 of leader's state in the system.And then, the yield in the second subset
The node device of following state is run in group to continue normal work according to the heartbeat message of the fixed time broadcast of node device 2
Make;First sub-cluster is due to the network interruption with node device 2, wherein the node device for running on following state is super in timer
In the case of can not receive the heartbeat message of node device 2, according to bft-raft overtime election mechanism, run on
Candidate state can be switched to run with the node device of state, reset timer, the cycle of operation information of itself is added one, and extensively
Broadcast ballot request.However, because the node device quantity of first sub-cluster is less than the half of system interior joint number of devices, because
Any node equipment in this first sub-cluster can not all receive the general throwing more than the system interior joint number of devices
Ticket is asked, and causes the timer expired until each node and equipment, leader's state can not be selected in first sub-cluster
Node device, then the node device in the first sub-cluster can keep candidate state, but be weighed again in the case of timer expiry
Timer is put, the cycle of operation information of itself is added one, and broadcasts ballot request, if the first sub-cluster and yield in the second subset group are extensive
Multiple network connection, according to prior art, even if the node device in first sub-cluster receives the heartbeat letter of node device 2
Breath, but because the cycle of operation information in the heartbeat message is less than the ballot request of the node device in yield in the second subset group, should
Node device in first sub-cluster can also ignore the heartbeat message of node device 2, and continue waiting for the throwing of other node devices
Ticket or the heartbeat message for receiving the node device for being qualified as leader's state, until timer again time out, are so followed
Ring.
Fig. 3 is a kind of flow chart of node device operation method provided in an embodiment of the present invention, and referring to Fig. 3, this method can
With the node device 1 applied to embodiment illustrated in fig. 1, following steps are specifically included:
301st, node device 1 receives the heartbeat message for the node device for running on leader's state.
Wherein, the node device 1 runs on candidate state, can elect start when based on itself the cycle of operation letter
Breath, newest daily record index (last log index) and node equipment identification generation ballot request, and broadcast ballot request.Should
The node device for running on leader's state can be the node device 2 in yield in the second subset group in embodiment illustrated in fig. 1.Due to this
Any node that the node device quantity of one sub-cluster is less than in the half of system interior joint number of devices, first sub-cluster is set
The standby ballot that can not all receive the half more than system interior joint number of devices, then can not select neck all the time in the first sub-cluster
The node device of state is led, and then causes node device 1 to run on candidate state all the time, and is incremented by after each timer expiry
The cycle of operation information of itself, starts the new election of a wheel.Heartbeat message is wide by the timing of node device 2 in yield in the second subset group
Broadcast, cycle of operation information, newest daily record index and node equipment identification of the node device 2 etc. can be carried.In the first subset
When group and yield in the second subset group recover network connection, the heartbeat message that the node device 2 is broadcasted can be run on candidate's shape by this
The node device of state is received.
If the 302, node device 1 runs on candidate state, node device 1 obtains cycle of operation information from heartbeat message
With newest daily record index.
Wherein, cycle of operation information refers to send the cycle of operation number that the node device of the heartbeat message is presently in.Often
Secondary when conducting an election, the cycle of operation information of the node device of candidate state is switched to by following state to add one, eventually become
The node device of leader's state can carry cycle of operation information in heartbeat message, and be broadcast to other node devices, connect
Receiving the node device of the candidate state of heartbeat message can switch to following state to run, and by the cycle of operation information of itself
Synchronous is the cycle of operation information in the heartbeat message, and therefore, whether the cycle of operation information can characterize a node device
All the time with running on the synchronous and normal operation of node device holding of leader's state.Newest daily record index refers to send heartbeat letter
The index of the daily record of the newest storage of node device of breath, each run is added after new daily record in the node device of leader's state,
The newest daily record index Jia one, and the node device for running on leader's state can save daily record reproduction command broadcast to other
Point device so that the node device for receiving daily record reproduction instruction can the synchronously daily record of the node device of leader's state and most
New daily record index, therefore, the newest daily record index can characterize the usage data mining of a node device, it is clear that run on neck
The node device for leading state is the best node device of usage data mining in its system.
In the step, node device 1 can be respectively according to cycle of operation information and newest daily record index in heartbeat message
Protocol position, from heartbeat message respectively extract correspondence protocol position cycle of operation information and newest daily record index.
In the actual application scenarios, in order to avoid the disguise oneself as node device of leader's state of the network equipment having is sent
Heartbeat message, improves the security of system, and the heartbeat message needs the node device of each in carrying system to run on leader in response
Signature during the ballot request of the node device of state.When receiving the heartbeat message, if node device 1 runs on candidate
State, can obtain multiple signatures from heartbeat message;If the quantity of multiple signatures is more than system interior joint number of devices
Half, and it is multiple signature be verified, from heartbeat message obtain cycle of operation information and newest daily record index.In the system
Each node device can be configured with itself private key and each node device public key.Node device 1 can be from heartbeat
The signature of each node device is extracted in information as the plurality of signature, and using the public key of configured any node equipment
The signature of the node device is verified, if the signature of each node device is verified, and the signature being verified
Quantity is more than the half of the system interior joint number of devices, illustrates the heartbeat message actually from the node for running on leader's state
Equipment, then can obtain cycle of operation information and newest daily record index, and continue executing with step 302 from heartbeat message.
303rd, node device 1 judges whether the cycle of operation information in heartbeat message is less than the cycle of operation of node device 1
Information, if it is, step 304 is performed, if not, ignoring the heartbeat message.
In the step, network connection has been recovered between the sub-cluster that the system is currently in after division to confirm, and the
The implement scene that node device in one sub-cluster is conducting an election, it is contemplated that the first sub-cluster and yield in the second subset group are initial
The cycle of operation information of the node device of each in system is identical during division, then first sub-cluster constantly conducts an election after cleaving
During the cycle of operation information of node device 1 can be constantly incremental, and yield in the second subset group is due to the normal operation of node device 2,
The cycle of operation information of node device therein can keep constant, therefore cycle of operation information can be used as above-mentioned implement scene
One of confirmation foundation, if the cycle of operation information in heartbeat message is less than the cycle of operation information of the node device 1, above-mentioned reality
Apply scene to be confirmed, then continue executing with step 304, if the cycle of operation information in the heartbeat message is not less than node device
1 cycle of operation information, illustrates not meeting above-mentioned implement scene, can ignore the heartbeat message, but because the condition meets choosing
Enumerate one of new situation of node device of leader's state, then node device 1 can continue to perform step 304 (in fact,
The situation belongs to situation about normally being elected in system, and the embodiment of the present invention does not limit how node device 1 is handled).
304th, node device 1 judges whether the newest daily record index in heartbeat message is more than or equal to present node equipment most
New daily record index, if it is, be the cycle of operation information in heartbeat message by the cycle of operation synchronizing information of node device 1, and
Following state is switched to run current operating state, if not, ignoring the heartbeat message.
In view of before System splitting, the day that the daily record of each node device in the system ought to be with node device 2
Will is synchronous, therefore yield in the second subset group is by a period of time for client service, after two sub- cluster recovery network connections,
The daily record that the daily record that node device 2 is stored should be stored no less than the node device 1, also therefore can be by newest daily record rope
Draw as one of foundation for confirming above-mentioned implement scene, if the newest daily record index in the ballot request of multiple node devices is equal
Newest daily record not less than node device 1 is indexed, and illustrates that the daily record amount that the ballot asks corresponding node device to store is equal to
Or more than the daily record amount of node device 1, above-mentioned implement scene finally gives every confirmation, therefore node device 1 can be by node
The cycle of operation synchronizing information of equipment 1 is the cycle of operation information in heartbeat message, and switches to following state to run, if should
Newest daily record of the newest daily record index less than node device 1 in heartbeat message is indexed, and above-mentioned implement scene is not confirmed,
The heartbeat message can then be ignored.
Certainly, if node device 1 switches to following state, in addition it is also necessary to reset timer, and based on when node device 1
Newest daily record index and heartbeat message in newest daily record index, determine node device 1 need add daily record index;Xiang Yun
Row sends daily record addition request in the node device of leader's state.Daily record addition request can carry the daily record rope for needing to add
Draw so that when node device 2 receives daily record addition request, the daily record added can will be needed to index corresponding daily record and returned to
Node device 1.
In fact, the cycle of operation synchronizing information of node device 1 can also be the operation in heartbeat message by node device 1
Cycle information, and keep candidate state to run.In the implementation, node device 1 can be until receiving node device 2 again
Heartbeat message when switch to following state to run, and the daily record of the synchronous node device 2.
It should be noted that the embodiment of the present invention performs step 303 to node device 1 and 304 sequential does not do specific limit
It is fixed, in fact, node device 1 first can also be judged newest daily record index, then cycle of operation information is judged, or
Person, in order to improve judging efficiency, and causes the first sub-cluster and yield in the second subset group to be combined into a system job, node device as early as possible
1 can also judge newest daily record index and cycle of operation information simultaneously, as long as the two meets above-mentioned respective sentence respectively
Broken strip part, node device 1 can switch to current operating state following state (or keeping candidate state).
It was any section for running on candidate state in first sub-cluster originally based on above-mentioned node device operation method
Point device can be combined into a system job with yield in the second subset group.
The embodiment of the present invention is by when receiving heartbeat message, obtaining the cycle of operation information in heartbeat and newest daily record
Index, if the cycle of operation information obtained is less than the cycle of operation information of itself, and the newest daily record rope obtained is not less than certainly
The newest daily record index of body, then be the cycle of operation information in the heartbeat message by the cycle of operation synchronizing information of itself, and will
The working condition of itself switches to following state or keeps candidate state so that switch to the node device of following state can be straight
Connect and the work of system is combined into according to this heartbeat message and yield in the second subset group, or keep the node device of candidate state can be with
When receiving heartbeat message again, according to the cycle of operation information of itself and newest daily record index no more than in heartbeat message
Correspondence two, switch to following state to run, and then can also be combined into the work of system with yield in the second subset group, improve system
Functional reliability.
305th, node device 1, which is received, runs on the daily record reproduction instruction that the node device of leader's state is broadcasted, based on this
Daily record reproduction instructs replication log.
In order to which each node device can store complete daily record in guarantee system, so that ensure the uniformity of system, should
The node device for running on leader's state can be in systems each node device determine the new daily record of addition after broadcast daily record
Duplicate instructions so that the node device 1 can receive daily record reproduction instruction, so that by the recently received service of the system
Instruction is added in daily record.Certainly, node device uniformity is not only solved based on bft-raft, and solves node device take advantage of
Swindleness, data are tampered, lose or the problem of order entanglement, and daily record reproduction instruction needs the node device of each in carrying system in sound
Signature during the ballot request for the node device that should run on leader's state so that node device 1 can refer to the daily record reproduction
Make and being verified, and carry out after being verified daily record reproduction.
It should be noted that in the first sub-cluster and yield in the second subset group after network connection is recovered, if appointed in the system
One node device is not received by heartbeat message in the case of timer expiry, it may be determined that run on the node of leader's state
Equipment operation failure, then switch to candidate state, resets timer, and broadcasts ballot request, is more than the system until receiving
Node device as new leader's state during the ballot request of the half of interior joint number of devices, or it is new until receiving
Following state is switched to during the heartbeat message of the node device of leader's state.
Fig. 4 is a kind of module diagram of node device provided in an embodiment of the present invention.Referring to Fig. 4, node device tool
Body includes:
Receiving module 401, the heartbeat message for receiving the node device for running on leader's state;
Acquisition module 402, if running on candidate state for present node equipment, obtains operation week from heartbeat message
Phase information and newest daily record index;
Module 403 is run, if being less than the operation week of present node equipment for the cycle of operation information in heartbeat message
Phase information, and newest daily record index of the newest daily record index more than or equal to present node equipment in heartbeat message, and will be current
The cycle of operation synchronizing information of node device be heartbeat message in cycle of operation information, and by current operating state switch to
Candidate state is run or kept with state.
The embodiment of the present invention is by when receiving heartbeat message, obtaining the cycle of operation information in heartbeat and newest daily record
Index, if the cycle of operation information obtained is less than the cycle of operation information of itself, and the newest daily record rope obtained is not less than certainly
The newest daily record index of body, then be the cycle of operation information in the heartbeat message by the cycle of operation synchronizing information of itself, and will
The working condition of itself switches to following state or keeps candidate state so that switch to the node device of following state can be straight
Connect and the work of system is combined into according to this heartbeat message and yield in the second subset group, or keep the node device of candidate state can be with
When receiving heartbeat message again, according to the cycle of operation information of itself and newest daily record index no more than in heartbeat message
Correspondence two, switch to following state to run, and then can also be combined into the work of system with yield in the second subset group, improve system
Functional reliability.
In a kind of possible implementation, acquisition module 402 is used for:
If present node equipment runs on candidate state, multiple signatures are obtained from heartbeat message;
If the quantity of multiple signatures is more than the half of system interior joint number of devices, and multiple signatures are verified,
Cycle of operation information and newest daily record index are obtained from heartbeat message.
In a kind of possible implementation, receiving module 401 is additionally operable to:
Receive and run on the daily record reproduction instruction that the node device of leader's state is broadcasted, instructed and replicated based on daily record reproduction
Daily record.
In a kind of possible implementation, the node device composition based on Fig. 4, referring to Fig. 5, node device also includes:
Determining module 504, for the newest daily record in newest daily record index and heartbeat message based on present node equipment
Index, determines that present node equipment needs the daily record index added;
Sending module 504, is asked for sending daily record addition to the node device for running on leader's state.
In a kind of possible implementation, each node device is in sound in heartbeat message or daily record reproduction instruction carrying system
Signature during the ballot request for the node device that should run on leader's state.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the present invention, herein no longer using any combination
Repeat one by one.
It should be noted that:Above-described embodiment provide node device perform node device operation method when, only more than
The division progress of each functional module is stated for example, in practical application, as needed can distribute above-mentioned functions by difference
Functional module complete, i.e., the internal structure of node device is divided into different functional modules, with complete it is described above entirely
Portion or partial function.In addition, the node device that above-described embodiment is provided belongs to same with node device operation method embodiment
Design, it implements process and refers to embodiment of the method, repeats no more here.
Fig. 6 is a kind of node device structural representation provided in an embodiment of the present invention.Reference picture 6, the node device can be with
It is provided as a server, the node device 600 includes processing assembly 622, and it further comprises one or more processors,
And as the memory resource representated by memory 632, for store can by the execution of processing component 622 instruction, for example should
Use program.The application program stored in memory 632 can include it is one or more each correspond to one group of instruction
Module.In addition, processing assembly 622 is configured as execute instruction, to perform above-mentioned node device operation method.
Node device 600 can also include the power supply pipe that a power supply module 626 is configured as performing node device 600
Reason, a wired or wireless network interface 650 is configured as node device 600 being connected to network, and an input and output (I/
O) interface 658.Node device 600 can be operated based on the operating system for being stored in memory 632, such as Windows
ServerTM, Mac OS XTM, UnixTM,LinuxTM, FreeBSDTMOr it is similar.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.
Claims (10)
1. a kind of node device operation method, it is characterised in that methods described includes:
Receive the heartbeat message for the node device for running on leader's state;
If present node equipment runs on candidate state, cycle of operation information and newest daily record are obtained from the heartbeat message
Index;
If the cycle of operation information in the heartbeat message is less than the cycle of operation information of the present node equipment, and described
Newest daily record of the newest daily record index more than or equal to the present node equipment in heartbeat message is indexed, by the present node
The cycle of operation synchronizing information of equipment be the heartbeat message in cycle of operation information, and by current operating state switch to
The candidate state is run or kept with state.
2. according to the method described in claim 1, it is characterised in that if the present node equipment runs on candidate state,
Cycle of operation information and newest daily record index are obtained from the heartbeat message, including:
If the present node equipment runs on candidate state, multiple signatures are obtained from the heartbeat message;
If the quantity of the multiple signature is more than the half of system interior joint number of devices, and the multiple signature verifies logical
Cross, cycle of operation information and newest daily record index are obtained from the heartbeat message.
3. according to the method described in claim 1, it is characterised in that if the cycle of operation information in the heartbeat message
Less than the cycle of operation information of the present node equipment, and newest daily record index in the heartbeat message be more than or equal to it is described
The newest daily record index of present node equipment, is the heartbeat message by the cycle of operation synchronizing information of the present node equipment
In cycle of operation information, and current operating state is switched to after following state runs or keep the candidate state, institute
Stating method also includes:
The daily record reproduction instruction that the node device of leader's state is broadcasted is run on described in receiving, based on daily record reproduction instruction
Replication log.
4. according to the method described in claim 1, it is characterised in that if the cycle of operation information in the heartbeat message
Less than the cycle of operation information of the present node equipment, and newest daily record index in the heartbeat message be more than or equal to it is described
The newest daily record index of present node equipment, is the heartbeat message by the cycle of operation synchronizing information of the present node equipment
In cycle of operation information, and current operating state is switched to after following state runs or keep the candidate state, institute
Stating method also includes:
Newest daily record index in newest daily record index and the heartbeat message based on the present node equipment, it is determined that described
Present node equipment needs the daily record index added;
Daily record addition request is sent to the node device for running on leader's state.
5. the method according to any one of claim 1-4, it is characterised in that the heartbeat message or the daily record reproduction
Label of each node device when running on the ballot request of the node device of leader's state described in response in instruction carrying system
Name.
6. a kind of node device, it is characterised in that the node device includes:
Receiving module, the heartbeat message for receiving the node device for running on leader's state;
Acquisition module, if running on candidate state for present node equipment, the cycle of operation is obtained from the heartbeat message
Information and newest daily record index;
Module is run, if being less than the operation week of the present node equipment for the cycle of operation information in the heartbeat message
Newest daily record of the newest daily record index more than or equal to the present node equipment in phase information, and the heartbeat message is indexed,
It is the cycle of operation information in the heartbeat message by the cycle of operation synchronizing information of the present node equipment, and by current work
Following state is switched to run or keep the candidate state as state.
7. node device according to claim 6, it is characterised in that the acquisition module is used for:
If the present node equipment runs on candidate state, multiple signatures are obtained from the heartbeat message;
If the quantity of the multiple signature is more than the half of system interior joint number of devices, and the multiple signature verifies logical
Cross, cycle of operation information and newest daily record index are obtained from the heartbeat message.
8. node device according to claim 6, it is characterised in that the receiving module is additionally operable to:
The daily record reproduction instruction that the node device of leader's state is broadcasted is run on described in receiving, based on daily record reproduction instruction
Replication log.
9. node device according to claim 6, it is characterised in that the node device also includes:
Determining module, for the newest daily record in newest daily record index and the heartbeat message based on the present node equipment
Index, determines that the present node equipment needs the daily record index added;
Sending module, is asked for sending daily record addition to the node device for running on leader's state.
10. the node device according to any one of claim 6-9, it is characterised in that the heartbeat message or the day
Each node device is running on the ballot request of the node device of leader's state in will duplicate instructions carrying system described in response
When signature.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710263587.9A CN107124305B (en) | 2017-04-20 | 2017-04-20 | Node device operation method and node device |
PCT/CN2018/083595 WO2018192534A1 (en) | 2017-04-20 | 2018-04-18 | Node device running method, working state switching device, node device, and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710263587.9A CN107124305B (en) | 2017-04-20 | 2017-04-20 | Node device operation method and node device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107124305A true CN107124305A (en) | 2017-09-01 |
CN107124305B CN107124305B (en) | 2019-08-23 |
Family
ID=59725923
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710263587.9A Active CN107124305B (en) | 2017-04-20 | 2017-04-20 | Node device operation method and node device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107124305B (en) |
WO (1) | WO2018192534A1 (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107967291A (en) * | 2017-10-12 | 2018-04-27 | 腾讯科技(深圳)有限公司 | Journal entries clone method, device, computer equipment and storage medium |
WO2018192534A1 (en) * | 2017-04-20 | 2018-10-25 | 腾讯科技(深圳)有限公司 | Node device running method, working state switching device, node device, and medium |
CN109726211A (en) * | 2018-12-27 | 2019-05-07 | 无锡华云数据技术服务有限公司 | A kind of distribution time series database |
WO2019085875A1 (en) * | 2017-10-31 | 2019-05-09 | 华为技术有限公司 | Configuration modification method for storage cluster, storage cluster and computer system |
CN109803024A (en) * | 2019-01-28 | 2019-05-24 | 北京中科晶上科技股份有限公司 | A method of for cluster node network |
CN111586110A (en) * | 2020-04-22 | 2020-08-25 | 广州锦行网络科技有限公司 | Optimization processing method for raft in point-to-point fault |
CN112865992A (en) * | 2019-11-27 | 2021-05-28 | 上海哔哩哔哩科技有限公司 | Method and device for switching master nodes in distributed master-slave system and computer equipment |
CN116827966A (en) * | 2023-08-29 | 2023-09-29 | 中国兵器装备集团兵器装备研究所 | Data processing method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103152434A (en) * | 2013-03-27 | 2013-06-12 | 江苏辰云信息科技有限公司 | Leader node replacing method of distributed cloud system |
CN104115469A (en) * | 2011-09-23 | 2014-10-22 | 混合电路逻辑有限公司 | System for live -migration and automated recovery of applications in a distributed system |
CN104933132A (en) * | 2015-06-12 | 2015-09-23 | 广州巨杉软件开发有限公司 | Distributed database weighted voting method based on operating sequence number |
CN105512266A (en) * | 2015-12-03 | 2016-04-20 | 曙光信息产业(北京)有限公司 | Method and device for achieving operational consistency of distributed database |
CN105511987A (en) * | 2015-12-08 | 2016-04-20 | 上海爱数信息技术股份有限公司 | Distributed task management system with high consistency and availability |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679796A (en) * | 2013-12-03 | 2015-06-03 | 方正信息产业控股有限公司 | Selecting method, selecting device and database mirror image cluster node |
CN105991325B (en) * | 2015-02-10 | 2019-06-21 | 华为技术有限公司 | Handle the method, apparatus and system of the failure at least one distributed type assemblies |
CN107124305B (en) * | 2017-04-20 | 2019-08-23 | 腾讯科技(深圳)有限公司 | Node device operation method and node device |
-
2017
- 2017-04-20 CN CN201710263587.9A patent/CN107124305B/en active Active
-
2018
- 2018-04-18 WO PCT/CN2018/083595 patent/WO2018192534A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104115469A (en) * | 2011-09-23 | 2014-10-22 | 混合电路逻辑有限公司 | System for live -migration and automated recovery of applications in a distributed system |
CN103152434A (en) * | 2013-03-27 | 2013-06-12 | 江苏辰云信息科技有限公司 | Leader node replacing method of distributed cloud system |
CN104933132A (en) * | 2015-06-12 | 2015-09-23 | 广州巨杉软件开发有限公司 | Distributed database weighted voting method based on operating sequence number |
CN105512266A (en) * | 2015-12-03 | 2016-04-20 | 曙光信息产业(北京)有限公司 | Method and device for achieving operational consistency of distributed database |
CN105511987A (en) * | 2015-12-08 | 2016-04-20 | 上海爱数信息技术股份有限公司 | Distributed task management system with high consistency and availability |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018192534A1 (en) * | 2017-04-20 | 2018-10-25 | 腾讯科技(深圳)有限公司 | Node device running method, working state switching device, node device, and medium |
CN110377570A (en) * | 2017-10-12 | 2019-10-25 | 腾讯科技(深圳)有限公司 | Node switching method, device, computer equipment and storage medium |
WO2019072085A1 (en) * | 2017-10-12 | 2019-04-18 | 腾讯科技(深圳)有限公司 | Log entry duplication method and device, computer equipment, and storage medium |
CN107967291A (en) * | 2017-10-12 | 2018-04-27 | 腾讯科技(深圳)有限公司 | Journal entries clone method, device, computer equipment and storage medium |
US11360854B2 (en) | 2017-10-31 | 2022-06-14 | Huawei Technologies Co., Ltd. | Storage cluster configuration change method, storage cluster, and computer system |
WO2019085875A1 (en) * | 2017-10-31 | 2019-05-09 | 华为技术有限公司 | Configuration modification method for storage cluster, storage cluster and computer system |
CN109726211B (en) * | 2018-12-27 | 2020-02-04 | 无锡华云数据技术服务有限公司 | Distributed time sequence database |
CN109726211A (en) * | 2018-12-27 | 2019-05-07 | 无锡华云数据技术服务有限公司 | A kind of distribution time series database |
CN109803024A (en) * | 2019-01-28 | 2019-05-24 | 北京中科晶上科技股份有限公司 | A method of for cluster node network |
CN109803024B (en) * | 2019-01-28 | 2021-12-21 | 北京中科晶上科技股份有限公司 | Method for cluster node network |
CN112865992A (en) * | 2019-11-27 | 2021-05-28 | 上海哔哩哔哩科技有限公司 | Method and device for switching master nodes in distributed master-slave system and computer equipment |
CN112865992B (en) * | 2019-11-27 | 2022-10-14 | 上海哔哩哔哩科技有限公司 | Method and device for switching master nodes in distributed master-slave system and computer equipment |
CN111586110A (en) * | 2020-04-22 | 2020-08-25 | 广州锦行网络科技有限公司 | Optimization processing method for raft in point-to-point fault |
CN111586110B (en) * | 2020-04-22 | 2021-03-19 | 广州锦行网络科技有限公司 | Optimization processing method for raft in point-to-point fault |
CN116827966A (en) * | 2023-08-29 | 2023-09-29 | 中国兵器装备集团兵器装备研究所 | Data processing method and system |
CN116827966B (en) * | 2023-08-29 | 2024-04-26 | 中国兵器装备集团兵器装备研究所 | Data processing method and system |
Also Published As
Publication number | Publication date |
---|---|
CN107124305B (en) | 2019-08-23 |
WO2018192534A1 (en) | 2018-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107105032B (en) | Node device operation method and node device | |
CN107124305B (en) | Node device operation method and node device | |
CN103744809B (en) | Vehicle information management system double hot standby method based on VRRP | |
CN112506702B (en) | Disaster recovery method, device, equipment and storage medium for data center | |
CN110032478B (en) | Method, device and system for real-time synchronization of data of main and standby centers and storage medium | |
CN110392120B (en) | Method and device for recovering fault in message pushing process | |
CN111130879B (en) | PBFT algorithm-based cluster exception recovery method | |
KR970066900A (en) | Distributed Memory Multiprocessor Systems and Failure Recovery Methods | |
EP2902922A1 (en) | Distributed file system and data backup method for distributed file system | |
CN101237315A (en) | A synchronous detection and failure separation method for dual control high-availability system | |
CN104077181A (en) | Status consistent maintaining method applicable to distributed task management system | |
CN114363350A (en) | Service management system and method | |
CN110213359A (en) | A kind of car networking networking data delivery system and method based on D2D | |
CN112948484A (en) | Distributed database system and data disaster recovery drilling method | |
CN113064755B (en) | Data recovery method, device, equipment, medium and program product | |
CN107483257B (en) | Application system deployment method and architecture based on X86 and ARM mixed environment | |
CN110113395B (en) | Shared file system maintenance method and device | |
CN115599600A (en) | Disaster recovery switching method and device, storage medium and electronic equipment | |
CN112948177A (en) | Disaster recovery backup method and device, electronic equipment and storage medium | |
JP3398681B2 (en) | Communication processing system | |
CN105786645A (en) | Backup and restoring methods and devices of operating system | |
CN114244638B (en) | Multicast network communication method, device, equipment and medium | |
CN114826584B (en) | Method, system and terminal for maintaining Slurm HA state data file | |
CN114584459B (en) | Method for realizing high availability of main and standby of container cloud platform | |
CN117640349A (en) | Fault recovery method and device for network additional storage system cluster and host equipment |
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 |