Search

CN-121984844-A - Distributed cluster node management method, system and equipment

CN121984844ACN 121984844 ACN121984844 ACN 121984844ACN-121984844-A

Abstract

The application provides a distributed cluster node management method, a system and equipment, wherein the cluster comprises a master management node and a plurality of candidate management nodes, and the method comprises the steps of obtaining the running state of the master management node and monitoring the running state of the master management node; the method comprises the steps of determining a main management node to be in fault according to the running state of the main management node, initiating proposal after delaying random time for each candidate management node to obtain proposal initiating time corresponding to each candidate management node, determining a target management node from the candidate management nodes according to the proposal initiating time, taking the target management node as a new main management node, obtaining configuration information corresponding to the new main management node, and broadcasting the configuration information to all nodes in the cluster.

Inventors

  • LEI XINJIAN
  • FU LINLI
  • BAO PENGFEI
  • Bao Lize

Assignees

  • 浙江睿数云联科技有限公司

Dates

Publication Date
20260505
Application Date
20231213

Claims (10)

  1. 1. A method of managing nodes of a distributed cluster, wherein the cluster includes a master management node and a plurality of candidate management nodes, the method comprising the steps of: acquiring the running state of the master management node, and monitoring the running state of the master management node; responding to the fact that the master management node is determined to be faulty according to the running state of the master management node, and initiating proposal after delaying random time for each candidate management node to obtain proposal initiating time corresponding to each candidate management node; determining a target management node from the candidate management nodes according to the proposal initiating time, and taking the target management node as a new master management node; and acquiring configuration information corresponding to the new master management node, and broadcasting the configuration information to all nodes in the cluster.
  2. 2. The distributed cluster node management method according to claim 1, wherein the determining a target management node from the candidate management nodes according to the proposal initiation time includes: And determining the candidate management node with the earliest proposal initiating time as a target management node.
  3. 3. The distributed cluster node management method of claim 1, wherein prior to said determining a target management node from said candidate management nodes according to said proposal initiation time, said method further comprises: triggering and executing proposal initiating actions on each candidate management node according to the proposal initiating time, and receiving first proposal responses corresponding to each proposal initiating action; The determining a target management node from the candidate management nodes according to the proposal initiating time comprises the following steps: And determining a target management node from the candidate management nodes according to the proposal initiating time and the first proposal response.
  4. 4. The method for managing distributed cluster nodes according to claim 3, wherein the type of the first proposal response is either a positive response or a negative response, wherein the determining a target management node from the candidate management nodes according to the proposal initiation time and the first proposal response comprises: taking the candidate management node with the earliest proposal initiation time as a first initial management node; and when the proportion of the number of the first proposal responses which are received by the first initial management node and are of the positive responses to all the candidate management nodes is larger than a first preset threshold value, determining the first initial management node as a target management node.
  5. 5. The distributed cluster node management method according to claim 1, wherein the determining a target management node from the candidate management nodes according to the proposal initiation time includes: Determining a second initial management node from the candidate management nodes according to the proposal initiating time; responding to the second proposal response made by other candidate management nodes when the second initial management node sends proposal preparation requests to other candidate management nodes, wherein the type of the second proposal response is positive response or negative response; when the proportion of the response quantity of the type of positive response in the second proposal response to all the candidate management nodes is larger than a second preset threshold value, determining all the candidate management nodes making positive response as intermediate management nodes; The second initial management node sends a proposal receiving request to the intermediate management node; acquiring a third proposal response of the intermediate management node for proposal receiving request, wherein the type of the third proposal response is positive response or negative response; And determining the candidate management node with the earliest proposal initiating time and the response quantity of the positive response type in the corresponding third proposal response, which is larger than a third preset threshold value in proportion of all the intermediate management nodes, as a target management node.
  6. 6. The method of claim 1, wherein each proposal has an attribute value pair, the attribute value pair including a proposal number, wherein determining a target management node from the candidate management nodes based on the proposal initiation time comprises: and determining the candidate management node with the earliest proposal initiating time and meeting the preset rule as a target management node, wherein the preset rule is that the numerical value corresponding to the proposal number of the target management node is larger than or equal to the numerical values corresponding to the proposal numbers of the other candidate management nodes.
  7. 7. The method for managing distributed cluster nodes according to claim 1, wherein said cluster further comprises a plurality of working nodes, said method further comprising the steps of: And determining a target working node from the working nodes according to a preset strategy in response to the number of the candidate management nodes being smaller than a fourth preset threshold, and taking the target working node as a new candidate management node.
  8. 8. The distributed cluster node management method according to claim 7, wherein the preset policy is to randomly select one working node as the target working node from working nodes located at different sites and on different racks from all candidate management nodes.
  9. 9. A distributed cluster node management system for implementing the distributed cluster node management method of claim 1, the system comprising: The first state monitoring module is used for acquiring the running state of the master management node and monitoring the running state of the master management node; The proposal initiation time processing module is used for responding to the fact that the master management node is determined to be faulty according to the running state of the master management node, initiating proposal after delaying random time for each candidate management node, and obtaining proposal initiation time corresponding to each candidate management node; A master management node election module for determining a target management node from the candidate management nodes according to the proposal initiating time, and taking the target management node as a new master management node, and And the cluster broadcasting module is used for acquiring configuration information corresponding to the new master management node and broadcasting the configuration information to all nodes in the cluster.
  10. 10. A distributed cluster node management apparatus, comprising: A processor; A memory in which an executable program of the processor is stored; wherein the processor is configured to perform the steps of the distributed cluster node management method of any of claims 1 to 8 via execution of the executable program.

