+

WO2018166474A1 - Member group change method and apparatus, medium, and computer device - Google Patents

Member group change method and apparatus, medium, and computer device Download PDF

Info

Publication number
WO2018166474A1
WO2018166474A1 PCT/CN2018/078989 CN2018078989W WO2018166474A1 WO 2018166474 A1 WO2018166474 A1 WO 2018166474A1 CN 2018078989 W CN2018078989 W CN 2018078989W WO 2018166474 A1 WO2018166474 A1 WO 2018166474A1
Authority
WO
WIPO (PCT)
Prior art keywords
member group
request
cluster member
proposal
group
Prior art date
Application number
PCT/CN2018/078989
Other languages
French (fr)
Chinese (zh)
Inventor
吴义谱
张炎泼
Original Assignee
贵州白山云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 贵州白山云科技有限公司 filed Critical 贵州白山云科技有限公司
Publication of WO2018166474A1 publication Critical patent/WO2018166474A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method, device, medium, and computer device for changing a member group.
  • the Paxos algorithm is a message-based consistency algorithm proposed by Leslie Lamport for solving distributed system consistency problems. Processes in distributed systems based on messaging communication models may stop due to errors and restart due to anomalies, messages in network transmissions may be delayed, lost or duplicated, regardless of possible tampering, ie Byzantine error Next, the Paxos algorithm solves the problem of how to agree on a value in a distributed system where the above anomalies may occur.
  • Participants in Paxos can act as at least one of the three roles of a proposer, an acceptor, and a learner.
  • the proposer can propose a proposal, a proposal information including the proposal number n and the value of the proposal;
  • the recipient is the processor of the proposal, and it has the right to decide whether to accept or reject the proposal, if the proposal receives the majority of the recipient Acceptance, the proposal is selected (chosen); learners can only learn the proposal that has been selected.
  • the Paxos algorithm guarantees the correctness of the algorithm by satisfying security constraints and activity constraints.
  • the active constraint means that a proposal is finally selected, and the security constraints include the following constraints:
  • Lamport obtained the Paxos algorithm by continuously strengthening the above three constraints, especially constraint 2. Lamport used a lot of space in the "Paxos make simple" paper to strengthen the constraint 2, thus obtaining the following stage submission process of the Paxos algorithm:
  • Stage 1a The proposer determines the number n of the proposal and then sends a prepare request to the recipient, the request request carrying the number n of the proposal.
  • Stage 1b After receiving the request, the recipient determines that the number n of the proposal is not less than the number of the proposal that it has responded to before, and the recipient responds to the request through the preparation and returns the value of the proposal with the highest number before (if present) At the same time, it is guaranteed that no further proposals with a number less than n will be passed.
  • Stage 2a If the proposer receives a response from the majority recipient to the preparation request number n, then it sends an acceptance request including the proposal with the value v number n to the recipient, where v Is the value of the largest numbered proposal in the Phase 1b response, or the value that the proposer needs to submit in this paxos algorithm.
  • Phase 2b The recipient receives the acceptance request for the proposal including the number n, and as long as it has not responded to the preparation request with the number greater than n, it can pass the proposal.
  • the stop-the-word method will suspend the cluster first, modify the configuration information of all members, and then restart the entire cluster.
  • This method can solve the problem of consistency of configuration information of member groups, and will not cause the configuration information of different members to be inconsistent, but The problem revealed at the same time is also obvious, that is, the service cannot be provided during the suspension of the cluster. For the reality, service unavailability is unbearable in most cases.
  • the first-stage member change method was originally a method of changing the member group proposed by the raft paper.
  • the method is also applicable to Paxos.
  • the member configuration information is changed by running the Paxos instance once, and the member configuration information after the change is required as the Paxos algorithm proposal.
  • the value of the proposal allows the proposal to pass that value among the majority recipients.
  • the one-stage member group change algorithm has a very extreme limitation, that is, only one member can be changed at a time, which means that only one member can be added or deleted at a time. For example, replacing one member requires two Paxos, first member Remove from the configuration and add new members to the configuration.
  • the algorithm can also ensure the consistency of the member group configuration information, because changing one member at a time can ensure that the transition of the member configuration before the change and the member configuration after the change is not empty, thus ensuring that only One of the majority of the two member configurations is met so that only one value can be selected.
  • the stop-the-word method modifies the configuration by suspending the service provided by the cluster, and then provides the service after the configuration of the change completer.
  • the obvious disadvantage of this method is that the service cannot be provided during the change member configuration process, and the availability is relatively high. This is unbearable for the service.
  • the one-stage member change method can change the member configuration information while providing the service, but only one member can be added or deleted at a time, meaning that if it is impossible to replace multiple members at the same time, it can only be replaced one by one. Services that are more frequently changed in member configurations greatly reduce their performance.
  • the present invention provides a method, device, medium and computer device for changing a member group.
  • the transition cluster member group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
  • the transition cluster member group executes the consistency algorithm, and updates the transition cluster member group to the target cluster member group.
  • the initial cluster member group performs a consistency algorithm, and updating the initial cluster member group to the transition cluster member group includes: setting a first request proposal by a member that receives the change request in the initial cluster member group, to preset The incrementing rule sets the number of the first request proposal, sets the value of the first request proposal to the transition cluster member group, sets the version number of the execution of the consistency algorithm, and accepts all the values in the initial cluster member group.
  • the member sends at least one request, the at least one request carrying the version number, the number of the first request proposal, and the value of the first request proposal; the initial cluster member group executes the consistency algorithm Until the majority of the initial cluster member group passes the first request proposal.
  • the transition cluster member group executes the consistency algorithm, and updating the transition cluster member group to the target cluster member group includes: setting a second request proposal by a member of the transition cluster member group, by a preset increment The rule sets the number of the second request proposal, sets the value of the second request proposal to the target cluster member group, sets the version number of the execution of the consistency algorithm, and assigns all members in the transition cluster member group as recipients Sending at least one request, the at least one request carrying the version number, the number of the second request proposal, and the value of the second request proposal; the transition cluster member group executing the consistency algorithm until the The majority of the transition cluster member group passes the second request proposal.
  • the step 2 further includes: the initial cluster member group executing the consistency algorithm until the majority of the initial cluster member group passes the first request proposal, and the member receiving the change request goes to the transition cluster All members in the member group send a notification request carrying a version number. After the member of the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member, the first request proposal is learned. Updating the saved current version number to the version number in the notification request and updating the value of the saved proposal is the value of the first request proposal, and thus the transition cluster member group is successfully selected by the initial cluster member group.
  • the step 3 further includes: the transition cluster member group executing the consistency algorithm until the majority of the transition cluster member group passes the second request proposal, and setting a member of the second request proposal to the transition All members in the cluster member group send a notification request carrying a version number, and the member in the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member in the transition cluster member group, and learns the second request proposal.
  • the target cluster member group is successfully selected by the transition cluster member group. set.
  • the step 2 further includes: after the initial cluster member group executes the consistency algorithm, the member that receives the change request in the initial cluster member group determines whether the majority of the initial cluster member group passes the first Requesting a proposal, if not, setting the number of the first request proposal by a preset incremental rule, and sending the first request proposal of the updated number to all members in the initial cluster, and executing in this manner until the initial cluster member The majority of the group passes the first request proposal.
  • the step 3 further includes: after the transition cluster member group executes the consistency algorithm, the member sending the request in the transition cluster member group determines whether the majority of the transition cluster member group passes the second request Proposal, if not, setting the number of the second request proposal by a preset increment rule, and sending the second request proposal of the update number to all members in the initial cluster, and executing in this manner until the initial cluster member group The majority sent the proposal through the second request.
  • the change request includes a member corresponding to the change type and the change type, and the change type includes adding and/or deleting.
  • the member group changing apparatus provided in the embodiment of the present invention is applied to a server, and includes:
  • a change request receiving module configured to receive a change request for an initial cluster member group when the belonging server is a member of the initial cluster member group
  • a determining module configured to determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group is configured
  • the first group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
  • An execution module configured to execute the consistency algorithm until the initial cluster member group is updated to the transition cluster member group; and is further configured to execute the consistency algorithm again when the belonging server is a member of the transition cluster member group The transition cluster member group is updated to the target cluster member group.
  • the execution module includes a first unit and a second unit;
  • the first unit is configured to: when the belonging server receives the member of the change request for the initial cluster member group, set a first request proposal, set a number of the first request proposal by using a preset incremental rule, and set the The value of the first request proposal is the transition cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the initial cluster member group as recipients, the at least one request Carrying the version number, the number of the first request proposal, and the value of the first request proposal; and further, after receiving the response of the other members in the initial cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
  • the second unit is configured to: when the belonging server is the other member of the initial cluster member group, in addition to receiving the member of the change request, send at least the member that is the proposer role in the initial cluster member group After a request, the part of the consistency algorithm that is the recipient role is executed.
  • the execution module includes a first unit and a second unit;
  • the first unit is configured to: when the belonging server is a member of the sponsoring role in the transition cluster member group, set a second request proposal, set a number of the second request proposal by using a preset incremental rule, and set the The value of the second request proposal is the target cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the transition cluster member group as recipients, the at least one request Carrying the version number, the number of the second request proposal, and the value of the second request proposal; and further, after receiving the response of the other members in the transition cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
  • the second unit is configured to: when the belonging server is the transition cluster member group, in addition to the sending the other members of the at least one requested member, in the receiving the transition cluster member group as a proposer role After at least one request sent by the member, the part of the consistency algorithm that is the recipient role is executed.
  • the first unit is further configured to: when the belonging server is a member of the sponsor role in the initial cluster member group, after the majority of the initial cluster member group passes the first request proposal, All members in the transition cluster member group send a notification request carrying the version number;
  • the second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the first request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the first request proposal.
  • the first unit is further configured to: when the belonging server is a member of the sponsor role in the transition cluster member group, after the majority of the transition cluster member group passes the second request proposal, All members in the transition cluster member group send a notification request carrying the version number;
  • the second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the second request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the second request proposal.
  • the embodiment of the present invention further provides a computer readable storage medium, where the computer program stores a computer program, and when the program is executed by the processor, the steps of the foregoing method are implemented.
  • An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the method when the program is executed step.
  • the embodiment of the present invention can complete the replacement of multiple members in one member group at one time without stopping the cluster service, thereby effectively improving the intelligence and effectiveness of the cluster service.
  • 1 is a flow chart of a method for changing a member group in an embodiment
  • FIG. 2 is a structural diagram of a member group changing device in the embodiment
  • FIG. 3 is a schematic diagram of a member group change in a specific embodiment.
  • 1 is a flow chart of a method for changing a member group in an embodiment; the method includes:
  • Step 101 Receive a change request for the initial cluster member group, determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group includes the first a group and a second group, the first group includes all members of the initial cluster member group, and the second group includes all members of the target cluster member group;
  • Step 102 The initial cluster member group executes a consistency algorithm, and the initial cluster member group is updated to a transition cluster member group.
  • Step 103 The transition cluster member group executes the consistency algorithm, and updates the transition cluster member group to the target cluster member group.
  • Step 102 includes: setting a first request proposal by a member that receives the change request in the initial cluster member group, setting a number of the first request proposal by using a preset incremental rule, and setting a value of the first request proposal as a transition cluster member group.
  • the initial cluster member group executes the consistency algorithm until the majority of the initial cluster member group passes the first request proposal.
  • the preset increment rule includes: the proposal number is a combination of a member identifier and a time stamp, and the time stamp increases with time.
  • the step 103 includes: setting a second request proposal by a member of the transition cluster member group, setting a number of the second request proposal by using a preset incremental rule, and setting a value of the second request proposal as a target cluster member group. Setting a version number of the execution of the consistency algorithm; sending at least one request to all members of the transition cluster member group as recipients, at least one request carrying the version number, the number of the second request proposal, and the value of the second request proposal; The transition cluster member group executes the consistency algorithm until the majority of the transition cluster member group passes the second request proposal.
  • the step 102 further includes: after the initial cluster member group executes the consistency algorithm, the member that receives the change request in the initial cluster member group determines whether the majority of the initial cluster member group passes the first request proposal, and if not, presets The incremental rule sets the number of the first request proposal, and sends the first request proposal of the update number to all members in the initial cluster, and executes in this manner until the majority of the initial cluster member group passes the first request proposal.
  • Step 103 further includes: after the transition cluster member group executes the consistency algorithm, the first member of the transition cluster member group determines whether the majority of the transition cluster member group passes the second request proposal, and if not, sets the second with a preset incremental rule. Request the number of the proposal, send the second request proposal with the updated number to all members in the initial cluster, and execute in this way until the majority of the initial cluster member group passes the second request proposal.
  • Step 2 further includes: the initial cluster member group executing the consistency algorithm until the majority of the initial cluster member group passes the first request proposal, and the member receiving the change request sends a notification request carrying the version number to all members in the transition cluster member group. That is, the commit request, the member who is a learner in the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the user, and updates the current version number saved in the notification request after learning the first request proposal.
  • the version number and the value of the updated proposal are the values of the first request proposal.
  • the transition cluster member group is successfully selected by the initial cluster member group.
  • the step 103 further includes: the transition cluster member group executes the consistency algorithm until the majority of the transition cluster member group passes the second request proposal, and then the member of the second request proposal sends a notification carrying the version number to all members of the transition cluster member group.
  • the request is a commit request
  • the member of the transition cluster member group as the learner determines that the version number in the notification request is greater than the current version number saved by the member, and updates the saved current version number to the notification request after learning the second request proposal.
  • the version number and the value of the updated proposal are updated to the value of the second request proposal.
  • the target cluster member group is successfully selected by the transition cluster member group.
  • the change request includes a member corresponding to the change type and the change type
  • the change type includes adding and/or deleting.
  • the consistency algorithm in this method is typically the PAXOS algorithm.
  • FIG. 2 is a structural diagram of a member group changing device in an embodiment, the device is applied to a server, and includes:
  • a change request receiving module configured to receive a change request for an initial cluster member group when the belonging server is a member of the initial cluster member group
  • a determining module configured to determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group includes the first group and the second group, One group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
  • Execution module which is used to execute the consistency algorithm until the initial cluster member group is updated to the transition cluster member group; and is also used to execute the consistency algorithm again until the transition cluster member group is updated to the target cluster when the belonging server is a member of the transition cluster member group Member group.
  • the execution module includes a first unit and a second unit.
  • the first unit of the server is configured to set the first request proposal when the owner server receives the member of the change request in the initial cluster member group, to preset
  • the incremental rule sets the number of the first request proposal, sets the value of the first request proposal to the transition cluster member group, sets the version number of the execution of the consistency algorithm, and sends at least one time to all members in the initial cluster member group as recipients.
  • the request at least once, carries the version number, the number of the first request proposal, and the value of the first request proposal; and is also used to execute the consistency algorithm as a proposal after receiving the response of the other members in the initial cluster member group to the request Part of the person's role;
  • the second unit of the server is used to receive the initial cluster when the member belongs to the initial cluster member group except the other members of the member who received the change request.
  • the part of the consistency algorithm that acts as the recipient role is executed.
  • the first unit is configured to set a second request proposal when the belonging server is a member of the sponsor role in the transition cluster member group, set the number of the second request proposal by using a preset incremental rule, and set the value of the second request proposal.
  • the target cluster member group sets the version number of the execution of the consistency algorithm, and sends at least one request to all members in the transition cluster member group as recipients, at least one request carrying the version number, the number of the second request proposal, and the second The value of the request proposal; also used to perform the part of the consensus algorithm as the proposer role after receiving responses from other members in the transition cluster member group.
  • the second unit is configured to perform consistency after receiving at least one request sent by a member of the transition cluster member group as a member of the proposer role in the transitional cluster member group of the belonging server, in addition to sending the other members of the member at least once.
  • the part of the algorithm that acts as the recipient's role is configured to perform consistency after receiving at least one request sent by a member of the transition cluster member group as a member of the proposer role in the transitional cluster member group of the belonging server, in addition to sending the other members of the member at least once.
  • the first unit is also used to pass the first majority of the initial cluster member group when the owning server is a member of the sponsor role in the initial cluster member group.
  • a notification request carrying the version number that is, a commit request, is sent to all members of the transition cluster member group.
  • the second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and update the current saved current after learning the first request proposal.
  • the version number is the version number in the notification request and the value of the updated proposal is the value of the first request proposal.
  • the owning server is a member of the transition cluster member group that is the sponsor role.
  • the first unit is also used to send the version number to all members of the transition cluster member group after the majority of the transition cluster member group passes the second request proposal when the belonging server is a member of the sponsor role in the transition cluster member group.
  • the notification request is the commit request.
  • the second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and update the saved current after learning the second request proposal.
  • the version number is the version number in the notification request and the value of the updated proposal is the value of the second request proposal.
  • FIG. 3 is a schematic diagram of a member group change in a specific embodiment. As shown in FIG. 3, members a, b, and c are included in the group member group C_old. A list of members in this cluster is stored in members a, b, and c. Member a receives the change request, which includes two parts:
  • the change type is increased, and the change target is d, e.
  • the change type is delete
  • the change target is a, b.
  • the target cluster after the cluster member group C_old is changed is C_new, and C_new includes members c, d, and e.
  • the identifiers corresponding to the members a, b, c, d, and e are: 01, 02, 03, 04, 05.
  • the specific implementation part includes the following:
  • the last request proposal that member a responded to is numbered 1400000010_01
  • the last request proposal that member b responded to is numbered 1400000009_02
  • the last request proposal that member c should pass is number 1400000008_03.
  • the proposal number includes the number of seconds and the member ID in seconds from a fixed historical time to the current time.
  • Member a runs the Paxos algorithm as the proposer, determines the first request proposal, determines the number of the request proposal as 1400000011_01, and determines the value of the request proposal as C_middle. Member a determines that the version number at which the Paxos algorithm is executed is, for example, T. Member a sends a preparation request to all members of C_old, which carries the version number T and the number of the first request proposal.
  • All members of C_old as acceptors receive this preparation request, for example, all members are recipients.
  • member a determines that the number carried in the preparation request is 1400000011_01, which is greater than the number 1400000010_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member.
  • the response to the preparation request is returned, and the number of the last requested request that was responded is updated to 1400000011_01, and the saved version number is updated to T.
  • the member b After receiving the preparation request, the member b determines that the number 1400000011_01 carried in the preparation request is greater than the number 1400000009_02 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes the Proposal, returning a response to the preparation request, and updating the number of the last requested request that was responded to 1400000011_01, and updating the saved version number to T.
  • the member c After receiving the preparation request, the member c determines that the number carried in the preparation request is 1400000011_01 is greater than the number 140000008_03 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes This proposal returns a response to the prepare request and updates the number of the last requested request that was responded to 1400000011_01.
  • the member a After receiving the response from the majority of the C_old to the preparation request, the member a sends an acceptance request to the member as the acceptor, where the acceptance request carries the version number T, the number of the first request proposal 1400000011_01, and the value of the first request proposal C_middle .
  • the acceptance request After receiving the acceptance request as a member of the acceptor in C_old, it judges that the version number of the currently accepted request is greater than its saved version number, and has not responded to the preparation request with the number greater than 1400000011_01, responds to the acceptance request, and updates The version number it holds is the version number in the acceptance request.
  • member a After member a receives the response from the majority of C_old to accept the request, it determines that the majority in C_old passes the first request proposal.
  • Member a sends a notification request to all members of C_middle. After learning the first request proposal as a member of the learner in C_middle, C_middle is successfully selected by C_old.
  • the member a After the first Paxos algorithm is successfully run, the member a is still selected as the first member to run the Paxos algorithm.
  • Member a as the proposer, runs the Paxos algorithm for the second time, determines the second request proposal, determines the number of the request proposal as 1400000012_01, and determines that the value of the request proposal is C_new.
  • Member a determines that the version number of the implementation of this Paxos algorithm is T+1.
  • the member a sends a preparation request to all members of the C_middle, and the preparation request carries the version number T+1 and the number of the second request proposal.
  • All members of C_old who are recipients receive this preparation request for example, all members are recipients.
  • member a determines that the number carried in the preparation request is 1400000012_01, which is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member.
  • the response to the preparation request is returned, and the number of the last requested request that was responded is updated to 1400000012_01, and the saved version number is updated to T+1.
  • the member b After receiving the preparation request, the member b determines that the number 1400000012_01 carried in the preparation request is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes the The proposal returns a response to the preparation request and updates the number of the last requested proposal that was responded to 1400000012_01, updating the saved version number to T+1.
  • the member c determines that the number carried in the preparation request is 1400000012_01 is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member. This proposal returns a response to the prepare request and updates the number of the last requested request that was responded to 1400000012_01.
  • Member a receives the response to the preparation request from the majority in C_middle (the majority of C_middle is C_old majority and C_new), and then sends an acceptance request to the member who is the recipient, and carries the version number T in the acceptance request. +1, the number of the second request proposal 1400000012_01 and the value of the second request proposal C_new.
  • the member who is the recipient of C_middle determines that the version number in the current acceptance request is greater than the version number it has saved, and has not responded to the preparation request with the number greater than 1400000012_01, and responds to the request. And update its saved version number to accept the version number in the request.
  • member a After member a receives the response from the majority in C_middle to accept the request, it determines that the majority in C_middle passes the second request proposal.
  • Member a sends a notification request to all members of C_middle. After C_new learns the second request proposal as a member of the learner, C_new is successfully selected by C_middle.
  • Any step in the whole process of change can be interrupted without affecting the cluster to provide normal services. Since C-old and C-new are not required to intersect, all members can be changed at the same time, and the consistency of the algorithm is determined by Paxos. It is guaranteed by itself.
  • the invention can complete the replacement of multiple members in one member group at one time without stopping the cluster service, and can effectively improve the intelligence and effectiveness of the cluster service.
  • computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
  • the replacement of multiple members in a member group can be completed at one time without stopping the cluster service, which can effectively improve the intelligence and effectiveness of the cluster service.

