CN106878382A - Dynamically change the method and device of cluster scale in a kind of distributed arbitration program cluster - Google Patents
Dynamically change the method and device of cluster scale in a kind of distributed arbitration program cluster Download PDFInfo
- Publication number
- CN106878382A CN106878382A CN201611248514.4A CN201611248514A CN106878382A CN 106878382 A CN106878382 A CN 106878382A CN 201611248514 A CN201611248514 A CN 201611248514A CN 106878382 A CN106878382 A CN 106878382A
- Authority
- CN
- China
- Prior art keywords
- node
- cluster
- instruction
- host node
- section point
- 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
- 230000008859 change Effects 0.000 title claims abstract description 34
- 238000000034 method Methods 0.000 title claims abstract description 24
- 230000004044 response Effects 0.000 claims abstract description 21
- 238000012790 confirmation Methods 0.000 claims abstract description 12
- 238000013475 authorization Methods 0.000 claims description 35
- 230000000630 rising effect Effects 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 7
- 239000004744 fabric Substances 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000012217 deletion Methods 0.000 description 12
- 230000037430 deletion Effects 0.000 description 12
- 238000013461 design Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000009826 distribution Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000003860 storage Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 230000010339 dilation Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000005728 strengthening Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
-
- 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/0659—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1048—Departure or maintenance mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1051—Group master selection mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1061—Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
- H04L67/1068—Discovery involving direct consultation or announcement among potential requesting and potential source peers
- H04L67/107—Discovery involving direct consultation or announcement among potential requesting and potential source peers with limitation or expansion of the discovery scope
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/407—Bus networks with decentralised control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/407—Bus networks with decentralised control
- H04L12/413—Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection [CSMA-CD]
- H04L12/4135—Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection [CSMA-CD] using bit-wise arbitration
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Multi Processors (AREA)
- Hardware Redundancy (AREA)
Abstract
The application is related to field of computer technology, discloses the method and device for dynamically changing cluster scale in a kind of distributed arbitration program cluster, is used to solve the problems, such as occur double main, many main or derelictions during dynamically change distributed arbitration program cluster scale.The method is:Host node receives the instruction for changing cluster scale, determines the M node that the distributed arbitration program cluster includes after cluster scale is changed, and M is positive integer, and the M node includes that the host node and (M 1) are individual from node;The instruction is forwarded to the host node (M 1) is individual from node, and (M 1) individual confirmation response returned from node described in receiving, described to confirm that response agrees to the change cluster scale for characterizing;If in a heart beat cycle, the host node receives the L heartbeat message sent from node, then perform the operation of the change cluster scale, L is positive integer.
Description
Technical field
The application is related to field of computer technology, and cluster scale is dynamically changed in more particularly to a kind of distributed arbitration program cluster
Method and device.
Background technology
In multiprocessing system, multiple equipment or module may simultaneously apply for the right to use to bus, total to avoid producing
Line conflict, need to reasonably be controlled by bus arbitration mechanism with needed in management system take bus applicant, multiple apply
When person proposes bus request simultaneously, judge that the applicant to the bus right to use should be obtained with certain referee method.Referee method
Centralized arbitration and distributed arbitration program can be divided into.Centralized arbitration distributes the request of multiple processors using single moderator.
In distributed arbitration program, each arbitration node has the moderator of oneself.Arbitration node can be referred to as node.
System where distributed arbitration program is properly termed as distributed system, and distributed system includes several nodes, if this
Dry node forms arbitration cluster.Arbitration cluster can be reallocated resources, and service is externally provided as an entirety.In arbitration cluster
At most a host node is only allowed.At present, various arbitration algorithms choose host nodes, such as Fast Leader election algorithms,
Raft election algorithms etc..
In distributed system running, user may need dynamic to change the scale of arbitration cluster, that is, add node
Or deletion of node.At present, the change of the general not scale support of arbitration cluster in distributed system;Or restricted support rule
Moding is more;Or, occur the problem of " double masters " or " how main " or " dereliction " during scale change, wherein, " double masters "
Refer to two host nodes, " how main " refers to two or more host node, and " dereliction " refers to no host node.
The content of the invention
The method and device of cluster scale is dynamically provided in a kind of distributed arbitration program cluster of the embodiment of the present application offer, is used to
Solve the problems, such as occur double main, many main or derelictions during dynamically change distributed arbitration program cluster scale.
The concrete technical scheme that the embodiment of the present application is provided is as follows:
First aspect, there is provided a kind of method for dynamically changing cluster scale in distributed arbitration program cluster, the distribution is secondary
Cutting out cluster includes host node, after agreeing to that change is operated by all nodes in the cluster, judges whether to be able to maintain that itself
The identity of host node, wherein, the condition for maintaining host node is to include between maintaining main and subordinate node in interior half node
Signal is connected, and after being determined to maintain the identity of host node, resolidification changes the operation of cluster scale to host node.Such energy
It is enough to ensure to keep master node roles constant during cluster scale is changed, and the condition for remaining main is independently arranged, with a liter master
Condition is separated, and enhances the availability of system, and ensure will not the owner of lost property during System Expansion.
In a possible design, the host node receives the instruction for changing cluster scale, determines that the distribution is secondary
Cut out cluster M node including after cluster scale is changed, M is positive integer, the M node include the host node with
(M-1) individual from node, the instruction is forwarded to the host node (M-1) is individual from node, and (M-1) described in receiving is individual from node
The confirmation response of return, it is described to confirm that response agrees to the change cluster scale for characterizing, if in a heart beat cycle, institute
State host node and receive the L heartbeat message sent from node, then perform the operation of the change cluster scale,L is positive integer.In such manner, it is possible to realize that single node dilatation, multinode dilatation and capacity reducing etc. are various not
Same application scenarios, are not in dereliction or many main situations in application scenarios of each change cluster scale.
In a possible design, the host node receives the instruction for changing cluster scale, can be in the following manner
Realize:The host node receives the instruction for increasing first node, or, the host node receives the instruction for deleting Section Point,
Wherein, the Section Point is the nodes different from the host node, and described first is not included in the distributed arbitration program cluster
Node and including the Section Point.
In a possible design, any node includes Authorization Attributes, and whether the Authorization Attributes are used for characterizing node
With right to be elected limit, the Authorization Attributes allow dynamic adjustment, wherein, perform the operation for changing cluster scale it
Before, the Authorization Attributes of the first node are without right to be elected limit.Avoid dereliction or many occur after first node is increased
Main situation.
In a possible design, before the instruction for deleting Section Point is received in the host node, the second section
Point is disconnection with the communication connection status of the M node;Or, the host node receive delete Section Point instruction it
Before, the Authorization Attributes of the Section Point are set to be limited without the right to be elected.When avoiding the Section Point deleted for host node,
Distributed system is caused to break down.
In a possible design, the host node includes configuration information, the configuration information include rising main condition and
Maintain main condition;The main condition of liter is:When the distributed arbitration program cluster includes N number of node, K node agrees to described
Host node rises master, wherein,K, N are positive integer;It is described to maintain the main condition to be:In the distributed arbitration program collection
When group includes N number of node, in a heart beat cycle, the host node receives the P heartbeat message from node, wherein,P, N are positive integer.Main condition will be risen and maintain main condition to keep apart, the availability of strengthening system, and
Will not the owner of lost property in guarantee dilation process.
Second aspect, there is provided dynamically change the device of cluster scale in a kind of distributed arbitration program cluster, the device has real
The function of host node behavior in any one possible design of existing above-mentioned first aspect and first aspect.The function can pass through
Hardware is realized, it is also possible to is performed corresponding software by hardware and is realized.The hardware or software include one or more with it is above-mentioned
The corresponding module of function phase.
In a possible design, the structure of the device includes transceiver, memory and processor, wherein, it is described to deposit
Reservoir is used to store batch processing, and the processor is used to call the program of the memory storage to perform such as above-mentioned first party
Method described in the possible design of any one of face and first aspect.
A kind of third aspect, there is provided distributed arbitration program cluster, the distributed arbitration program cluster includes such as above-mentioned first party
Host node in the possible design of any one of face and first aspect.
Fourth aspect, there is provided a kind of computer-readable storage medium, for saving as used by the host node described in above-mentioned aspect
Computer software instructions, it is included for performing the program designed by above-mentioned aspect.
Brief description of the drawings
Fig. 1 is the configuration diagram of distributed arbitration program cluster in the embodiment of the present application;
Fig. 2 is the method flow schematic diagram for dynamically changing cluster scale in the embodiment of the present application in distributed arbitration program cluster;
Fig. 3 is the dilatation schematic flow sheet of single node dilatation in the embodiment of the present application;
Fig. 4 is the dilatation schematic flow sheet of multinode dilatation in the embodiment of the present application;
Fig. 5 is one of schematic flow sheet of capacity reducing in the embodiment of the present application;
Fig. 6 is the two of the schematic flow sheet of capacity reducing in the embodiment of the present application;
Fig. 7 be dynamically change in distributed arbitration program cluster in the embodiment of the present application cluster scale apparatus structure schematic diagram it
One;
Fig. 8 be dynamically change in distributed arbitration program cluster in the embodiment of the present application cluster scale apparatus structure schematic diagram it
Two.
Specific embodiment
Below in conjunction with accompanying drawing, the embodiment of the present application is described in detail.
The embodiment of the present application can apply to distributed system, can be, but not limited to be applied to distributed arbitration program cluster, with
In lower description, distributed arbitration program cluster can be referred to as cluster.In a distributed system, user needs dynamic change arbitration cluster
Scale, the embodiment of the present application agreed to after change operation by all nodes in the cluster, judges whether to be able to maintain that itself
The identity of host node, wherein, the condition for maintaining host node is to include between maintaining main and subordinate node in interior half node
Signal is connected, and after being determined to maintain the identity of host node, resolidification changes the operation of cluster scale to host node.Such energy
It is enough to ensure to keep master node roles constant during cluster scale is changed, and the condition for remaining main is independently arranged, with a liter master
Condition is separated, and enhances the availability of system, and ensure will not the owner of lost property during System Expansion.
As shown in figure 1, the scale of distributed arbitration program cluster 100 can include a node in the embodiment of the present application, or
Including two or more nodes.Distributed arbitration program cluster 100 includes a host node 101.If cluster scale is more than
Equal to two nodes, then except including a host node 101 in distributed arbitration program cluster 100, also including at least one from node
102.Distributed arbitration program cluster 100 can be reallocated resources, and service is externally provided as an entirety.Distributed arbitration program cluster 100
In at most only allowed a host node 101.
Host node 101 is that the election of each node is obtained, for example, the arbitration algorithm for choosing host node can include Fast
Leader election algorithms, Raft election algorithms, the application are not construed as limiting.
In the embodiment of the present application, each node in distributed arbitration program cluster 100 configures some local attributes, including:
The identity (i.e. ID) of node, the identity has the node one unique identity of correspondence of uniqueness, i.e.,;It is logical
Letter address, such as Internet protocol (Internet Protocol, IP) address, for the institute's foundation that communicated with other nodes
Address;Whether Authorization Attributes, the Authorization Attributes are used to characterize node with right to be elected limit, and the node with right to be elected limit exists
Can be voted to itself during vote host node, without the right to be elected limit node can not be voted in vote host node to
Whether itself, master can be risen by the setting of Authorization Attributes with control node, and the identity of control node drops from host node
It is from node.Authorization Attributes allow dynamic adjustment.
Host node 101 also includes some configuration informations, and configuration information includes rising main condition and maintains main condition;
Wherein, rising main condition is:When distributed arbitration program cluster includes N number of node, K node agrees to host node liter
It is main, wherein,K, N are positive integer;
The main condition is maintained to be:When distributed arbitration program cluster includes N number of node, in a heart beat cycle, host node
The P heartbeat message from node is received, wherein,P, N are positive integer.
Optionally, each node includes above-mentioned configuration information.
In summary, only just can guarantee that a liter master more than node (including oneself) ballot of cluster scale half;In application
During, the heartbeat of the node (not including oneself) no more than cluster scale half is lost, master could be maintained.
In actual applications, host node 101 and between node 102 can be determined by sending heartbeat message principal and subordinate close
System, host node 101 periodically can send heartbeat message to all according to heart beat cycle from node 102, also can week from node 102
Phase property to host node 101 reply heartbeat message, each does not send heartbeat message between node 102.Host node 101 passes through the heart
Hop-information may determine that from node 102 whether with itself keep master slave relation.
Based on the framework of the distributed arbitration program cluster shown in Fig. 1, as shown in Fig. 2 the distribution that the embodiment of the present application is provided
The method flow for dynamically changing cluster scale in arbitration cluster is as described below.
Step 201:Host node receives the instruction for changing cluster scale, determines that distributed arbitration program cluster is changing cluster scale
The M node for including afterwards.
M is positive integer, and M node includes that host node and (M-1) are individual from node.
The instruction of the change cluster scale received by host node is probably the instruction of dilatation, it is also possible to the finger of capacity reducing
Order.Dilatation refers to increase node in original cluster, and capacity reducing refers to delete the node in cluster.The instruction is in an implementation procedure
Middle intelligence increases or deletes a node.
For example, host node receives the instruction for increasing first node, or, host node receives the instruction for deleting Section Point,
Wherein, Section Point is the nodes different from host node;
Wherein, first node is not included in distributed arbitration program cluster and including Section Point.That is, first node is cluster
An outer node, Section Point is a node in cluster.
If instruction of the instruction for increase first node, M is the cluster scale after dilatation, if instructing to delete Section Point
Instruction, then M is the cluster scale after capacity reducing, that is, delete the number of nodes in cluster after Section Point.
Step 202:Instruction is forwarded to host node (M-1) is individual from node, and receives (M-1) individual confirmation returned from node
Response.
Wherein, confirm that response is agreed to change cluster scale for characterizing.
Specifically, host node when instruction is received, it is necessary to ask each node whether agree to change cluster scale behaviour
Make.After the confirmation for receiving all nodes is responded, determine that all nodes agree to change the operation of cluster scale.If host node
After instruction is forwarded, the confirmation response that wherein certain node is returned is not received, then illustrate that the node departs from cluster, or, no
Agree to change the operation of cluster scale, then host node does not carry out subsequent operation, so ensure that the security of distributed system.
Step 203:If in a heart beat cycle, host node receives the L heartbeat message sent from node, then perform
Change the operation of cluster scale,L is positive integer.
After the confirmation for receiving each node is responded, host node needs to ensure itself to disclosure satisfy that the condition for remaining main,
When determining itself to disclosure satisfy that the condition for remaining main, the operation for changing cluster scale is just performed, for example, increasing section to disk write-in
The information of point, or, the information of deletion of node is write to disk.
Specifically, if instruction is the instruction of increase first node, before first node is increased to disk write-in,
The Authorization Attributes of first node are to be limited without the right to be elected, after first node is increased to disk write-in, first node
Authorization Attributes are with right to be elected limit.
So, for single node dilatation be two nodes, ensure that be not in dereliction problem.If for example, former collection
A node is only included in group, the node is host node.Host node receives the instruction of the node for increasing first node, confirms M=
2, because the Authorization Attributes of first node are to be limited without the right to be elected, therefore, after first node adds cluster, host node is not
Become.Otherwise, if first node is not provided with Authorization Attributes, first node is after cluster is added, it may appear that the situation of dereliction.
If instruction is the instruction of deletion Section Point, before the instruction for deleting Section Point is received in host node, the
Two nodes are disconnection with the M communication connection status of node, for example, being in Network Isolation shape between Section Point and M node
State, but it is for example, electric under Section Point;
Or, before the instruction for deleting Section Point is received in host node, the Authorization Attributes of Section Point are set to not to be had
There is the right to be elected to limit.
So, if Section Point is host node in former cluster, after preventing from deleting Section Point, cluster occurs
The problem of dereliction, first ensures Section Point with the M communication connection status of node to disconnect, then, M node can be chosen again
New host node, after new host node receives the instruction for deleting Section Point, sends to (M-1) is individual from node and Section Point
Instruction, is receiving (M-1) individual confirmation response returned from node, the feedback information without receiving Section Point.
The embodiment of the present application is described in further detail with reference to specific application scenarios.
Scene one, single node dilatation are binode.Origin node node 1 represents, increases node node 2 and represent.
As shown in figure 3, the dilatation flow of single node dilatation is specially:
Step 301, node 1 receive the dilatation instruction for increasing node 2.
Step 302, node 1 send dilatation and ask to node 2.
Dilatation add request in carry current cluster in node listing, and in node listing each node it is local
Attribute.
Step 303, node 2 are returned to node 1 and confirm response.
Confirm that response representation adheres to cluster.
Step 304, node 1 judge to meet the condition for maintaining host node, and the affairs of node 2 will be added to write magnetic in cluster
Disk.
Step 305, the instruction of node 1 node 2 will add the affairs of node 2 to write disk in cluster.
Wherein, the configuration information of node 1 includes rising main condition and the main condition of maintenance, in actual conditions and above-described embodiment
Description is consistent, will not be repeated here.Before cluster is added, Authorization Attributes are configured as being limited without the right to be elected node 2, because
This, add cluster when be not in just dereliction situation.
Scene two, multinode dilatation.Former cluster has n node, is represented with node 1 ... node n, n >=2, and n is just whole
Number, node 1 is host node, increases node node (n+1) and represents.
As shown in figure 4, the dilatation flow of multinode dilatation is specially:
Step 401, node 1 receive the dilatation instruction for increasing node (n+1).
Step 402, node 1 send dilatation and ask to 2~node of node n and node (n+1).
The local attribute of node (n+1) is carried in the dilatation request sent to 2~node of node n, to node (n+1)
Carried in the dilatation request of transmission current cluster and node listing and local attribute from node 1 to 2~node of node n.
The confirmation response that step 403,2~node of the receiving node n of node 1 and node (n+1) are returned.
Step 404, in a heart beat cycle, node 1 judge meet maintain host node condition, that is, judge can receive
To being not less thanThe individual heartbeat message sent from node, then add the affairs write-in of node (n+1) just in cluster
Disk.
For example, if n=4, the later cluster scale of dilatation is n+1=5,One
In individual heart beat cycle, node 1 can receive the heartbeat message sent from node not less than 2, it is possible to meet and maintain main section
The condition of point.
Step 405, node 1 indicate 2~node of node n and node (n+1), the affairs of node (n+1) will be added in cluster
Write-in disk.
Wherein, the configuration information of node 1 includes rising main condition and the main condition of maintenance, in actual conditions and above-described embodiment
Description is consistent, will not be repeated here.Before cluster is added, Authorization Attributes are configured as without the right to be elected node (n+1)
Limit, after step 405, the Authorization Attributes of node (n+1) are configured with right to be elected limit.
Based on main condition is maintained, can realize that dynamic changes cluster scale, and suitable for various possible conditions.Example
Such as, cluster scale after dilatation be even number, and dilatation after cluster two parts, the section that two parts include are split into by network
Count out identical, in this case, host node still is able to maintain the identity of host node.
Scene three, capacity reducing.Former cluster has n node, is represented with node 1 ... node n, n >=2, and n is positive integer, node 1
It is host node, deletion of node is node n, and node n is from node.
As shown in figure 5, the flow of capacity reducing is specially:
Step 501, node 1 receive the capacity reducing instruction of deletion of node n.
Step 502, node 1 send capacity reducing and ask respectively to 2~node of node n.
The local attribute of deleted node n is carried in capacity reducing request.
The confirmation response that step 503, the 2~node of receiving node (n-1) of node 1 are returned respectively.
Step 504, in a heart beat cycle, node 1 judge meet maintain host node condition, that is, judge can receive
To being not less thanThe individual heartbeat message sent from node, then the affairs of deletion of node n write disk just in cluster.
Step 505, node 1 indicate 2~node of node (n-1), and the affairs of deletion of node in cluster (n-1) are write into magnetic
Disk.
Scene four, capacity reducing.Former cluster has n node, is represented with node 1 ... node n, n >=2, and n is positive integer, node 2
It is the host node of former cluster, deletion of node is node 2.
It is determined that during deletion of node 2, node 2 and cluster are carried out into Network Isolation or lower electricity, or by the authority of node 2
Attribute configuration is without right to be elected limit.
Triggering cluster selects master again, for example, re-elect node 1 for host node.
As shown in fig. 6, the flow of capacity reducing is specially:
Step 601, node 1 receive the capacity reducing instruction of deletion of node 2.
Step 602, node 1 send capacity reducing and ask respectively to 3~node of node n.
The local attribute of deleted node 2 is carried in capacity reducing request.
The confirmation response that step 603,3~node of the receiving node n of node 1 are returned respectively.
Step 604, in a heart beat cycle, node 1 judge meet maintain host node condition, that is, judge can receive
To being not less thanThe individual heartbeat message sent from node, then the affairs of deletion of node 2 write disk just in cluster.
Step 605, node 1 indicate node 3~node n, and the affairs of deletion of node in cluster 2 are write into disk.
Based on the same design with the method shown in Fig. 2, as shown in fig. 7, the embodiment of the present application additionally provides a kind of distribution
Dynamically change the device 700 of cluster scale in formula arbitration cluster, the device of cluster scale is dynamically changed in distributed arbitration program cluster
700 is the host node in distributed arbitration program cluster, and the device 700 that cluster scale is dynamically changed in distributed arbitration program cluster includes:
Receiving unit 701, the instruction of cluster scale is changed for receiving, and determines that distributed arbitration program cluster is changing cluster rule
The M node included after mould, M is positive integer, and M node includes that host node and (M-1) are individual from node;
Transmitting element 702, it is individual from node for instruction to be forwarded to (M-1), and receive (M-1) it is individual from node return really
Recognize response, confirm that response is agreed to change cluster scale for characterizing;
Processing unit 703, if in a heart beat cycle, determining that receiving unit receives L from node transmission
Heartbeat message, then perform the operation for changing cluster scale,L is positive integer.
Optionally, receiving unit 701 is used for:
The instruction for increasing first node is received, or, the instruction for deleting Section Point is received, Section Point is and host node
Different nodes;
Wherein, first node is not included in distributed arbitration program cluster and including Section Point.
Optionally, any node includes Authorization Attributes, and whether Authorization Attributes are used to characterize node with right to be elected limit, power
Limit attribute allows dynamic adjustment;
Wherein, before the operation for changing cluster scale is performed, the Authorization Attributes of first node are without the right to be elected
Limit.
Optionally, before host node receives the instruction for deleting Section Point, the communication connection of Section Point and M node
State is disconnection;Or,
Before the instruction for deleting Section Point is received in host node, the Authorization Attributes of Section Point are set to without selected
Lift authority.
Optionally, also comprising configuration information, configuration information includes rising main condition and maintains main condition;
Rising main condition is:When distributed arbitration program cluster includes N number of node, K node agrees to that host node rises master, its
In,K, N are positive integer;
The main condition is maintained to be:When distributed arbitration program cluster includes N number of node, in a heart beat cycle, host node
The P heartbeat message from node is received, wherein,P, N are positive integer.
Based on the same design with the method shown in Fig. 2, as shown in figure 8, the embodiment of the present application additionally provides a kind of distribution
Dynamically change the device 800 of cluster scale, including transceiver 801, processor 802, memory 803 and bus in formula arbitration cluster
804, transceiver 801, processor 802, memory 803 are connected with bus 804, wherein, one group is stored in the memory 803
Program, the processor 802 is used to call the program stored in the memory 803, performs following operation:
The instruction for changing cluster scale is received by transceiver 801, determines that distributed arbitration program cluster is changing cluster scale
The M node for including afterwards, M is positive integer, and M node includes that host node and (M-1) are individual from node;
Instruction is forwarded to (M-1) is individual from node by transceiver 801, and receives (M-1) individual confirmation returned from node
Response, confirms that response is agreed to change cluster scale for characterizing;
If in a heart beat cycle, determining that receiving unit receives the L heartbeat message sent from node, then perform and change
Become the operation of cluster scale,L is positive integer.
Optionally, transceiver 801 is used for:
The instruction for increasing first node is received, or, the instruction for deleting Section Point is received, Section Point is and host node
Different nodes;
Wherein, first node is not included in distributed arbitration program cluster and including Section Point.
Optionally, any node includes Authorization Attributes, and whether Authorization Attributes are used to characterize node with right to be elected limit, power
Limit attribute allows dynamic adjustment;
Wherein, before the operation for changing cluster scale is performed, the Authorization Attributes of first node are without the right to be elected
Limit.
Optionally, before host node receives the instruction for deleting Section Point, the communication connection of Section Point and M node
State is disconnection;Or,
Before the instruction for deleting Section Point is received in host node, the Authorization Attributes of Section Point are set to without selected
Lift authority.
Optionally, also comprising configuration information, configuration information includes rising main condition and maintains main condition;
Rising main condition is:When distributed arbitration program cluster includes N number of node, K node agrees to that host node rises master, its
In,K, N are positive integer;
The main condition is maintained to be:When distributed arbitration program cluster includes N number of node, in a heart beat cycle, host node
The P heartbeat message from node is received, wherein,P, N are positive integer.
Processor 802 can be central processing unit (central processing unit, CPU), network processing unit
The combination of (network processor, NP) or CPU and NP.
Processor 802 can further include hardware chip.Above-mentioned hardware chip can be application specific integrated circuit
(application-specific integrated circuit, ASIC), PLD (programmable
Logic device, PLD) or its combination.Above-mentioned PLD can be CPLD (complex
Programmable logic device, CPLD), field programmable gate array (field-programmable gate
Array, FPGA), GAL (generic array logic, GAL) or its any combination.
Memory 803 can include volatile memory (volatile memory), such as random access memory
(random-access memory, RAM);Memory 803 can also include nonvolatile memory (non-volatile
Memory), such as flash memory (flash memory), hard disk (hard disk drive, HDD) or solid state hard disc
(solid-state drive, SSD);Memory 803 can also include the combination of the memory of mentioned kind.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the application can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.And, the application can be used and wherein include the computer of computer usable program code at one or more
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) is produced
The form of product.
The application is the flow with reference to method, equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram are described.It should be understood that every first-class during flow chart and/or block diagram can be realized by computer program instructions
The combination of flow and/or square frame in journey and/or square frame and flow chart and/or block diagram.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices
The device of the function of being specified in present one flow of flow chart or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices with spy
In determining the computer-readable memory that mode works so that instruction of the storage in the computer-readable memory is produced and include finger
Make the manufacture of device, the command device realize in one flow of flow chart or multiple one square frame of flow and/or block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented treatment, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although having been described for the preferred embodiment of the application, those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent
Select embodiment and fall into having altered and changing for the application scope.
Obviously, those skilled in the art can carry out various changes and modification without deviating from this Shen to the embodiment of the present application
Please embodiment spirit and scope.So, if these modifications of the embodiment of the present application and modification belong to the application claim
And its within the scope of equivalent technologies, then the application is also intended to comprising these changes and modification.
Claims (10)
1. a kind of method for dynamically changing cluster scale in distributed arbitration program cluster, it is characterised in that the distributed arbitration program collection
Group includes host node, and methods described includes:
The host node receives the instruction for changing cluster scale, determines that the distributed arbitration program cluster is wrapped after cluster scale is changed
The M node for including, M is positive integer, and the M node includes that the host node and (M-1) are individual from node;
The instruction is forwarded to the host node (M-1) is individual from node, and (M-1) individual confirmation returned from node described in receiving
Response, it is described to confirm that response agrees to the change cluster scale for characterizing;
If in a heart beat cycle, the host node receives the L heartbeat message sent from node, then perform the change
The operation of cluster scale,L is positive integer.
2. the method for claim 1, it is characterised in that the host node receives the instruction for changing cluster scale, including:
The host node receives the instruction for increasing first node, or, the host node receives the instruction for deleting Section Point, institute
It is the nodes different from the host node to state Section Point;
Wherein, the first node is not included in the distributed arbitration program cluster and including the Section Point.
3. method as claimed in claim 2, it is characterised in that any node includes Authorization Attributes, the Authorization Attributes are used for
Whether node is characterized with right to be elected limit, the Authorization Attributes allow dynamic adjustment;
Wherein, before the operation for changing cluster scale is performed, the Authorization Attributes of the first node are without selected
Lift authority.
4. method as claimed in claim 3, it is characterised in that the host node receive delete Section Point instruction it
Before, the Section Point is disconnection with the communication connection status of the M node;Or,
Before the instruction for deleting Section Point is received in the host node, the Authorization Attributes of the Section Point are set to not to be had
The right to be elected is limited.
5. the method as described in any one of Claims 1 to 4, it is characterised in that the host node includes configuration information, described to match somebody with somebody
Confidence breath includes rising main condition and maintains main condition;
The main condition of liter is:When the distributed arbitration program cluster includes N number of node, K node agrees to the host node
Master is risen, wherein,K, N are positive integer;
It is described to maintain the main condition to be:When the distributed arbitration program cluster includes N number of node, in a heart beat cycle, institute
State host node and receive the P heartbeat message from node, wherein,P, N are positive integer.
6. the device of cluster scale is dynamically changed in a kind of distributed arbitration program cluster, it is characterised in that described device is described point
Host node in cloth arbitration cluster, described device includes:
Receiving unit, the instruction of cluster scale is changed for receiving, and determines that the distributed arbitration program cluster is changing cluster scale
The M node for including afterwards, M is positive integer, and the M node includes that the host node and (M-1) are individual from node;
Transmitting element, for the instruction to be forwarded to, (M-1) is individual from node, and (M-1) described in receiving is individual is returned from node
Confirm response, it is described to confirm that response agrees to the change cluster scale for characterizing;
Processing unit, if in a heart beat cycle, determining that the receiving unit receives the L heartbeat sent from node
Information, then perform the operation of the change cluster scale,L is positive integer.
7. device as claimed in claim 6, it is characterised in that the receiving unit is used for:
The instruction for increasing first node is received, or, the instruction for deleting Section Point is received, the Section Point is and the master
The different node of node;
Wherein, the first node is not included in the distributed arbitration program cluster and including the Section Point.
8. device as claimed in claim 7, it is characterised in that any node includes Authorization Attributes, the Authorization Attributes are used for
Whether node is characterized with right to be elected limit, the Authorization Attributes allow dynamic adjustment;
Wherein, before the operation for changing cluster scale is performed, the Authorization Attributes of the first node are without selected
Lift authority.
9. device as claimed in claim 8, it is characterised in that the host node receive delete Section Point instruction it
Before, the Section Point is disconnection with the communication connection status of the M node;Or,
Before the instruction for deleting Section Point is received in the host node, the Authorization Attributes of the Section Point are set to not to be had
The right to be elected is limited.
10. the device as described in any one of claim 6~9, it is characterised in that described device also includes configuration information, described
Configuration information includes rising main condition and maintains main condition;
The main condition of liter is:When the distributed arbitration program cluster includes N number of node, K node agrees to the host node
Master is risen, wherein,K, N are positive integer;
It is described to maintain the main condition to be:When the distributed arbitration program cluster includes N number of node, in a heart beat cycle, institute
State host node and receive the P heartbeat message from node, wherein,P, N are positive integer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611248514.4A CN106878382B (en) | 2016-12-29 | 2016-12-29 | Method and device for dynamically changing cluster scale in distributed arbitration cluster |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611248514.4A CN106878382B (en) | 2016-12-29 | 2016-12-29 | Method and device for dynamically changing cluster scale in distributed arbitration cluster |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106878382A true CN106878382A (en) | 2017-06-20 |
CN106878382B CN106878382B (en) | 2020-02-14 |
Family
ID=59164415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611248514.4A Expired - Fee Related CN106878382B (en) | 2016-12-29 | 2016-12-29 | Method and device for dynamically changing cluster scale in distributed arbitration cluster |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106878382B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063787A (en) * | 2017-06-26 | 2018-05-22 | 杭州沃趣科技股份有限公司 | The method that dual-active framework is realized based on distributed consensus state machine |
CN108134712A (en) * | 2017-12-19 | 2018-06-08 | 海能达通信股份有限公司 | A kind of processing method, device and the equipment of distributed type assemblies fissure |
CN108769118A (en) * | 2018-04-23 | 2018-11-06 | 网宿科技股份有限公司 | The choosing method and device of host node in a kind of distributed system |
CN109729129A (en) * | 2017-10-31 | 2019-05-07 | 华为技术有限公司 | Configuration modification method, storage cluster and the computer system of storage cluster |
CN111355600A (en) * | 2018-12-21 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | Method and device for determining main node |
CN114461141A (en) * | 2021-12-30 | 2022-05-10 | 苏州浪潮智能科技有限公司 | ETCD system, node arbitration method and system |
WO2023124663A1 (en) * | 2021-12-28 | 2023-07-06 | 华为技术有限公司 | Cluster quorum implementation method, network device, and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030018735A1 (en) * | 2000-07-28 | 2003-01-23 | Teruko Fujii | Communication method and communication system |
CN103634375A (en) * | 2013-11-07 | 2014-03-12 | 华为技术有限公司 | Method, device and equipment for cluster node expansion |
CN104378232A (en) * | 2014-11-10 | 2015-02-25 | 东软集团股份有限公司 | Schizencephaly finding and recovering method and device under main joint and auxiliary joint cluster networking mode |
-
2016
- 2016-12-29 CN CN201611248514.4A patent/CN106878382B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030018735A1 (en) * | 2000-07-28 | 2003-01-23 | Teruko Fujii | Communication method and communication system |
CN103634375A (en) * | 2013-11-07 | 2014-03-12 | 华为技术有限公司 | Method, device and equipment for cluster node expansion |
CN104378232A (en) * | 2014-11-10 | 2015-02-25 | 东软集团股份有限公司 | Schizencephaly finding and recovering method and device under main joint and auxiliary joint cluster networking mode |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063787A (en) * | 2017-06-26 | 2018-05-22 | 杭州沃趣科技股份有限公司 | The method that dual-active framework is realized based on distributed consensus state machine |
CN109729129A (en) * | 2017-10-31 | 2019-05-07 | 华为技术有限公司 | Configuration modification method, storage cluster and the computer system of storage cluster |
US11360854B2 (en) | 2017-10-31 | 2022-06-14 | Huawei Technologies Co., Ltd. | Storage cluster configuration change method, storage cluster, and computer system |
CN108134712A (en) * | 2017-12-19 | 2018-06-08 | 海能达通信股份有限公司 | A kind of processing method, device and the equipment of distributed type assemblies fissure |
CN108769118A (en) * | 2018-04-23 | 2018-11-06 | 网宿科技股份有限公司 | The choosing method and device of host node in a kind of distributed system |
CN108769118B (en) * | 2018-04-23 | 2022-01-21 | 网宿科技股份有限公司 | Method and device for selecting master nodes in distributed system |
CN111355600A (en) * | 2018-12-21 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | Method and device for determining main node |
CN111355600B (en) * | 2018-12-21 | 2023-05-02 | 杭州海康威视数字技术股份有限公司 | Main node determining method and device |
WO2023124663A1 (en) * | 2021-12-28 | 2023-07-06 | 华为技术有限公司 | Cluster quorum implementation method, network device, and system |
CN114461141A (en) * | 2021-12-30 | 2022-05-10 | 苏州浪潮智能科技有限公司 | ETCD system, node arbitration method and system |
CN114461141B (en) * | 2021-12-30 | 2023-08-18 | 苏州浪潮智能科技有限公司 | ETCD system, node arbitration method and system |
Also Published As
Publication number | Publication date |
---|---|
CN106878382B (en) | 2020-02-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106878382A (en) | Dynamically change the method and device of cluster scale in a kind of distributed arbitration program cluster | |
Li et al. | An optimized byzantine fault tolerance algorithm for consortium blockchain | |
JP5625998B2 (en) | Information processing system | |
CN113347164B (en) | Block chain-based distributed consensus system, method, device and storage medium | |
EP4300323A1 (en) | Data processing method and apparatus for blockchain network, computer device, computer readable storage medium, and computer program product | |
CN105827678B (en) | Communication means and node under a kind of framework based on High Availabitity | |
CN112650812A (en) | Data fragment storage method and device, computer equipment and storage medium | |
CN110635941A (en) | Database node cluster fault migration method and device | |
CN114244835A (en) | Decentralized self-adaptive collaborative training method and device based on block chain | |
CN114938292B (en) | Multi-level optimization PBFT consensus method based on node credibility | |
Zhong et al. | Improve PBFT based on hash ring | |
CN110149352B (en) | Service request processing method and device, computer equipment and storage medium | |
EP3349416B1 (en) | Relationship chain processing method and system, and storage medium | |
CN104079663A (en) | Distributed type real-time synchronizing network system and data annunciating method thereof | |
CN111258840B (en) | Cluster node management method and device and cluster | |
CN104717258B (en) | A kind of data transmission method for uplink and system | |
CN110502578A (en) | A kind of common recognition mechanism of rapid data cochain | |
CN111670560A (en) | Electronic device, system and method | |
CN111327447A (en) | Distributed system, arbitration method, node device and storage medium | |
CN108306964A (en) | Server node information centralized displaying method, system, equipment and storage medium | |
CN112054926B (en) | Cluster management method and device, electronic equipment and storage medium | |
CN106294721A (en) | A kind of company-data statistics and deriving method and device | |
CN114666348B (en) | Method for quickly constructing distributed system based on python language | |
CN112040434B (en) | Complex environment information acquisition method based on sensor network | |
EffatParvar et al. | Determining a central controlling processor with fault tolerant method in distributed system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200214 Termination date: 20201229 |