Description

Distributed cluster node management method, system and equipment Technical Field The present invention relates to the field of distributed cluster management technologies, and in particular, to a method, a system, and an apparatus for managing distributed cluster nodes. Background With the continuous development of social networks, mobile internet, e-commerce and other technologies, internet users have contributed more and more content. To handle this, distributed cluster systems are currently in common use for data storage, computation, and value extraction. In order to guarantee the availability of services, this places high demands on the reliability and availability of the distributed cluster system. Currently, distributed cluster product software is basically a master-slave cluster architecture, and clusters are realized in a mode of basically one master-slave or one master-multiple slaves, and also a typical single-master centralized cluster architecture is adopted, and once a master management node fails, the whole cluster is usually in an unavailable state, so that great challenges are brought to service availability. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art. Disclosure of Invention Aiming at the problems in the prior art, the invention aims to provide a distributed cluster node management method, a system and equipment, which can rapidly select a new master management node for substitution when the current master management node fails, thereby ensuring the availability and unaware of service and being beneficial to ensuring the availability and reliability of the distributed cluster. To achieve the above object, the present invention provides a distributed cluster node management method, where the cluster includes a master management node and a plurality of candidate management nodes, and the method includes the steps of: acquiring the running state of the master management node, and monitoring the running state of the master management node; responding to the fact that the master management node is determined to be faulty according to the running state of the master management node, and initiating proposal after delaying random time for each candidate management node to obtain proposal initiating time corresponding to each candidate management node; determining a target management node from the candidate management nodes according to the proposal initiating time, and taking the target management node as a new master management node; and acquiring configuration information corresponding to the new master management node, and broadcasting the configuration information to all nodes in the cluster. Optionally, the determining, according to the proposal initiation time, a target management node from the candidate management nodes includes: And determining the candidate management node with the earliest proposal initiating time as a target management node. Optionally, before determining the target management node from the candidate management nodes according to the proposal initiation time, the method further includes: triggering and executing proposal initiating actions on each candidate management node according to the proposal initiating time, and receiving first proposal responses corresponding to each proposal initiating action; The determining a target management node from the candidate management nodes according to the proposal initiating time comprises the following steps: And determining a target management node from the candidate management nodes according to the proposal initiating time and the first proposal response. Optionally, the type of the first proposal response is positive response or negative response, and the determining the target management node from the candidate management nodes according to the proposal initiating time and the first proposal response comprises the following steps: taking the candidate management node with the earliest proposal initiation time as a first initial management node; and when the proportion of the number of the first proposal responses which are received by the first initial management node and are of the positive responses to all the candidate management nodes is larger than a first preset threshold value, determining the first initial management node as a target management node. Optionally, the determining, according to the proposal initiation time, a target management node from the candidate management nodes includes: Determining a second initial management node from the candidate management nodes according to the proposal initiating time; responding to the second proposal response made by other candidate management nodes when the second initial management node sends proposal preparation requests to other candi