Landscapes

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

Abstract

Disclosed are a member group change method and apparatus. The method comprises: receive a change request for an initial cluster member group, determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, the transition cluster member group comprising a first group and a second group, the first group comprising all elements in the initial cluster member group, and the second group comprising all elements in the target cluster member group; the initial cluster member group executes a consistency algorithm so as to update the initial cluster member group to the transition cluster member group; the transition cluster member group executes the consistency algorithm so as to update the transition cluster member group to the target cluster member group. According to embodiments of the present invention, the replacement of a plurality of elements in a member group can be finished once without suspending the cluster service, and the intelligence and the effectiveness of the cluster service can be effectively improved.

Description

一种成员组变更方法、装置、介质及计算机设备Method, device, medium and computer equipment for changing member groups
本申请要求在2017年3月17日提交中国专利局、申请号为201710161757.2,、发明名称为“一种成员组变更方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on March 17, 2017, to the Chinese Patent Office, Application No. 201710161757.2, entitled "A Member Group Change Method and Apparatus", the entire contents of which are incorporated herein by reference. In the application.
技术领域Technical field
本发明涉及互联网技术领域,尤其涉及一种成员组变更方法、装置、介质及计算机设备。The present invention relates to the field of Internet technologies, and in particular, to a method, device, medium, and computer device for changing a member group.
背景技术Background technique
Paxos算法是莱斯利·兰伯特(Leslie Lamport)为解决分布式系统一致性问题提出的一种基于消息传递的一致性算法。基于消息传递通信模型的分布式系统中的进程可能会因为错误而停止并且因为异常而重启,在网络传输中的消息可能会延迟、丢失或重复,在不考虑可能出现消息篡改即拜占庭错误的情况下,Paxos算法解决的是在一个可能发生以上异常情况的分布式系统中如何就某个值达成一致的问题。The Paxos algorithm is a message-based consistency algorithm proposed by Leslie Lamport for solving distributed system consistency problems. Processes in distributed systems based on messaging communication models may stop due to errors and restart due to anomalies, messages in network transmissions may be delayed, lost or duplicated, regardless of possible tampering, ie Byzantine error Next, the Paxos algorithm solves the problem of how to agree on a value in a distributed system where the above anomalies may occur.
Paxos的参与者可以充当提议者(proposer),接受者(acceptor)和学习者(learner)三个角色中的至少一个角色。提议者可以提出一个提案,一个提案信息包括提案编号n和提议的价值(value);接受者是提案的处理者,它有权决定是接受(accept)还是拒绝这个提案,若提案获得多数接受者的接受,则称该提案被选定(chosen);学习者只能学习已被选定的提案。Paxos算法通过满足安全性约束和活性约束来保证算法的正确性,活性约束是指最终有一个提案被选定,安全性约束包括以下约束:Participants in Paxos can act as at least one of the three roles of a proposer, an acceptor, and a learner. The proposer can propose a proposal, a proposal information including the proposal number n and the value of the proposal; the recipient is the processor of the proposal, and it has the right to decide whether to accept or reject the proposal, if the proposal receives the majority of the recipient Acceptance, the proposal is selected (chosen); learners can only learn the proposal that has been selected. The Paxos algorithm guarantees the correctness of the algorithm by satisfying security constraints and activity constraints. The active constraint means that a proposal is finally selected, and the security constraints include the following constraints:
1.只有被提议者提出的提案才能被接受者选定;1. Only proposals submitted by the proponent can be selected by the recipient;
2.在一次Paxos实例(instance)算法中只能有一个值被选定(chosen),同时2. Only one value can be selected (chosen) in a Paxos instance algorithm.
3.如果某个参与者认为某个提案被选定了,那么这个提案必须是真的被选定的那个。3. If a participant believes that a proposal has been selected, then the proposal must be the one that was actually selected.
Lamport通过不断加强上述的3个约束来得到Paxos算法,特别是约束2,lamport在“Paxos make simple”论文中用大量的篇幅来加强约束2,从而得到Paxos算法的如下的阶段提交的过程:Lamport obtained the Paxos algorithm by continuously strengthening the above three constraints, especially constraint 2. Lamport used a lot of space in the "Paxos make simple" paper to strengthen the constraint 2, thus obtaining the following stage submission process of the Paxos algorithm:
阶段1a.提议者确定提案的编号n,然后向接受者发送准备(prepare)请求,此准备请求中携带所述提案的编号n。Stage 1a. The proposer determines the number n of the proposal and then sends a prepare request to the recipient, the request request carrying the number n of the proposal.
阶段1b.接受者收到此请求后,判断此提案的编号n不小于它之前响应过的提案的编号,则接受者响应通过该准备请求,且返回之前通过编号最大的提案的价值(如果存在的话),同时保证不会再通过任何编号小于n的任何提案。Stage 1b. After receiving the request, the recipient determines that the number n of the proposal is not less than the number of the proposal that it has responded to before, and the recipient responds to the request through the preparation and returns the value of the proposal with the highest number before (if present) At the same time, it is guaranteed that no further proposals with a number less than n will be passed.
阶段2a.如果提议者收到多数派个的接受者对编号为n的准备请求的响应,那么它就会发送一个包括价值为v编号为n的提案的接受请求给接受者,此处v要么是阶段1b响应中最大编号提案的价值,要么是提议者这次paxos算法中需要提交的值。Stage 2a. If the proposer receives a response from the majority recipient to the preparation request number n, then it sends an acceptance request including the proposal with the value v number n to the recipient, where v Is the value of the largest numbered proposal in the Phase 1b response, or the value that the proposer needs to submit in this paxos algorithm.
阶段2b.接受者收到包括编号n的提案的接受请求,只要它还未对编号大于n的准备请求作出响应,它就可以通过这个提案。Phase 2b. The recipient receives the acceptance request for the proposal including the number n, and as long as it has not responded to the preparation request with the number greater than n, it can pass the proposal.
Paxos正是通过以上2阶段完成一次Paxos,确定一次Paxos提交一个价值。Lamport在他的论文中也证明了算法的正确性,但在实践中Paxos算法还有许多细节需要进一步的解决,如Paxos成员组变更问题。It is through the above two stages that Paxos completes a Paxos and determines that Paxos submits a value. Lamport also proved the correctness of the algorithm in his paper, but in practice there are many details of the Paxos algorithm that need to be further resolved, such as the Paxos membership group change problem.
目前为止,我们都假设集群的成员组配置是固定不变的。但是在实践中,由于机器的宕机导致成员下线,新旧成员的替换是不可避免的问题,那么在成员组配置信息发生变更之后,如何保持成员组配置信息的一致性,Lamport在论文中并没有给出具体的解决方案,但保持成员组配置信息在集群中一致是正确运行Paxos的前提。现在的方法包括以下两种:So far, we have assumed that the cluster member group configuration is fixed. However, in practice, because the machine is down, the members are offline, and the replacement of new and old members is an inevitable problem. Then, after the member group configuration information is changed, how to maintain the consistency of the member group configuration information, Lamport is in the paper. No specific solution is given, but keeping the member group configuration information consistent in the cluster is a prerequisite for proper operation of Paxos. The current methods include the following two:
方法一,stop-the-word方法Method one, stop-the-word method
stop-the-word方法是将先暂停集群,修改所有成员的配置信息,然后再重启整个集群,这种方式能解决成员组配置信息一致性的问题,不会造成不同成员的配置信息不一致,但是同时透露出的问题也是明显的,就是在集群暂停过程中无法提供服务。对于现实中,服务不可用在大部分情况下是不可忍受的。The stop-the-word method will suspend the cluster first, modify the configuration information of all members, and then restart the entire cluster. This method can solve the problem of consistency of configuration information of member groups, and will not cause the configuration information of different members to be inconsistent, but The problem revealed at the same time is also obvious, that is, the service cannot be provided during the suspension of the cluster. For the reality, service unavailability is unbearable in most cases.
方法二,一阶段成员变更方法Method 2, one-stage member change method
一阶段成员变更方法最早是raft论文提出的一个变更成员组的方法,该方 法同样适用于Paxos,通过运行1次Paxos实例来变更成员配置信息,将需要变更之后的成员配置信息作为Paxos算法提案的的价值,使该提案在多数派接受者中通过该价值。该一阶段成员组变更算法有一个非常极端的限制,就是每次只能变更一个成员,也就意味着每次只能添加或者删除一个成员,如替换一个成员需要执行2次Paxos,先将成员从配置中删除,再将新成员添加到配置中。该算法同样可以保证成员组配置信息的一致性,因为一次变更一个成员可以保证变更之前的成员配置和变更之后的成员配置各自形成的多数派的交接都不为空,这样就保证了同时只能满足两个成员配置的多数派中的一个,从而只能有一个价值能被选定。The first-stage member change method was originally a method of changing the member group proposed by the raft paper. The method is also applicable to Paxos. The member configuration information is changed by running the Paxos instance once, and the member configuration information after the change is required as the Paxos algorithm proposal. The value of the proposal allows the proposal to pass that value among the majority recipients. The one-stage member group change algorithm has a very extreme limitation, that is, only one member can be changed at a time, which means that only one member can be added or deleted at a time. For example, replacing one member requires two Paxos, first member Remove from the configuration and add new members to the configuration. The algorithm can also ensure the consistency of the member group configuration information, because changing one member at a time can ensure that the transition of the member configuration before the change and the member configuration after the change is not empty, thus ensuring that only One of the majority of the two member configurations is met so that only one value can be selected.
现有技术的缺点包括:Disadvantages of the prior art include:
1、stop-the-word方法通过暂停集群提供服务的方式修改配置,变更完成员配置后再提供服务,这种方法非常明显的缺点就是在变更成员配置过程中无法提供服务,对于可用性比较高的服务来说这是无法忍受的。1. The stop-the-word method modifies the configuration by suspending the service provided by the cluster, and then provides the service after the configuration of the change completer. The obvious disadvantage of this method is that the service cannot be provided during the change member configuration process, and the availability is relatively high. This is unbearable for the service.
2、一阶段成员变更方法可以在提供服务的同时,变更成员配置信息,但是一次只能添加或者删除一个成员,意味着如果同时需要替换多个成员根本无法做到,只能一个一个的替换,在成员配置更变操作频繁的服务大大降低了其性能。2, the one-stage member change method can change the member configuration information while providing the service, but only one member can be added or deleted at a time, meaning that if it is impossible to replace multiple members at the same time, it can only be replaced one by one. Services that are more frequently changed in member configurations greatly reduce their performance.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
为了解决上述技术问题,本发明提供了一种成员组变更方法、装置、介质及计算机设备。In order to solve the above technical problem, the present invention provides a method, device, medium and computer device for changing a member group.
本发明实施例中提供的成员组变更方法,包括:The member group changing method provided in the embodiment of the present invention includes:
接收针对初始集群成员组的变更请求,根据所述初始集群成员组和所述变更请求确定目标集群成员组,根据所述初始集群成员组和所述目标集群成员组设置过渡集群成员组,所述过渡集群成员组中包括第一组和第二组,所述第一组包括所述初始集群成员组中的所有成员,所述第二组包括所述目标集群成员组中的所有成员;Receiving a change request for the initial cluster member group, determining a target cluster member group according to the initial cluster member group and the change request, and setting a transition cluster member group according to the initial cluster member group and the target cluster member group, The transition cluster member group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
所述初始集群成员组执行一致性算法,将所述初始集群成员组更新为所述过渡集群成员组;Performing a consistency algorithm on the initial cluster member group, and updating the initial cluster member group to the transition cluster member group;
所述过渡集群成员组执行所述一致性算法,将所述过渡集群成员组更新为所述目标集群成员组。The transition cluster member group executes the consistency algorithm, and updates the transition cluster member group to the target cluster member group.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述初始集群成员组执行一致性算法,将所述初始集群成员组更新为所述过渡集群成员组包括:所述初始集群成员组中接收到变更请求的成员设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置所述第一请求提案的值为所述过渡集群成员组,设置执行此次一致性算法的版本号,向所述初始集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第一请求提案的编号和所述第一请求提案的值;所述初始集群成员组执行所述一致性算法直至所述初始集群成员组的多数派通过所述第一请求提案。The initial cluster member group performs a consistency algorithm, and updating the initial cluster member group to the transition cluster member group includes: setting a first request proposal by a member that receives the change request in the initial cluster member group, to preset The incrementing rule sets the number of the first request proposal, sets the value of the first request proposal to the transition cluster member group, sets the version number of the execution of the consistency algorithm, and accepts all the values in the initial cluster member group. The member sends at least one request, the at least one request carrying the version number, the number of the first request proposal, and the value of the first request proposal; the initial cluster member group executes the consistency algorithm Until the majority of the initial cluster member group passes the first request proposal.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述过渡集群成员组执行所述一致性算法,将所述过渡集群成员组更新为所述目标集群成员组包括:所述过渡集群成员组中的一成员设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置所述第二请求提案的值为目标集群成员组,设置执行此次一致性算法的版本号,向所述过渡集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第二请求提案的编号和所述第二请求提案的值;所述过渡集群成员组执行所述一致性算法直至所述过渡集群成员组的多数派通过所述第二请求提案。The transition cluster member group executes the consistency algorithm, and updating the transition cluster member group to the target cluster member group includes: setting a second request proposal by a member of the transition cluster member group, by a preset increment The rule sets the number of the second request proposal, sets the value of the second request proposal to the target cluster member group, sets the version number of the execution of the consistency algorithm, and assigns all members in the transition cluster member group as recipients Sending at least one request, the at least one request carrying the version number, the number of the second request proposal, and the value of the second request proposal; the transition cluster member group executing the consistency algorithm until the The majority of the transition cluster member group passes the second request proposal.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述步骤2中还包括:所述初始集群成员组执行所述一致性算法直至所述初始集群成员组的多数派通过所述第一请求提案后,接收到变更请求的成员向所述过渡集群成员组中所有成员发送携带版本号的通知请求,所述过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第一请求提案的值,至此,所述过渡集群成员组 成功被所述初始集群成员组选定。The step 2 further includes: the initial cluster member group executing the consistency algorithm until the majority of the initial cluster member group passes the first request proposal, and the member receiving the change request goes to the transition cluster All members in the member group send a notification request carrying a version number. After the member of the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member, the first request proposal is learned. Updating the saved current version number to the version number in the notification request and updating the value of the saved proposal is the value of the first request proposal, and thus the transition cluster member group is successfully selected by the initial cluster member group.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述步骤3中还包括:所述过渡集群成员组执行所述一致性算法直至所述过渡集群成员组的多数派通过所述第二请求提案后,设置第二请求提案的成员向所述过渡集群成员组中所有成员发送携带版本号的通知请求,所述过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第二请求提案的值,至此,所述目标集群成员组成功被所述过渡集群成员组成功选定。The step 3 further includes: the transition cluster member group executing the consistency algorithm until the majority of the transition cluster member group passes the second request proposal, and setting a member of the second request proposal to the transition All members in the cluster member group send a notification request carrying a version number, and the member in the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member in the transition cluster member group, and learns the second request proposal. After updating the saved current version number to the version number in the notification request and updating the value of the saved proposal to the value of the second request proposal, the target cluster member group is successfully selected by the transition cluster member group. set.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述步骤2中还包括:所述初始集群成员组执行所述一致性算法后,所述初始集群成员组中接收变更请求的成员判断所述初始集群成员组的多数派是否通过所述第一请求提案,如果否,以预设递增规则设置所述第一请求提案的编号,将更新编号的第一请求提案发送至所述初始集群中所有成员,依照此方式执行,直至所述初始集群成员组的多数派通过所述第一请求提案。The step 2 further includes: after the initial cluster member group executes the consistency algorithm, the member that receives the change request in the initial cluster member group determines whether the majority of the initial cluster member group passes the first Requesting a proposal, if not, setting the number of the first request proposal by a preset incremental rule, and sending the first request proposal of the updated number to all members in the initial cluster, and executing in this manner until the initial cluster member The majority of the group passes the first request proposal.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述步骤3中还包括:所述过渡集群成员组执行所述一致性算法后,所述过渡集群成员组中发送请求的成员判断所述过渡集群成员组的多数派是否通过所述第二请求提案,如果否,以预设递增规则设置所述第二请求提案的编号,将更新编号的第二请求提案发送至所述初始集群中所有成员,依照此方式执行,直至所述初始集群成员组的多数派通过所述第二请求提案。The step 3 further includes: after the transition cluster member group executes the consistency algorithm, the member sending the request in the transition cluster member group determines whether the majority of the transition cluster member group passes the second request Proposal, if not, setting the number of the second request proposal by a preset increment rule, and sending the second request proposal of the update number to all members in the initial cluster, and executing in this manner until the initial cluster member group The majority sent the proposal through the second request.
上述成员组变更方法还具有以下特点:The above member group change method also has the following characteristics:
所述变更请求中包括变更类型和变更类型对应的成员,所述变更类型包括增加和/或删除。The change request includes a member corresponding to the change type and the change type, and the change type includes adding and/or deleting.
本发明实施例中提供的成员组变更装置,应用于服务器中,包括:The member group changing apparatus provided in the embodiment of the present invention is applied to a server, and includes:
变更请求接收模块,用于在所属服务器是初始集群成员组的成员时,接收针对初始集群成员组的变更请求;a change request receiving module, configured to receive a change request for an initial cluster member group when the belonging server is a member of the initial cluster member group;
确定模块,用于根据所述初始集群成员组和所述变更请求确定目标集群成 员组,根据所述初始集群成员组和所述目标集群成员组设置过渡集群成员组,所述过渡集群成员组中包括第一组和第二组,所述第一组包括所述初始集群成员组中的所有成员,所述第二组包括所述目标集群成员组中的所有成员;a determining module, configured to determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group is configured The first group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
执行模块,用于执行一致性算法直至所述初始集群成员组更新为所述过渡集群成员组;还用于在所属服务器是所述过渡集群成员组的成员时,再次执行所述一致性算法直至所述过渡集群成员组更新为所述目标集群成员组。An execution module, configured to execute the consistency algorithm until the initial cluster member group is updated to the transition cluster member group; and is further configured to execute the consistency algorithm again when the belonging server is a member of the transition cluster member group The transition cluster member group is updated to the target cluster member group.
上述成员组变更装置还具有以下特点:The above member group changing device also has the following characteristics:
所述执行模块包括第一单元和第二单元;The execution module includes a first unit and a second unit;
所述第一单元,用于在所属服务器为所述初始集群成员组中接收到变更请求的成员时,设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置所述第一请求提案的值为所述过渡集群成员组,设置执行此次一致性算法的版本号,向所述初始集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第一请求提案的编号和所述第一请求提案的值;还用于在收到所述初始集群成员组中其它成员对所述请求的响应后,执行所述一致性算法中作为提案人角色的部分;The first unit is configured to: when the belonging server receives the member of the change request for the initial cluster member group, set a first request proposal, set a number of the first request proposal by using a preset incremental rule, and set the The value of the first request proposal is the transition cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the initial cluster member group as recipients, the at least one request Carrying the version number, the number of the first request proposal, and the value of the first request proposal; and further, after receiving the response of the other members in the initial cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
所述第二单元,用于在所属服务器为所述初始集群成员组中除了接收到变更请求的成员的其它成员时,在接收到所述初始集群成员组中作为提案人角色的成员发送的至少一次请求后,执行所述一致性算法中作为接受者角色的部分。The second unit is configured to: when the belonging server is the other member of the initial cluster member group, in addition to receiving the member of the change request, send at least the member that is the proposer role in the initial cluster member group After a request, the part of the consistency algorithm that is the recipient role is executed.
上述成员组变更装置还具有以下特点:The above member group changing device also has the following characteristics:
所述执行模块包括第一单元和第二单元;The execution module includes a first unit and a second unit;
所述第一单元,用于在所属服务器为所述过渡集群成员组中作为提案人角色的成员时,设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置所述第二请求提案的值为所述目标集群成员组,设置执行此次一致性算法的版本号,向所述过渡集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第二请求提案的编号和所述第二请求提案的值;还用于在收到所述过渡集群成员组中其它成员对所述请求的响应后,执行所述一致性算法中作为提案人角色的部分;The first unit is configured to: when the belonging server is a member of the sponsoring role in the transition cluster member group, set a second request proposal, set a number of the second request proposal by using a preset incremental rule, and set the The value of the second request proposal is the target cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the transition cluster member group as recipients, the at least one request Carrying the version number, the number of the second request proposal, and the value of the second request proposal; and further, after receiving the response of the other members in the transition cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
所述第二单元,用于在所属服务器为所述过渡集群成员组中除了所述发送所述至少一次请求的成员的其它成员时,在接收到所述过渡集群成员组中作为 提案人角色的成员发送的至少一次请求后,执行所述一致性算法中作为接受者角色的部分。The second unit is configured to: when the belonging server is the transition cluster member group, in addition to the sending the other members of the at least one requested member, in the receiving the transition cluster member group as a proposer role After at least one request sent by the member, the part of the consistency algorithm that is the recipient role is executed.
上述成员组变更装置还具有以下特点:The above member group changing device also has the following characteristics:
所述第一单元,还用于在所属服务器为所述初始集群成员组中作为提案人角色的成员时,在所述初始集群成员组的多数派通过所述第一请求提案后,向所述过渡集群成员组中所有成员发送携带版本号的通知请求;The first unit is further configured to: when the belonging server is a member of the sponsor role in the initial cluster member group, after the majority of the initial cluster member group passes the first request proposal, All members in the transition cluster member group send a notification request carrying the version number;
所述第二单元,还用于在所属服务器为所述过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第一请求提案的值。The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the first request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the first request proposal.
上述成员组变更装置还具有以下特点:The above member group changing device also has the following characteristics:
所述第一单元,还用于在所属服务器为所述过渡集群成员组中作为提案人角色的成员时,在所述过渡集群成员组的多数派通过所述第二请求提案后,向所述过渡集群成员组中所有成员发送携带版本号的通知请求;The first unit is further configured to: when the belonging server is a member of the sponsor role in the transition cluster member group, after the majority of the transition cluster member group passes the second request proposal, All members in the transition cluster member group send a notification request carrying the version number;
所述第二单元,还用于在所属服务器为所述过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第二请求提案的值。The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the second request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the second request proposal.
本发明实施例还提供了一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述程序被处理器执行时实现上述方法的步骤。The embodiment of the present invention further provides a computer readable storage medium, where the computer program stores a computer program, and when the program is executed by the processor, the steps of the foregoing method are implemented.
本发明实施例还提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法的步骤。An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the method when the program is executed step.
本发明实施例可以在无需中止集群服务的情况下一次性完成一个成员组中多个成员的替换,可有效提高集群服务的智能性和有效性。The embodiment of the present invention can complete the replacement of multiple members in one member group at one time without stopping the cluster service, thereby effectively improving the intelligence and effectiveness of the cluster service.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的 一部分,本发明实施例的示意性实施例及其说明用于解释本发明实施例,并不构成对本发明实施例的不当限定。在附图中:The accompanying drawings are intended to provide a further understanding of the embodiments of the embodiments of the invention Improper limitations. In the drawing:
图1是实施例中成员组变更方法的流程图;1 is a flow chart of a method for changing a member group in an embodiment;
图2是实施例中成员组变更装置的结构图;2 is a structural diagram of a member group changing device in the embodiment;
图3是具体实施例中成员组变更的示意图。3 is a schematic diagram of a member group change in a specific embodiment.
具体实施方式detailed description
现结合附图和具体实施方式对本发明实施例进一步说明。The embodiments of the present invention will be further described with reference to the drawings and specific embodiments.
图1是实施例中成员组变更方法的流程图;此方法包括:1 is a flow chart of a method for changing a member group in an embodiment; the method includes:
步骤101,接收针对初始集群成员组的变更请求,根据初始集群成员组和变更请求确定目标集群成员组,根据初始集群成员组和目标集群成员组设置过渡集群成员组,过渡集群成员组中包括第一组和第二组,第一组包括初始集群成员组中的所有成员,第二组包括目标集群成员组中的所有成员;Step 101: Receive a change request for the initial cluster member group, determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group includes the first a group and a second group, the first group includes all members of the initial cluster member group, and the second group includes all members of the target cluster member group;
步骤102,初始集群成员组执行一致性算法,将初始集群成员组更新为过渡集群成员组;Step 102: The initial cluster member group executes a consistency algorithm, and the initial cluster member group is updated to a transition cluster member group.
步骤103,过渡集群成员组执行所述一致性算法,将过渡集群成员组更新为目标集群成员组。Step 103: The transition cluster member group executes the consistency algorithm, and updates the transition cluster member group to the target cluster member group.
其中,步骤102包括:初始集群成员组中接收到变更请求的成员设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置第一请求提案的值为过渡集群成员组,设置执行此次一致性算法的版本号,向初始集群成员组中所有作为接受者的成员发送至少一次请求,至少一次请求中携带版本号、第一请求提案的编号和第一请求提案的值;初始集群成员组执行一致性算法直至初始集群成员组的多数派通过第一请求提案。其中,预设递增规则包括:提案的编号为成员标识和时间戳的组合,时间戳随时间推移而增加。Step 102 includes: setting a first request proposal by a member that receives the change request in the initial cluster member group, setting a number of the first request proposal by using a preset incremental rule, and setting a value of the first request proposal as a transition cluster member group. Setting a version number for executing the consistency algorithm, and sending at least one request to all members in the initial cluster member group as recipients, at least one request carrying the version number, the number of the first request proposal, and the value of the first request proposal; The initial cluster member group executes the consistency algorithm until the majority of the initial cluster member group passes the first request proposal. The preset increment rule includes: the proposal number is a combination of a member identifier and a time stamp, and the time stamp increases with time.
与上述同理,步骤103包括:过渡集群成员组中的一成员设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置第二请求提案的值为目标集群成员组,设置执行此次一致性算法的版本号;向过渡集群成员组中所有作为接受者的成员发送至少一次请求,至少一次请求中携带版本号、第二请求提案的编号和第二请求提案的值;过渡集群成员组执行一致性算法直至过渡集 群成员组的多数派通过第二请求提案。In the same manner as the above, the step 103 includes: setting a second request proposal by a member of the transition cluster member group, setting a number of the second request proposal by using a preset incremental rule, and setting a value of the second request proposal as a target cluster member group. Setting a version number of the execution of the consistency algorithm; sending at least one request to all members of the transition cluster member group as recipients, at least one request carrying the version number, the number of the second request proposal, and the value of the second request proposal; The transition cluster member group executes the consistency algorithm until the majority of the transition cluster member group passes the second request proposal.
在无法一次通过提案的情况下,需要多次发送更新提案的编号并多次发送提案。具体的,步骤102中还包括:初始集群成员组执行一致性算法后,初始集群成员组中接收变更请求的成员判断初始集群成员组的多数派是否通过第一请求提案,如果否,以预设递增规则设置第一请求提案的编号,将更新编号的第一请求提案发送至初始集群中所有成员,依照此方式执行,直至初始集群成员组的多数派通过第一请求提案。步骤103中还包括:过渡集群成员组执行一致性算法后,过渡集群成员组的第一成员判断过渡集群成员组的多数派是否通过第二请求提案,如果否,以预设递增规则设置第二请求提案的编号,将更新编号的第二请求提案发送至初始集群中所有成员,依照此方式执行,直至初始集群成员组的多数派通过第二请求提案。In the case where the proposal cannot be passed at one time, it is necessary to send the number of the update proposal multiple times and send the proposal multiple times. Specifically, the step 102 further includes: after the initial cluster member group executes the consistency algorithm, the member that receives the change request in the initial cluster member group determines whether the majority of the initial cluster member group passes the first request proposal, and if not, presets The incremental rule sets the number of the first request proposal, and sends the first request proposal of the update number to all members in the initial cluster, and executes in this manner until the majority of the initial cluster member group passes the first request proposal. Step 103 further includes: after the transition cluster member group executes the consistency algorithm, the first member of the transition cluster member group determines whether the majority of the transition cluster member group passes the second request proposal, and if not, sets the second with a preset incremental rule. Request the number of the proposal, send the second request proposal with the updated number to all members in the initial cluster, and execute in this way until the majority of the initial cluster member group passes the second request proposal.
本方法中还包括学习的过程。步骤2中还包括:初始集群成员组执行一致性算法直至初始集群成员组的多数派通过第一请求提案后,接收到变更请求的成员向过渡集群成员组中所有成员发送携带版本号的通知请求即为commit请求,过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为第一请求提案的值,至此,过渡集群成员组成功被初始集群成员组选定。步骤103中还包括:过渡集群成员组执行一致性算法直至过渡集群成员组的多数派通过第二请求提案后,设置第二请求提案的成员向过渡集群成员组中所有成员发送携带版本号的通知请求即为commit请求,过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为第二请求提案的值,至此,目标集群成员组成功被过渡集群成员组成功选定。The method also includes a learning process. Step 2 further includes: the initial cluster member group executing the consistency algorithm until the majority of the initial cluster member group passes the first request proposal, and the member receiving the change request sends a notification request carrying the version number to all members in the transition cluster member group. That is, the commit request, the member who is a learner in the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the user, and updates the current version number saved in the notification request after learning the first request proposal. The version number and the value of the updated proposal are the values of the first request proposal. At this point, the transition cluster member group is successfully selected by the initial cluster member group. The step 103 further includes: the transition cluster member group executes the consistency algorithm until the majority of the transition cluster member group passes the second request proposal, and then the member of the second request proposal sends a notification carrying the version number to all members of the transition cluster member group. The request is a commit request, and the member of the transition cluster member group as the learner determines that the version number in the notification request is greater than the current version number saved by the member, and updates the saved current version number to the notification request after learning the second request proposal. The version number and the value of the updated proposal are updated to the value of the second request proposal. At this point, the target cluster member group is successfully selected by the transition cluster member group.
本方法中,变更请求中包括变更类型和变更类型对应的成员,变更类型包括增加和/或删除。In the method, the change request includes a member corresponding to the change type and the change type, and the change type includes adding and/or deleting.
本方法中的一致性算法典型的为PAXOS算法。The consistency algorithm in this method is typically the PAXOS algorithm.
图2是实施例中成员组变更装置的结构图,此装置应用于服务器中,包括:2 is a structural diagram of a member group changing device in an embodiment, the device is applied to a server, and includes:
变更请求接收模块,用于在所属服务器是初始集群成员组的成员时,接收针对初始集群成员组的变更请求;a change request receiving module, configured to receive a change request for an initial cluster member group when the belonging server is a member of the initial cluster member group;
确定模块,用于根据初始集群成员组和变更请求确定目标集群成员组,根据初始集群成员组和目标集群成员组设置过渡集群成员组,过渡集群成员组中包括第一组和第二组,第一组包括初始集群成员组中的所有成员,第二组包括目标集群成员组中的所有成员;a determining module, configured to determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group includes the first group and the second group, One group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
执行模块,用于执行一致性算法直至初始集群成员组更新为过渡集群成员组;还用于在所属服务器是过渡集群成员组的成员时,再次执行一致性算法直至过渡集群成员组更新为目标集群成员组。Execution module, which is used to execute the consistency algorithm until the initial cluster member group is updated to the transition cluster member group; and is also used to execute the consistency algorithm again until the transition cluster member group is updated to the target cluster when the belonging server is a member of the transition cluster member group Member group.
执行模块包括第一单元和第二单元。The execution module includes a first unit and a second unit.
在服务器为初始集群成员组中接收到变更请求的成员时,此服务器的第一单元用于在所属服务器为初始集群成员组中接收到变更请求的成员时,设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置第一请求提案的值为过渡集群成员组,设置执行此次一致性算法的版本号,向初始集群成员组中所有作为接受者的成员发送至少一次请求,至少一次请求中携带版本号、第一请求提案的编号和第一请求提案的值;还用于在收到初始集群成员组中其它成员对请求的响应后,执行一致性算法中作为提案人角色的部分;When the server receives the member of the change request in the initial cluster member group, the first unit of the server is configured to set the first request proposal when the owner server receives the member of the change request in the initial cluster member group, to preset The incremental rule sets the number of the first request proposal, sets the value of the first request proposal to the transition cluster member group, sets the version number of the execution of the consistency algorithm, and sends at least one time to all members in the initial cluster member group as recipients. The request, at least once, carries the version number, the number of the first request proposal, and the value of the first request proposal; and is also used to execute the consistency algorithm as a proposal after receiving the response of the other members in the initial cluster member group to the request Part of the person's role;
在服务器为初始集群成员组中接收到变更请求的成员时,此服务器的第二单元用于在所属服务器为初始集群成员组中除了接收到变更请求的成员的其它成员时,在接收到初始集群成员组中作为提案人角色的成员发送的至少一次请求后,执行一致性算法中作为接受者角色的部分。When the server receives the member of the change request for the initial cluster member group, the second unit of the server is used to receive the initial cluster when the member belongs to the initial cluster member group except the other members of the member who received the change request. After at least one request sent by a member of the member group as a proposer role, the part of the consistency algorithm that acts as the recipient role is executed.
在无法一次通过提案的情况下,需要多次发送更新提案的编号并多次发送提案。第一单元用于在所属服务器为过渡集群成员组中作为提案人角色的成员时,设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置第二请求提案的值为目标集群成员组,设置执行此次一致性算法的版本号,向过渡集群成员组中所有作为接受者的成员发送至少一次请求,至少一次请求中携带版本号、第二请求提案的编号和第二请求提案的值;还用于在收到过渡集群成员组中其它成员对请求的响应后,执行一致性算法中作为提案人角色的部分。第二单元用于在所属服务器为过渡集群成员组中除了发送至少一次请求的成员的其它成员时,在接收到过渡集群成员组中作为提案人角色的成员发送的至少一次请求后,执行一致性算法中作为接受者角色的部分。In the case where the proposal cannot be passed at one time, it is necessary to send the number of the update proposal multiple times and send the proposal multiple times. The first unit is configured to set a second request proposal when the belonging server is a member of the sponsor role in the transition cluster member group, set the number of the second request proposal by using a preset incremental rule, and set the value of the second request proposal. The target cluster member group sets the version number of the execution of the consistency algorithm, and sends at least one request to all members in the transition cluster member group as recipients, at least one request carrying the version number, the number of the second request proposal, and the second The value of the request proposal; also used to perform the part of the consensus algorithm as the proposer role after receiving responses from other members in the transition cluster member group. The second unit is configured to perform consistency after receiving at least one request sent by a member of the transition cluster member group as a member of the proposer role in the transitional cluster member group of the belonging server, in addition to sending the other members of the member at least once. The part of the algorithm that acts as the recipient's role.
对应于本方法中学习的过程。所属服务器为初始集群成员组中作为提案人角色的成员时,第一单元还用于在所属服务器为初始集群成员组中作为提案人 角色的成员时,在初始集群成员组的多数派通过第一请求提案后,向过渡集群成员组中所有成员发送携带版本号的通知请求即commit请求。第二单元还用于在所属服务器为过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为第一请求提案的值。Corresponds to the process of learning in this method. When the own server is a member of the initial cluster member group as the proposer role, the first unit is also used to pass the first majority of the initial cluster member group when the owning server is a member of the sponsor role in the initial cluster member group. After requesting the proposal, a notification request carrying the version number, that is, a commit request, is sent to all members of the transition cluster member group. The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and update the current saved current after learning the first request proposal. The version number is the version number in the notification request and the value of the updated proposal is the value of the first request proposal.
对应于本方法中学习的过程。所属服务器为过渡集群成员组中作为提案人角色的成员。第一单元还用于在所属服务器为过渡集群成员组中作为提案人角色的成员时,在过渡集群成员组的多数派通过第二请求提案后,向过渡集群成员组中所有成员发送携带版本号的通知请求即commit请求。第二单元还用于在所属服务器为过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为第二请求提案的值。Corresponds to the process of learning in this method. The owning server is a member of the transition cluster member group that is the sponsor role. The first unit is also used to send the version number to all members of the transition cluster member group after the majority of the transition cluster member group passes the second request proposal when the belonging server is a member of the sponsor role in the transition cluster member group. The notification request is the commit request. The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and update the saved current after learning the second request proposal. The version number is the version number in the notification request and the value of the updated proposal is the value of the second request proposal.
具体实施例Specific embodiment
图3是具体实施例中成员组变更的示意图。如图3所示,群成员组C_old中包括成员a,b,c。成员a,b,c中均保存有此集群中的成员列表。成员a接收到变更请求,此变更请求中包括两部分:3 is a schematic diagram of a member group change in a specific embodiment. As shown in FIG. 3, members a, b, and c are included in the group member group C_old. A list of members in this cluster is stored in members a, b, and c. Member a receives the change request, which includes two parts:
第一部分,变更类型为增加,变更目标为d,e。In the first part, the change type is increased, and the change target is d, e.
第二部分,变更类型为删除,变更目标为a,b。In the second part, the change type is delete, and the change target is a, b.
集群成员组C_old变更后的目标集群为C_new,C_new中包括成员c,d,e。The target cluster after the cluster member group C_old is changed is C_new, and C_new includes members c, d, and e.
设置过渡集群成员组C_middle为{{a,b,c},{c,d,e}}。Set the transition cluster member group C_middle to {{a,b,c},{c,d,e}}.
设置成员a,b,c,d,e对应的标识分别为:01,02,03,04,05。The identifiers corresponding to the members a, b, c, d, and e are: 01, 02, 03, 04, 05.
具体执行部分包括以下内容:The specific implementation part includes the following:
成员a响应过的最后一个请求提案的编号为1400000010_01,成员b响应过的最后一个请求提案的编号为1400000009_02,成员c应过的最后一个请求提案的编号1400000008_03。提案的编号包括以秒为单位从一固定历史时间到当前时间的秒数和成员标识。成员进行编号比较时,时间戳不同时,比较时间戳的大小作编号比较结果,在时间戳相同时,比较成员标识的大小作为编号比较结果。The last request proposal that member a responded to is numbered 1400000010_01, the last request proposal that member b responded to is numbered 1400000009_02, and the last request proposal that member c should pass is number 1400000008_03. The proposal number includes the number of seconds and the member ID in seconds from a fixed historical time to the current time. When a member compares numbers, when the timestamps are different, the size of the timestamps is compared to the number comparison result. When the timestamps are the same, the size of the member identifiers is compared as the number comparison result.
成员a作为提议者运行Paxos算法,确定第一请求提案,确定此请求提案的编号为1400000011_01,确定此请求提案的值为C_middle。成员a确定执行此次Paxos算法的版本号例如为T。成员a向C_old中所有成员发送准备请求, 此准备请求中携带版本号T和第一请求提案的编号。Member a runs the Paxos algorithm as the proposer, determines the first request proposal, determines the number of the request proposal as 1400000011_01, and determines the value of the request proposal as C_middle. Member a determines that the version number at which the Paxos algorithm is executed is, for example, T. Member a sends a preparation request to all members of C_old, which carries the version number T and the number of the first request proposal.
C_old中作为acceptor的所有成员收到此准备请求,例如所有成员均作为接受者。成员a收到此准备请求后,判断此准备请求中携带的编号为1400000011_01,大于此成员响应过的最后一个请求提案的编号1400000010_01,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000011_01,将保存的版本号更新为T。成员b收到此准备请求后,判断此准备请求中携带的编号1400000011_01大于此成员响应过的最后一个请求提案的编号1400000009_02,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000011_01,将保存的版本号更新为T。成员c收到此准备请求后,判断此准备请求中携带的编号为1400000011_01大于此成员响应过的最后一个请求提案的编号140000008_03,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000011_01。All members of C_old as acceptors receive this preparation request, for example, all members are recipients. After receiving the preparation request, member a determines that the number carried in the preparation request is 1400000011_01, which is greater than the number 1400000010_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member. With this proposal, the response to the preparation request is returned, and the number of the last requested request that was responded is updated to 1400000011_01, and the saved version number is updated to T. After receiving the preparation request, the member b determines that the number 1400000011_01 carried in the preparation request is greater than the number 1400000009_02 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes the Proposal, returning a response to the preparation request, and updating the number of the last requested request that was responded to 1400000011_01, and updating the saved version number to T. After receiving the preparation request, the member c determines that the number carried in the preparation request is 1400000011_01 is greater than the number 140000008_03 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes This proposal returns a response to the prepare request and updates the number of the last requested request that was responded to 1400000011_01.
成员a收到C_old中多数派的对准备请求的响应后,向作为acceptor的成员发送接受请求,在此接受请求中携带版本号T、第一请求提案的编号1400000011_01和第一请求提案的值C_middle。C_old中作为acceptor的成员收到此接受请求后,判断当前接受请求的版本号大于其保存的版本号,而且还未对编号大于1400000011_01的准备请求作出响应,就对此接受请求作出响应,并更新其保存的版本号为接受请求中的版本号。After receiving the response from the majority of the C_old to the preparation request, the member a sends an acceptance request to the member as the acceptor, where the acceptance request carries the version number T, the number of the first request proposal 1400000011_01, and the value of the first request proposal C_middle . After receiving the acceptance request as a member of the acceptor in C_old, it judges that the version number of the currently accepted request is greater than its saved version number, and has not responded to the preparation request with the number greater than 1400000011_01, responds to the acceptance request, and updates The version number it holds is the version number in the acceptance request.
成员a收到C_old中多数派的对接受请求的响应后,确定C_old中多数派通过此第一请求提案。After member a receives the response from the majority of C_old to accept the request, it determines that the majority in C_old passes the first request proposal.
成员a向C_middle中所有成员发送通知请求,C_middle中作为学习者的成员学习第一请求提案后,至此C_middle成功被C_old选定。Member a sends a notification request to all members of C_middle. After learning the first request proposal as a member of the learner in C_middle, C_middle is successfully selected by C_old.
使用与以上同理的方式执行C_middle至C_new的更新过程。The update process of C_middle to C_new is performed in the same manner as above.
上述第一次Paxos算法运行成功后,仍然选用成员a作为第一成员运行Paxos算法。成员a作为提议者第二次运行Paxos算法,确定第二请求提案,确定此请求提案的编号为1400000012_01,确定此请求提案的值为C_new。成员a确定执行此次Paxos算法的版本号为T+1。成员a向C_middle中所有成员发送准备请求,此准备请求中携带版本号T+1和第二请求提案的编号。After the first Paxos algorithm is successfully run, the member a is still selected as the first member to run the Paxos algorithm. Member a, as the proposer, runs the Paxos algorithm for the second time, determines the second request proposal, determines the number of the request proposal as 1400000012_01, and determines that the value of the request proposal is C_new. Member a determines that the version number of the implementation of this Paxos algorithm is T+1. The member a sends a preparation request to all members of the C_middle, and the preparation request carries the version number T+1 and the number of the second request proposal.
C_old中作为接受者的所有成员收到此准备请求,例如所有成员均作为接受者。成员a收到此准备请求后,判断此准备请求中携带的编号为1400000012_01,大于此成员响应过的最后一个请求提案的编号1400000011_01,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000012_01,将保存的版本号更新为T+1。成员b收到此准备请求后,判断此准备请求中携带的编号1400000012_01大于此成员响应过的最后一个请求提案的编号1400000011_01,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000012_01,将保存的版本号更新为T+1。成员c收到此准备请求后,判断此准备请求中携带的编号为1400000012_01大于此成员响应过的最后一个请求提案的编号1400000011_01,并且判断准备请求中的版本号大于其保存的版本号,则通过此提案,返回对准备请求的响应,并将响应过的最后一个请求提案的编号更新为1400000012_01。All members of C_old who are recipients receive this preparation request, for example, all members are recipients. After receiving the preparation request, member a determines that the number carried in the preparation request is 1400000012_01, which is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member. With this proposal, the response to the preparation request is returned, and the number of the last requested request that was responded is updated to 1400000012_01, and the saved version number is updated to T+1. After receiving the preparation request, the member b determines that the number 1400000012_01 carried in the preparation request is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member, and then passes the The proposal returns a response to the preparation request and updates the number of the last requested proposal that was responded to 1400000012_01, updating the saved version number to T+1. After receiving the preparation request, the member c determines that the number carried in the preparation request is 1400000012_01 is greater than the number 1400000011_01 of the last request proposal that the member has responded to, and determines that the version number in the preparation request is greater than the version number saved by the member. This proposal returns a response to the prepare request and updates the number of the last requested request that was responded to 1400000012_01.
成员a收到C_middle中多数派(C_middle的多数派为C_old多数派和C_new的多数派)的对准备请求的响应后,向作为接受者的成员发送接受请求,在此接受请求中携带版本号T+1、第二请求提案的编号1400000012_01和第二请求提案的值C_new。C_middle中作为接受者的成员收到此接受请求后,判断当前接受请求中的版本号大于其保存的版本号,而且还未对编号大于1400000012_01的准备请求作出响应,就对此接受请求作出响应,并更新其保存的版本号为接受请求中的版本号。Member a receives the response to the preparation request from the majority in C_middle (the majority of C_middle is C_old majority and C_new), and then sends an acceptance request to the member who is the recipient, and carries the version number T in the acceptance request. +1, the number of the second request proposal 1400000012_01 and the value of the second request proposal C_new. After receiving the acceptance request, the member who is the recipient of C_middle determines that the version number in the current acceptance request is greater than the version number it has saved, and has not responded to the preparation request with the number greater than 1400000012_01, and responds to the request. And update its saved version number to accept the version number in the request.
成员a收到C_middle中多数派的对接受请求的响应后,确定C_middle中多数派通过此第二请求提案。After member a receives the response from the majority in C_middle to accept the request, it determines that the majority in C_middle passes the second request proposal.
成员a向C_middle中所有成员发送通知请求,C_new中作为学习者的成员学习第二请求提案后,至此C_new成功被C_middle选定。Member a sends a notification request to all members of C_middle. After C_new learns the second request proposal as a member of the learner, C_new is successfully selected by C_middle.
在整个变更的过程中任意一步都可以中断,都不影响集群提供正常的服务,由于不要求C-old和C-new有交集,所有可以同时变更多个成员,而且算法的一致性由Paxos本身来保证。Any step in the whole process of change can be interrupted without affecting the cluster to provide normal services. Since C-old and C-new are not required to intersect, all members can be changed at the same time, and the consistency of the algorithm is determined by Paxos. It is guaranteed by itself.
本发明可以在无需中止集群服务的情况下一次性完成一个成员组中多个成员的替换,可有效提高集群服务的智能性和有效性。The invention can complete the replacement of multiple members in one member group at one time without stopping the cluster service, and can effectively improve the intelligence and effectiveness of the cluster service.
本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者 等同替换,而不脱离本发明技术方案的精神和范围,均应涵盖在权利要求范围当中。It should be understood by those skilled in the art that the present invention may be modified or equivalently substituted without departing from the spirit and scope of the invention.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and functional blocks/units of the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components work together. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer readable medium, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer. Moreover, it is well known to those skilled in the art that communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
工业实用性Industrial applicability
本文中可以在无需中止集群服务的情况下一次性完成一个成员组中多个成员的替换,可有效提高集群服务的智能性和有效性。In this paper, the replacement of multiple members in a member group can be completed at one time without stopping the cluster service, which can effectively improve the intelligence and effectiveness of the cluster service.

