WO2016127580A1 - 处理至少一个分布式集群中的故障的方法、设备和系统 - Google Patents

处理至少一个分布式集群中的故障的方法、设备和系统 Download PDF

Info

Publication number
WO2016127580A1
WO2016127580A1 PCT/CN2015/084573 CN2015084573W WO2016127580A1 WO 2016127580 A1 WO2016127580 A1 WO 2016127580A1 CN 2015084573 W CN2015084573 W CN 2015084573W WO 2016127580 A1 WO2016127580 A1 WO 2016127580A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
distributed cluster
standby
heartbeat message
master node
Prior art date
Application number
PCT/CN2015/084573
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP15881740.3A priority Critical patent/EP3247090B1/en
Publication of WO2016127580A1 publication Critical patent/WO2016127580A1/zh
Priority to US15/674,159 priority patent/US10560315B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection

Definitions

  • Embodiments of the present invention relate to the field of cluster management and, more particularly, to a method, apparatus, and system for processing a fault in at least one distributed cluster.
  • HA distributed clusters are usually centralized (Master nodes) and multiple slaves (Slave nodes).
  • the Master node sends heartbeat messages to all Slave nodes in the cluster.
  • Each Salve node in the cluster also sends a heartbeat message to the master node.
  • the Slave node determines whether the master node is faulty by detecting a heartbeat message sent by the master node.
  • the master node determines whether the Salve node is faulty by detecting a heartbeat message sent by the slave node.
  • the Salve node usually determines that the master node fails after multiple times determining that the heartbeat message of the master node is not received, and then initiates a new determination in the cluster.
  • the election policy of the master node Therefore, in the current technology, the fault detection time of the master node is too long.
  • the embodiments of the present invention provide a method, a device, and a system for processing a fault in at least one distributed cluster, which can effectively shorten the fault detection time.
  • the first aspect provides a method for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, The distributed cluster further includes a first reference node and a first standby node as a backup of the first master node, the method comprising:
  • a heartbeat message sent by the first reference node where the heartbeat message includes a first indication information indicating that the first reference node and the first master node are in a disconnected state;
  • the first standby node detects whether the heartbeat message sent by the first master node to the first standby node is interrupted
  • the first standby node determines that the first standby node and the first master node are also in a disconnected state
  • the first standby node determines that the first master node that is disconnected from both the first standby node and the first reference node fails.
  • the method further includes:
  • the first standby node sends a broadcast message to all the nodes in the first distributed cluster, where the broadcast message is used to indicate that the first standby node is upgraded to the first master node.
  • the first standby node detects that the first master node sends the first standby node to the first standby node Whether the heartbeat message is interrupted, including:
  • the first standby node detects whether a heartbeat message sent by the first master node is received between the first time and the second time, where the first time is that the first standby node receives the first reference node and includes The time of the heartbeat message of the first indication information, the second time is earlier than the first time, and the time interval between the first time and the second time is that the first master node sends a heartbeat to the first standby node. N times the heartbeat period of the message, N is a positive integer.
  • the at least one distributed cluster further includes a second distributed cluster
  • the second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node.
  • the method further includes:
  • the first standby node receives a heartbeat message sent by the second reference node, where the heartbeat message includes second indication information indicating that the node attribute of the receiving end of the heartbeat message is a slave node, and the second reference node is configured to respectively
  • the second slave node and all the nodes in the first distributed cluster send a heartbeat message including the second indication information, the second distributed cluster and the first distribution Clusters have the same cluster identity;
  • the second distributed cluster where the second reference node is located and the first distributed cluster where the first standby node is located are two sub-clusters formed by splitting one network distributed cluster;
  • the first standby node negotiates with the second standby node in the second distributed cluster to facilitate integration of the first distributed cluster and the second distributed cluster.
  • the first standby node negotiates with the second standby node in the second distributed cluster, including:
  • the first standby node receives the negotiation message sent by the second standby node, where the negotiation message includes information for indicating the weight of the second standby node, where the negotiation message is that the second standby node detects the broadcast message indication
  • the node attribute is sent to the first standby node if the node attribute is the same as the node attribute of the node;
  • the first standby node After determining that the weight of the first standby node is greater than or equal to the weight of the second standby node, the first standby node sends a negotiation response to the second standby node to indicate that the second standby node is downgraded to a slave node.
  • the second aspect provides a method for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, The first distributed cluster further includes a first reference node and a first standby node that is a backup of the first master node, and the method includes:
  • the first master node detects whether the heartbeat message sent by the first slave node to the first master node is interrupted
  • the first master node determines that the first master node and the first slave node are also in a disconnected state
  • the first master node determines that the first slave node that is disconnected from both the first master node and the first standby node fails.
  • the first master node detects whether the heartbeat message sent by the first slave node to the first master node is interrupted, including:
  • the first master node detects whether a heartbeat message sent by the first slave node is received between the third time and the fourth time, where the third time is that the first master node receives the first standby node and includes The time of the heartbeat message of the third indication information, the fourth time is earlier than the third time, and the time interval between the third time and the fourth time is that the first slave node sends a heartbeat to the first master node N times the heartbeat period of the message, N is a positive integer.
  • the method further includes:
  • the first master node detects whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received in a preset detection period, where the preset detection period is M times of a heartbeat period of sending a heartbeat message. , M is a positive integer;
  • the first master node determines the first standby node and The first reference node has failed.
  • the at least one distributed cluster further includes a second distributed cluster
  • the second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node.
  • the method further includes:
  • a heartbeat message sent by the second reference node where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively
  • the second slave node and all the nodes in the first distributed cluster send a heartbeat message including the fourth indication information, the second distributed cluster and the first point A tile cluster has the same cluster identity;
  • the second distributed cluster where the second reference node is located and the first distributed cluster where the first master node is located are two sub-clusters formed by splitting one network distributed cluster;
  • the first master node negotiates with the second master node in the second distributed cluster to facilitate integration of the first distributed cluster and the second distributed cluster.
  • the first master node negotiates with the second master node in the second distributed cluster, including:
  • the first master node receives the negotiation message sent by the second master node, where the negotiation message includes information for indicating the weight of the second master node, where the negotiation message is that the second master node detects the broadcast message indication.
  • the node attribute is sent to the first master node if the node attribute is the same as the node attribute of the node;
  • the first master node When determining that the weight of the first master node is greater than or equal to the weight of the second master node, the first master node sends a negotiation response message to the second master node to indicate that the second master node is downgraded to a slave node;
  • the first master node When it is determined that the weight of the first master node is less than the weight of the second master node, the first master node sends the first master node to all the nodes in the first distributed cluster and the second distributed cluster to indicate the first master.
  • the node is downgraded to a broadcast message of the slave node.
  • a third aspect provides an apparatus for processing a fault in at least one distributed cluster, the at least one distributed cluster comprising a first distributed cluster, the first distributed cluster including a first master node and a first slave a node, the distributed cluster further includes a first reference node, and a first standby node that is a backup of the first master node, where the first reference node is configured to detect the first master node to the first
  • the heartbeat message sent by the reference node is interrupted
  • the heartbeat message is sent to the first standby node, where the heartbeat message includes first indication information indicating that the first reference node is in a disconnected state with the first master node, where
  • the device is the first standby node, and the device includes:
  • a first receiving module configured to receive a heartbeat message that is sent by the first reference node and includes the first indication information
  • a first determining module configured to determine, according to the first indication information received by the first receiving module, that the first reference node and the first master node are in a disconnected state
  • a detecting module configured to detect whether a heartbeat message sent by the first master node to the device is interrupted
  • a second determining module configured to: when the detecting module detects that the heartbeat message sent by the first master node to the device is interrupted, determining that the device and the first master node are also in a disconnected state;
  • the third determining module is configured to determine that the first master node is faulty according to the result determined by the first determining module and the second determining module.
  • the device further includes:
  • a sending module configured to send a broadcast message to all nodes in the first distributed cluster, where the third determining module determines that the first master node is faulty, the broadcast message is used to indicate that the device is upgraded to the first Master node.
  • the detecting module is specifically configured to detect whether between the first time and the second time Receiving a heartbeat message sent by the first master node, where the first time is a time when the device receives the heartbeat message that is sent by the first reference node and includes the first indication information, where the second time is earlier than the first time
  • the time interval between the first time and the second time is N times the heartbeat period of the heartbeat message sent by the first master node to the device, where N is a positive integer.
  • the at least one distributed cluster further includes a second distributed cluster, where The second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node, and the device further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes second indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the second indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fourth determining module configured to determine, according to the second indication information received by the second receiving module The node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node does not match the node attribute of the device, and determines that the second distributed cluster where the second reference node is located and the device where the second reference node is located
  • a distributed cluster is a two sub-cluster formed by splitting a network distributed cluster
  • the negotiation module is configured to negotiate with the second standby node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that a node attribute of the device is a standby node
  • a receiving unit configured to receive a negotiation message sent by the second standby node, where the negotiation message includes information for indicating a weight of the second standby node, where the negotiation message is that the second standby node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second standby node, a negotiation response message for indicating that the second standby node is downgraded to a slave node, if the weight of the device is determined to be greater than or equal to the weight of the second standby node.
  • a third sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, the device to be downgraded to be determined, if the weight of the device is less than the weight of the second standby node Broadcast message of the Slave node.
  • a fourth aspect provides an apparatus for processing a fault in at least one distributed cluster, the at least one distributed cluster comprising a first distributed cluster, the first distributed cluster including a first master node and a first slave a node, wherein the first distributed cluster further includes a first reference node and a first standby node that is a backup of the first master node, where the first standby node is configured to detect the first slave node If the heartbeat message sent by the first standby node is interrupted, the heartbeat message is sent to the first master node, where the heartbeat message includes a third indication that the first standby node is in a disconnected state with the first slave node.
  • Information the device is the first master node, and the device includes:
  • a first receiving module configured to receive a heartbeat message that is sent by the first standby node and includes the third indication information
  • a first determining module configured to determine, according to the third indication information received by the first receiving module The first standby node and the first slave node are in a disconnected state;
  • a first detecting module configured to detect whether a heartbeat message sent by the first slave node to the device is interrupted
  • a second determining module configured to: when the first detecting module detects that the heartbeat message sent by the first slave node to the device is interrupted, determining that the device and the first slave node are also in a disconnected state;
  • the third determining module is configured to determine that the first slave node is faulty according to the result determined by the first determining module and the second determining module.
  • the first detecting module is configured to detect whether a heartbeat sent by the first slave node is received between the third time and the fourth time a third time, where the device receives the heartbeat message that is sent by the first standby node and includes the third indication information, where the fourth time is earlier than the third time, the third time and the fourth time
  • the time interval between the times is N times the heartbeat period of the heartbeat message sent by the first slave node to the device, and N is a positive integer.
  • the device further includes:
  • a second detecting module configured to detect, in a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the preset detection period is a heartbeat period of sending a heartbeat message M times, M is a positive integer;
  • a fourth determining module configured to: when the second detecting module receives neither the heartbeat message sent by the first standby node nor the heartbeat message sent by the first reference node in the preset detecting period And determining that both the first standby node and the first reference node fail.
  • the at least one distributed cluster further includes a second distributed cluster
  • the second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node
  • the device further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the fourth indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fifth determining module configured to determine, according to the fourth indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and a node attribute of the device is not Corresponding, and determining that the second distributed cluster where the second reference node is located and the first distributed cluster where the device is located are two sub-clusters formed by splitting one network distributed cluster;
  • the negotiation module is configured to negotiate with the second master node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that a node attribute of the device is a master node
  • a receiving unit configured to receive a negotiation message sent by the second master node, where the negotiation message includes information for indicating a weight of the second master node, where the negotiation message is that the second master node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second master node, a negotiation response message for indicating that the second master node is downgraded to a slave node, when determining that the weight of the device is greater than or equal to the weight of the second master node;
  • a third sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, the device to be downgraded to Slave when determining that the weight of the device is less than the weight of the second master node The broadcast message of the node.
  • a distributed cluster system in a fifth aspect, includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, and the distributed cluster is characterized in that the distributed The cluster further includes a first reference node, and a first standby node that is a backup of the first master node, where the first master node, the first standby node, and the first reference node are used to send heartbeat messages to each other.
  • the first reference node is further configured to send a heartbeat message to the first slave node, where the first slave node is configured to send a heartbeat message to the first master node and the first standby node, respectively, where
  • the first reference node is further configured to: when detecting that the heartbeat message sent by the first master node to the first reference node is interrupted, send a heartbeat message to the first standby node, where the heartbeat message includes First, the first reference node and the first master node are in a disconnected state Instructions,
  • the first standby node includes:
  • a first receiving module configured to receive a heartbeat message that is sent by the first reference node and includes the first indication information
  • a first determining module configured to determine, according to the first indication information received by the first receiving module, that the first reference node and the first master node are in a disconnected state
  • a detecting module configured to detect whether a heartbeat message sent by the first master node to the first standby node is interrupted
  • a second determining module configured to: when the detecting module detects that the heartbeat message sent by the first master node to the first standby node is interrupted, determining that the first standby node and the first master node are also in a disconnected state ;
  • the third determining module is configured to determine that the first master node is faulty according to the result determined by the first determining module and the second determining module.
  • the first standby device further includes:
  • a sending module configured to send a broadcast message to all nodes in the first distributed cluster, where the third determining module determines that the first master node is faulty, the broadcast message is used to indicate that the first standby node is upgraded to The first master node.
  • the detecting module is specifically configured to detect whether the first time and the second time are between Receiving a heartbeat message sent by the first master node, where the first time is a time when the first standby node receives the heartbeat message that is sent by the first reference node and includes the first indication information, where the second time is earlier than The first time, the time interval between the first time and the second time is N times the heartbeat period of the heartbeat message sent by the first master node to the first standby node, where N is a positive integer.
  • the distributed cluster system further includes a second distributed cluster, the first The second distributed node includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node, where the first standby node further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message is sent And including, by the second reference node, a second indication information that is used to indicate that the node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is configured to send the first node to the second slave node and all nodes in the first distributed cluster, respectively.
  • a heartbeat message indicating information that the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fourth determining module configured to determine, according to the second indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first standby node The node attributes do not match, and the second distributed cluster where the second reference node is located and the first distributed cluster where the first standby node is located are two sub-clusters formed by splitting a network distributed cluster;
  • the negotiation module is configured to negotiate with the second standby node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first standby node is a standby node;
  • a receiving unit configured to receive a negotiation message sent by the second standby node, where the negotiation message includes information for indicating a weight of the second standby node, where the negotiation message is that the second standby node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second standby node, the second standby node to be downgraded to a slave node, if the weight of the first standby node is greater than or equal to the weight of the second standby node Negotiation response message;
  • a third sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, the indication, in the case that determining that the weight of the first standby node is less than the weight of the second standby node
  • the first standby node is downgraded to a broadcast message of the slave node.
  • the sixth aspect provides a distributed cluster system, where the distributed cluster system includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, where The distributed cluster further includes a first reference node, and a first standby node that is a backup of the first master node, where the first master node, the first standby node, and the first reference node are used to mutually exchange each other a heartbeat message, the first reference node is further configured to send a heartbeat message to the first slave node, where the first slave node is used to respectively send the first The master node and the first standby node send a heartbeat message, where
  • the first standby node is further configured to send a heartbeat message to the first master node, where the heartbeat message sent by the first slave node to the first standby node is interrupted, where the heartbeat message includes The third indication information that the first standby node and the first slave node are in a disconnected state,
  • the first master node includes:
  • a first receiving module configured to receive a heartbeat message that is sent by the first standby node and includes the third indication information
  • a first determining module configured to determine, according to the third indication information received by the first receiving module, that the first standby node and the first slave node are in a disconnected state
  • a first detecting module configured to detect whether a heartbeat message sent by the first slave node to the first master node is interrupted
  • a second determining module configured to: when the first detecting module detects that the heartbeat message sent by the first slave node to the first master node is interrupted, determining that the first master node and the first slave node are also in a loss Joint state
  • the third determining module is configured to determine that the first slave node is faulty according to the result determined by the first determining module and the second determining module.
  • the first detecting module is configured to detect whether a heartbeat sent by the first slave node is received between the third time and the fourth time a third time is a time when the first master node receives the heartbeat message that is sent by the first standby node and includes the third indication information, where the fourth moment is earlier than the third moment, and the third moment is The time interval between the fourth moments is N times the heartbeat period of the heartbeat message sent by the first slave node to the first master node, where N is a positive integer.
  • the first master node further includes:
  • a second detecting module configured to detect, in a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the preset detection period is a heartbeat period of sending a heartbeat message M times, M is a positive integer;
  • a fourth determining module configured to: when the second detecting module receives neither the heartbeat message sent by the first standby node nor the heartbeat message sent by the first reference node in the preset detecting period And determining that both the first standby node and the first reference node fail.
  • the distributed cluster system further includes a second distributed cluster, the first The second distributed node includes a second master node, a second slave node, a second reference node, and a second standby node that is a backup of the second master node, where the first master node further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the fourth indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fifth determining module configured to determine, according to the fourth indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first master node The node attributes do not match, and the second distributed cluster where the second reference node is located and the first distributed cluster where the first master node is located are two sub-clusters formed by splitting one network distributed cluster;
  • the negotiation module is configured to negotiate with the second master node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first master node is a master node
  • a receiving unit configured to receive a negotiation message sent by the second master node, where the negotiation message includes information for indicating a weight of the second master node, where the negotiation message is that the second master node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the first master node if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second master node, a negotiation response for indicating that the second master node is downgraded to a slave node, when determining that the weight of the first master node is greater than or equal to the weight of the second master node Message
  • a third sending unit configured to send, to the first distributed cluster and all the nodes in the second distributed cluster, the first indicator, when determining that the weight of the first master node is less than the weight of the second master node A Master node is downgraded to a broadcast message of the Slave node.
  • the distributed cluster includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the standby node determines the master node according to the heartbeat message sent by the reference node. And the reference node is in a disconnected state, and by detecting that the heartbeat message sent by the master node to the standby node is also interrupted, it is determined that the master node and the standby node are also in a disconnected state, so that the standby node and the standby node can be effectively determined.
  • the master node that is de-linked by the reference node fails.
  • the standby node can quickly and effectively determine the master by using the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node detected by the slave node. If the node fails, compared with the prior art, the fault detection time of the master node can be effectively shortened.
  • FIG. 1 is a schematic diagram of a distributed cluster according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 3 is another schematic flowchart of a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 4 is still another schematic flowchart of a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 5(a), (b), (c) and (d) are diagrams showing a method of processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 6 is still another schematic flowchart of a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 7 is a schematic block diagram of an apparatus for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 8 is still another schematic block diagram of an apparatus for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 9 is still another schematic block diagram of an apparatus for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 10 is still another schematic block diagram of an apparatus for processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • FIG. 11 is a schematic block diagram of a distributed cluster system according to an embodiment of the present invention.
  • FIG. 12 is another schematic block diagram of a distributed cluster system according to an embodiment of the present invention.
  • a heartbeat message is a message sent by a source to a receiver. This message allows the receiver to determine if and when the source has failed or terminated. Usually, the heartbeat message is sent from the time the source is started until the source is turned off, during which the source continuously sends periodic or repeated heartbeat messages. When the receiver does not receive a heartbeat message within a heartbeat message receiving period, the receiver may consider that the source has been turned off, has failed, or is currently unavailable.
  • Heartbeat messages can often be used for high availability or fault tolerant processing purposes.
  • the distributed cluster 100 includes a master node (master node) 110, a standby node 120, a reference node 130, and a slave node (slave node) 140.
  • the master node 110, the standby node 120 and the reference node 130 mutually send a heartbeat message; the reference node 130 also sends a heartbeat message to the slave node 140; the slave node 140 sends a heartbeat message to the master node 110 and the standby node 120, respectively.
  • the heartbeat message is sent between the two nodes.
  • the master node 110 sends a heartbeat message to the standby node 120 and the reference node 130, respectively, and the standby node 120 sends a heartbeat message to the master node 110 and the reference node 130, respectively.
  • Node 110 and standby node 120 send heartbeat messages. That is, the master node 110, the standby node 120, and the reference node 130 monitor each other whether there is a fault. It should be understood that if a node has a fault, the node cannot send heartbeat messages to other nodes, nor can it receive heartbeat messages sent by other nodes.
  • both the master node 110 and the standby node 120 can monitor the failure of the slave node 130.
  • the slave node 140 can also monitor the reference node 130.
  • nodes included in the distributed cluster 100 have basic local service calculation object failure monitoring functions, such as processes and the like. among them,
  • the master node 110 is configured to be responsible for scheduling the service computing object (for example, a process), for example, providing arbitration for the service cluster of the application layer, specifically, including active and standby arbitration, cluster consistency coordination control, and the like.
  • the Master node monitors all nodes in the distributed cluster 100.
  • the standby node 120 is used as a backup node of the master node 110, that is, as a backup of the master node. For example, when the master node 110 fails, the standby node 120 quickly takes over the service of the master node 110, and the standby node 120 also Monitor all nodes in the distributed cluster 100.
  • the reference node 130 is configured to monitor the heartbeat message sent by the master node 110 and the standby node 120 in real time, so as to timely discover that the master node 110 or the standby node 120 is faulty. Specifically, for example, when the reference node 130 detects that the heartbeat message sent by the master node 110 to the reference node 130 is interrupted, it is considered that the master node 110 is disconnected, and then sends a heartbeat message carrying the indication information to the standby node 120.
  • the indication information is used to indicate that the reference node 130 and the master node 110 are in a disconnected state, so that the standby node 120 can effectively determine that the master node 110 is faulty according to the indication information.
  • the standby node 120 may comprehensively consider its own detection result and the indication information in the heartbeat message sent by the reference node 130. It is relatively quick and accurate to determine that the Master node 110 does fail.
  • the reference node 130 can also assist the master node 110 to quickly and accurately determine the standby A failure occurs with node 120.
  • each node in the cluster may be sent based on the same heartbeat period.
  • each node sends a heartbeat message according to a preset heartbeat period, and accordingly, according to the preset Heartbeat cycle to receive heartbeat messages. Therefore, for example, when the reference node 130 does not receive the heartbeat message sent by the master node 110 in a heartbeat period, the heartbeat message of the master node 110 may be considered to be interrupted, and then the master node 110 is considered to be disconnected.
  • the reference node 130 may also determine whether the heartbeat message of the master node 110 is interrupted according to a preset preset detection period, and the preset detection period is set to, for example, 3 times of a heartbeat period or other integer multiples.
  • the reference node 130 serves as a reference for the master node 110 and the standby node 120 to assist the master node 110 and the standby node 120 to quickly and effectively detect whether there is a fault between each other, and can effectively enhance the fault diagnosis of the master node 110.
  • the accuracy is a reference for the master node 110 and the standby node 120 to assist the master node 110 and the standby node 120 to quickly and effectively detect whether there is a fault between each other, and can effectively enhance the fault diagnosis of the master node 110.
  • the Slave node 140 is all nodes in the cluster 100 except the above-mentioned master node 110, standby node 120, and reference node 130.
  • the slave node 140 is configured to collect status information of a local service computing object (for example, a process), and report the status information to the master node 110, and execute an instruction issued by the master node 110.
  • a local service computing object for example, a process
  • the distributed cluster 100 involved in the embodiment of the present invention includes a master node 110 and a standby node 120, and may include multiple reference nodes 130 and multiple slave nodes 140.
  • all nodes in the cluster 100 are virtual machines.
  • all nodes in the cluster 100 are physical group devices.
  • each of the above nodes may also be a logical site or the like.
  • FIG. 2 illustrates a method 200 for processing a fault in at least one distributed cluster, the first distributed cluster including a first master node and a first distributed cluster in an embodiment of the present invention.
  • a slave node the distributed cluster further comprising a first reference node, and a first standby node as a backup of the first master node, the method 200 comprising:
  • the first standby node receives a heartbeat message sent by the first reference node, where the heartbeat message includes first indication information indicating that the first reference node and the first master node are in a disconnected state;
  • the first standby node determines, according to the first indication information, that the first reference node and the first master node are in a disconnected state;
  • the first standby node detects that the first master node sends the first standby node to the first standby node. Whether the heartbeat message is interrupted;
  • the first standby node determines that the first standby node and the first master node are also in a disconnected state
  • the first standby node determines that the first master node that is disconnected from the first standby node and the first reference node fails.
  • the distributed cluster includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the standby node determines that the master node and the reference node are located according to the heartbeat message sent by the reference node.
  • De-connected state, and detecting that the heartbeat message sent by the master node to the standby node is also interrupted to determine that the master node and the standby node are also in a disconnected state, thereby effectively determining that the standby node and the reference node are both lost.
  • the associated Master node has failed.
  • the method for processing a fault in at least one distributed cluster provided by the embodiment of the present invention, the heartbeat message sent by the reference node by using the reference node to indicate that the master node is disconnected, and the heartbeat message sent by the master node that is detected by the master node.
  • the detection result of the interrupt can quickly and effectively determine that the master node is faulty. Compared with the prior art, the fault detection time of the master node can be effectively shortened.
  • the first distributed cluster involved in the method 200 for processing the fault in the at least one distributed cluster provided by the embodiment of the present invention may be the distributed cluster 100 as shown in FIG.
  • a master node, a first standby node, a first reference node, and a first slave node respectively correspond to the master node 110, the standby node 120, the reference node 130, and the slave node 140 in the distributed cluster 100 shown in FIG.
  • the heartbeat messages sent by the nodes may be sent based on the same heartbeat period.
  • each node sends a heartbeat message according to a preset heartbeat period, and accordingly, according to the pre- Set the heartbeat cycle to receive heartbeat messages.
  • the heartbeat period can be preset by the system.
  • the first reference node when the first reference node does not receive the heartbeat message of the first master node in the preset detection period, it is determined that the first master node is in a disconnected state, and then in the next heartbeat period.
  • the preset detection period may be equal to N times the heartbeat period, and N may be an integer of 1 or greater than 1. Ground, for example, N is 4-7.
  • node attributes of all nodes in a distributed cluster ie, the role information of the nodes, such as the Master node, the Slave node, the reference node, and the standby node
  • the role information of the nodes such as the Master node, the Slave node, the reference node, and the standby node
  • each Slave node knows the distributed. Which of the clusters is the master node, which is the standby node, and which is the reference node.
  • the heartbeat message sent by each node includes the node attribute information (Message Type) of the receiving end node of the heartbeat message that the sending end node of the heartbeat message considers.
  • Message Type the node attribute information
  • the node attribute of the receiving end of the heartbeat message included in the heartbeat message sent by the master node 110 to the standby node 120 is a standby node; for example, the master node 110 sends the reference node 130 to the reference node 130.
  • the heartbeat message includes node attribute information for indicating the reference node.
  • the first standby node detects whether the heartbeat message sent by the first master node to the first standby node is interrupted, including:
  • the first standby node detects whether a heartbeat message sent by the first master node is received between the first time and the second time, where the first time is that the first standby node receives the first reference node and includes The time of the heartbeat message of the first indication information, the second time is earlier than the first time, and the time interval between the first time and the second time is that the first master node sends a heartbeat to the first standby node. N times the heartbeat period of the message, N is a positive integer.
  • the first standby node receives a heartbeat message that is sent by the first reference node and includes the first indication information, where the first standby node detects the first time t1 and the first moment. Whether the heartbeat message sent by the first master node is received between the second time t2 before t1.
  • the time interval between the first time and the second time may be an integer multiple of a heartbeat period of the heartbeat message sent by the first master node to the first standby node, for example, 1 time, 4 times or 7 times.
  • the first standby node may also adopt other feasible solutions to detect whether the first standby node is in a disconnected state, for example, the first standby node may also receive the first reference node.
  • the heartbeat message of the first indication information it is determined by the embodiment of the present invention that it is in a state of being disconnected from the first master node.
  • the standby node sends a heartbeat message including the first indication information and the self-checking by the reference node
  • the result of the measurement determines that the master node is disconnected from the standby node and the reference node, thereby determining that the master node is faulty. It is relatively efficient and accurate to determine whether the Master node in the distributed cluster has failed. Compared with the prior art, the fault detection time can be effectively shortened, and the fault detection accuracy can be improved.
  • the method 200 further includes:
  • the first standby node sends a broadcast message to all the nodes in the first distributed cluster, where the broadcast message is used to indicate that the first standby node is upgraded to the first master node.
  • the first standby node is updated to a new first master node in the first distributed cluster, that is, the related service of the original first master node, that is, the first master node that fails.
  • the method 200 further includes:
  • the first master node that is upgraded by the original first standby node re-determines the new first standby node in the first distributed cluster.
  • the first master node upgraded by the original first standby node selects a new first standby node from the first slave node of the first distributed cluster, and the new first standby node and the original The first standby node has the same function, that is, it is used to monitor the first master node and the first reference node in the first distributed cluster, and take over the service when the first master node fails.
  • the standby node determines that the master node is faulty, it quickly upgrades to the new master node, skipping the link of temporarily electing a new master node in the current technology, and saving the election of a new master node.
  • the first standby node receives the heartbeat sent by the first reference node that includes the first indication information indicating that the first reference node and the first master node are in a disconnected state. After the message, it is detected that there is no loss of association with the first Master node, and there is no action of the above S250, S260 and S270.
  • the number of the first reference nodes may be multiple.
  • the distributed cluster 100 includes three reference nodes 131, 132, and 133, and each reference node forms a monitoring ring composed of three nodes with the master node 110 and the standby node 120, that is, In the monitoring loop, three nodes send heartbeat messages to each other, utilizing The method described in method 200 monitors each other whether they are faulty nodes.
  • the standby node 120 receives the heartbeat messages A, B, and C sent by the reference nodes 131, 132, and 133, respectively, and the center hop message A is included to indicate that the reference node 131 and the master node 110 are in the loss.
  • the indication information of the connected state includes indication information for indicating that the reference node 132 and the master node 110 are in a disconnected state
  • the heartbeat message C includes an indication for indicating that the reference node 133 and the master node 110 are in a disconnected state.
  • the standby node 120 detects that it is also in a disconnected state with the master node 110; the standby node 120 infers that the master node 110 and the reference according to the indication information in the heartbeat messages A, B, and C, and its own detection information.
  • the master node 110 may be relatively accurately determined to be faulty.
  • the distributed cluster includes multiple reference nodes, which can provide more reference information to the standby node, thereby facilitating the standby node to quickly and accurately determine whether the master node is faulty.
  • the standby node may autonomously detect whether it is disconnected from the Master node, or may receive a heartbeat message A and/or a heartbeat message B and/or a heartbeat message C. In the case, it is necessary to detect whether it is disconnected from the Master node.
  • the master node 110 can also monitor the fault condition of the slave node 140 according to the method of the two parties jointly monitoring one of the methods described in the method 200.
  • FIG. 4 is a schematic flowchart of a method 300 for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, and the first distributed cluster, according to another embodiment of the present invention.
  • the first master node and the first slave node are further included, the first distributed cluster further includes a first reference node and a first standby node that is a backup of the first master node, and the method 300 includes:
  • the first master node receives a heartbeat message sent by the first standby node, where the heartbeat message includes third indication information indicating that the first standby node and the first slave node are in a disconnected state;
  • the first master node determines, according to the third indication information, that the first standby node and the first slave node are in a disconnected state;
  • the first master node detects whether a heartbeat message sent by the first slave node to the first master node is interrupted.
  • the heartbeat message sent by the first slave node to the first master node is detected.
  • the first master node determines that the first master node and the first slave node are also in a disconnected state;
  • the first master node determines that the first slave node that is disconnected from the first master node and the first standby node fails.
  • the distributed node includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the master node determines that the standby node is disconnected from the slave according to the heartbeat message sent by the standby node.
  • the state, and by detecting that the heartbeat message sent by the slave node to the master node is also interrupted, determining that the slave node and the master node are also in a disconnected state, thereby effectively determining that the master node and the standby node are both disconnected.
  • the slave node has failed.
  • the method for processing a fault in at least one distributed cluster provided by the embodiment of the present invention, the heartbeat message sent by the standby node by using the standby node to indicate that the slave node is disconnected, and the heartbeat message sent by the slave node detected by the slave node.
  • the detection result of the interrupt can quickly and effectively determine that the Slave node is faulty.
  • the fault detection time of the Slave node can be effectively shortened, and the accuracy of fault detection can also be improved.
  • the master node does not need to send a heartbeat message to all the slave nodes as in the prior art, and only needs to detect the heartbeat message sent by the Salve node to implement monitoring of the slave node, and combines the heartbeat message sent by the standby node.
  • the indication information indicating that the Salve node is out of association can determine the faulty Slave node.
  • the heartbeat message processing capacity of the master node can be halved, which effectively reduces the load of the master node.
  • the first standby node when the first standby node does not receive the heartbeat message of the first slave node in the preset detection period, determining that the first slave node is lost, and then in the next heartbeat period, And transmitting, to the first master node, a heartbeat message including third indication information for indicating that the first standby node is disconnected from the first slave node.
  • the preset detection period may be equal to N times the heartbeat message sending period, and N may be 1 or an integer greater than 1.
  • the heartbeat message that includes the third indication information that is sent by the standby node further includes indication information for indicating a node attribute of the receiving end of the heartbeat message, where the node attribute may also be called Character Type (Message Type).
  • the first master node detects whether the heartbeat message sent by the first slave node to the first master node is interrupted, including:
  • the first master node detects whether the first time is received between the third moment and the fourth moment a heartbeat message sent by the slave node, where the third time is the time when the first master node receives the heartbeat message that is sent by the first standby node and includes the third indication information, where the fourth time is earlier than the third time,
  • the time interval between the third time and the fourth time is N times the heartbeat period of the heartbeat message sent by the first slave node to the first master node, where N is a positive integer.
  • the first master node receives a heartbeat message that is sent by the first standby node and includes the third indication information, where the first master node detects the third time t2 and the third moment. Whether the heartbeat message sent by the first slave node is received between the fourth time t4 before t3.
  • the time interval between the third time and the fourth time may be an integer multiple of a heartbeat period of the heartbeat message sent by the first slave node to the first master node, for example, 1 time, 4 times or 7 times.
  • the first master node may also adopt other feasible solutions to detect whether the first slave node is in a disconnected state.
  • the first master node may also send the first standby node.
  • the autonomous determination of whether the user is in a disconnected state with the first slave node is not limited in this embodiment of the present invention.
  • the master node determines that both the master node and the standby node are in a disconnected state from the Salve node according to the heartbeat message including the third indication information sent by the standby node and the detection information of the slave node. Therefore, the fault of the Slave node can be determined more efficiently and accurately, and the fault detection time is effectively shortened compared with the existing solution for handling the fault in the cluster, and the energy consumption of the master node during the fault detection process can also be reduced. .
  • the nodes of the two roles monitor each other's faults by sending heartbeat messages. Because the monitoring information is single, it is generally necessary to detect heartbeat messages multiple times. For example, When the Slave node receives a heartbeat message sent by the master node in multiple preset detection periods (integer multiples of the heartbeat period), the slave node considers that the master node is faulty, resulting in a longer fault detection time.
  • the distributed cluster includes nodes of four roles, such as the master node, the slave node, the reference node, and the standby node shown in FIG. 1, wherein the master node, the standby node, and the reference node mutually generate heartbeats.
  • Messages can be monitored by each other; the slave node sends a heartbeat message to the master node and the standby node, that is, the master node and the standby node can jointly monitor the slave node.
  • the reference node also sends a heartbeat message to the slave node to let the slave node perceive the cluster it is in.
  • the master node can quickly and accurately determine whether the slave node is faulty by referring to the heartbeat message sent by the standby node and its own monitoring information on the Salve node.
  • the new standby node and/or the reference node may be re-determined in the slave node; if the standby node finds that the master node fails, it will be fast. Update to the new Master node. That is, in the embodiment of the present invention, the nodes of the four roles in the cluster maintain the integrity and validity of the cluster in real time.
  • the master node only receives the heartbeat message of the slave node, and does not send a heartbeat message to each slave node, and can effectively monitor the slave node according to the heartbeat message sent by the standby node and its own detection result.
  • the fault condition while being compared with the prior art, can improve the efficiency of detecting faults on the one hand, and effectively reduce the load of the master node on the other hand.
  • the method 300 further includes:
  • the first master node detects, in a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the preset detection period is a heartbeat period of sending a heartbeat message. M times, M is a positive integer;
  • the first master node determines the first backup. Both the node and the first reference node fail.
  • the preset detection period may be a time period preset by the system for determining a fault, for example, may be directly equal to a heartbeat period, or may be 4 times or 7 times of a heartbeat period.
  • the method 300 further includes:
  • a new alternate node and a new reference node are randomly assigned from a set of nodes satisfying a certain principle (such as a normal heartbeat), for example, using a distributed election algorithm.
  • the master node uses the multipath detection result to comprehensively determine the fault condition of the slave node, and on the one hand, shortens the time for detecting the fault, and on the other hand, improves the reliability of the fault detection.
  • a cluster is a typical cluster failure scenario.
  • the cluster including four roles involved in the embodiment of the present invention can effectively avoid or solve the problem of cluster splitting.
  • the method 300 further includes the at least one distributed cluster further comprising a second distributed cluster, the second distributed cluster including a second master node, a second slave node, a second reference node, and the second master node
  • the second standby node of the backup the method 300 further includes:
  • the first master node receives a heartbeat message sent by the second reference node, where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the fourth indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • the first distributed cluster and the second distributed cluster have the same cluster identifier, so the second reference node in the second distributed cluster can sense the nodes in the first distributed cluster, and All nodes in a distributed cluster are regarded as slave nodes, and therefore, the second reference node sends to the second Salve node in the second distributed cluster and all nodes in the first distributed cluster respectively, including for indicating the receiving end.
  • the node attribute is the heartbeat message of the Salve node.
  • the first master node determines, according to the fourth indication information, that the node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node does not match the node attribute of the first master node, and determines The second distributed cluster where the second reference node is located and the first distributed cluster where the first master node is located are two sub-clusters formed by splitting one network distributed cluster;
  • the first master node negotiates with a second master node in the second distributed cluster to facilitate integration of the first distributed cluster and the second distributed cluster.
  • the first master node of the S3030 negotiates with the second master node of the second distributed cluster, including:
  • the first master node sends, to the first distributed cluster and all the nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first master node is a master node.
  • the first master node receives the negotiation message sent by the second master node, where the negotiation message includes information for indicating the weight of the second master node, where the negotiation message is that the second master node detects the broadcast.
  • the node attribute indicated by the message is related to its own node attribute. In the same case, sent to the first master node;
  • the first master node when determining that the weight of the first master node is greater than or equal to the weight of the second master node, the first master node sends a negotiation response to the second master node to indicate that the second master node is downgraded to a slave node.
  • the first master node sends, to the first distributed cluster and all nodes in the second distributed cluster, the first A Master node is downgraded to a broadcast message of the Slave node.
  • one network cluster is split into two sub-clusters A and B, and sub-clusters A and B are split by one network cluster, so the sub-clusters A and B have the same cluster identifier.
  • the sub-cluster A includes a master node A, a standby node A, a reference node A, and a slave node A
  • the sub-cluster B includes a master node B, a standby node B, a reference node B, and a slave node B.
  • Each of the sub-cluster A and the sub-cluster B has the characteristics of the corresponding node in the distributed cluster 100 as shown in FIG. 1.
  • the reference node B in the sub-cluster B can receive the heartbeat message of the master node B and the standby node B. Therefore, in the view of the reference node B, all nodes except the master node B and the standby node B are It is a Slave node, that is, all the nodes in the sub-cluster A are in the view of the reference node B, and are all Slave nodes in the disconnected state.
  • the reference node B in the sub-cluster B sends a heartbeat message to the master node B in the sub-cluster B (the node attribute of the receiving end is Master), and sends a heartbeat to the standby node B in the sub-cluster B.
  • the message (the node attribute of the receiving end is standby), and the heartbeat message (the node attribute of the receiving end is Slave) is sent to the Slave node B in the sub-cluster B, so a heartbeat message is also sent to all the nodes in the sub-cluster A, which The node attribute of the receiving end indicated in the heartbeat message is a Slave node.
  • All the nodes in the sub-cluster A receive the heartbeat message sent by the reference node B in the sub-cluster B, including the indication information indicating that the node attribute of the receiving end is the slave node, and the master node A in the sub-cluster A, the standby node A After receiving the heartbeat message sent by the reference node B, the reference node A senses that the node attribute carried by the heartbeat message does not match the node attribute information of the node.
  • the master node A in the sub-cluster A determines that the node attribute carried by the heartbeat message does not match the node attribute information of the node node B according to the heartbeat message sent by the reference node B. Master node A sends to all nodes for indication The broadcast message of its own node attribute is shown in Figure 5(c).
  • the master node B in the sub-cluster B After receiving the broadcast message sent by the master node A, the master node B in the sub-cluster B detects the role conflict and sends a negotiation message to the master node A in the sub-cluster A.
  • the negotiation message carries the weight information of the master node B.
  • the master node A After receiving the negotiation message sent by the master node B, the master node A compares the weight of the master node B with the master node B. If the master node A determines that the weight of the master node A is higher than the weight of the master node B, the master node A sends the indicator to the master node B for indication. The master node B is downgraded to the negotiation response message of the slave node; if it is determined that the weight of the master node B is higher than the weight of the master node A, the master node A is actively demoted to the slave node.
  • the weights of the nodes are, for example, the length of time the node is alive, the degree of newness of the node's local cache (generally characterized by a version number), or the size of the managed cluster, and so on.
  • FIG. 5(c) only shows a schematic diagram of the master node A as an example.
  • the sub-cluster A is The standby node B and the reference node B also determine that the node attribute carried by the heartbeat message does not match the node attribute information of the heartbeat message, and also sends a broadcast message including the attribute of the own node.
  • the standby node A and the standby node B will also adopt a schematic diagram similar to that shown in Fig. 5(c) and Fig. 5(d) to negotiate the final spare node, and the reference node A and the reference node B will also adopt a similar diagram (Fig. 5(c) and The schematic diagram depicted in Figure 5(d) negotiates the final reference node.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, and a second slave node.
  • the second reference node, and the second standby node that is the backup of the second master node the method 200 further includes:
  • the first standby node receives a heartbeat message sent by the second reference node, where the heartbeat message includes second indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the second indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • the first standby node determines, according to the second indication information, that a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node does not match a node attribute of the first standby node, and determines
  • the second distributed cluster where the second reference node is located and the first distributed cluster where the first standby node is located are formed by splitting a network distributed cluster Sub-cluster
  • the first standby node negotiates with the second standby node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the first standby node of the S2030 negotiates with the second standby node in the second distributed cluster, including:
  • the first standby node sends, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first standby node is a standby node.
  • the first standby node receives the negotiation message sent by the second standby node, where the negotiation message includes information indicating a weight of the second standby node, where the negotiation message is that the second standby node detects the broadcast.
  • the node attribute indicated by the message is sent to the first standby node if the node attribute is the same as the node attribute of the node;
  • the first standby node in a case that determining that the weight of the first standby node is greater than or equal to the weight of the second standby node, the first standby node sends, to the second standby node, the second standby node to be downgraded to a slave node.
  • negotiation response message in a case that determining that the weight of the first standby node is greater than or equal to the weight of the second standby node, the first standby node sends, to the second standby node, the second standby node to be downgraded to a slave node.
  • the first standby node sends the indication to the first distributed cluster and all nodes in the second distributed cluster.
  • the first standby node is demoted to a broadcast message of the slave node.
  • first distributed cluster in the embodiment of the present invention may correspond to the sub-cluster A shown in FIG. 5, and the second distributed cluster corresponds to the sub-cluster B in FIG.
  • FIG. 5(a) only shows that the reference node B in the sub-cluster B regards all the nodes in the sub-cluster A as slave nodes, and transmits to them a node attribute indicating that the receiving end is a slave node. Heartbeat message. It should also be understood that before the sub-cluster A and the sub-cluster B are merged into one cluster, the reference node A in the sub-cluster A also regards all the nodes in the sub-cluster B as slave nodes, and also sends them to indicate the reception. The node attribute of the end is the heartbeat message of the Slave node. Master Node B, Reference Node B, and Standby Node B in Subcluster B also perform the actions shown in Figure 5(b), Figure 5(c) and Figure 5(d) until subcluster A and subcluster B are integrated. As of a cluster.
  • the heartbeat message sent by each node carries the node attribute information (role information) of the receiving end node of the heartbeat message considered by the sending end node of the heartbeat message, so that the node that receives the heartbeat message can be Perceive the split of the cluster, triggering subsequent actions to achieve the integration of split clusters.
  • the method for processing faults in at least one distributed cluster provided by the embodiments of the present invention can effectively shorten the time of fault detection in the cluster, and can effectively improve the accuracy of fault detection, and can also reduce the processing of the master node.
  • the burden of heartbeat messages can effectively shorten the time of fault detection in the cluster, and can effectively improve the accuracy of fault detection, and can also reduce the processing of the master node.
  • the standby node determines that the master node is faulty.
  • the distribution proposed in the embodiment of the present invention is described.
  • the Master node determines the failure of the Slave node.
  • a method for processing a fault of a distributed cluster provided by an embodiment of the present invention is described below from the perspective of a reference node.
  • FIG. 6 illustrates a method 400 for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, and the first distributed cluster includes a first master, according to another embodiment of the present invention.
  • a node and a first slave node the distributed cluster further comprising a first reference node, and a first standby node as a backup of the first master node, the method 400 comprising:
  • the first reference node detects whether the heartbeat message sent by the first master node to the first reference node is interrupted.
  • the first reference node determines that the first reference node is in a disconnected state
  • the first reference node sends a heartbeat message to the first standby node, where the heartbeat message includes first indication information indicating that the first reference node and the first master node are in a disconnected state, so as to facilitate the first
  • the standby node determines whether the first master node is a faulty node.
  • the reference node sends a heartbeat message including indication information for indicating the status to the standby node in the case that it is determined to be in a disconnected state with the master node, so as to facilitate the standby node by referring to the indication information. Further, it is determined whether the master node is faulty. It helps the standby node to comprehensively determine the fault condition in the distributed cluster according to the detection information of the multipath, and can effectively improve the efficiency and accuracy of the fault detection.
  • the first reference node detects whether the heartbeat message sent by the first master node to the first reference node is interrupted, including:
  • the first reference node detects whether the heartbeat message sent by the first master is received within a preset detection period.
  • the preset detection period may be N times the heartbeat period of the heartbeat message sent by the first master node to the first reference node, where N is a positive integer.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and The second standby node of the backup of the second master node, the second distributed cluster and the first distributed cluster are two sub-clusters formed by splitting one network cluster, and the method 400 further includes:
  • the first reference node sends a heartbeat message to the first slave node in the first distributed cluster and all nodes in the second distributed cluster, where the heartbeat message includes a node attribute for indicating the receiving end of the heartbeat message
  • the indication information of the slave node is such that the second master node in the second distributed cluster, the second standby node and the second reference node can perceive the second distributed cluster by using the indication information.
  • the reference node B in the sub-cluster B transmits a heartbeat message including the indication information indicating that the receiving end is the slave node to the slave node B and all the nodes in the sub-cluster A.
  • first reference node in the embodiment of the present invention may correspond to the second reference node involved in the method 200 and the method 300, and may also correspond to the reference node B shown in FIG. 5(b).
  • the heartbeat message sent by the reference node carries the indication information of the node attribute of the receiving end of the heartbeat message, so that the receiving end node of the heartbeat message can perceive the splitting of the cluster, thereby triggering the subsequent action.
  • the distributed cluster includes a reference node and a standby node of the master node in addition to the master node and the slave node.
  • the standby node determines that the master node and the reference node are in a disconnected state according to the heartbeat message sent by the reference node, and determines that the master node and the standby node are also lost by detecting that the heartbeat message sent by the master node to the standby node is also interrupted.
  • the state is connected, so that it can be effectively determined that the master node that is disconnected from the standby node and the reference node fails.
  • the master node determines that the standby node is in a disconnected state from the slave according to the heartbeat message sent by the standby node, and determines that the slave node is also disconnected from the master node by detecting that the heartbeat message sent by the slave node to the master node is also interrupted. State, thus To effectively determine that the Slave node that is de-linked to both the Master node and the standby node fails. That is, the distributed cluster provided by the embodiment of the present invention includes a master node, a slave node, a standby node, and a reference node, and can comprehensively determine whether a third-party node is faulty through the detection result of the two-party node, thereby detecting the fault more efficiently and accurately. Compared with the prior art, the fault detection time can be effectively shortened, and the burden of processing the heartbeat message by the master node can also be reduced.
  • the method for processing a fault in at least one distributed cluster provided by the embodiment of the present invention is described above with reference to FIG. 1 to FIG. 6.
  • the following describes the method for processing at least one provided by the embodiment of the present invention with reference to FIG. 7 and FIG. A failed device in a distributed cluster.
  • FIG. 7 shows a schematic block diagram of an apparatus 500 for processing a fault in at least one distributed cluster, provided in accordance with an embodiment of the present invention.
  • the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, the distributed cluster further includes a first reference node, and the first master node
  • the first receiving module 510 is configured to receive a heartbeat message that is sent by the first reference node and includes the first indication information.
  • the first determining module 520 is configured to determine that the first reference node and the first master node are in a disconnected state according to the first indication information received by the first receiving module;
  • the detecting module 530 is configured to detect whether the heartbeat message sent by the first master node to the device is interrupted.
  • the second determining module 540 is configured to: when the detecting module detects that the heartbeat message sent by the first master node to the device is interrupted, determine that the device and the first master node are also in a disconnected state;
  • the third determining module 550 is configured to determine that the first master node is faulty according to the result determined by the first determining module and the second determining module.
  • the first reference node is configured to send a heartbeat message to the first standby node when detecting that the heartbeat message sent by the first master node to the first reference node is interrupted,
  • the heartbeat message includes first indication information indicating that the first reference node and the first master node are in a disconnected state.
  • the distributed cluster includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the standby node determines that the master node and the reference node are located according to the heartbeat message sent by the reference node. Disconnected state and by detecting the The heartbeat message sent by the master node to the standby node is also interrupted to determine that the master node and the standby node are also in a disconnected state, so that the master node that is disconnected from the standby node and the reference node may be effectively determined to be faulty.
  • the device provided by the embodiment of the present invention can quickly and effectively determine the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node that is detected by the master node.
  • the failure of the master node can effectively shorten the fault detection time of the master node compared to the prior art.
  • the distributed cluster involved in the device 500 for processing faults in the at least one distributed cluster provided by the embodiment of the present invention may be the distributed cluster 100 as shown in FIG. 1 .
  • the device 500 further includes:
  • a sending module 560 configured to send, to the third determining module, that the first master node is faulty, to send a broadcast message to all nodes in the first distributed cluster, where the broadcast message is used to indicate that the device is upgraded to the first A Master node.
  • the detecting module is specifically configured to: detect whether a heartbeat message sent by the first master node is received between the first time and the second time, where the first time is received by the device a time when the heartbeat message including the first indication information is sent by the first reference node, the second time is earlier than the first time, and the time interval between the first time and the second time is the first time
  • the master node sends N times the heartbeat period of the heartbeat message to the device, and N is a positive integer.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and The second standby node of the backup of the second master node, the device 500 further includes:
  • the second receiving module 570 is configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes second indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used by Sending a heartbeat message including the second indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • the fourth determining module 580 is configured to determine, according to the second indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and a node attribute of the device Does not match, and determines the second distribution of the second reference node
  • the cluster and the first distributed cluster where the device is located are two sub-clusters formed by splitting a network distributed cluster;
  • the negotiation module 590 is configured to negotiate with the second standby node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiating module 590 includes:
  • a first sending unit 591 configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that a node attribute of the device is a standby node;
  • the receiving unit 592 is configured to receive a negotiation message sent by the second standby node, where the negotiation message includes information for indicating a weight of the second standby node, where the negotiation message is that the second standby node detects the first
  • the node attribute indicated by the broadcast message sent by the sending unit is sent to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit 593 configured to send, to the second standby node, a negotiation response indicating that the second standby node is downgraded to a slave node, if the weight of the device is determined to be greater than or equal to the weight of the second standby node.
  • a third sending unit 594 configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a device to indicate that the device is degraded, if the device weight is less than the weight of the second standby node.
  • the device provided by the embodiment of the present invention can quickly and effectively determine the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node that is detected by the master node.
  • the failure of the master node can effectively shorten the fault detection time of the master node compared to the prior art.
  • the apparatus 500 for processing a fault in at least one distributed cluster according to an embodiment of the present invention may correspond to a standby node in a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention, and the device
  • the above and other operations and/or functions of the respective modules in the 500 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 1 to FIG. 5, and are not described herein again for brevity.
  • FIG. 8 shows a schematic block diagram of an apparatus 600 for processing a fault in at least one distributed cluster, provided in accordance with an embodiment of the present invention.
  • the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster includes a first master node and a first slave node, the first distributed cluster further includes a first reference node and the first master node The first standby node of the backup, the device 600 is the first master node, and the device 600 includes:
  • the first receiving module 610 is configured to receive a heartbeat message that is sent by the first standby node and includes the third indication information.
  • the first determining module 620 is configured to determine, according to the third indication information received by the first receiving module, that the first standby node and the first slave node are in a disconnected state;
  • the first detecting module 630 is configured to detect whether the heartbeat message sent by the first slave node to the device is interrupted;
  • the second determining module 640 is configured to: when the first detecting module detects that the heartbeat message sent by the first slave node to the device is interrupted, determine that the device and the first slave node are also in a disconnected state;
  • the third determining module 650 is configured to determine that the first slave node is faulty according to the result determined by the first determining module and the second determining module.
  • the first standby node is configured to send a heartbeat message to the first master node when detecting that the heartbeat message sent by the first slave node to the first standby node is interrupted,
  • the heartbeat message includes third indication information for indicating that the first standby node and the first slave node are in a disconnected state.
  • the distributed node includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the master node determines that the standby node is disconnected from the slave according to the heartbeat message sent by the standby node.
  • the state, and by detecting that the heartbeat message sent by the slave node to the master node is also interrupted, determining that the slave node and the master node are also in a disconnected state, thereby effectively determining that the master node and the standby node are both disconnected.
  • the slave node has failed.
  • the heartbeat message sent by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message interrupted by the slave node detected by the slave node can be quickly and effectively determined.
  • the Slave node is faulty. Compared with the existing solution for handling the fault in the cluster, the fault detection time is effectively shortened, and the energy consumption of the master node during the fault detection process can also be reduced.
  • the first detecting module is configured to detect whether a heartbeat message sent by the first slave node is received between the third time and the fourth time, where the third time is Receiving, by the first standby node, a time of the heartbeat message including the third indication information, where the fourth time is earlier than the third time, and the time interval between the third time and the fourth time is The first slave node sends N times the heartbeat period of the heartbeat message to the device, where N is A positive integer.
  • the device 600 further includes:
  • a second detecting module configured to detect, in a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the preset detection period is a heartbeat period of sending a heartbeat message M times, M is a positive integer;
  • a fourth determining module configured to: when the second detecting module receives neither the heartbeat message sent by the first standby node nor the heartbeat message sent by the first reference node in the preset detecting period And determining that both the first standby node and the first reference node fail.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and The second standby node of the backup of the second master node, the device 600 further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively Sending a heartbeat message including the fourth indication information to the second slave node and all the nodes in the first distributed cluster, where the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fifth determining module configured to determine, according to the fourth indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and a node attribute of the device is not Corresponding, and determining that the second distributed cluster where the second reference node is located and the first distributed cluster where the device is located are two sub-clusters formed by splitting one network distributed cluster;
  • the negotiation module is configured to negotiate with the second master node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that a node attribute of the device is a master node
  • a receiving unit configured to receive a negotiation message sent by the second master node, where the negotiation message includes information for indicating a weight of the second master node, where the negotiation message is that the second master node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second master node, a negotiation response message for indicating that the second master node is downgraded to a slave node, when determining that the weight of the device is greater than or equal to the weight of the second master node;
  • a third sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, the device to be downgraded to Slave when determining that the weight of the device is less than the weight of the second master node The broadcast message of the node.
  • the heartbeat message sent by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message interrupted by the slave node detected by the slave node can be quickly and effectively determined.
  • the Slave node is faulty. Compared with the existing solution for handling the fault in the cluster, the fault detection time is effectively shortened, and the energy consumption of the master node during the fault detection process can also be reduced.
  • the apparatus 600 for processing a fault in at least one distributed cluster according to an embodiment of the present invention may correspond to a master node in a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention, and the device
  • the above and other operations and/or functions of the respective modules in the 600 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 1 to FIG. 5, and are not described herein again for brevity.
  • an embodiment of the present invention further provides an apparatus 700 for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster is in the first distributed cluster.
  • the first master node and the first slave node are further included, the distributed cluster further includes a first reference node, and the first standby node that is the backup of the first master node, the device 700 is the first standby node, and the device 700
  • a processor 710, a memory 720, a bus system 730, a receiver 740, and a transmitter 750 are included.
  • the processor 710, the memory 720, the receiver 740 and the transmitter 750 are connected by a bus system 730 for storing instructions for executing instructions stored in the memory 720 to control the receiver 740 to receive. Signal and control transmitter 750 to send a signal.
  • the receiver 740 is configured to receive a heartbeat message sent by the first reference node, where the heartbeat message includes first indication information that is used to indicate that the first reference node and the first master node are in a disconnected state; the processor The 710 is configured to: determine, according to the first indication information, that the first reference node is in a disconnected state with the first master node; and detect whether the heartbeat message sent by the first master node to the first standby node is interrupted; When the heartbeat message sent by the first master node to the first standby node is interrupted, the first standby node determines that the first standby node and the first master node are also in a disconnected state; determining the first The first master node that is disconnected from the standby node and the first reference no
  • the device provided by the embodiment of the present invention can quickly and effectively determine the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node that is detected by the master node.
  • the failure of the master node can effectively shorten the fault detection time of the master node compared to the prior art.
  • the transmitter 750 is further configured to: after the processor 710 determines that the first master node is faulty, send a broadcast message to all nodes in the first distributed cluster, where the broadcast message is used. And indicating that the first standby node is upgraded to the first master node.
  • the processor 710 is specifically configured to: detect whether a heartbeat message sent by the first master node is received between the first time and the second time, where the first time is the first Receiving, by the first reference node, a time of the heartbeat message including the first indication information, where the second time is earlier than the first time, and the time interval between the first time and the second time is The first master node sends N times the heartbeat period of the heartbeat message to the first standby node, where N is a positive integer.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node of the backup of the second master node
  • the receiver 740 is configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes a node attribute indicating that the receiving end of the heartbeat message is a slave node a second indication information
  • the second reference node is configured to send a heartbeat message including the second indication information to the second slave node and all nodes in the first distributed cluster, the second distributed cluster and the first a distributed cluster has the same cluster identifier
  • the processor 710 is configured to determine, according to the second indication information, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first The node attributes of the standby node do not match, and determine the second distributed cluster where the second reference node is located and
  • the transmitter 750 is configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a node attribute indicating that the first standby node is reserved. a broadcast message of the node; the receiver 740 is configured to receive a negotiation message sent by the second standby node, where the negotiation message includes information indicating a weight of the second standby node, where the association
  • the MME message is that the second standby node sends to the first standby node if it detects that the node attribute indicated by the broadcast message is the same as its own node attribute; the transmitter 750 is configured to determine the first standby node.
  • the weight of the second standby node is greater than or equal to the weight of the second standby node, send a negotiation response message to the second standby node to indicate that the second standby node is downgraded to a slave node; determining that the weight of the first standby node is less than In the case of the weight of the second standby node, a broadcast message indicating that the first standby node is downgraded to a slave node is sent to all nodes in the first distributed cluster and the second distributed cluster.
  • the processor 710 may be a central processing unit (“CPU"), and the processor 710 may also be other general-purpose processors, digital signal processors (DSPs). , an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, and the like.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 720 can include read only memory and random access memory and provides instructions and data to the processor 710. A portion of the memory 720 can also include a non-volatile random access memory. For example, the memory 720 can also store information of the device type.
  • the bus system 730 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 730 in the figure.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 710 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 720, and processor 710 reads the information in memory 720 and, in conjunction with its hardware, performs the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the device provided by the embodiment of the present invention can quickly and effectively determine the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node that is detected by the master node.
  • the failure of the master node can effectively shorten the fault detection time of the master node compared to the prior art.
  • the apparatus 700 for processing a fault in at least one distributed cluster according to an embodiment of the present invention may correspond to processing a fault in at least one distributed cluster according to an embodiment of the present invention.
  • the spare node in the method also corresponds to the apparatus 500 for processing a fault in at least one distributed cluster provided according to an embodiment of the present invention, and the above and other operations and/or functions of the respective modules in the apparatus 700 are respectively.
  • the corresponding processes of the various methods in FIG. 1 to FIG. 5 are implemented, and are not described herein for brevity.
  • an embodiment of the present invention further provides an apparatus 800 for processing a fault in at least one distributed cluster, where the at least one distributed cluster includes a first distributed cluster, where the first distributed cluster includes a first a master node and a first slave node, the first distributed cluster further includes a first reference node and a first standby node that is a backup of the first master node, the device 800 is the first master node, and the device 800 includes Processor 810, memory 820, bus system 830, receiver 840, and transmitter 850.
  • the processor 810, the memory 820, the receiver 840, and the transmitter 850 are connected by a bus system 830 for storing instructions for executing instructions stored in the memory 820 to control the receiver 840 to receive.
  • the receiver 840 is configured to receive a heartbeat message sent by the first standby node, where the heartbeat message includes third indication information for indicating that the first standby node and the first slave node are in a disconnected state;
  • the controller 810 is configured to: determine, according to the third indication information, that the first standby node is in a disconnected state with the first slave node; and detect whether the heartbeat message sent by the first slave node to the first master node is interrupted; When the heartbeat message sent by the first slave node to the first master node is interrupted, the first master node determines that the first master node and the first slave node are also in a disconnected state; the point is determined with the first The first slave node that is lost between the master node and the first standby node fails.
  • the heartbeat message sent by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message interrupted by the slave node detected by the slave node can be quickly and effectively determined.
  • the Slave node is faulty. Compared with the existing solution for handling the fault in the cluster, the fault detection time is effectively shortened, and the energy consumption of the master node during the fault detection process can also be reduced.
  • the processor 810 is configured to detect whether a heartbeat message sent by the first slave node is received between the third moment and the fourth moment, where the third moment is the first Receiving, by the first standby node, a time of the heartbeat message including the third indication information, where the fourth time is earlier than the third time, and the time interval between the third time and the fourth time is
  • the first slave node sends a heartbeat week of the heartbeat message to the first master node N times the period, N is a positive integer.
  • the processor 810 is configured to detect, during a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the The detection period is M times of the heartbeat period of the heartbeat message, and M is a positive integer.
  • the preset detection period neither the heartbeat message sent by the first standby node nor the first reference node is received. In the case of the heartbeat message, it is determined that both the first standby node and the first reference node are faulty.
  • the at least one distributed cluster further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and a second standby node of the backup of the second master node
  • the receiver 840 is configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes a node attribute indicating that the receiving end of the heartbeat message is a slave node a fourth indication information
  • the second reference node is configured to send a heartbeat message including the fourth indication information to the second slave node and all nodes in the first distributed cluster, the second distributed cluster and the first a distributed cluster has the same cluster identifier
  • the processor 810 is configured to determine, according to the fourth indication information, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first The node attributes of the master node do not match, and the second distributed cluster where the second reference node is located and the first
  • the transmitter 850 is configured to send, to the first distributed cluster and all the nodes in the second distributed cluster, a node attribute indicating that the first master node is a master node.
  • the receiver 840 is configured to receive the negotiation message sent by the second master node, where the negotiation message includes information for indicating the weight of the second master node, where the negotiation message is that the second master node is detecting Transmitting to the first master node if the node attribute indicated by the broadcast message is the same as the node attribute of the broadcast message; the transmitter 850 is configured to determine that the weight of the first master node is greater than or equal to the second master node.
  • the distributed cluster and all nodes in the second distributed cluster send a broadcast message indicating that the first master node is downgraded to a slave node.
  • the heartbeat message sent by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message interrupted by the slave node detected by the slave node can be quickly and effectively determined.
  • the Slave node is faulty. Compared with the existing solution for handling the fault in the cluster, the fault detection time is effectively shortened, and the energy consumption of the master node during the fault detection process can also be reduced.
  • the apparatus 800 for processing a fault in at least one distributed cluster according to an embodiment of the present invention may correspond to a master node in a method for processing a fault in at least one distributed cluster according to an embodiment of the present invention, or may Corresponding to the apparatus 600 for processing faults in at least one distributed cluster provided in accordance with an embodiment of the present invention, and the above and other operations and/or functions of the various modules in the apparatus, 800, respectively, in order to implement FIGS. 1 through 5, respectively The corresponding processes of the various methods are not repeated here for the sake of brevity.
  • FIG. 11 is a schematic block diagram of a distributed cluster system 900 according to an embodiment of the present invention.
  • the distributed cluster system includes a first distributed cluster 901, where the first distributed cluster includes a first master node 910 and a first a Slave node 920, the distributed cluster further includes a first reference node 930, and a backup 941 as the backup of the first master node, where the first master node 910, the first standby node 940, and the first reference node 930 are used.
  • the first reference node 930 is further configured to send a heartbeat message to the first slave node 920, where the first slave node 920 is configured to respectively send the first master node 910 and the first standby node 930 sends a heartbeat message, wherein
  • the first reference node 930 is further configured to: when detecting that the heartbeat message sent by the first master node to the first reference node is interrupted, send a heartbeat message to the first standby node, where the heartbeat message includes The first indication information that the first reference node and the first master node are in a disconnected state,
  • the first standby node 940 includes:
  • the first receiving module 941 is configured to receive a heartbeat message that is sent by the first reference node and includes the first indication information.
  • the first determining module 942 is configured to determine that the first reference node and the first master node are in a disconnected state according to the first indication information received by the first receiving module;
  • the detecting module 943 is configured to detect whether the heartbeat message sent by the first master node to the first standby node is interrupted;
  • a second determining module 944 configured to detect, by the detecting module, the first master node to the first When the heartbeat message sent by the standby node is interrupted, it is determined that the first standby node and the first master node are also in a disconnected state;
  • the third determining module 945 is configured to determine that the first master node is faulty according to the result determined by the first determining module and the second determining module.
  • the first distributed cluster may correspond to the distributed cluster 100 shown in FIG. 1 .
  • the distributed cluster 100 shown in FIG. 1 may correspond to the distributed cluster 100 shown in FIG. 1 .
  • the distributed cluster includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the standby node determines that the master node and the reference node are located according to the heartbeat message sent by the reference node.
  • De-connected state, and detecting that the heartbeat message sent by the master node to the standby node is also interrupted to determine that the master node and the standby node are also in a disconnected state, thereby effectively determining that the standby node and the reference node are both lost.
  • the associated Master node has failed.
  • the standby node can quickly and effectively determine the master by using the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node detected by the slave node. If the node fails, compared with the prior art, the fault detection time of the master node can be effectively shortened.
  • the first standby device 940 further includes:
  • the sending module 946 is configured to send, to the third determining module, that the first master node is faulty, to send a broadcast message to all nodes in the first distributed cluster, where the broadcast message is used to indicate that the first standby node is upgraded. For the first master node.
  • the detecting module is configured to: detect whether a heartbeat message sent by the first master node is received between the first time and the second time, where the first time is the first standby node. Receiving, by the first reference node, a time of the heartbeat message including the first indication information, where the second time is earlier than the first time, and the time interval between the first time and the second time is the first time A master node sends N times the heartbeat period of the heartbeat message to the first standby node, where N is a positive integer.
  • the distributed cluster system further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and the second A second standby node of the backup of the master node, the first standby node further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes a second indication that is used to indicate that the node attribute of the receiving end of the heartbeat message is a slave node
  • the second reference node is configured to send a heartbeat message including the second indication information to the second slave node and all nodes in the first distributed cluster, the second distributed cluster and the first distributed
  • the cluster has the same cluster ID;
  • a fourth determining module configured to determine, according to the second indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first standby node The node attributes do not match, and the second distributed cluster where the second reference node is located and the first distributed cluster where the first standby node is located are two sub-clusters formed by splitting a network distributed cluster;
  • the negotiation module is configured to negotiate with the second standby node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first standby node is a standby node;
  • a receiving unit configured to receive a negotiation message sent by the second standby node, where the negotiation message includes information for indicating a weight of the second standby node, where the negotiation message is that the second standby node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the device if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second standby node, the second standby node to be downgraded to a slave node, if the weight of the first standby node is greater than or equal to the weight of the second standby node Negotiation response message;
  • a third sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, the indication, in the case that determining that the weight of the first standby node is less than the weight of the second standby node
  • the first standby node is downgraded to a broadcast message of the slave node.
  • the distributed cluster includes a master node, a slave node reference node, and a standby node of the master node, and the standby node determines that the master node and the reference node are in a disconnected state according to the heartbeat message sent by the reference node. And detecting that the heartbeat message sent by the master node to the standby node is also interrupted to determine that the master node and the standby node are also in a disconnected state, thereby effectively determining that the standby node and the reference node are both disconnected.
  • the Master node has failed.
  • the standby node can quickly and effectively determine the master by using the heartbeat message sent by the reference node to indicate that the master node is disconnected, and the detection result of the heartbeat message sent by the master node detected by the slave node. Node occurs Compared with the prior art, the fault detection time of the master node can be effectively shortened.
  • the first distributed cluster 901 in the distributed cluster system 900 may correspond to the first distributed cluster in the method for processing faults in the distributed cluster provided by the embodiment of the present invention.
  • the first standby node 940 in the distributed cluster system 900 also corresponds to the device 700 for processing a fault in the distributed cluster provided by the embodiment of the present invention, and the above-mentioned sum of each module in the distributed cluster system 900
  • the other operations and/or functions are respectively implemented in order to implement the corresponding processes of the respective methods in FIG. 1 to FIG. 5 , and are not described herein again for brevity.
  • FIG. 12 shows a distributed cluster system 1000 according to an embodiment of the present invention.
  • the distributed cluster system 1000 includes a first distributed cluster 1001, where the first distributed cluster includes a first master node 1010 and a first slave node 1020.
  • the distributed cluster further includes a first reference node 1030, and a first standby node 1040 that is a backup of the first master node, where the first master node 1010, the first standby node 1040, and the first reference node 1030 Sending a heartbeat message to each other, the first reference node 1030 is further configured to send a heartbeat message to the first slave node 1020, where the first slave node 1020 is configured to respectively send the first master node 1010 and the first standby Node 1030 sends a heartbeat message, where
  • the first standby node 1030 is further configured to: when detecting that the heartbeat message sent by the first slave node to the first standby node is interrupted, send a heartbeat message to the first master node, where the heartbeat message includes The third indication information that the first standby node and the first slave node are in a disconnected state,
  • the first master node 1010 includes:
  • the first receiving module 1011 is configured to receive a heartbeat message that is sent by the first standby node and includes the third indication information.
  • the first determining module 1012 is configured to determine, according to the third indication information received by the first receiving module, that the first standby node and the first slave node are in a disconnected state;
  • the first detecting module 1013 is configured to detect whether the heartbeat message sent by the first slave node to the first master node is interrupted;
  • the second determining module 1014 is configured to determine that the first master node and the first slave node are also in the case that the first detecting module detects that the heartbeat message sent by the first slave node to the first master node is interrupted. Loss of state
  • the third determining module 1015 is configured to determine that the first slave node is faulty according to the result determined by the first determining module and the second determining module.
  • the distributed node includes a reference node and a standby node of the master node in addition to the master node and the slave node, and the master node determines that the standby node is disconnected from the slave according to the heartbeat message sent by the standby node.
  • the state, and by detecting that the heartbeat message sent by the slave node to the master node is also interrupted, determining that the slave node and the master node are also in a disconnected state, thereby effectively determining that the master node and the standby node are both disconnected.
  • the slave node has failed.
  • the heartbeat message sent by the standby node by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message sent by the slave node detected by the slave node are
  • the fault of the Slave node can be determined quickly and effectively. Compared with the prior art, the fault detection time of the Slave node can be effectively shortened, and the accuracy of fault detection can also be improved.
  • the first detecting module 1013 is specifically configured to: detect whether a heartbeat message sent by the first slave node is received between the third time and the fourth time, where the third time is the first time a time at which the master node receives the heartbeat message including the third indication information sent by the first standby node, the fourth time is earlier than the third time, and the time interval between the third time and the fourth time Sending N times the heartbeat period of the heartbeat message to the first master node for the first slave node, where N is a positive integer.
  • the first master node 1010 further includes:
  • a second detecting module configured to detect, in a preset detection period, whether a heartbeat message sent by the first standby node and a heartbeat message sent by the first reference node are received, where the preset detection period is a heartbeat period of sending a heartbeat message M times, M is a positive integer;
  • a fourth determining module configured to: when the second detecting module receives neither the heartbeat message sent by the first standby node nor the heartbeat message sent by the first reference node in the preset detecting period And determining that both the first standby node and the first reference node fail.
  • the distributed cluster system 1000 further includes a second distributed cluster, where the second distributed cluster includes a second master node, a second slave node, a second reference node, and the The second standby node of the backup of the two master nodes, the first master node 1010 further includes:
  • a second receiving module configured to receive a heartbeat message sent by the second reference node, where the heartbeat message includes fourth indication information indicating that a node attribute of the receiving end of the heartbeat message is a slave node, where the second reference node is used to respectively To the second slave node and the first distributed cluster All the nodes send a heartbeat message including the fourth indication information, and the second distributed cluster has the same cluster identifier as the first distributed cluster;
  • a fifth determining module configured to determine, according to the fourth indication information received by the second receiving module, a node attribute of the receiving end of the heartbeat message indicated by the heartbeat message sent by the second reference node, and the first master node The node attributes do not match, and the second distributed cluster where the second reference node is located and the first distributed cluster where the first master node is located are two sub-clusters formed by splitting one network distributed cluster;
  • the negotiation module is configured to negotiate with the second master node in the second distributed cluster to facilitate the integration of the first distributed cluster and the second distributed cluster.
  • the negotiation module includes:
  • a first sending unit configured to send, to the first distributed cluster and all nodes in the second distributed cluster, a broadcast message indicating that the node attribute of the first master node is a master node
  • a receiving unit configured to receive a negotiation message sent by the second master node, where the negotiation message includes information for indicating a weight of the second master node, where the negotiation message is that the second master node detects the first sending And sending, by the unit, the node attribute indicated by the broadcast message to the first master node if the node attribute is the same as the node attribute of the broadcast message;
  • a second sending unit configured to send, to the second master node, a negotiation response for indicating that the second master node is downgraded to a slave node, when determining that the weight of the first master node is greater than or equal to the weight of the second master node Message
  • a third sending unit configured to send, to the first distributed cluster and all the nodes in the second distributed cluster, the first indicator, when determining that the weight of the first master node is less than the weight of the second master node A Master node is downgraded to a broadcast message of the Slave node.
  • the heartbeat message sent by the standby node by the standby node to indicate that the slave node is disconnected, and the detection result of the heartbeat message sent by the slave node detected by the slave node are
  • the fault of the Slave node can be determined quickly and effectively. Compared with the prior art, the fault detection time of the Slave node can be effectively shortened, and the accuracy of fault detection can also be improved.
  • the first distributed cluster 1001 in the distributed cluster system 1000 may correspond to the first distributed cluster in the method for processing faults in the distributed cluster provided by the embodiment of the present invention.
  • the first master node 1010 in the distributed cluster system 1000 also corresponds to the device for processing faults in the distributed cluster provided by the embodiment of the present invention. 800, and the above-mentioned and other operations and/or functions of the respective modules in the distributed cluster system 1000 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 1 to FIG. 5, and are not described herein again for brevity.
  • the size of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be directed to the embodiments of the present invention.
  • the implementation process constitutes any limitation.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

本发明实施例提供一种处理至少一个分布式集群中的故障的方法、设备和系统,至少一个分布式集群包括第一分布式集群,第一分布式集群中包括第一Master节点和第一Slave节点,第一参考节点,以及作为第一Master节点的备份的第一备用节点,第一备用节点接收第一参考节点发送的包括用于指示第一参考节点与第一Master节点处于失联状态的第一指示信息的心跳消息;第一备用节点根据第一指示信息,确定第一参考节点与第一Master节点处于失联状态;第一备用节点在检测到第一Master节点向第一备用节点发送的心跳消息中断的情况下,确定第一备用节点与第一Master节点也处于失联状态;第一备用节点确定该第一Master节点发生故障。在本发明实施例中,能够有效缩短故障检测时间。

Description

处理至少一个分布式集群中的故障的方法、设备和系统
本申请要求于2015年2月10日提交中国专利局、申请号为201510068053.1、发明名称为“处理至少一个分布式集群中的故障的方法、设备和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及集群管理领域,并且更具体地,涉及一种处理至少一个分布式集群中的故障的方法、设备和系统。
背景技术
目前大部分的高可用性(High Available,简称为“HA”)分布式集群通常为一主(Master节点)多从(Slave节点)集中式的,其中,Master节点向集群中所有Slave节点发送心跳消息,集群中每个Salve节点也向该Master节点发送心跳消息。Slave节点通过检测Master节点发送的心跳消息来判断该Master节点是否发生故障,Master节点通过检测Slave节点发送的心跳消息来判断该Salve节点是否发生故障。
但在上述故障检测中存在以下弊端,Salve节点通常是在多次判断没有接收到Master节点的心跳消息的情况下,才会认为该Master节点发生故障,才会发起用于在集群内确定新的Master节点的选举策略,因此,在目前技术中,Master节点的故障检测时间过长。
发明内容
本发明实施例提供一种处理至少一个分布式集群中的故障的方法、设备和系统,能够有效缩短故障检测时间。
第一方面提供了一种处理至少一个分布式集群中的故障的方法,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该方法包括:
该第一备用节点接收该第一参考节点发送的心跳消息,该心跳消息包括 用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息;
该第一备用节点根据该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
该第一备用节点检测该第一Master节点向该第一备用节点发送的心跳消息是否中断;
在检测到该第一Master节点向该第一备用节点发送的心跳消息中断的情况下,该第一备用节点确定该第一备用节点与该第一Master节点也处于失联状态;
该第一备用节点确定与该第一备用节点和该第一参考节点均失联的该第一Master节点发生故障。
结合第一方面,在第一方面的第一种可能的实现方式中,在确定该第一Master节点发生故障的情况下,该方法还包括:
该第一备用节点向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该第一备用节点升级为该第一Master节点。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,该第一备用节点检测该第一Master节点向该第一备用节点发送的心跳消息是否中断,包括:
该第一备用节点检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该第一备用节点接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
结合第一方面或第一方面的第一种或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该方法还包括:
该第一备用节点接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布 式集群具有相同的集群标识;
该第一备用节点根据该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一备用节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
该第一备用节点与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,该第一备用节点与该第二分布式集群中的第二备用节点进行协商,包括:
该第一备用节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点的节点属性为备用节点的广播消息;
该第一备用节点接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一备用节点发送的;
在确定该第一备用节点的权重大于或等于该第二备用节点的权重的情况下,该第一备用节点向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
在确定该第一备用节点的权重小于该第二备用节点的权重的情况下,该第一备用节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点降级为Slave节点的广播消息
第二方面提供了一种处理至少一个分布式集群中的故障的方法,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该第一分布式集群还包括第一参考节点以及作为该第一Master节点的备份的第一备用节点,该方法包括:
该第一Master节点接收该第一备用节点发送的心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息;
该第一Master节点根据该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;
该第一Master节点检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断;
在检测到该第一Slave节点向该第一Master节点发送的心跳消息中断的情况下,该第一Master节点确定该第一Master节点与该第一Slave节点也处于失联状态;
该第一Master节点确定与该第一Master节点和该第一备用节点均失联的该第一Slave节点发生故障。
结合第二方面,在第二方面的第一种可能的实现方式中,该第一Master节点检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断,包括:
该第一Master节点检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该第一Master节点接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,该方法还包括:
该第一Master节点在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,该第一Master节点确定该第一备用节点和该第一参考节点均发生故障。
结合第二方面或第二方面的第一种或第二种可能的实现方式,在第二方面的第三种可能的实现方式中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该方法还包括:
该第一Master节点接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分 布式集群具有相同的集群标识;
该第一Master节点根据该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一Master节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
该第一Master节点与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,该第一Master节点与该第二分布式集群中的第二Master节点进行协商,包括:
该第一Master节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点的节点属性为Master节点的广播消息;
该第一Master节点接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一Master节点发送的;
在确定该第一Master节点的权重大于或等于该第二Master节点的权重时,该第一Master节点向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
在确定该第一Master节点的权重小于该第二Master节点的权重时,该第一Master节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点降级为Slave节点的广播消息。
第三方面提供了一种用于处理至少一个分布式集群中的故障的设备,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,其中,该第一参考节点用于,在检测到该第一Master节点向该第一参考节点发送的心跳消息中断的情况下,向该第一备用节点发送心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息,该设备为该第一备用节点,该设备包括:
第一接收模块,用于接收该第一参考节点发送的包括有该第一指示信息的心跳消息;
第一确定模块,用于根据该第一接收模块接收的该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
检测模块,用于检测该第一Master节点向该设备发送的心跳消息是否中断;
第二确定模块,用于在该检测模块检测到该第一Master节点向该设备发送的心跳消息中断的情况下,确定该设备与该第一Master节点也处于失联状态;
第三确定模块,用于根据该第一确定模块和该第二确定模块确定的结果,确定该第一Master节点发生故障。
结合第三方面,在第三方面的第一种可能的实现方式中,该设备还包括:
发送模块,用于在该第三确定模块确定该第一Master节点发生故障的情况下,向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该设备升级为该第一Master节点。
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,该检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该设备接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该设备发送心跳消息的心跳周期的N倍,N为正整数。
结合第三方面或第三方面的第一种或第二种可能的实现方式,在第三方面的第三种可能的实现方式中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该设备还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第四确定模块,用于根据该第二接收模块接收的该第二指示信息,确定 该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该设备的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备的节点属性为备用节点的广播消息;
接收单元,用于接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元,用于在确定该设备的权重大于或等于该第二备用节点的权重的情况下,向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该设备权重小于该第二备用节点的权重的情况下,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备降级为Slave节点的广播消息。
第四方面提供了一种用于处理至少一个分布式集群中的故障的设备,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,该第一分布式集群还包括第一参考节点以及作为该第一Master节点的备份的第一备用节点,该第一备用节点用于,在检测到该第一Slave节点向该第一备用节点发送的心跳消息中断的情况下,向该第一Master节点发送心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息,该设备为该第一Master节点,该设备包括:
第一接收模块,用于接收该第一备用节点发送的包括该第三指示信息的心跳消息;
第一确定模块,用于根据该第一接收模块接收的该第三指示信息,确定 该第一备用节点与该第一Slave节点处于失联状态;
第一检测模块,用于检测该第一Slave节点向该设备发送的心跳消息是否中断;
第二确定模块,用于在该第一检测模块检测到该第一Slave节点向该设备发送的心跳消息中断的情况下,确定该设备与该第一Slave节点也处于失联状态;
第三确定模块,用于根据该第一确定模块与该第二确定模块确定的结果,确定该第一Slave节点发生故障。
结合第四方面,在第四方面的第一种可能的实现方式中,该第一检测模块具体用于,检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该设备接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该设备发送心跳消息的心跳周期的N倍,N为正整数。
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,该设备还包括:
第二检测模块,用于在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
第四确定模块,用于在该第二检测模块在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,确定该第一备用节点和该第一参考节点均发生故障。
结合第四方面或第四方面的第一种或第二种可能的实现方式,在第四方面的第三种可能的实现方式中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该设备还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第五确定模块,用于根据该第二接收模块接收的该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该设备的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备的节点属性为Master节点的广播消息;
接收单元,用于接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元,用于在确定该设备的权重大于或等于该第二Master节点的权重时,向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该设备的权重小于该第二Master节点的权重时,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备降级为Slave节点的广播消息。
第五方面,提供了一种分布式集群系统,该分布式集群系统包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该第一Master节点、该第一备用节点和该第一参考节点用于彼此之间互发心跳消息,该第一参考节点还用于向该第一Slave节点发送心跳消息,该第一Slave节点用于分别向该第一Master节点和该第一备用节点发送心跳消息,其中,
该第一参考节点还用于,在检测到该第一Master节点向该第一参考节点发送的心跳消息中断的情况下,向该第一备用节点发送心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一 指示信息,
该第一备用节点包括:
第一接收模块,用于接收该第一参考节点发送的包括该第一指示信息的心跳消息;
第一确定模块,用于根据该第一接收模块接收的该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
检测模块,用于检测该第一Master节点向该第一备用节点发送的心跳消息是否中断;
第二确定模块,用于在该检测模块检测到该第一Master节点向该第一备用节点发送的心跳消息中断的情况下,确定该第一备用节点与该第一Master节点也处于失联状态;
第三确定模块,用于根据该第一确定模块和该第二确定模块确定的结果,确定该第一Master节点发生故障。
结合第五方面,在第五方面的第一种可能的实现方式中,该第一备用设备还包括:
发送模块,用于在该第三确定模块确定该第一Master节点发生故障的情况下,向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该第一备用节点升级为该第一Master节点。
结合第五方面或第五方面的第一种可能的实现方式,在第五方面的第二种可能的实现方式中,该检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该第一备用节点接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
结合第五方面或第五方面的第一种或第二种可能的实现方式,在第五方面的第三种可能的实现方式中,该分布式集群系统还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该第一备用节点还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息 包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第四确定模块,用于根据该第二接收模块接收的该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一备用节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第五方面的第三种可能的实现方式,在第五方面的第四种可能的实现方式中,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点的节点属性为备用节点的广播消息;
接收单元,用于接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元,用于在确定该第一备用节点的权重大于或等于该第二备用节点的权重的情况下,向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该第一备用节点权重小于该第二备用节点的权重的情况下,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点降级为Slave节点的广播消息。
第六方面提供了一种分布式集群系统,其特征在于,该分布式集群系统包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该第一Master节点、该第一备用节点和该第一参考节点用于彼此之间互发心跳消息,该第一参考节点还用于向该第一Slave节点发送心跳消息,该第一Slave节点用于分别向该第一 Master节点和该第一备用节点发送心跳消息,其中,
该第一备用节点还用于,在检测到该第一Slave节点向该第一备用节点发送的心跳消息中断的情况下,向该第一Master节点发送心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息,
该第一Master节点包括:
第一接收模块,用于接收该第一备用节点发送的包括该第三指示信息的心跳消息;
第一确定模块,用于根据该第一接收模块接收的该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;
第一检测模块,用于检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断;
第二确定模块,用于在该第一检测模块检测到该第一Slave节点向该第一Master节点发送的心跳消息中断的情况下,确定该第一Master节点与该第一Slave节点也处于失联状态;
第三确定模块,用于根据该第一确定模块与该第二确定模块确定的结果,确定该第一Slave节点发生故障。
结合第六方面,在第六方面的第一种可能的实现方式中,该第一检测模块具体用于,检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该第一Master节点接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
结合第六方面或第六方面的第一种可能的实现方式,在第六方面的第二种可能的实现方式中,该第一Master节点还包括:
第二检测模块,用于在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
第四确定模块,用于在该第二检测模块在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,确定该第一备用节点和该第一参考节点均发生故障。
结合第六方面或第六方面的第一种或第二种可能的实现方式,在第六方面的第三种可能的实现方式中,该分布式集群系统还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该第一Master节点还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第五确定模块,用于根据该第二接收模块接收的该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一Master节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
结合第六方面的第三种可能的实现方式,在第六方面的第四种可能的实现方式中,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点的节点属性为Master节点的广播消息;
接收单元,用于接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一Master节点发送的;
第二发送单元,用于在确定该第一Master节点的权重大于或等于该第二Master节点的权重时,向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该第一Master节点的权重小于该第二Master节点的权重时,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点降级为Slave节点的广播消息。
基于上述技术方案,在本发明实施例中,该分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。在本发明实施例中,备用节点通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1示出了本发明实施例涉及的分布式集群的示意图。
图2示出了本发明实施例提供的处理至少一个分布式集群中的故障的方法的示意性流程图。
图3示出了本发明实施例提供的处理至少一个分布式集群中的故障的方法的另一示意性流程图。
图4示出了本发明实施例提供的处理至少一个分布式集群中的故障的方法的再一示意性流程图。
图5(a),(b),(c)和(d)示出了本发明实施例提供的处理至少一个分布式集群中的故障的方法的示意图。
图6示出了本发明实施例提供的处理至少一个分布式集群中的故障的方法的再一示意性流程图。
图7示出了本发明实施例提供的用于处理至少一个分布式集群中的故障的设备的示意性框图。
图8示出了本发明实施例提供的用于处理至少一个分布式集群中的故障的设备的再一示意性框图。
图9示出了本发明实施例提供的用于处理至少一个分布式集群中的故障的设备的再一示意性框图。
图10示出了本发明实施例提供的用于处理至少一个分布式集群中的故障的设备的再一示意性框图。
图11示出了本发明实施例提供的分布式集群系统的示意性框图。
图12示出了本发明实施例提供的分布式集群系统的另一示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
为了便于理解本发明实施例提供的数据处理的方案,首先介绍以下概念:
心跳消息
心跳消息(Heartbeat Message)是一种发送源发送到接收方的消息,这种消息可以让接收方确定发送源是否以及何时出现故障或终止。通常,心跳消息从发送源启动时开始发送,直到发送源关闭,期间发送源会不间断的发送周期性或重复的心跳消息。当接收方在某个心跳消息接收周期内没有接收到心跳消息,接收方可能会认为发送源已经关闭、或出现故障,或者当前不可用。
心跳消息可能常常被用于高可用性或容错处理的目的。
为了便于本领域技术人员理解本发明实施例提出的处理至少一个分布式集群中的故障的方法、设备和系统,下面首先结合图1介绍本发明实施例涉及到的分布式集群。
如图1所示,分布式集群100包括Master节点(主节点)110,备用节点120,参考节点130和Slave节点(从属节点)140。其中,Master节点110,备用节点120和参考节点130三者之间互发心跳消息;参考节点130还向Slave节点140发送心跳消息;Slave节点140分别向主节点110和备用节点120发送心跳消息。
如图1所示,Master节点110,备用节点120和参考节点130三者之中 的两两之间发送心跳消息,具体地,Master节点110分别向备用节点120和参考节点130发送心跳消息,备用节点120分别向Master节点110和参考节点130发送心跳消息,参考节点130分别向Master节点110和备用节点120发送心跳消息。即Master节点110,备用节点120和参考节点130三者互相监控彼此是否存在故障。应理解,如果一个节点存在故障,则该节点就无法向其他节点发送心跳消息,也无法接收到其他节点发送的心跳消息。
如图1所示,由于Slave节点140分别向主节点110和备用节点120发送心跳消息,则Master节点110和备用节点120均可以监控Slave节点130的故障与否。
由于参考节点130向Slave节点140发送心跳消息,则Slave节点140也可以监控该参考节点130。
应理解,分布式集群100中包括的所有节点,均具有基本的本地业务计算对象故障监控功能,该业务计算对象例如为进程等。其中,
Master节点110用于,负责业务计算对象(例如进程)的调度,例如为应用层的业务集群提供仲裁,具体地包括主备仲裁,集群一致性协调控制等。该Master节点监控分布式集群100中所有节点。
备用节点120用于,作为Master节点110的备用节点,即作为Master节点的备份,例如,在Master节点110发生故障时,该备用节点120快速升主接替该Master节点110业务,该备用节点120也监控分布式集群100中所有节点。
参考节点130用于,实时监控Master节点110和备用节点120发送的心跳消息,以便于及时地发现Master节点110或备用节点120发生故障。具体地,例如,在参考节点130检测到Master节点110向参考节点130发送的心跳消息中断的情况下,认为与该Master节点110失联,然后向备用节点120发送携带有指示信息的心跳消息,该指示信息用于指示该参考节点130与该Master节点110处于失联状态,以便于该备用节点120根据该指示信息,能够有效地确定出该Master节点110发生故障。例如,当备用节点120也检测到Master节点110向备用节点120发送的心跳消息中断的情况下,该备用节点120可以综合考虑自身的检测结果以及参考节点130发送的心跳消息中的该指示信息,较为快捷、准确地确定该Master节点110确实发生故障。
类似的,参考节点130也可以协助Master节点110快捷、准确地确定备 用节点120发生故障。
应理解,集群中各个节点发送的心跳消息,可以基于相同的心跳周期来发送,换句话说,每个节点都是按照预设的心跳周期来发送心跳消息,相应地,也按照该预设的心跳周期来接收心跳消息。因此,例如,当参考节点130在一个心跳周期内没有接收到Master节点110发送的心跳消息,就可以认为该Master节点110的心跳消息中断,进而认为与该Master节点110失联。
应理解,该参考节点130也可以根据预设的预设检测周期来判断Master节点110的心跳消息是否中断,该预设检测周期例如设置为心跳周期的3倍或其他整数倍。
综上所述,该参考节点130作为Master节点110和备用节点120的参考方,用于协助Master节点110和备用节点120快速有效地检测彼此是否存在故障,可以有效增强对Master节点110的故障判断的准确性。
Slave节点140,为集群100中除上述Master节点110、备用节点120和参考节点130以外的其它所有节点。该Slave节点140用于,负责搜集本地业务计算对象(例如进程)的状态信息,并将该状态信息上报给Master节点110,并执行Master节点110下发的指令。
可选地,在本发明实施例涉及的分布式集群100包括一个Master节点110和一个备用节点120,可以包括多个参考节点130和多个Slave节点140。
具体地,当该分布式集群100为虚拟机集群时,该集群100中的所有节点均为虚拟机。再例如,当该分布式集群100为物理组机集群时,该集群100中的所有节点均为物理组设备。此外,上述各个节点也可以为逻辑站点等。
图2示出了本发明实施例的处理至少一个分布式集群中的故障的方法200,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该方法200包括:
S210,该第一备用节点接收该第一参考节点发送的心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息;
S220,该第一备用节点根据该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
S230,该第一备用节点检测该第一Master节点向该第一备用节点发送 的心跳消息是否中断;
S240,在检测到该第一Master节点向该第一备用节点发送的心跳消息中断的情况下,该第一备用节点确定该第一备用节点与该第一Master节点也处于失联状态;
S250,该第一备用节点确定与该第一备用节点和该第一参考节点均失联的该第一Master节点发生故障。
在本发明实施例中,该分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。
因此,本发明实施例提供的处理至少一个分布式集群中的故障的方法,备用节点通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
可选地,本发明实施例提供的处理至少一个分布式集群中的故障的方法200所涉及的第一分布式集群可以是如图1所示的分布式集群100,本发明实施例中的第一Master节点、第一备用节点、第一参考节点和第一Slave节点分别对应于图1所示的分布式集群100中的Master节点110,备用节点120,参考节点130和Slave节点140。
在本发明实施例中,各个节点发送的心跳消息,可以基于相同的心跳周期来发送,换句话说,每个节点都是按照预设的心跳周期来发送心跳消息,相应地,也按照该预设的心跳周期来接收心跳消息。该心跳周期可以是系统预设的。
在本发明实施例中,可选地,第一参考节点当在预设检测周期内没有接收到第一Master节点的心跳消息时,确定与第一Master节点处于失联状态,然后在下一个心跳周期,向该第一备用节点发送包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息的心跳消息。其中,该预设检测周期可以等于N倍的心跳周期,N可以为1或大于1的整数,具体 地,例如N为4~7。
还应理解,一个分布式集群中所有节点的节点属性(即节点的角色信息,例如Master节点,Slave节点,参考节点和备用节点)都是公知的,例如,每一个Slave节点都知道该分布式集群中哪个是Master节点,哪个是备用节点,哪个是参考节点。
可选地,在本发明实施例中,各个节点发送的心跳消息中均包括该心跳消息的发送端节点所认为的该心跳消息的接收端节点的节点属性信息(Message Type)。
例如,在图1所示的分布式集群100中,Master节点110向备用节点120发送的心跳消息中包括的心跳消息的接收端的节点属性为备用节点;再例如,Master节点110发送给参考节点130的心跳消息中包括用于表示参考节点的节点属性信息。
可选地,在本发明实施例中,S230该第一备用节点检测该第一Master节点向该第一备用节点发送的心跳消息是否中断,包括:
该第一备用节点检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该第一备用节点接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
具体地,例如在第一时刻t1该第一备用节点接收到第一参考节点发送的包括有该第一指示信息的心跳消息,该第一备用节点检测在该第一时刻t1与该第一时刻t1之前的第二时刻t2之间,是否接收到该第一Master节点发送的心跳消息。
该第一时刻与该第二时刻之间的时间间隔可以为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的整数倍,例如1倍、4倍或7倍。
应理解,在S230中,第一备用节点还可以采用其他可行的方案,来检测自己与第一Master节点是否处于失联状态,例如,该第一备用节点还可以在接收到第一参考节点的包括该第一指示信息的心跳消息之前,自主地判断自己是否与第一Master节点处于失联状态,本发明实施例对此不作限定。
因此,本发明实施例提供的处理至少一个分布式集群中的故障的方法,备用节点通过参考节点发送的包括第一指示信息的心跳消息以及自己的检 测结果,确定Master节点与备用节点和参考节点均失联,从而确定出该Master节点发生故障。能够较为高效、准确地判断分布式集群中的Master节点是否发生故障,相对于现有技术,能够有效缩短故障检测时间,也能够提高故障检测准确性。
可选地,如图3所示,在本发明实施例中,在确定该第一Master节点发生故障的情况下,该方法200还包括:
S260,该第一备用节点向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该第一备用节点升级为该第一Master节点。
具体地,该第一备用节点更新为该第一分布式集群内新的第一Master节点,即接替了原来第一Master节点(即发生故障的第一Master节点)的相关业务。
可选地,在本发明实施中,该方法200还包括:
S270,由原有第一备用节点升级后的第一Master节点重新确定该第一分布式集群中的新的第一备用节点。
具体地,例如该由原有第一备用节点升级后的第一Master节点从该第一分布式集群的第一Slave节点中选出新的第一备用节点,该新的第一备用节点与原有的第一备用节点具有相同功能,即用于监控第一分布式集群内的第一Master节点和第一参考节点,并在第一Master节点发生故障时,接替其业务。
因此,在本发明实施例中,当备用节点确定Master节点发生故障后,快速升级为新的Master节点,跳过了目前技术中临时选举新的Master节点的环节,节省了选举新的Master节点所消耗的时间,从而能够较为快捷地恢复集群中存在的故障,有利于业务的延续性。
应理解,在本发明实施例中,如果第一备用节点在收到第一参考节点发送的包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息的心跳消息后,检测到自己与该第一Master节点没有失联,则没有上述S250、S260和S270的动作。
可选地,在本发明实施例中,第一参考节点的数量可以有多个。
具体地,结合图1所示,例如分布式集群100中包括3个参考节点131,132和133,且每个参考节点都与Master节点110和备用节点120构成一个由三个节点组成的监控环,即在该监控环内,三个节点之间互发心跳消息,利用 方法200中描述的方法,互相监控彼此是否为故障节点。
可选地,在本发明实施例中,备用节点120分别接收到参考节点131,132和133发送的心跳消息A,B和C,其中心跳消息A中包括有用于指示参考节点131与Master节点110处于失联状态的指示信息,心跳消息B中包括有用于指示参考节点132与Master节点110处于失联状态的指示信息,心跳消息C中包括有用于指示参考节点133与Master节点110处于失联状态的指示信息;备用节点120检测到自身与Master节点110也处于失联状态;该备用节点120根据心跳消息A,B和C中的指示信息,以及自己的检测信息,推断出,该Master节点110与参考节点131,132,133以及备用节点120均处于失联状态,则可以较为准确地确定该Master节点110发生故障。
因此,在本发明实施例中,分布式集群中包括多个参考节点,可以向备用节点提供较多的参考信息,从而有助于备用节点快速且较为准确地判断出Master节点是否发生故障。
还应理解,在上述包括多个参考节点的实施例中,备用节点可以自主地检测自身是否与Master节点失联,也可以在接收到心跳消息A和/或心跳消息B和/或心跳消息C的情况下,再去检测自身是否与Master节点失联。
结合图1,在分布式集群100中,Master节点110也可以根据方法200描述的两方共同监控一方的方法,监控Slave节点140的故障情况。
图4示出了本发明另一实施例提供的处理至少一个分布式集群中的故障的方法300的示意性流程图,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该第一分布式集群还包括第一参考节点以及作为该第一Master节点的备份的第一备用节点,该方法300包括:
S310,该第一Master节点接收该第一备用节点发送的心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息;
S320,该第一Master节点根据该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;
S330,该第一Master节点检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断;
S340,在检测到该第一Slave节点向该第一Master节点发送的心跳消息 中断的情况下,该第一Master节点确定该第一Master节点与该第一Slave节点也处于失联状态;
S350,该第一Master节点确定与该第一Master节点和该第一备用节点均失联的该第一Slave节点发生故障。
在本发明实施例中,分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该Master节点根据备用节点发送的心跳消息确定备用节点与该Slave处于失联状态,并通过检测该Slave节点向该Master节点发送的心跳消息也中断来确定该Slave节点与该Master节点也处于失联状态,从而可以有效地确定与该Master节点和该备用节点均失联的该Slave节点发生故障。
因此,本发明实施例提供的处理至少一个分布式集群中的故障的方法,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有技术,能够有效缩短Slave节点的故障检测时间,同时也能够提高故障检测的准确性。
在本发明实施例中,Master节点无需像现有技术中一样向所有Slave节点发送心跳消息,只需通过检测Salve节点发送的心跳消息,实现对Slave节点的监控,并结合备用节点发送的心跳消息中的用于指示Salve节点失联的指示信息,可以确定出存在故障的Slave节点。相对于现有方案,Master节点的心跳消息处理量可以减半,有效降低了Master节点的负载。
在本发明实施例中,可选地,第一备用节点当在预设检测周期内没有接收到第一Slave节点的心跳消息时,确定与该第一Slave节点失联,然后在下一个心跳周期,向第一Master节点发送包括用于指示第一备用节点与该第一Slave节点失联的第三指示信息的心跳消息。其中,该预设检测周期可以等于N倍的心跳消息发送周期,N可以为1或大于1的整数。
可选地,在本发明实施例中,该备用节点发送的包括第三指示信息的心跳消息中还包括用于指示该心跳消息的接收端的节点属性的指示信息,其中节点属性也可称之为角色信息(Message Type)。
可选地,在本发明实施例中,S330该第一Master节点检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断,包括:
该第一Master节点检测在第三时刻与第四时刻之间是否接收到该第一 Slave节点发送的心跳消息,该第三时刻为该第一Master节点接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
具体地,例如在第三时刻t3该第一Master节点接收到第一备用节点发送的包括有该第三指示信息的心跳消息,该第一Master节点检测在该第三时刻t2与该第三时刻t3之前的第四时刻t4之间,是否接收到该第一Slave节点发送的心跳消息。
该第三时刻与该第四时刻之间的时间间隔可以为该第一Slave节点向该第一Master节点发送心跳消息的心跳周期的整数倍,例如,1倍、4倍或7倍。
应理解,在S330中,该第一Master节点还可以采用其他可行的方案,来检测与第一Slave节点是否处于失联状态,例如,该第一Master节点还可以在接收到第一备用节点发送的包括该第三指示信息的心跳消息之前,自主地判断自己是否与第一Slave节点处于失联状态,本发明实施例对此不作限定。
因此,在本发明实施例中,Master节点根据备用节点发送的包括第三指示信息的心跳消息以及自己对Slave节点的检测信息,通过确定Master节点和备用节点均与该Salve节点均处于失联状态,从而能够较为高效、准确地确定该Slave节点发生故障,相比于现有的处理集群中故障的方案,有效缩短了故障检测的时间,同时也能够降低在故障检测过程中Master节点的能耗。
现有的分布式集群中包括两种角色的节点,即Master节点和Slave节点,通过互发心跳消息来监控彼此是否发生故障,由于监控信息的单一,一般需要通过多次检测心跳消息,例如,Slave节点在多个预设检测周期(心跳周期的整数倍)内都接收不大Master节点发送的心跳消息时,才会认为Master节点发生故障,导致故障检测时间较长。
在本发明实施例提供的分布式集群中包括四种角色的节点,例如图1所示的,Master节点,Slave节点,参考节点和备用节点,其中,Master节点,备用节点和参考节点互发心跳消息,能够互相监控;Slave节点向Master节点和备用节点发送心跳消息,即Master节点和备用节点可以共同监控Slave 节点。参考节点还向Slave节点发送心跳消息,用于让Slave节点感知到自己所在的集群。例如,Master节点通过参考备用节点发送的心跳消息和自己对Salve节点的监控信息,可以快速、准确地确定Slave节点是否发生故障。在本发明实施例中,如果Master节点发现备用节点和/或参考节点发生故障,可以在Slave节点中重新确定出新的备用节点和/或参考节点;如果备用节点发现Master节点发生故障,会快速更新为新的Master节点。即在本发明实施例中,集群中四个角色的节点实时地维护这集群的完整性和有效性。
此外,在本发明实施例中,Master节点只接收Slave节点的心跳消息,而不向各个Slave节点发送心跳消息,根据备用节点发送的心跳消息和自己的检测结果,就可以有效地监控Slave节点的故障情况,同时相比于现有技术,一方面能够提高检测故障的效率,另一方面有效地降低了Master节点的负载。
可选地,在本发明实施例中,该方法300还包括:
S360,该第一Master节点在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
S370,在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,该第一Master节点确定该第一备用节点和该第一参考节点均发生故障。
具体地,该预设检测周期可以是系统预设的用于判断故障的时间段,例如可以直接等于心跳周期,也可以为心跳周期的4倍或7倍。
可选地,在本发明实施例中,该方法300还包括:
S380,当该第一Master节点确定该第一备用节点和该第一参考节点均发生故障的情况下,重新确定该第一分布式集群中的新的第一备用节点和新的第一参考节点。
具体地,例如利用分布式选举算法、从满足某一原则(如心跳正常)的节点集合里面随机指定新的备用节点和新的参考节点。
在本发明实施例中,Master节点利用多路径检测结果,综合判断Slave节点的故障情况,一方面可以缩短检测故障的时间,另一方面可以提高故障检测的可靠性。
一个网络集群因交换节点或路由节点发生故障而导致分裂成多个子集 群是一种典型的集群故障场景。本发明实施例涉及的包括四个角色的集群,可以有效避免或者解决上述集群分裂的问题。
可选地,在本发明实施例中,
该方法300还包括:该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该方法300还包括:
S3010,该第一Master节点接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
具体地,该第一分布式集群与该第二分布式集群具有相同的集群标识,所以,第二分布式集群中的第二参考节点能够感知到第一分布式集群中的节点,并将第一分布式集群中的所有节点都看作为Slave节点,因此,第二参考节点分别向第二分布式集群中的第二Salve节点和第一分布式集群中的所有节点发送包括用于指示接收端的节点属性为Salve节点的心跳消息。
S3020,该第一Master节点根据该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一Master节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
S3030,该第一Master节点与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,S3030第一Master节点与该第二分布式集群中的第二Master节点进行协商,包括:
S3031,该第一Master节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点的节点属性为Master节点的广播消息;
S3032,该第一Master节点接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该广播消息指示的节点属性与自身的节点属性相 同的情况下向该第一Master节点发送的;
S3033,在确定该第一Master节点的权重大于或等于该第二Master节点的权重时,该第一Master节点向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
S3034,在确定该第一Master节点的权重小于该第二Master节点的权重时,该第一Master节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点降级为Slave节点的广播消息。
具体地,如图5(a)所示,一个网络集群分裂为两个子集群A和B,子集群A和B是由一个网络集群分裂而来,因此该子集群A和B具有相同的集群标识。记子集群A包括Master节点A,备用节点A,参考节点A和Slave节点A;子集群B包括Master节点B,备用节点B,参考节点B和Slave节点B。子集群A和子集群B中的各个节点都具有如图1所示的分布式集群100中的对应节点的特性。
在子集群B中的参考节点B看来,它能够接收到Master节点B和备用节点B的心跳消息,所以,在参考节点B看来,除了Master节点B和备用节点B之外,其他节点都是Slave节点,即子集群A中的所有节点在参考节点B看来,都是处于失联状态下的Slave节点。
如图5(b)所示,子集群B中的参考节点B除了向子集群B中的Master节点B发送心跳消息(接收端的节点属性为Master)、向子集群B中的备用节点B发送心跳消息(接收端的节点属性为备用)、向子集群B中的Slave节点B发送心跳消息(接收端的节点属性为Slave)之外,所以还会向子集群A中的所有节点发送心跳消息,其该心跳消息中指示的接收端的节点属性为Slave节点。
子集群A中的所有节点都接收到子集群B中的参考节点B发送的包括用于指示接收端的节点属性为Slave节点的指示信息的心跳消息,子集群A中的Master节点A,备用节点A和参考节点A接收到参考节点B发送的该心跳消息后,会感知到该心跳消息携带的节点属性与自身的节点属性信息不相符。
以子集群A中的Master节点A为例,子集群A中的Master节点A根据参考节点B发送的心跳消息,确定该心跳消息携带的节点属性与自身的节点属性信息不相符,子集群A中的Master节点A向所有节点发送用于指示 自己的节点属性的广播消息,如图5(c)所示。
子集群B中Master节点B接收到Master节点A发送的广播消息后,检测到角色冲突,向子集群A中的Master节点A发送协商消息,该协商消息中携带有Master节点B的权重信息。
Master节点A接收到Master节点B发送的协商消息后,比较自身与Master节点B的权重,如果判断Master节点A的权重高于Master节点B的权重,则Master节点A向Master节点B发送用于指示Master节点B降级为Slave节点的协商响应消息;如果判断Master节点B的权重高于Master节点A的权重,则该Master节点A主动降级为Slave节点。
具体地,节点的权重例如为:节点存活时长,节点本地缓存的新旧程度(一般用版本号来表征),或者所管理的集群的规模等等。
应理解,图5(c)只示出了以Master节点A为例的示意图,实际中,接收到参考节点B发送的用于指示接收端节点属性为Slave节点的心跳消息后,子集群A中的备用节点B和参考节点B也会判断出该心跳消息携带的节点属性与自身的节点属性信息不相符,也会发送包括自己节点属性的广播消息。备用节点A和备用节点B也会采用类似图5(c)和图5(d)所述的示意图,协商最终的备用节点,参考节点A和参考节点B也会采用类似图5(c)和图5(d)所述的示意图,协商最终的参考节点。
可选地,在图2所示的实施例提供的方法200中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该方法200还包括:
S2010,该第一备用节点接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
S2020,该第一备用节点根据该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一备用节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两 个子集群;
S2030,该第一备用节点与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,S2030该第一备用节点与该第二分布式集群中的第二备用节点进行协商,包括:
S2031,该第一备用节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点的节点属性为备用节点的广播消息;
S2032,该第一备用节点接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一备用节点发送的;
S2033,在确定该第一备用节点的权重大于或等于该第二备用节点的权重的情况下,该第一备用节点向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
S2034,在确定该第一备用节点的权重小于该第二备用节点的权重的情况下,该第一备用节点向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点降级为Slave节点的广播消息。
具体流程与图5所示一致,这里不再赘述。
应理解,本发明实施例中的第一分布式集群可以对应于图5所示的子集群A,第二分布式集群对应于图5中的子集群B。
还应理解,图5(a)只示出了,子集群B中的参考节点B将子集群A中的所有节点看作Slave节点,而向其发送包括有指示接收端的节点属性为Slave节点的心跳消息。还应理解,在子集群A与子集群B合并为一个集群之前,子集群A中的参考节点A也会将子集群B中的所有节点看作为Slave节点,也会向其发送包括有指示接收端的节点属性为Slave节点的心跳消息。子集群B中的Master节点B,参考节点B,以及备用节点B也会执行图5(b),图5(c)和图5(d)所示的动作,直至子集群A和子集群B整合为一个集群为止。
还应理解,上面结合图5只描述了一个分布式集群分裂为两个子集群后,将其整合恢复的过程,本发明实施例提供的集群整合恢复的方案同样适应于,将两个以上分裂的分布式子集群整合为一个分布式集群的场合,本发明 实施例对此不作限定。
在本发明实施例中,各个节点发送的心跳消息中都携带该心跳消息的发送端节点所认为的心跳消息的接收端节点的节点属性信息(角色信息),这样能够让接收心跳消息的节点,感知到集群的分裂,从而触发后续的动作,实现分裂的集群的整合。
综上所述,本发明实施例提供的处理至少一个分布式集群中的故障的方法,能够有效缩短集群中故障检测的时间,并能够有效提高故障检测的准确性,同时也能够降低Master节点处理心跳消息的负担。
上文结合图1至图3,描述了在本发明实施例提出的分布式集群中,备用节点确定Master节点发生故障的过程,结合图1和图4,描述了在本发明实施例提出的分布式集群中,Master节点确定Slave节点发生故障的过程。下面从参考节点的角度描述本发明实施例提供的用于处理分布式集群的故障的方法。
图6示出了本发明另一实施例提供的处理至少一个分布式集群中的故障的方法400,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该方法400包括:
S410,该第一参考节点检测该第一Master节点向该第一参考节点发送的心跳消息是否中断;
S420,当确定该第一Master向该第一参考节点发送的心跳消息中断时,该第一参考节点确定与该第一Master节点处于失联状态;
S430,该第一参考节点向第一备用节点发送心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息,以便于所述第一备用节点判断所述第一Master节点是否为故障节点。
在本发明实施例中,参考节点在确定与Master节点处于失联状态的情况下,向备用节点发送包括用于指示该状况的指示信息的心跳消息,从而以便于备用节点,通过参考该指示信息,进一步判断该Master节点是否发生故障。有助于备用节点根据多路径的检测信息综合确定分布式集群中的故障情况,能够有效提高故障检测的效率和准确性。
可选地,在本发明实施例中,S410该第一参考节点检测该第一Master节点向该第一参考节点发送的心跳消息是否中断,包括:
该第一参考节点在预设检测周期内,检测是否接收到该第一Master发送的心跳消息。
具体地,该预设检测周期可以为该第一Master节点向该第一参考节点发送心跳消息的心跳周期的N倍,N为正整数。
可选地,在本发明实施例中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该第二分布式集群与第一分布式集群为一个网络集群分裂后形成的两个子集群,该方法400还包括:
该第一参考节点分别向该第一分布式集群中的第一Slave节点,以及该第二分布式集群中的所有节点发送心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的指示信息,以便于该第二分布式集群中的第二Master节点,第二备用节点和第二参考节点能够通过该指示信息,感知到该第二分布式集群。
具体地,如图5(b)所示,子集群B中的参考节点B向Slave节点B,以及子集群A中的所有节点发送包括用于指示接收端为Slave节点的指示信息的心跳消息。
应理解,本发明实施例中的第一参考节点可对应于方法200和方法300中涉及的第二参考节点,还可以对应于图5(b)所示的参考节点B。
在本发明实施例中,参考节点发送的心跳消息携带用于指示心跳消息的接收端的节点属性的指示信息,这样能够让心跳消息的接收端端节点,感知到集群的分裂,从而触发后续的动作,实现分裂的集群的整合。
综上所述,在本发明实施例提供的处理至少一个分布式集群中的故障的方法中,该分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点。该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。该Master节点根据备用节点发送的心跳消息确定备用节点与该Slave处于失联状态,并通过检测该Slave节点向该Master节点发送的心跳消息也中断来确定该Slave节点与该Master节点也处于失联状态,从而可 以有效地确定与该Master节点和该备用节点均失联的该Slave节点发生故障。即本发明实施例提供的分布式集群中包括Master节点,Slave节点,备用节点和参考节点,可以通过两方节点的检测结果综合判断第三方节点是否发生故障,从而能够较为高效、准确地检测故障,相对于现有技术,能够有效缩短故障检测时间,同时也能够降低Master节点处理心跳消息的负担。
上文中结合图1至图6,描述了本发明实施例提供的处理至少一个分布式集群中的故障的方法,下面将结合图7和图8,描述本发明实施例提供的用于处理至少一个分布式集群中的故障的设备。
图7示出了根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备500的示意性框图。该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,其中,该设备为该第一备用节点,该设备500包括:
第一接收模块510,用于接收该第一参考节点发送的包括有该第一指示信息的心跳消息;
第一确定模块520,用于根据该第一接收模块接收的该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
检测模块530,用于检测该第一Master节点向该设备发送的心跳消息是否中断;
第二确定模块540,用于在该检测模块检测到该第一Master节点向该设备发送的心跳消息中断的情况下,确定该设备与该第一Master节点也处于失联状态;
第三确定模块550,用于根据该第一确定模块和该第二确定模块确定的结果,确定该第一Master节点发生故障。
在该第一分布式集群中,该第一参考节点用于,在检测到该第一Master节点向该第一参考节点发送的心跳消息中断的情况下,向该第一备用节点发送心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息。
在本发明实施例中,该分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该 Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。
因此,本发明实施例提供的设备,通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
可选地,本发明实施例提供的用于处理至少一个分布式集群中的故障的设备500中涉及的分布式集群可以是如图1所示的分布式集群100。
可选地,在本发明实施例中,该设备500还包括:
发送模块560,用于在该第三确定模块确定该第一Master节点发生故障的情况下,向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该设备升级为该第一Master节点。
可选地,在本发明实施例中,该检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该设备接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该设备发送心跳消息的心跳周期的N倍,N为正整数。
可选地,在本发明实施例中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该设备500还包括:
第二接收模块570,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第四确定模块580,用于根据该第二接收模块接收的该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该设备的节点属性不相符,并确定该第二参考节点所在的第二分布 式集群与该设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块590,用于与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,该协商模块590包括:
第一发送单元591,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备的节点属性为备用节点的广播消息;
接收单元592,用于接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元593,用于在确定该设备的权重大于或等于该第二备用节点的权重的情况下,向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
第三发送单元594,用于在确定该设备权重小于该第二备用节点的权重的情况下,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备降级为Slave节点的广播消息。
因此,本发明实施例提供的设备,通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
应理解,根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备500可对应于本发明实施例的处理至少一个分布式集群中的故障的方法中的备用节点,并且设备500中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
图8示出了根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备600的示意性框图。该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该第一分布式集群还包括第一参考节点以及作为该第一Master节点的备份的第一备用节点,该设备600为该第一Master节点,该设备600包括:
第一接收模块610,用于接收该第一备用节点发送的包括该第三指示信息的心跳消息;
第一确定模块620,用于根据该第一接收模块接收的该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;
第一检测模块630,用于检测该第一Slave节点向该设备发送的心跳消息是否中断;
第二确定模块640,用于在该第一检测模块检测到该第一Slave节点向该设备发送的心跳消息中断的情况下,确定该设备与该第一Slave节点也处于失联状态;
第三确定模块650,用于根据该第一确定模块与该第二确定模块确定的结果,确定该第一Slave节点发生故障。
在该第一分布式集群中,该第一备用节点用于,在检测到该第一Slave节点向该第一备用节点发送的心跳消息中断的情况下,向该第一Master节点发送心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息。
在本发明实施例中,分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该Master节点根据备用节点发送的心跳消息确定备用节点与该Slave处于失联状态,并通过检测该Slave节点向该Master节点发送的心跳消息也中断来确定该Slave节点与该Master节点也处于失联状态,从而可以有效地确定与该Master节点和该备用节点均失联的该Slave节点发生故障。
因此,在本发明实施例中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有的处理集群中故障的方案,有效缩短了故障检测的时间,同时也能够降低在故障检测过程中Master节点的能耗。
可选地,在本发明实施例中,该第一检测模块具体用于,检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该设备接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该设备发送心跳消息的心跳周期的N倍,N为 正整数。
可选地,在本发明实施例中,该设备600还包括:
第二检测模块,用于在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
第四确定模块,用于在该第二检测模块在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,确定该第一备用节点和该第一参考节点均发生故障。
可选地,在本发明实施例中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该设备600还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第五确定模块,用于根据该第二接收模块接收的该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该设备的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备的节点属性为Master节点的广播消息;
接收单元,用于接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元,用于在确定该设备的权重大于或等于该第二Master节点的权重时,向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该设备的权重小于该第二Master节点的权重时,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该设备降级为Slave节点的广播消息。
因此,在本发明实施例中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有的处理集群中故障的方案,有效缩短了故障检测的时间,同时也能够降低在故障检测过程中Master节点的能耗。
应理解,根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备600可对应于本发明实施例的处理至少一个分布式集群中的故障的方法中的Master节点,并且设备600中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
如图9所示,本发明实施例还提供了一种用于处理至少一个分布式集群中的故障的设备700,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该分布式集群还包括第一参考节点,以及作为该第一Master节点的备份的第一备用节点,该设备700为该第一备用节点,该设备700包括处理器710、存储器720、总线系统730、接收器740和发送器750。其中,处理器710、存储器720、接收器740和发送器750通过总线系统730相连,该存储器720用于存储指令,该处理器710用于执行该存储器720存储的指令,以控制接收器740接收信号,并控制发送器750发送信号。其中,接收器740用于,接收该第一参考节点发送的心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息;该处理器710用于,根据该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;检测该第一Master节点向该第一备用节点发送的心跳消息是否中断;在检测到该第一Master节点向该第一备用节点发送的心跳消息中断的情况下,该第一备用节点确定该第一备用节点与该第一Master节点也处于失联状态;确定与该第一 备用节点和该第一参考节点均失联的该第一Master节点发生故障。
因此,本发明实施例提供的设备,通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
可选地,在本发明实施例中,发送器750还用于,在处理器710确定该第一Master节点发生故障之后,向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该第一备用节点升级为该第一Master节点。
可选地,在本发明实施例中,处理器710具体用于,检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该第一备用节点接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
可选地,在本发明实施例中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该接收器740用于,接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;该处理器710用于,根据该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一备用节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,该发送器750用于,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点的节点属性为备用节点的广播消息;该接收器740用于,接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协 商消息是该第二备用节点在检测到该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一备用节点发送的;该发送器750用于,在确定该第一备用节点的权重大于或等于该第二备用节点的权重的情况下,向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;在确定该第一备用节点的权重小于该第二备用节点的权重的情况下,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点降级为Slave节点的广播消息。
应理解,在本发明实施例中,该处理器710可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器710还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器720可以包括只读存储器和随机存取存储器,并向处理器710提供指令和数据。存储器720的一部分还可以包括非易失性随机存取存储器。例如,存储器720还可以存储设备类型的信息。
该总线系统730除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统730。
在实现过程中,上述方法的各步骤可以通过处理器710中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器720,处理器710读取存储器720中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
因此,本发明实施例提供的设备,通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
应理解,根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备700可对应于本发明实施例的处理至少一个分布式集群中的故障的 方法中的备用节点,也对应于根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备500,并且设备,700中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
如图10所示,本发明实施例还提供了用于处理至少一个分布式集群中的故障的设备800,该至少一个分布式集群包括第一分布式集群,该第一分布式集群中包括第一Master节点和第一Slave节点,该第一分布式集群还包括第一参考节点以及作为该第一Master节点的备份的第一备用节点,该设备800为该第一Master节点,该设备800包括处理器810、存储器820、总线系统830、接收器840和发送器850。其中,处理器810、存储器820、接收器840和发送器850通过总线系统830相连,该存储器820用于存储指令,该处理器810用于执行该存储器820存储的指令,以控制接收器840接收信号,并控制发送器850发送信号。其中,该接收器840用于,接收该第一备用节点发送的心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息;该处理器810用于,根据该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断;在检测到该第一Slave节点向该第一Master节点发送的心跳消息中断的情况下,该第一Master节点确定该第一Master节点与该第一Slave节点也处于失联状态;点确定与该第一Master节点和该第一备用节点均失联的该第一Slave节点发生故障。
因此,在本发明实施例中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有的处理集群中故障的方案,有效缩短了故障检测的时间,同时也能够降低在故障检测过程中Master节点的能耗。
可选地,在本发明实施例中,该处理器810用于,检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该第一Master节点接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该第一Master节点发送心跳消息的心跳周 期的N倍,N为正整数。
可选地,在本发明实施例中,该处理器810用于,在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,确定该第一备用节点和该第一参考节点均发生故障。
可选地,在本发明实施例中,该至少一个分布式集群还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该接收器840用于,接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;该处理器810用于,根据该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一Master节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,在本发明实施例中,发送器850用于,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点的节点属性为Master节点的广播消息;接收器840用于,接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一Master节点发送的;发送器850用于,在确定该第一Master节点的权重大于或等于该第二Master节点的权重时,向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;在确定该第一Master节点的权重小于该第二Master节点的权重时,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点降级为Slave节点的广播消息。
因此,在本发明实施例中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有的处理集群中故障的方案,有效缩短了故障检测的时间,同时也能够降低在故障检测过程中Master节点的能耗。
应理解,根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备800可对应于本发明实施例的处理至少一个分布式集群中的故障的方法中的Master节点,也可以对应于根据本发明实施例提供的用于处理至少一个分布式集群中的故障的设备600,并且设备,800中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
图11示出了本发明实施例提供的分布式集群系统900的示意性框图,该分布式集群系统包括第一分布式集群901,该第一分布式集群中包括第一Master节点910和第一Slave节点920,该分布式集群还包括第一参考节点930,以及作为该第一Master节点的备份的941,该第一Master节点910、该第一备用节点940和该第一参考节点930用于彼此之间互发心跳消息,该第一参考节点930还用于向该第一Slave节点920发送心跳消息,该第一Slave节点920用于分别向该第一Master节点910和该第一备用节点930发送心跳消息,其中,
该第一参考节点930还用于,在检测到该第一Master节点向该第一参考节点发送的心跳消息中断的情况下,向该第一备用节点发送心跳消息,该心跳消息包括用于指示该第一参考节点与该第一Master节点处于失联状态的第一指示信息,
该第一备用节点940包括:
第一接收模块941,用于接收该第一参考节点发送的包括该第一指示信息的心跳消息;
第一确定模块942,用于根据该第一接收模块接收的该第一指示信息,确定该第一参考节点与该第一Master节点处于失联状态;
检测模块943,用于检测该第一Master节点向该第一备用节点发送的心跳消息是否中断;
第二确定模块944,用于在该检测模块检测到该第一Master节点向该第 一备用节点发送的心跳消息中断的情况下,确定该第一备用节点与该第一Master节点也处于失联状态;
第三确定模块945,用于根据该第一确定模块和该第二确定模块确定的结果,确定该第一Master节点发生故障。
具体地,该第一分布式集群可对应于图1所示的分布式集群100,具体描述可参见上文,为了简洁,这里不再赘述。
在本发明实施例中,该分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。在本发明实施例中,备用节点通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
可选地,作为一个实施例,该第一备用设备940还包括:
发送模块946,用于在该第三确定模块确定该第一Master节点发生故障的情况下,向该第一分布式集群中所有节点发送广播消息,该广播消息用于指示该第一备用节点升级为该第一Master节点。
可选地,作为一个实施例,该检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到该第一Master节点发送的心跳消息,该第一时刻为该第一备用节点接收到该第一参考节点发送的包括有该第一指示信息的心跳消息的时刻,该第二时刻早于该第一时刻,该第一时刻与该第二时刻之间的时间间隔为该第一Master节点向该第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
可选地,作为一个实施例,该分布式集群系统还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该第一备用节点还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第二指示信 息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中的所有节点发送包括该第二指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第四确定模块,用于根据该第二接收模块接收的该第二指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一备用节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二备用节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,作为一个实施例,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点的节点属性为备用节点的广播消息;
接收单元,用于接收该第二备用节点发送的协商消息,该协商消息中包括用于指示该第二备用节点的权重的信息,该协商消息是该第二备用节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该设备发送的;
第二发送单元,用于在确定该第一备用节点的权重大于或等于该第二备用节点的权重的情况下,向该第二备用节点发送用于指示该第二备用节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该第一备用节点权重小于该第二备用节点的权重的情况下,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一备用节点降级为Slave节点的广播消息。
因此,在本发明实施例中,该分布式集群包括Master节点、Slave节点参考节点和该Master节点的备用节点,该备用节点根据参考节点发送的心跳消息确定Master节点与该参考节点处于失联状态,并通过检测该Master节点向该备用节点发送的心跳消息也中断来确定该Master节点与该备用节点也处于失联状态,从而可以有效地确定与该备用节点和该参考节点均失联的该Master节点发生故障。在本发明实施例中,备用节点通过参考节点发送的用于指示Master节点失联的心跳消息,以及自身检测到的该Master节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Master节点发生故 障,相比于现有技术,能够有效缩短Master节点的故障检测时间。
应理解,根据本发明实施例提供的分布式集群系统900中的第一分布式集群901可对应于本发明实施例提供的用于处理分布式集群中的故障的方法中的第一分布式集群,且该分布式集群系统900中的第一备用节点940也对应于本发明实施例提供的用于处理分布式集群中的故障的设备700,并且分布式集群系统900中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
图12示出了本发明实施例提供的分布式集群系统1000,该分布式集群系统1000包括第一分布式集群1001,该第一分布式集群中包括第一Master节点1010和第一Slave节点1020,该分布式集群还包括第一参考节点1030,以及作为该第一Master节点的备份的第一备用节点1040,该第一Master节点1010、该第一备用节点1040和该第一参考节点1030用于彼此之间互发心跳消息,该第一参考节点1030还用于向该第一Slave节点1020发送心跳消息,该第一Slave节点1020用于分别向该第一Master节点1010和该第一备用节点1030发送心跳消息,其中,
该第一备用节点1030还用于,在检测到该第一Slave节点向该第一备用节点发送的心跳消息中断的情况下,向该第一Master节点发送心跳消息,该心跳消息包括用于指示该第一备用节点与该第一Slave节点处于失联状态的第三指示信息,
该第一Master节点1010包括:
第一接收模块1011,用于接收该第一备用节点发送的包括该第三指示信息的心跳消息;
第一确定模块1012,用于根据该第一接收模块接收的该第三指示信息,确定该第一备用节点与该第一Slave节点处于失联状态;
第一检测模块1013,用于检测该第一Slave节点向该第一Master节点发送的心跳消息是否中断;
第二确定模块1014,用于在该第一检测模块检测到该第一Slave节点向该第一Master节点发送的心跳消息中断的情况下,确定该第一Master节点与该第一Slave节点也处于失联状态;
第三确定模块1015,用于根据该第一确定模块与该第二确定模块确定的结果,确定该第一Slave节点发生故障。
在本发明实施例中,分布式集群中除了Master节点和Slave节点之外还包括参考节点和该Master节点的备用节点,该Master节点根据备用节点发送的心跳消息确定备用节点与该Slave处于失联状态,并通过检测该Slave节点向该Master节点发送的心跳消息也中断来确定该Slave节点与该Master节点也处于失联状态,从而可以有效地确定与该Master节点和该备用节点均失联的该Slave节点发生故障。
因此,在本发明实施例提供的分布式集群系统中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有技术,能够有效缩短Slave节点的故障检测时间,同时也能够提高故障检测的准确性。
可选地,作为一个实施例,该第一检测模块1013具体用于,检测在第三时刻与第四时刻之间是否接收到该第一Slave节点发送的心跳消息,该第三时刻为该第一Master节点接收到该第一备用节点发送的包括有该第三指示信息的心跳消息的时刻,该第四时刻早于该第三时刻,该第三时刻与该第四时刻之间的时间间隔为该第一Slave节点向该第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
可选地,作为一个实施例,该第一Master节点1010还包括:
第二检测模块,用于在预设检测周期内检测是否接收到该第一备用节点发送的心跳消息和该第一参考节点发送的心跳消息,该预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
第四确定模块,用于在该第二检测模块在该预设检测周期内既没有接收到该第一备用节点发送的心跳消息,也没有接收到该第一参考节点发送的心跳消息的情况下,确定该第一备用节点和该第一参考节点均发生故障。
可选地,作为一个实施例,该分布式集群系统1000还包括第二分布式集群,该第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为该第二Master节点的备份的第二备用节点,该第一Master节点1010还包括:
第二接收模块,用于接收该第二参考节点发送的心跳消息,该心跳消息包括用于指示该心跳消息的接收端的节点属性为Slave节点的第四指示信息,该第二参考节点用于分别向该第二Slave节点以及该第一分布式集群中 的所有节点发送包括该第四指示信息的心跳消息,该第二分布式集群与该第一分布式集群具有相同的集群标识;
第五确定模块,用于根据该第二接收模块接收的该第四指示信息,确定该第二参考节点发送的心跳消息中所指示的该心跳消息的接收端的节点属性与该第一Master节点的节点属性不相符,并确定该第二参考节点所在的第二分布式集群与该第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
协商模块,用于与该第二分布式集群中的第二Master节点进行协商,以便于整合该第一分布式集群和该第二分布式集群。
可选地,作为一个实施例,该协商模块包括:
第一发送单元,用于向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点的节点属性为Master节点的广播消息;
接收单元,用于接收该第二Master节点发送的协商消息,该协商消息中包括用于指示该第二Master节点的权重的信息,该协商消息是该第二Master节点在检测到该第一发送单元发送的该广播消息指示的节点属性与自身的节点属性相同的情况下向该第一Master节点发送的;
第二发送单元,用于在确定该第一Master节点的权重大于或等于该第二Master节点的权重时,向该第二Master节点发送用于指示该第二Master节点降级为Slave节点的协商响应消息;
第三发送单元,用于在确定该第一Master节点的权重小于该第二Master节点的权重时,向该第一分布式集群和该第二分布式集群内所有的节点发送用于指示该第一Master节点降级为Slave节点的广播消息。
因此,在本发明实施例提供的分布式集群系统中,Master节点通过备用节点发送的用于指示Slave节点失联的心跳消息,以及自身检测到的该Slave节点发送的心跳消息中断的检测结果,可以快速、有效地确定该Slave节点发生故障,相比于现有技术,能够有效缩短Slave节点的故障检测时间,同时也能够提高故障检测的准确性。
应理解,根据本发明实施例提供的分布式集群系统1000中的第一分布式集群1001可对应于本发明实施例提供的用于处理分布式集群中的故障的方法中的第一分布式集群,且该分布式集群系统1000中的第一Master节点1010也对应于本发明实施例提供的用于处理分布式集群中的故障的设备 800,并且分布式集群系统1000中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。
应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质 中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (30)

  1. 一种处理至少一个分布式集群中的故障的方法,所述至少一个分布式集群包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述分布式集群还包括第一参考节点,以及作为所述第一Master节点的备份的第一备用节点,所述方法包括:
    所述第一备用节点接收所述第一参考节点发送的心跳消息,所述心跳消息包括用于指示所述第一参考节点与所述第一Master节点处于失联状态的第一指示信息;
    所述第一备用节点根据所述第一指示信息,确定所述第一参考节点与所述第一Master节点处于失联状态;
    所述第一备用节点检测所述第一Master节点向所述第一备用节点发送的心跳消息是否中断;
    在检测到所述第一Master节点向所述第一备用节点发送的心跳消息中断的情况下,所述第一备用节点确定所述第一备用节点与所述第一Master节点也处于失联状态;
    所述第一备用节点确定与所述第一备用节点和所述第一参考节点均失联的所述第一Master节点发生故障。
  2. 根据权利要求1所述的方法,其特征在于,在确定所述第一Master节点发生故障的情况下,所述方法还包括:
    所述第一备用节点向所述第一分布式集群中所有节点发送广播消息,所述广播消息用于指示所述第一备用节点升级为所述第一Master节点。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一备用节点检测所述第一Master节点向所述第一备用节点发送的心跳消息是否中断,包括:
    所述第一备用节点检测在第一时刻与第二时刻之间是否接收到所述第一Master节点发送的心跳消息,所述第一时刻为所述第一备用节点接收到所述第一参考节点发送的包括有所述第一指示信息的心跳消息的时刻,所述第二时刻早于所述第一时刻,所述第一时刻与所述第二时刻之间的时间间隔为所述第一Master节点向所述第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述至少一个分布式集群还包括第二分布式集群,所述第二分布式集群中包括第二 Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节点的备份的第二备用节点,所述方法还包括:
    所述第一备用节点接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第二指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第二指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    所述第一备用节点根据所述第二指示信息,确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述第一备用节点的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    所述第一备用节点与所述第二分布式集群中的第二备用节点进行协商,以便于整合所述第一分布式集群和所述第二分布式集群。
  5. 根据权利要求4所述的方法,其特征在于,所述第一备用节点与所述第二分布式集群中的第二备用节点进行协商,包括:
    所述第一备用节点向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一备用节点的节点属性为备用节点的广播消息;
    所述第一备用节点接收所述第二备用节点发送的协商消息,所述协商消息中包括用于指示所述第二备用节点的权重的信息,所述协商消息是所述第二备用节点在检测到所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述第一备用节点发送的;
    在确定所述第一备用节点的权重大于或等于所述第二备用节点的权重的情况下,所述第一备用节点向所述第二备用节点发送用于指示所述第二备用节点降级为Slave节点的协商响应消息;
    在确定所述第一备用节点的权重小于所述第二备用节点的权重的情况下,所述第一备用节点向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一备用节点降级为Slave节点的广播消息。
  6. 一种处理至少一个分布式集群中的故障的方法,所述至少一个分布式集群包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述第一分布式集群还包括第一参考节点以 及作为所述第一Master节点的备份的第一备用节点,所述方法包括:
    所述第一Master节点接收所述第一备用节点发送的心跳消息,所述心跳消息包括用于指示所述第一备用节点与所述第一Slave节点处于失联状态的第三指示信息;
    所述第一Master节点根据所述第三指示信息,确定所述第一备用节点与所述第一Slave节点处于失联状态;
    所述第一Master节点检测所述第一Slave节点向所述第一Master节点发送的心跳消息是否中断;
    在检测到所述第一Slave节点向所述第一Master节点发送的心跳消息中断的情况下,所述第一Master节点确定所述第一Master节点与所述第一Slave节点也处于失联状态;
    所述第一Master节点确定与所述第一Master节点和所述第一备用节点均失联的所述第一Slave节点发生故障。
  7. 根据权利要求6所述的方法,其特征在于,所述第一Master节点检测所述第一Slave节点向所述第一Master节点发送的心跳消息是否中断,包括:
    所述第一Master节点检测在第三时刻与第四时刻之间是否接收到所述第一Slave节点发送的心跳消息,所述第三时刻为所述第一Master节点接收到所述第一备用节点发送的包括有所述第三指示信息的心跳消息的时刻,所述第四时刻早于所述第三时刻,所述第三时刻与所述第四时刻之间的时间间隔为所述第一Slave节点向所述第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
  8. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:
    所述第一Master节点在预设检测周期内检测是否接收到所述第一备用节点发送的心跳消息和所述第一参考节点发送的心跳消息,所述预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
    在所述预设检测周期内既没有接收到所述第一备用节点发送的心跳消息,也没有接收到所述第一参考节点发送的心跳消息的情况下,所述第一Master节点确定所述第一备用节点和所述第一参考节点均发生故障。
  9. 根据权利要求6至8中任一项所述的方法,其特征在于,所述至少一个分布式集群还包括第二分布式集群,所述第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节 点的备份的第二备用节点,所述方法还包括:
    所述第一Master节点接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第四指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第四指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    所述第一Master节点根据所述第四指示信息,确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述第一Master节点的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    所述第一Master节点与所述第二分布式集群中的第二Master节点进行协商,以便于整合所述第一分布式集群和所述第二分布式集群。
  10. 根据权利要求9所述的方法,其特征在于,所述第一Master节点与所述第二分布式集群中的第二Master节点进行协商,包括:
    所述第一Master节点向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一Master节点的节点属性为Master节点的广播消息;
    所述第一Master节点接收所述第二Master节点发送的协商消息,所述协商消息中包括用于指示所述第二Master节点的权重的信息,所述协商消息是所述第二Master节点在检测到所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述第一Master节点发送的;
    在确定所述第一Master节点的权重大于或等于所述第二Master节点的权重时,所述第一Master节点向所述第二Master节点发送用于指示所述第二Master节点降级为Slave节点的协商响应消息;
    在确定所述第一Master节点的权重小于所述第二Master节点的权重时,所述第一Master节点向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一Master节点降级为Slave节点的广播消息。
  11. 一种用于处理至少一个分布式集群中的故障的设备,所述至少一个分布式集群包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述分布式集群还包括第一参考节点,以及作为所述第一Master节点的备份的第一备用节点,其中,所述设备为所 述第一备用节点,所述设备包括:
    第一接收模块,用于接收所述第一参考节点发送的包括有所述第一指示信息的心跳消息;
    第一确定模块,用于根据所述第一接收模块接收的所述第一指示信息,确定所述第一参考节点与所述第一Master节点处于失联状态;
    检测模块,用于检测所述第一Master节点向所述设备发送的心跳消息是否中断;
    第二确定模块,用于在所述检测模块检测到所述第一Master节点向所述设备发送的心跳消息中断的情况下,确定所述设备与所述第一Master节点也处于失联状态;
    第三确定模块,用于根据所述第一确定模块和所述第二确定模块确定的结果,确定所述第一Master节点发生故障。
  12. 根据权利要求11所述的设备,其特征在于,所述设备还包括:
    发送模块,用于在所述第三确定模块确定所述第一Master节点发生故障的情况下,向所述第一分布式集群中所有节点发送广播消息,所述广播消息用于指示所述设备升级为所述第一Master节点。
  13. 根据权利要求11或12所述的设备,其特征在于,所述检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到所述第一Master节点发送的心跳消息,所述第一时刻为所述设备接收到所述第一参考节点发送的包括有所述第一指示信息的心跳消息的时刻,所述第二时刻早于所述第一时刻,所述第一时刻与所述第二时刻之间的时间间隔为所述第一Master节点向所述设备发送心跳消息的心跳周期的N倍,N为正整数。
  14. 根据权利要求11至13中任一项所述的设备,其特征在于,所述至少一个分布式集群还包括第二分布式集群,所述第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节点的备份的第二备用节点,所述设备还包括:
    第二接收模块,用于接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第二指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第二指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    第四确定模块,用于根据所述第二接收模块接收的所述第二指示信息, 确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述设备的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    协商模块,用于与所述第二分布式集群中的第二备用节点进行协商,以便于整合所述第一分布式集群和所述第二分布式集群。
  15. 根据权利要求14所述的设备,其特征在于,所述协商模块包括:
    第一发送单元,用于向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述设备的节点属性为备用节点的广播消息;
    接收单元,用于接收所述第二备用节点发送的协商消息,所述协商消息中包括用于指示所述第二备用节点的权重的信息,所述协商消息是所述第二备用节点在检测到所述第一发送单元发送的所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述设备发送的;
    第二发送单元,用于在确定所述设备的权重大于或等于所述第二备用节点的权重的情况下,向所述第二备用节点发送用于指示所述第二备用节点降级为Slave节点的协商响应消息;
    第三发送单元,用于在确定所述设备权重小于所述第二备用节点的权重的情况下,向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述设备降级为Slave节点的广播消息。
  16. 一种用于处理至少一个分布式集群中的故障的设备,所述至少一个分布式集群包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述第一分布式集群还包括第一参考节点以及作为所述第一Master节点的备份的第一备用节点,所述设备为所述第一Master节点,所述设备包括:
    第一接收模块,用于接收所述第一备用节点发送的包括所述第三指示信息的心跳消息;
    第一确定模块,用于根据所述第一接收模块接收的所述第三指示信息,确定所述第一备用节点与所述第一Slave节点处于失联状态;
    第一检测模块,用于检测所述第一Slave节点向所述设备发送的心跳消息是否中断;
    第二确定模块,用于在所述第一检测模块检测到所述第一Slave节点向所述设备发送的心跳消息中断的情况下,确定所述设备与所述第一Slave节 点也处于失联状态;
    第三确定模块,用于根据所述第一确定模块与所述第二确定模块确定的结果,确定所述第一Slave节点发生故障。
  17. 根据权利要求16所述的设备,其特征在于,所述第一检测模块具体用于,检测在第三时刻与第四时刻之间是否接收到所述第一Slave节点发送的心跳消息,所述第三时刻为所述设备接收到所述第一备用节点发送的包括有所述第三指示信息的心跳消息的时刻,所述第四时刻早于所述第三时刻,所述第三时刻与所述第四时刻之间的时间间隔为所述第一Slave节点向所述设备发送心跳消息的心跳周期的N倍,N为正整数。
  18. 根据权利要求16或17所述的设备,其特征在于,所述设备还包括:
    第二检测模块,用于在预设检测周期内检测是否接收到所述第一备用节点发送的心跳消息和所述第一参考节点发送的心跳消息,所述预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
    第四确定模块,用于在所述第二检测模块在所述预设检测周期内既没有接收到所述第一备用节点发送的心跳消息,也没有接收到所述第一参考节点发送的心跳消息的情况下,确定所述第一备用节点和所述第一参考节点均发生故障。
  19. 根据权利要求16至18中任一项所述的设备,其特征在于,所述至少一个分布式集群还包括第二分布式集群,所述第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节点的备份的第二备用节点,所述设备还包括:
    第二接收模块,用于接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第四指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第四指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    第五确定模块,用于根据所述第二接收模块接收的所述第四指示信息,确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述设备的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述设备所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    协商模块,用于与所述第二分布式集群中的第二Master节点进行协商, 以便于整合所述第一分布式集群和所述第二分布式集群。
  20. 根据权利要求19所述的设备,其特征在于,所述协商模块包括:
    第一发送单元,用于向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述设备的节点属性为Master节点的广播消息;
    接收单元,用于接收所述第二Master节点发送的协商消息,所述协商消息中包括用于指示所述第二Master节点的权重的信息,所述协商消息是所述第二Master节点在检测到所述第一发送单元发送的所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述设备发送的;
    第二发送单元,用于在确定所述设备的权重大于或等于所述第二Master节点的权重时,向所述第二Master节点发送用于指示所述第二Master节点降级为Slave节点的协商响应消息;
    第三发送单元,用于在确定所述设备的权重小于所述第二Master节点的权重时,向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述设备降级为Slave节点的广播消息。
  21. 一种分布式集群系统,其特征在于,所述分布式集群系统包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述分布式集群还包括第一参考节点,以及作为所述第一Master节点的备份的第一备用节点,所述第一Master节点、所述第一备用节点和所述第一参考节点用于彼此之间互发心跳消息,所述第一参考节点还用于向所述第一Slave节点发送心跳消息,所述第一Slave节点用于分别向所述第一Master节点和所述第一备用节点发送心跳消息,其中,
    所述第一参考节点还用于,在检测到所述第一Master节点向所述第一参考节点发送的心跳消息中断的情况下,向所述第一备用节点发送心跳消息,所述心跳消息包括用于指示所述第一参考节点与所述第一Master节点处于失联状态的第一指示信息,
    所述第一备用节点包括:
    第一接收模块,用于接收所述第一参考节点发送的包括所述第一指示信息的心跳消息;
    第一确定模块,用于根据所述第一接收模块接收的所述第一指示信息,确定所述第一参考节点与所述第一Master节点处于失联状态;
    检测模块,用于检测所述第一Master节点向所述第一备用节点发送的心跳消息是否中断;
    第二确定模块,用于在所述检测模块检测到所述第一Master节点向所述第一备用节点发送的心跳消息中断的情况下,确定所述第一备用节点与所述第一Master节点也处于失联状态;
    第三确定模块,用于根据所述第一确定模块和所述第二确定模块确定的结果,确定所述第一Master节点发生故障。
  22. 根据权利要求21所述的分布式集群系统,其特征在于,所述第一备用设备还包括:
    发送模块,用于在所述第三确定模块确定所述第一Master节点发生故障的情况下,向所述第一分布式集群中所有节点发送广播消息,所述广播消息用于指示所述第一备用节点升级为所述第一Master节点。
  23. 根据权利要求21或22所述的分布式集群系统,其特征在于,所述检测模块具体用于,检测在第一时刻与第二时刻之间是否接收到所述第一Master节点发送的心跳消息,所述第一时刻为所述第一备用节点接收到所述第一参考节点发送的包括有所述第一指示信息的心跳消息的时刻,所述第二时刻早于所述第一时刻,所述第一时刻与所述第二时刻之间的时间间隔为所述第一Master节点向所述第一备用节点发送心跳消息的心跳周期的N倍,N为正整数。
  24. 根据权利要求21至23中任一项所述的分布式集群系统,其特征在于,所述分布式集群系统还包括第二分布式集群,所述第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节点的备份的第二备用节点,所述第一备用节点还包括:
    第二接收模块,用于接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第二指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第二指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    第四确定模块,用于根据所述第二接收模块接收的所述第二指示信息,确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述第一备用节点的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述第一备用节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    协商模块,用于与所述第二分布式集群中的第二备用节点进行协商,以 便于整合所述第一分布式集群和所述第二分布式集群。
  25. 根据权利要求24所述的分布式集群系统,其特征在于,所述协商模块包括:
    第一发送单元,用于向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一备用节点的节点属性为备用节点的广播消息;
    接收单元,用于接收所述第二备用节点发送的协商消息,所述协商消息中包括用于指示所述第二备用节点的权重的信息,所述协商消息是所述第二备用节点在检测到所述第一发送单元发送的所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述设备发送的;
    第二发送单元,用于在确定所述第一备用节点的权重大于或等于所述第二备用节点的权重的情况下,向所述第二备用节点发送用于指示所述第二备用节点降级为Slave节点的协商响应消息;
    第三发送单元,用于在确定所述第一备用节点权重小于所述第二备用节点的权重的情况下,向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一备用节点降级为Slave节点的广播消息。
  26. 一种分布式集群系统,其特征在于,所述分布式集群系统包括第一分布式集群,所述第一分布式集群中包括第一Master节点和第一Slave节点,其特征在于,所述分布式集群还包括第一参考节点,以及作为所述第一Master节点的备份的第一备用节点,所述第一Master节点、所述第一备用节点和所述第一参考节点用于彼此之间互发心跳消息,所述第一参考节点还用于向所述第一Slave节点发送心跳消息,所述第一Slave节点用于分别向所述第一Master节点和所述第一备用节点发送心跳消息,其中,
    所述第一备用节点还用于,在检测到所述第一Slave节点向所述第一备用节点发送的心跳消息中断的情况下,向所述第一Master节点发送心跳消息,所述心跳消息包括用于指示所述第一备用节点与所述第一Slave节点处于失联状态的第三指示信息,
    所述第一Master节点包括:
    第一接收模块,用于接收所述第一备用节点发送的包括所述第三指示信息的心跳消息;
    第一确定模块,用于根据所述第一接收模块接收的所述第三指示信息,确定所述第一备用节点与所述第一Slave节点处于失联状态;
    第一检测模块,用于检测所述第一Slave节点向所述第一Master节点发送的心跳消息是否中断;
    第二确定模块,用于在所述第一检测模块检测到所述第一Slave节点向所述第一Master节点发送的心跳消息中断的情况下,确定所述第一Master节点与所述第一Slave节点也处于失联状态;
    第三确定模块,用于根据所述第一确定模块与所述第二确定模块确定的结果,确定所述第一Slave节点发生故障。
  27. 根据权利要求26所述的分布式集群系统,其特征在于,所述第一检测模块具体用于,检测在第三时刻与第四时刻之间是否接收到所述第一Slave节点发送的心跳消息,所述第三时刻为所述第一Master节点接收到所述第一备用节点发送的包括有所述第三指示信息的心跳消息的时刻,所述第四时刻早于所述第三时刻,所述第三时刻与所述第四时刻之间的时间间隔为所述第一Slave节点向所述第一Master节点发送心跳消息的心跳周期的N倍,N为正整数。
  28. 根据权利要求26或27所述的分布式集群系统,其特征在于,所述第一Master节点还包括:
    第二检测模块,用于在预设检测周期内检测是否接收到所述第一备用节点发送的心跳消息和所述第一参考节点发送的心跳消息,所述预设检测周期为发送心跳消息的心跳周期的M倍,M为正整数;
    第四确定模块,用于在所述第二检测模块在所述预设检测周期内既没有接收到所述第一备用节点发送的心跳消息,也没有接收到所述第一参考节点发送的心跳消息的情况下,确定所述第一备用节点和所述第一参考节点均发生故障。
  29. 根据权利要求26至28中任一项所述的分布式集群系统,其特征在于,所述分布式集群系统还包括第二分布式集群,所述第二分布式集群中包括第二Master节点,第二Slave节点,第二参考节点,以及作为所述第二Master节点的备份的第二备用节点,所述第一Master节点还包括:
    第二接收模块,用于接收所述第二参考节点发送的心跳消息,所述心跳消息包括用于指示所述心跳消息的接收端的节点属性为Slave节点的第四指示信息,所述第二参考节点用于分别向所述第二Slave节点以及所述第一分布式集群中的所有节点发送包括所述第四指示信息的心跳消息,所述第二分布式集群与所述第一分布式集群具有相同的集群标识;
    第五确定模块,用于根据所述第二接收模块接收的所述第四指示信息,确定所述第二参考节点发送的心跳消息中所指示的所述心跳消息的接收端的节点属性与所述第一Master节点的节点属性不相符,并确定所述第二参考节点所在的第二分布式集群与所述第一Master节点所在的第一分布式集群为一个网络分布式集群分裂后形成的两个子集群;
    协商模块,用于与所述第二分布式集群中的第二Master节点进行协商,以便于整合所述第一分布式集群和所述第二分布式集群。
  30. 根据权利要求29所述的分布式集群系统,其特征在于,所述协商模块包括:
    第一发送单元,用于向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一Master节点的节点属性为Master节点的广播消息;
    接收单元,用于接收所述第二Master节点发送的协商消息,所述协商消息中包括用于指示所述第二Master节点的权重的信息,所述协商消息是所述第二Master节点在检测到所述第一发送单元发送的所述广播消息指示的节点属性与自身的节点属性相同的情况下向所述第一Master节点发送的;
    第二发送单元,用于在确定所述第一Master节点的权重大于或等于所述第二Master节点的权重时,向所述第二Master节点发送用于指示所述第二Master节点降级为Slave节点的协商响应消息;
    第三发送单元,用于在确定所述第一Master节点的权重小于所述第二Master节点的权重时,向所述第一分布式集群和所述第二分布式集群内所有的节点发送用于指示所述第一Master节点降级为Slave节点的广播消息。
PCT/CN2015/084573 2015-02-10 2015-07-21 处理至少一个分布式集群中的故障的方法、设备和系统 WO2016127580A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP15881740.3A EP3247090B1 (en) 2015-02-10 2015-07-21 Method, device and system for processing fault in at least one distributed cluster
US15/674,159 US10560315B2 (en) 2015-02-10 2017-08-10 Method and device for processing failure in at least one distributed cluster, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510068053.1 2015-02-10
CN201510068053.1A CN105991325B (zh) 2015-02-10 2015-02-10 处理至少一个分布式集群中的故障的方法、设备和系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/674,159 Continuation US10560315B2 (en) 2015-02-10 2017-08-10 Method and device for processing failure in at least one distributed cluster, and system

Publications (1)

Publication Number Publication Date
WO2016127580A1 true WO2016127580A1 (zh) 2016-08-18

Family

ID=56614128

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/084573 WO2016127580A1 (zh) 2015-02-10 2015-07-21 处理至少一个分布式集群中的故障的方法、设备和系统

Country Status (4)

Country Link
US (1) US10560315B2 (zh)
EP (1) EP3247090B1 (zh)
CN (1) CN105991325B (zh)
WO (1) WO2016127580A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106911524A (zh) * 2017-04-27 2017-06-30 紫光华山信息技术有限公司 一种ha实现方法及装置
WO2018192534A1 (zh) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 节点设备运行方法、工作状态切换装置、节点设备及介质
WO2018192533A1 (zh) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 节点设备运行方法、工作状态切换装置、节点设备及介质

Families Citing this family (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9842033B2 (en) * 2014-11-12 2017-12-12 Netapp, Inc. Storage cluster failure detection
CN106487611B (zh) * 2016-10-27 2020-10-27 新华三技术有限公司 一种检测sdn集群分裂的方法及装置
US10305970B2 (en) * 2016-12-13 2019-05-28 International Business Machines Corporation Self-recoverable multitenant distributed clustered systems
US10608882B2 (en) 2017-02-16 2020-03-31 International Business Machines Corporation Token-based lightweight approach to manage the active-passive system topology in a distributed computing environment
CN106878109A (zh) * 2017-03-13 2017-06-20 网宿科技股份有限公司 服务器检测方法及服务器系统
CN109104347B (zh) * 2017-06-21 2020-09-15 比亚迪股份有限公司 基于CANopen协议传输数据的网关轮换方法、系统及其装置
CN109104348B (zh) * 2017-06-21 2020-09-15 比亚迪股份有限公司 基于CANopen协议的列车网络数据传输方法、系统及其装置
US10496153B2 (en) 2017-10-27 2019-12-03 EMC IP Holding Company LLC Method and system for binding chassis and components
CN109729111B (zh) * 2017-10-27 2021-10-08 伊姆西Ip控股有限责任公司 用于管理分布式系统的方法、设备和计算机程序产品
US11075925B2 (en) 2018-01-31 2021-07-27 EMC IP Holding Company LLC System and method to enable component inventory and compliance in the platform
CN108509296B (zh) * 2018-03-19 2021-02-02 网宿科技股份有限公司 一种处理设备故障的方法和系统
US10754708B2 (en) 2018-03-28 2020-08-25 EMC IP Holding Company LLC Orchestrator and console agnostic method to deploy infrastructure through self-describing deployment templates
US10693722B2 (en) * 2018-03-28 2020-06-23 Dell Products L.P. Agentless method to bring solution and cluster awareness into infrastructure and support management portals
US10514907B2 (en) 2018-03-28 2019-12-24 EMC IP Holding Company LLC System and method for out-of-the-box solution-level management via logical architecture awareness
US10795756B2 (en) 2018-04-24 2020-10-06 EMC IP Holding Company LLC System and method to predictively service and support the solution
US11086738B2 (en) 2018-04-24 2021-08-10 EMC IP Holding Company LLC System and method to automate solution level contextual support
CN108881407A (zh) * 2018-05-30 2018-11-23 郑州云海信息技术有限公司 一种信息处理方法及装置
CN108964977B (zh) * 2018-06-05 2021-06-01 平安科技(深圳)有限公司 节点异常处理方法及系统,存储介质和电子设备
US10922199B2 (en) * 2018-07-04 2021-02-16 Vmware, Inc. Role management of compute nodes in distributed clusters
US10764371B2 (en) * 2018-07-13 2020-09-01 EMC IP Holding Company LLC Host device with multi-path layer configured to provide cluster identification information to storage system
US11599422B2 (en) 2018-10-16 2023-03-07 EMC IP Holding Company LLC System and method for device independent backup in distributed system
CN109474465A (zh) * 2018-11-13 2019-03-15 上海英方软件股份有限公司 一种基于服务器集群的可动态流转的高可用性的实现方法和系统
CN109728941A (zh) * 2018-12-20 2019-05-07 北京比新科技有限公司 一种区块链领导人选举方法及其装置
CN110149366B (zh) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 提高集群系统可用性的方法、装置和计算机设备
US10862761B2 (en) 2019-04-29 2020-12-08 EMC IP Holding Company LLC System and method for management of distributed systems
US11301557B2 (en) 2019-07-19 2022-04-12 Dell Products L.P. System and method for data processing device management
CN110611586A (zh) * 2019-08-28 2019-12-24 视联动力信息技术股份有限公司 一种安全检测方法及系统
CN112911520B (zh) * 2019-12-04 2022-05-31 哈尔滨海能达科技有限公司 自组网中确定主节点的方法、装置及存储介质
CN111510327B (zh) 2020-04-08 2022-01-21 北京字节跳动网络技术有限公司 用于共同训练模型的训练参与端的网络连接方法、装置、系统和服务器
US20220335003A1 (en) * 2021-04-19 2022-10-20 Advanced Micro Devices, Inc. Master-Slave Communication with Subdomains
US20230032812A1 (en) * 2021-08-02 2023-02-02 International Business Machines Corporation Auto-split and auto-merge clusters
US11803496B2 (en) * 2021-10-29 2023-10-31 Lenovo (Singapore) Pte. Ltd. Systems, apparatus, and methods for electing a new broker for a channel on an MQTT bus
CN116436755B (zh) * 2023-06-12 2023-08-25 新华三技术有限公司 一种网络管理方法、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494565A (zh) * 2008-01-24 2009-07-29 中国移动通信集团公司 在分布式无线接入系统中处理节点故障的方法
CN102752093A (zh) * 2012-06-29 2012-10-24 中国联合网络通信集团有限公司 基于分布式文件系统的数据处理方法、设备和系统
CN103117901A (zh) * 2013-02-01 2013-05-22 华为技术有限公司 一种分布式心跳检测方法、装置及系统
CN103500140A (zh) * 2013-09-27 2014-01-08 浪潮电子信息产业股份有限公司 一种快速获知分布式集群节点失效的方法
US20140181035A1 (en) * 2012-12-20 2014-06-26 Fujitsu Limited Data management method and information processing apparatus

Family Cites Families (45)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185698B1 (en) * 1998-04-20 2001-02-06 Sun Microsystems, Incorporated Method and apparatus using ranking to select repair nodes in formation of a dynamic tree for multicast repair
US6691173B2 (en) * 1999-07-06 2004-02-10 Widcomm, Inc. Distributed management of an extended network containing short-range wireless links
US6651242B1 (en) * 1999-12-14 2003-11-18 Novell, Inc. High performance computing system for distributed applications over a computer
US6885644B1 (en) * 2000-05-30 2005-04-26 International Business Machines Corporation Topology propagation in a distributed computing environment with no topology message traffic in steady state
US7389332B1 (en) * 2001-09-07 2008-06-17 Cisco Technology, Inc. Method and apparatus for supporting communications between nodes operating in a master-slave configuration
US7421478B1 (en) * 2002-03-07 2008-09-02 Cisco Technology, Inc. Method and apparatus for exchanging heartbeat messages and configuration information between nodes operating in a master-slave configuration
US7587465B1 (en) * 2002-04-22 2009-09-08 Cisco Technology, Inc. Method and apparatus for configuring nodes as masters or slaves
US7162250B2 (en) * 2003-05-16 2007-01-09 International Business Machines Corporation Method and apparatus for load sharing in wireless access networks based on dynamic transmission power adjustment of access points
US7421578B1 (en) * 2003-07-22 2008-09-02 Cisco Technology, Inc. Method and apparatus for electing a leader node in a computer network
US7233991B2 (en) * 2003-08-22 2007-06-19 Clearmesh Networks, Inc. Self-healing tree network
US20050086469A1 (en) * 2003-10-17 2005-04-21 Microsoft Corporation Scalable, fault tolerant notification method
US7461130B1 (en) * 2004-11-24 2008-12-02 Sun Microsystems, Inc. Method and apparatus for self-organizing node groups on a network
US7814065B2 (en) * 2005-08-16 2010-10-12 Oracle International Corporation Affinity-based recovery/failover in a cluster environment
US20070053309A1 (en) * 2005-09-06 2007-03-08 Texas Instruments Incorporated Policy-Based Topology Maintenance for Wireless Networks that Employ Hybrid Tree-Based Routing with AODV
US7593376B2 (en) * 2005-12-07 2009-09-22 Motorola, Inc. Method and apparatus for broadcast in an ad hoc network using elected broadcast relay nodes
US20080281938A1 (en) * 2007-05-09 2008-11-13 Oracle International Corporation Selecting a master node in a multi-node computer system
US8194591B2 (en) * 2007-12-13 2012-06-05 Thomson Licensing Communication methods in a network
US7818322B2 (en) * 2008-02-25 2010-10-19 Microsoft Corporation Efficient method for clustering nodes
US7688802B2 (en) * 2008-05-23 2010-03-30 Honeywell International Inc. System and method for time synchronization in a wireless network
CN101771579A (zh) * 2009-01-06 2010-07-07 鲁逸峰 一种p2p流媒体系统中的分布式节点故障检测方法
CN101478435B (zh) * 2009-01-20 2011-01-12 杭州华三通信技术有限公司 一种堆叠系统的拓扑收集方法和双控制板设备
US8862697B2 (en) * 2009-12-31 2014-10-14 Aten International Co., Ltd. Intelligent network management platform for IKVM servers
US8433760B2 (en) * 2010-12-03 2013-04-30 International Business Machines Corporation Inter-node communication scheme for node status sharing
US9710344B1 (en) * 2010-12-13 2017-07-18 Amazon Technologies, Inc. Locality based quorum eligibility
JP5928582B2 (ja) * 2012-05-16 2016-06-01 富士通株式会社 ノード装置および通信方法
US9678801B2 (en) * 2012-08-09 2017-06-13 International Business Machines Corporation Service management modes of operation in distributed node service management
US9226231B2 (en) * 2013-01-30 2015-12-29 Qualcomm Incorporated Systems and methods for monitoring the size of a wireless network
US9516595B2 (en) * 2013-03-27 2016-12-06 Qualcomm Incorporated Systems and methods for synchronization within a neighborhood aware network
JP6089884B2 (ja) * 2013-03-29 2017-03-08 富士通株式会社 情報処理システム,情報処理装置,情報処理装置の制御プログラム,及び情報処理システムの制御方法
US9872227B2 (en) * 2013-04-23 2018-01-16 Qualcomm Incorporated Systems and methods for identification in a neighborhood aware network
US9843995B2 (en) * 2013-05-15 2017-12-12 Qualcomm Incorporated Method and metrics for merging with a neighborhood aware network
US9686369B2 (en) * 2013-09-13 2017-06-20 Qualcomm Incorporated System and method for multihop service discovery with member station proxy service advertisements
US20150131529A1 (en) * 2013-11-14 2015-05-14 Qualcomm Incorporated Server aided nan cluster merging
WO2015086478A1 (en) * 2013-12-09 2015-06-18 Koninklijke Philips N.V. Method for operating a node in a network and node device
US10075333B2 (en) * 2014-08-12 2018-09-11 Maxlinear, Inc. Method and apparatus for admission to a MoCA network
US10863431B2 (en) * 2014-11-06 2020-12-08 Qualcomm Incorporated Systems and methods for synchronization within a neighborhood aware network
CN104320311A (zh) * 2014-11-20 2015-01-28 国电南京自动化股份有限公司 一种scada分布式平台下的心跳检测方法
US20160286476A1 (en) * 2015-03-26 2016-09-29 Qualcomm Incorporated Data link behavior for merger of wireless network clusters
US10334422B2 (en) * 2015-06-15 2019-06-25 Qualcomm Incorporated Methods and apparatus for wireless discovery location and ranging within a neighborhood aware network
US9872224B2 (en) * 2015-10-19 2018-01-16 Sk Planet Co., Ltd. Method for constructing beacon topology network
US10298461B2 (en) * 2016-05-10 2019-05-21 Motorola Mobility Llc System and method for determining a master device in a neighborhood aware network
CN107526659B (zh) * 2016-06-21 2021-02-12 伊姆西Ip控股有限责任公司 用于失效备援的方法和设备
US10270646B2 (en) * 2016-10-24 2019-04-23 Servicenow, Inc. System and method for resolving master node failures within node clusters
US10298674B2 (en) * 2016-11-16 2019-05-21 Intel Corporation Enhancing Wi-Fi aware protocol and algorithms for drone cluster formation
US11638229B2 (en) * 2017-02-28 2023-04-25 Apple Inc. Selective peer synchronization with mutual services

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494565A (zh) * 2008-01-24 2009-07-29 中国移动通信集团公司 在分布式无线接入系统中处理节点故障的方法
CN102752093A (zh) * 2012-06-29 2012-10-24 中国联合网络通信集团有限公司 基于分布式文件系统的数据处理方法、设备和系统
US20140181035A1 (en) * 2012-12-20 2014-06-26 Fujitsu Limited Data management method and information processing apparatus
CN103117901A (zh) * 2013-02-01 2013-05-22 华为技术有限公司 一种分布式心跳检测方法、装置及系统
CN103500140A (zh) * 2013-09-27 2014-01-08 浪潮电子信息产业股份有限公司 一种快速获知分布式集群节点失效的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3247090A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018192534A1 (zh) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 节点设备运行方法、工作状态切换装置、节点设备及介质
WO2018192533A1 (zh) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 节点设备运行方法、工作状态切换装置、节点设备及介质
US10833919B2 (en) 2017-04-20 2020-11-10 Tencent Technology (Shenzhen) Company Limited Node device operation method, work status switching apparatus, node device, and medium
CN106911524A (zh) * 2017-04-27 2017-06-30 紫光华山信息技术有限公司 一种ha实现方法及装置

Also Published As

Publication number Publication date
US20170339005A1 (en) 2017-11-23
CN105991325B (zh) 2019-06-21
EP3247090B1 (en) 2022-02-16
EP3247090A4 (en) 2018-02-28
CN105991325A (zh) 2016-10-05
EP3247090A1 (en) 2017-11-22
US10560315B2 (en) 2020-02-11

Similar Documents

Publication Publication Date Title
WO2016127580A1 (zh) 处理至少一个分布式集群中的故障的方法、设备和系统
US10862966B2 (en) Storage area network attached clustered storage system
US9189316B2 (en) Managing failover in clustered systems, after determining that a node has authority to make a decision on behalf of a sub-cluster
US11809291B2 (en) Method and apparatus for redundancy in active-active cluster system
US9054958B2 (en) System and method for reducing information loss in an aggregated information handling system
US9240937B2 (en) Fault detection and recovery as a service
US10846183B2 (en) Method and apparatus for ensuring data integrity in a storage cluster with the use of NVDIMM
WO2019128670A1 (zh) 用于在分布式系统中使管理能力自恢复的方法和装置
JP2005209201A (ja) 高可用性クラスタにおけるノード管理
US20130219224A1 (en) Job continuation management apparatus, job continuation management method and job continuation management program
US20160203017A1 (en) Baseboard management controller providing peer system identification
CN109245926B (zh) 智能网卡、智能网卡系统及控制方法
CN106330475A (zh) 一种通信系统中管理主备节点的方法和装置及高可用集群
WO2016180005A1 (zh) 处理虚拟机集群的方法和计算机系统
WO2018058941A1 (zh) 一种检测集群系统通信状态的方法及网关集群
CN110633168A (zh) 一种分布式存储系统的数据备份方法和系统
WO2017012383A1 (zh) 一种服务注册方法、使用方法及相关装置
CN114265753A (zh) 消息队列的管理方法、管理系统和电子设备
CN113364603B (zh) 环形网络的故障恢复方法及物理节点
EP3031172B1 (en) Managing data feeds
JP6509344B2 (ja) タグ交換パス接続性の検出方法及び装置
CN105704187A (zh) 一种集群脑裂的处理方法及装置
US9323629B2 (en) Method for managing path failures of OSEK networks
CN105528199B (zh) 一种节点的处理方法及装置
WO2022222968A1 (zh) 会议通话的恢复方法、装置、系统、电子设备和可读存储介质

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: 15881740

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2015881740

Country of ref document: EP