Claims (15)

  1. 一种成员组变更方法,其特征在于,包括:A method for changing a member group, comprising:
    接收针对初始集群成员组的变更请求,根据所述初始集群成员组和所述变更请求确定目标集群成员组,根据所述初始集群成员组和所述目标集群成员组设置过渡集群成员组,所述过渡集群成员组中包括第一组和第二组,所述第一组包括所述初始集群成员组中的所有成员,所述第二组包括所述目标集群成员组中的所有成员;Receiving a change request for the initial cluster member group, determining a target cluster member group according to the initial cluster member group and the change request, and setting a transition cluster member group according to the initial cluster member group and the target cluster member group, The transition cluster member group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
    所述初始集群成员组执行一致性算法,将所述初始集群成员组更新为所述过渡集群成员组;Performing a consistency algorithm on the initial cluster member group, and updating the initial cluster member group to the transition cluster member group;
    所述过渡集群成员组执行所述一致性算法,将所述过渡集群成员组更新为所述目标集群成员组。The transition cluster member group executes the consistency algorithm, and updates the transition cluster member group to the target cluster member group.
  2. 如权利要求1所述的成员组变更方法,其特征在于,A member group changing method according to claim 1, wherein
    所述初始集群成员组执行一致性算法,将所述初始集群成员组更新为所述过渡集群成员组包括:所述初始集群成员组中接收到变更请求的成员设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置所述第一请求提案的值为所述过渡集群成员组,设置执行此次一致性算法的版本号,向所述初始集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第一请求提案的编号和所述第一请求提案的值;所述初始集群成员组执行所述一致性算法直至所述初始集群成员组的多数派通过所述第一请求提案。The initial cluster member group performs a consistency algorithm, and updating the initial cluster member group to the transition cluster member group includes: setting a first request proposal by a member that receives the change request in the initial cluster member group, to preset The incrementing rule sets the number of the first request proposal, sets the value of the first request proposal to the transition cluster member group, sets the version number of the execution of the consistency algorithm, and accepts all the values in the initial cluster member group. The member sends at least one request, the at least one request carrying the version number, the number of the first request proposal, and the value of the first request proposal; the initial cluster member group executes the consistency algorithm Until the majority of the initial cluster member group passes the first request proposal.
  3. 如权利要求1所述的成员组变更方法,其特征在于,A member group changing method according to claim 1, wherein
    所述过渡集群成员组执行所述一致性算法,将所述过渡集群成员组更新为所述目标集群成员组包括:所述过渡集群成员组中的一成员设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置所述第二请求提案的值为目标集群成员组,设置执行此次一致性算法的版本号,向所述过渡集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第二请求提案的编号和所述第二请求提案的值;所述过渡集群成员组执行所述一致性算法直至所述过渡集群成员组的多数派通过所述第二请求提案。The transition cluster member group executes the consistency algorithm, and updating the transition cluster member group to the target cluster member group includes: setting a second request proposal by a member of the transition cluster member group, by a preset increment The rule sets the number of the second request proposal, sets the value of the second request proposal to the target cluster member group, sets the version number of the execution of the consistency algorithm, and assigns all members in the transition cluster member group as recipients Sending at least one request, the at least one request carrying the version number, the number of the second request proposal, and the value of the second request proposal; the transition cluster member group executing the consistency algorithm until the The majority of the transition cluster member group passes the second request proposal.
  4. 如权利要求2所述的成员组变更方法,其特征在于,The member group changing method according to claim 2, wherein
    所述步骤2中还包括:所述初始集群成员组执行所述一致性算法直至所述初始集群成员组的多数派通过所述第一请求提案后,接收到变更请求的成员向所述过渡集群成员组中所有成员发送携带版本号的通知请求,所述过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第一请求提案的值,至此,所述过渡集群成员组成功被所述初始集群成员组选定。The step 2 further includes: the initial cluster member group executing the consistency algorithm until the majority of the initial cluster member group passes the first request proposal, and the member receiving the change request goes to the transition cluster All members in the member group send a notification request carrying a version number. After the member of the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member, the first request proposal is learned. Updating the saved current version number to the version number in the notification request and updating the value of the saved proposal is the value of the first request proposal, and thus the transition cluster member group is successfully selected by the initial cluster member group.
  5. 如权利要求3所述的成员组变更方法,其特征在于,A member group changing method according to claim 3, wherein
    所述步骤3中还包括:所述过渡集群成员组执行所述一致性算法直至所述过渡集群成员组的多数派通过所述第二请求提案后,设置第二请求提案的成员向所述过渡集群成员组中所有成员发送携带版本号的通知请求,所述过渡集群成员组中作为学习者的成员判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第二请求提案的值,至此,所述目标集群成员组成功被所述过渡集群成员组成功选定。The step 3 further includes: the transition cluster member group executing the consistency algorithm until the majority of the transition cluster member group passes the second request proposal, and setting a member of the second request proposal to the transition All members in the cluster member group send a notification request carrying a version number, and the member in the transition cluster member group determines that the version number in the notification request is greater than the current version number saved by the member in the transition cluster member group, and learns the second request proposal. After updating the saved current version number to the version number in the notification request and updating the value of the saved proposal to the value of the second request proposal, the target cluster member group is successfully selected by the transition cluster member group. set.
  6. 如权利要求2所述的成员组变更方法,其特征在于,The member group changing method according to claim 2, wherein
    所述步骤2中还包括:所述初始集群成员组执行所述一致性算法后,所述初始集群成员组中接收变更请求的成员判断所述初始集群成员组的多数派是否通过所述第一请求提案,如果否,以预设递增规则设置所述第一请求提案的编号,将更新编号的第一请求提案发送至所述初始集群中所有成员,依照此方式执行,直至所述初始集群成员组的多数派通过所述第一请求提案。The step 2 further includes: after the initial cluster member group executes the consistency algorithm, the member that receives the change request in the initial cluster member group determines whether the majority of the initial cluster member group passes the first Requesting a proposal, if not, setting the number of the first request proposal by a preset incremental rule, and sending the first request proposal of the updated number to all members in the initial cluster, and executing in this manner until the initial cluster member The majority of the group passes the first request proposal.
  7. 如权利要求3所述的成员组变更方法,其特征在于,A member group changing method according to claim 3, wherein
    所述步骤3中还包括:所述过渡集群成员组执行所述一致性算法后,所述过渡集群成员组中发送请求的成员判断所述过渡集群成员组的多数派是否通过所述第二请求提案,如果否,以预设递增规则设置所述第二请求提案的编号,将更新编号的第二请求提案发送至所述初始集群中所有成员,依照此方式执行,直至所述初始集群成员组的多数派通过所述第二请求提案。The step 3 further includes: after the transition cluster member group executes the consistency algorithm, the member sending the request in the transition cluster member group determines whether the majority of the transition cluster member group passes the second request Proposal, if not, setting the number of the second request proposal by a preset increment rule, and sending the second request proposal of the update number to all members in the initial cluster, and executing in this manner until the initial cluster member group The majority sent the proposal through the second request.
  8. 如权利要求1所述的成员组变更方法,其特征在于,A member group changing method according to claim 1, wherein
    所述变更请求中包括变更类型和变更类型对应的成员,所述变更类型包括增加和/或删除。The change request includes a member corresponding to the change type and the change type, and the change type includes adding and/or deleting.
  9. 一种成员组变更装置,其特征在于,应用于服务器中,包括:A member group changing device, which is applied to a server, and includes:
    变更请求接收模块,用于在所属服务器是初始集群成员组的成员时,接收针对初始集群成员组的变更请求;a change request receiving module, configured to receive a change request for an initial cluster member group when the belonging server is a member of the initial cluster member group;
    确定模块,用于根据所述初始集群成员组和所述变更请求确定目标集群成员组,根据所述初始集群成员组和所述目标集群成员组设置过渡集群成员组,所述过渡集群成员组中包括第一组和第二组,所述第一组包括所述初始集群成员组中的所有成员,所述第二组包括所述目标集群成员组中的所有成员;a determining module, configured to determine a target cluster member group according to the initial cluster member group and the change request, and set a transition cluster member group according to the initial cluster member group and the target cluster member group, where the transition cluster member group is configured The first group includes a first group and a second group, the first group includes all members in the initial cluster member group, and the second group includes all members in the target cluster member group;
    执行模块,用于执行一致性算法直至所述初始集群成员组更新为所述过渡集群成员组;还用于在所属服务器是所述过渡集群成员组的成员时,再次执行所述一致性算法直至所述过渡集群成员组更新为所述目标集群成员组。An execution module, configured to execute the consistency algorithm until the initial cluster member group is updated to the transition cluster member group; and is further configured to execute the consistency algorithm again when the belonging server is a member of the transition cluster member group The transition cluster member group is updated to the target cluster member group.
  10. 如权利要求9所述的成员组变更装置,其特征在于,A member group changing device according to claim 9, wherein:
    所述执行模块包括第一单元和第二单元;The execution module includes a first unit and a second unit;
    所述第一单元,用于在所属服务器为所述初始集群成员组中接收到变更请求的成员时,设置第一请求提案,以预设递增规则设置此第一请求提案的编号,设置所述第一请求提案的值为所述过渡集群成员组,设置执行此次一致性算法的版本号,向所述初始集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第一请求提案的编号和所述第一请求提案的值;还用于在收到所述初始集群成员组中其它成员对所述请求的响应后,执行所述一致性算法中作为提案人角色的部分;The first unit is configured to: when the belonging server receives the member of the change request for the initial cluster member group, set a first request proposal, set a number of the first request proposal by using a preset incremental rule, and set the The value of the first request proposal is the transition cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the initial cluster member group as recipients, the at least one request Carrying the version number, the number of the first request proposal, and the value of the first request proposal; and further, after receiving the response of the other members in the initial cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
    所述第二单元,用于在所属服务器为所述初始集群成员组中除了接收到变更请求的成员的其它成员时,在接收到所述初始集群成员组中作为提案人角色的成员发送的至少一次请求后,执行所述一致性算法中作为接受者角色的部分。The second unit is configured to: when the belonging server is the other member of the initial cluster member group, in addition to receiving the member of the change request, send at least the member that is the proposer role in the initial cluster member group After a request, the part of the consistency algorithm that is the recipient role is executed.
  11. 如权利要求9所述的成员组变更装置,其特征在于,A member group changing device according to claim 9, wherein:
    所述执行模块包括第一单元和第二单元;The execution module includes a first unit and a second unit;
    所述第一单元,用于在所属服务器为所述过渡集群成员组中作为提案人角色的成员时,设置第二请求提案,以预设递增规则设置此第二请求提案的编号,设置所述第二请求提案的值为所述目标集群成员组,设置执行此次一致性算法 的版本号,向所述过渡集群成员组中所有作为接受者的成员发送至少一次请求,所述至少一次请求中携带所述版本号、所述第二请求提案的编号和所述第二请求提案的值;还用于在收到所述过渡集群成员组中其它成员对所述请求的响应后,执行所述一致性算法中作为提案人角色的部分;The first unit is configured to: when the belonging server is a member of the sponsoring role in the transition cluster member group, set a second request proposal, set a number of the second request proposal by using a preset incremental rule, and set the The value of the second request proposal is the target cluster member group, setting a version number for executing the consistency algorithm, and sending at least one request to all members in the transition cluster member group as recipients, the at least one request Carrying the version number, the number of the second request proposal, and the value of the second request proposal; and further, after receiving the response of the other members in the transition cluster member group to the request, performing the Part of the role of the proposer in the consistency algorithm;
    所述第二单元,用于在所属服务器为所述过渡集群成员组中除了所述发送所述至少一次请求的成员的其它成员时,在接收到所述过渡集群成员组中作为提案人角色的成员发送的至少一次请求后,执行所述一致性算法中作为接受者角色的部分。The second unit is configured to: when the belonging server is the transition cluster member group, in addition to the sending the other members of the at least one requested member, in the receiving the transition cluster member group as a proposer role After at least one request sent by the member, the part of the consistency algorithm that is the recipient role is executed.
  12. 如权利要求10所述的成员组变更装置,其特征在于,A member group changing device according to claim 10, wherein:
    所述第一单元,还用于在所属服务器为所述初始集群成员组中作为提案人角色的成员时,在所述初始集群成员组的多数派通过所述第一请求提案后,向所述过渡集群成员组中所有成员发送携带版本号的通知请求;The first unit is further configured to: when the belonging server is a member of the sponsor role in the initial cluster member group, after the majority of the initial cluster member group passes the first request proposal, All members in the transition cluster member group send a notification request carrying the version number;
    所述第二单元,还用于在所属服务器为所述过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第一请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第一请求提案的值。The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the first request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the first request proposal.
  13. 如权利要求11所述的成员组变更装置,其特征在于,A member group changing device according to claim 11, wherein:
    所述第一单元,还用于在所属服务器为所述过渡集群成员组中作为提案人角色的成员时,在所述过渡集群成员组的多数派通过所述第二请求提案后,向所述过渡集群成员组中所有成员发送携带版本号的通知请求;The first unit is further configured to: when the belonging server is a member of the sponsor role in the transition cluster member group, after the majority of the transition cluster member group passes the second request proposal, All members in the transition cluster member group send a notification request carrying the version number;
    所述第二单元,还用于在所属服务器为所述过渡集群成员组中作为学习者的成员时,判断此通知请求中的版本号大于其保存的当前版本号后,学习所述第二请求提案后更新其保存的当前版本号为通知请求中的版本号并更新保存的提案的值为所述第二请求提案的值。The second unit is further configured to: when the belonging server is a member of the learner in the transition cluster member group, determine that the version number in the notification request is greater than the saved current version number, and learn the second request. After the proposal is updated, the current version number saved is the version number in the notification request and the value of the updated proposal is updated to the value of the second request proposal.
  14. 一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述程序被处理器执行时实现权利要求1至8中任意一项所述方法的步骤。A computer readable storage medium having stored thereon a computer program, the program being executed by a processor to perform the steps of the method of any one of claims 1-8.
  15. 一种计算机设备,其特征在于,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至8中任意一项所述方法的步骤。A computer device, comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the program to implement the claims 1 to 8 The steps of any of the methods described.
PCT/CN2018/078989 2017-03-17 2018-03-14 Member group change method and apparatus, medium, and computer device WO2018166474A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710161757.2 2017-03-17
CN201710161757.2A CN107707595B (en) 2017-03-17 2017-03-17 A kind of member organizes variation and device

Publications (1)

Publication Number Publication Date
WO2018166474A1 true WO2018166474A1 (en) 2018-09-20

Family

ID=61169548

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078989 WO2018166474A1 (en) 2017-03-17 2018-03-14 Member group change method and apparatus, medium, and computer device

Country Status (2)

Country Link
CN (1) CN107707595B (en)
WO (1) WO2018166474A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707595B (en) * 2017-03-17 2018-06-15 贵州白山云科技有限公司 A kind of member organizes variation and device
CN111930840B (en) * 2020-08-06 2024-09-13 平安科技(深圳)有限公司 Method and system for optimizing consensus mechanism based on Paxos algorithm and blockchain network

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162588A1 (en) * 2005-09-26 2007-07-12 Huawei Technologies Co., Ltd. Method and system for adding group member
CN101072390A (en) * 2006-05-12 2007-11-14 中兴通讯股份有限公司 Dynamic group management method for digital trunking communication system
WO2009015526A1 (en) * 2007-08-01 2009-02-05 Zte Corporation Method for triggering group information synchronization in real time on network side in cluster communication system
CN101674662A (en) * 2008-09-11 2010-03-17 中兴通讯股份有限公司 Method for establishing temporary group in digital trunking system
CN102124697A (en) * 2008-08-18 2011-07-13 F5网络公司 Upgrading network traffic management devices while maintaining availability
US20150120887A1 (en) * 2013-10-31 2015-04-30 International Business Machines Corporation Deploying a cluster
CN107707595A (en) * 2017-03-17 2018-02-16 贵州白山云科技有限公司 A kind of member organizes variation and device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5491835A (en) * 1994-02-18 1996-02-13 Motorola, Inc. Method for maintaining audience continuity of a communication group call
US7076645B2 (en) * 2003-06-25 2006-07-11 Nokia Inc. Method of rebooting a multi-device cluster while maintaining cluster operation
US20050289228A1 (en) * 2004-06-25 2005-12-29 Nokia Inc. System and method for managing a change to a cluster configuration
CN101540957A (en) * 2008-03-19 2009-09-23 中兴通讯股份有限公司 Cluster terminal with authority and method for realizing group member management
CN101272341B (en) * 2008-05-27 2011-11-09 杭州华三通信技术有限公司 Method, device, distributed system and routing device for implementing hardware multicast under distributed structure
CN102083008A (en) * 2009-11-27 2011-06-01 中兴通讯股份有限公司 Method and system for dynamic management of colony terminal automatic grouping members
CN102075456B (en) * 2011-02-25 2013-06-19 中国科学院计算技术研究所 Group creating and member adding method in distributed domain management system
CN102833692A (en) * 2011-06-15 2012-12-19 中兴通讯股份有限公司 Method and server for managing cluster in digital cluster system by user
CN102882927B (en) * 2012-08-29 2016-12-21 华南理工大学 A kind of cloud storage data syn-chronization framework and its implementation
CN103916426B (en) * 2012-12-31 2017-06-27 北京新媒传信科技有限公司 A kind of paxos examples update method, equipment and system
CN104483828A (en) * 2014-12-04 2015-04-01 中国航空工业集团公司第六三一研究所 Distributed fault tolerance computer member consistency ensuring method
CN106302700B (en) * 2016-08-11 2019-09-24 浪潮(北京)电子信息产业有限公司 Distributed system consistent update method and system based on paxos algorithm

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162588A1 (en) * 2005-09-26 2007-07-12 Huawei Technologies Co., Ltd. Method and system for adding group member
CN101072390A (en) * 2006-05-12 2007-11-14 中兴通讯股份有限公司 Dynamic group management method for digital trunking communication system
WO2009015526A1 (en) * 2007-08-01 2009-02-05 Zte Corporation Method for triggering group information synchronization in real time on network side in cluster communication system
CN102124697A (en) * 2008-08-18 2011-07-13 F5网络公司 Upgrading network traffic management devices while maintaining availability
CN101674662A (en) * 2008-09-11 2010-03-17 中兴通讯股份有限公司 Method for establishing temporary group in digital trunking system
US20150120887A1 (en) * 2013-10-31 2015-04-30 International Business Machines Corporation Deploying a cluster
CN107707595A (en) * 2017-03-17 2018-02-16 贵州白山云科技有限公司 A kind of member organizes variation and device

Also Published As

Publication number Publication date
CN107707595A (en) 2018-02-16
CN107707595B (en) 2018-06-15

Similar Documents

Publication Publication Date Title
US10657119B1 (en) Fleet node management system
US20090150566A1 (en) Virtually synchronous paxos
JP3554471B2 (en) Group event management method and apparatus in a distributed computer environment
US10282457B1 (en) Distributed transactions across multiple consensus groups
CN104850416B (en) A kind of upgrade-system, method, apparatus and cloud computing node
WO2017088572A1 (en) Data processing method, device, and system
US9760529B1 (en) Distributed state manager bootstrapping
CN112148798A (en) Data processing method and device applied to distributed system
EP4191429A1 (en) Techniques to achieve cache coherency across distributed storage clusters
WO2018166474A1 (en) Member group change method and apparatus, medium, and computer device
CN110865907A (en) Method and system for providing service redundancy between master server and slave server
US11451465B1 (en) In-order fault tolerant consensus logs for replicated services
US11522966B2 (en) Methods, devices and systems for non-disruptive upgrades to a replicated state machine in a distributed computing environment
CN112650561B (en) Transaction management method, system, network device and readable storage medium
EP3721604B1 (en) Automatic subscription management of computing services
US20220286229A1 (en) Safely overwriting decided slots
US7437426B2 (en) Detecting and correcting node misconfiguration of information about the location of shared storage resources
US11637749B1 (en) Metadata synchronization for remote managed systems
CN113890875B (en) Task allocation method and device
US11876682B2 (en) Consensus-based node retirement process in a mesh
US11513717B2 (en) Online data rehydration
PETRESCU LEADER ELECTION IN A CLUSTER USING ZOOKEEPER.
CN116775314A (en) Asynchronous processing method, device and equipment
CN119728378A (en) Method and device for implementing double-machine-room arbitration system based on distributed key value storage library
TWI421677B (en) A transaction processing method for a cluster

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18767407

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18767407

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载