A SWIM-based fault detection method, device, and electronic equipment

By selecting the node to be detected in parallel in distributed storage and sending detection signals, confirming its status and spreading the fault status, the problem of unclear fault detection time interval in the SWIM protocol is solved, and rapid fault detection and service recovery are achieved.

CN115766516BActive Publication Date: 2024-12-13CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211432996.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2024-12-13
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

The existing SWIM protocol cannot clearly guarantee the detection time interval during node failure detection, resulting in failure detection not being fast enough.

Method used

The node list is preconfigured in the cluster, and at least two nodes to be detected are selected in parallel to send the first detection signal, determine the node status based on feedback, and use other nodes to confirm whether it is a fault node, and directly report the fault information to the control role when determining the fault. , by spreading the fault state to the entire cluster.

Benefits of technology

It realizes rapid detection of faults of distributed storage nodes, reduces the message load of cluster members during fault detection, shortens the fault detection time, and timely updates the control surface metadata table to restore services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766516B_ABST
    Figure CN115766516B_ABST
Patent Text Reader

Abstract

The present invention proposes a fault detection method and device based on SWIM, and an electronic device, the method comprising: in a current node list pre-configured in a reference node in a cluster, selecting at least two nodes to be detected in parallel and sending a first detection signal; based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node; when the node to be detected is determined as a faulty node, spreading the fault state of the faulty node to the entire cluster, and when the reference node detects the faulty node, directly reporting the corresponding fault information to the control role in the cluster; based on the SWIM mechanism, determining the faulty node in the control role. The fault monitoring method based on SWIM provided by the present invention can more quickly realize faulty node detection in distributed storage nodes compared to the existing SWIM protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed storage fault detection, and in particular to a fault detection method and device based on SWIM, and electronic equipment. Background Art

[0002] The traditional distributed storage fault detection mechanism is implemented through heartbeat. If the heartbeat of the other party is not received within a certain period of time, it is considered to be faulty. Specifically, there are two main methods:

[0003] 1) There is a central control node, and other nodes send heartbeats to the central control node. This approach will cause the central control node to become a bottleneck point and easily lead to single point failure.

[0004] 2) Each node in the cluster sends heartbeats to all nodes within the range, which will cause a large network load. The larger the cluster size, the greater the network load. In addition, when multiple nodes in the cluster fail, the fault detection time may be very long.

[0005] SWIM (Scalable Weakly-consistent Infection-style Process GroupMembership Protocol) is an accurate, efficient and scalable fault detection mechanism based on the Gossip protocol. The fault detection principle is shown in the SWIM fault detection diagram in Part 4. The SWIM mechanism mainly implements fault detection through the dping and iping mechanisms. In each fault detection cycle, a node (assuming N2) is randomly selected from the node list of the current node (assuming N1), a dping message is sent to it, and then the ack of N2 is waited for. If the ack is not received within the specified time, N1 will set N2 to the SUSPECT state and set the SUSPECT timeout, and then randomly select K nodes from its own node list to send iping. After receiving the message, these K nodes will send a dping message to N2. If N2 has an ack, the ack will be forwarded to N1 again. If N1 does not receive any response from N2 (whether dping or iping) within the SUSPECT timeout, N2 will be set to a fault state and then spread within the cluster.

[0006] The SWIM protocol can ensure that node failures can be detected eventually, but the time interval from node failure to failure detection cannot be explicitly guaranteed. Summary of the invention

[0007] The technical problem to be solved by the present invention is that the current SWIM protocol cannot clearly guarantee the time interval from node failure to fault detection. In view of this, the present invention provides a SWIM-based fault detection method and device, and electronic device, which are applied to node status detection scenarios in distributed storage.

[0008] The technical solution adopted by the present invention is that the fault detection method based on SWIM comprises:

[0009] In a current node list preconfigured in a reference node in the cluster, selecting at least two nodes to be detected in parallel and sending a first detection signal;

[0010] Based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node;

[0011] When the node to be detected is determined to be a faulty node, the fault status of the faulty node is spread to the entire cluster, wherein when the reference node detects the faulty node, the reference node directly reports the corresponding fault information to the control role in the cluster;

[0012] Based on the SWIM mechanism, the faulty node in the control role is determined.

[0013] In one embodiment, determining the state of the node to be detected based on feedback of the node to be detected on the first detection signal includes:

[0014] When the node to be detected fails to feed back the first detection signal within the first time range, the reference node selects at least two nodes in the corresponding node list and sends iping signals to each of them;

[0015] In response to the iping signal, at least two of the nodes respectively send a second detection signal to the node to be detected;

[0016] When the node to be detected fails to feed back the second detection signal within the first time range, the reference node determines the node to be detected as a faulty node.

[0017] In one embodiment, when the node to be detected fails to feed back the first detection signal within the first time range, the node to be detected is determined as a pending node;

[0018] When the node to be detected fails to feed back the first detection signal within a second time range, the node to be detected is determined as a faulty node.

[0019] In one embodiment, when the node to be detected is determined to be a faulty node, spreading the fault state of the faulty node to the entire cluster includes:

[0020] Sort the nodes of non-control roles in the cluster by sequence numbers starting from 0;

[0021] Starting from the node with sequence number 0, the usage status of the current node is diffused to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node;

[0022] When spreading to the faulty node or the pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with serial numbers 2m+1 or 2m+2, where m is the serial number of the current faulty node or the pending node.

[0023] Another aspect of the present invention further provides a SWIM-based fault detection device, comprising:

[0024] An initialization unit is configured to select at least two nodes to be detected in parallel from a current node list preconfigured in a reference node in the cluster and send a first detection signal;

[0025] a state judgment unit configured to determine the state of the node to be detected based on the feedback of the node to be detected on the first detection signal, and when the node to be detected is determined as a pending node, determine whether the pending node is a faulty node by using other nodes in the node list;

[0026] A state diffusion unit is configured to diffuse the fault state of the faulty node to the entire cluster when the node to be detected is determined to be a faulty node, wherein the reference node directly reports the corresponding fault information to the control role in the cluster when detecting the faulty node;

[0027] The control role detection unit is configured to determine a faulty node in the control role based on a SWIM mechanism.

[0028] In one embodiment, the state determination unit is further configured to:

[0029] When the node to be detected fails to feed back the first detection signal within the first time range, the reference node selects at least two nodes in the corresponding node list and sends iping signals to each of them;

[0030] In response to the iping signal, at least two of the nodes respectively send a second detection signal to the node to be detected;

[0031] When the node to be detected fails to feed back the second detection signal within the first time range, the reference node determines the node to be detected as a faulty node.

[0032] In one embodiment, the state determination unit is further configured to:

[0033] When the node to be detected fails to feed back the first detection signal within the first time range, determining the node to be detected as a pending node;

[0034] When the node to be detected fails to feed back the first detection signal within a second time range, the node to be detected is determined as a faulty node.

[0035] In one embodiment, the state diffusion unit is further configured as follows:

[0036] Sort all nodes of non-control roles in the cluster by serial numbers starting from 0;

[0037] Starting from the node with sequence number 0, the usage status of the current node is diffused to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node;

[0038] When spreading to the faulty node or the pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with serial numbers 2m+1 or 2m+2, where m is the serial number of the current faulty node or the pending node.

[0039] Another aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the SWIM-based fault detection method as described in any one of the above items.

[0040] Another aspect of the present invention further provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the SWIM-based fault detection method as described in any one of the above items are implemented.

[0041] By adopting the above technical solution, the present invention has at least the following advantages:

[0042] Compared with the existing SWIM protocol, the fault monitoring method based on SWIM provided by the present invention can more quickly realize faulty node detection in distributed storage nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of a fault detection method based on SWIM according to an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of a specific implementation of fault node detection of a SWIM-based fault detection method according to an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of a specific implementation of a fault node diffusion method based on SWIM according to an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of the structure of a fault detection device based on SWIM according to an embodiment of the present invention;

[0047] Figure 5 FIG. 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the present invention is described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0049] In the drawings, the thickness, size and shape of objects have been slightly exaggerated for ease of explanation. The drawings are only examples and are not drawn strictly to scale.

[0050] It should also be understood that the terms "comprises", "including", "having", "includes" and / or "comprising", when used in this specification, indicate the presence of the stated features, wholes, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, parts and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire listed features rather than modifying the individual elements in the list. In addition, when describing embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.

[0051] As used herein, the terms "substantially," "approximately," and similar terms are used as terms of approximation, not degree, and are intended to account for the inherent variations in measurements or calculations that would be recognized by those of ordinary skill in the art.

[0052] Unless otherwise defined, all terms (including technical terms and scientific terms) used in this article have the same meaning as commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that terms (such as terms defined in commonly used dictionaries) should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and will not be interpreted in an idealized or overly formal sense unless explicitly defined in this article.

[0053] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0054] The description of the method flow in the specification of the present invention and the steps of the flowchart in the drawings of the specification of the present invention do not have to be strictly executed according to the step numbers, and the method steps can be executed in a different order. Moreover, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0055] The first embodiment of the present invention is a fault detection method based on SWIM, such as Figure 1 As shown, the specific steps include:

[0056] Step S1, in a current node list pre-configured in a reference node in a cluster, select at least two nodes to be detected in parallel and send a first detection signal;

[0057] Step S2, based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node;

[0058] Step S3, when the node to be detected is determined to be a faulty node, the fault status of the faulty node is spread to the entire cluster, wherein when the reference node detects the faulty node, it directly reports the corresponding fault information to the control role in the cluster;

[0059] Step S4: Based on the SWIM mechanism, determine the faulty node in the control role.

[0060] refer to Figure 1 as well as Figure 2 , the method provided in this embodiment will be described in detail step by step below.

[0061] Step S1 : Select at least two nodes to be detected in parallel from a current node list pre-configured in a reference node in a cluster and send a first detection signal.

[0062] This embodiment is applied to the application scenario of distributed storage, in which it is usually a distributed node cluster. Furthermore, in each node in the node cluster, the present invention configures a node list accordingly. It can be understood that the node list configured in each node can be reasonably configured according to the actual situation. Exemplarily, when the node to be detected is in the node list of the reference node, the reference node can send a dping signal (first detection signal) or an iping signal to the node to be detected, which can be used for subsequent fault detection implementation.

[0063] In this embodiment, any node in the cluster, which for ease of explanation may be a reference node, may be randomly selected from a node list preconfigured in the reference node, such as a node to be detected, and a first detection signal (dping signal) may be sent to the node to be detected.

[0064] Furthermore, there may be multiple reference nodes at the same time, and each reference selects multiple nodes to be detected in the corresponding node list, and starts the state detection process of the nodes to be detected in parallel.

[0065] Step S2, based on the feedback of the node to be detected to the first detection signal, determine the state of the node to be detected, when the node to be detected is determined as a pending node, use other nodes in the node list to determine whether the pending node is a faulty node.

[0066] In some possible implementations, when the node to be detected fails to feed back a first detection signal within a first time range, the node to be detected is determined as a pending node; when the node to be detected fails to feed back a first detection signal within a second time range, the second node is determined as a faulty node.

[0067] It is understandable that, usually, the second time range is much longer than the first time range. If, in the state of pending nodes, the node continues to wait for a possible response in the second time range, it will cause a waste of time.

[0068] In this embodiment, when the node to be detected fails to feed back the first detection signal within the first time range, at least two nodes are directly selected from other fault domains in the node list that are different from the node to be detected (for example, two nodes can be selected, and if there is only one fault domain, three nodes can be randomly selected), and the reference node sends an iping signal to the at least two nodes selected above respectively.

[0069] It is understandable that the size of the fault domain and the number of nodes selected to send iping signals can be reasonably adjusted according to actual conditions, and this article will not limit this.

[0070] In this embodiment, when at least two nodes receive an iping signal, they will immediately send a dping signal to the node to be detected in a short time. In order to distinguish it from the above-mentioned dping signal, it can be called a second detection signal.

[0071] In this embodiment, the first time range may be the same as the first time range in the above step, or may be approximately the same short time interval.

[0072] Furthermore, when the node to be detected receives multiple (at least two) second detection signals, if none of them feed back to the corresponding reference node, then it can be determined that the node to be detected is a faulty node.

[0073] Correspondingly, the node to be detected may feed back a second detection signal sent by a certain node, and at this time the reference node may determine the node to be detected as a normal node, or a non-faulty node.

[0074] Since the time interval of the first time range is much smaller than the time interval of the second time range in the conventional SWIM protocol, this embodiment can save time on the basis of the SWIM protocol and can also achieve the technical purpose of faulty node detection.

[0075] Step S3, when the node to be detected is determined to be a faulty node, the fault state of the faulty node is diffused to the entire cluster, wherein when the reference node detects the faulty node, it directly reports the corresponding fault information to the control role in the cluster.

[0076] In some implementations of this embodiment, the fault status of a node can be spread to other nodes in the cluster, such as Figure 3 shown.

[0077] Specifically, all nodes of non-control roles in the cluster can be sorted starting from 0 in the order of 0, 1, 2... The specific diffusion process can be:

[0078] Starting from the node with sequence number 0, the usage status (normal, pending, faulty) of the current node is spread to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node;

[0079] Can be combined Figure 3 , Figure 3As an example, the node with sequence number 4 is a pending node, and the node with sequence number 5 is a faulty node. When spreading to the faulty node or the pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with sequence numbers 2m+1 or 2m+2, where m is the sequence number of the current faulty node or the pending node.

[0080] Based on the above-mentioned method of spreading faulty nodes, the spreading speed of the faulty node status can be greatly improved.

[0081] In this embodiment, only when the fault detection information spreads to the control role can it be truly marked down in the control plane (that is, marked as a faulty node). Only after being perceived by the client can the impact on the business plane be reduced. The propagation of the SWIM protocol node status update depends on the dping / iping message in fault detection. Since the node list is currently polled and traversed, there will be a delay in the fault detection results actually spreading to the nodes with the control role. The control plane view can be updated in a timely manner by allowing the first SWIM role that detects the fault result to directly report the fault detection result to the control role, and the faulty node can be marked down in the cluster control plane view.

[0082] Step S4: Based on the SWIM mechanism, determine the faulty node in the control role.

[0083] In this embodiment, the distributed storage control cluster will use consistency protocols, such as raft, paxos protocol, etc. The consistency protocol itself has heartbeat detection, but its fault detection is only between the master and the slave. The master fault detection or slave fault detection can be performed by using the SWIM protocol on the cluster control role. In the heartbeat detection of the consistency protocol, it usually takes 2-3 heartbeat cycles of timeout from the slave detection to the master fault to determine the master fault. By using the SWIM protocol to supplement the heartbeat detection of the consistency protocol, the detection speed in the master fault scenario can be improved. First, the heartbeat of the SWIM protocol exists between the master and the slave, and between the slaves. Second, the detection of SWIM faults has an iping mechanism, which uses the detection of multiple nodes to make results, which is more reliable.

[0084] The second embodiment of the present invention corresponds to the first embodiment. This embodiment introduces a fault detection device based on SWIM, such as Figure 4 As shown, it includes the following components:

[0085] An initialization unit is configured to select at least two nodes to be detected in parallel from a current node list preconfigured in a reference node in the cluster and send a detection signal;

[0086] A state judgment unit is configured to determine the state of the node to be detected based on the feedback of the node to be detected on the first detection signal, and when the node to be detected is determined as a pending node, determine whether the pending node is a faulty node by using other nodes in the node list;

[0087] The state diffusion unit is configured to diffuse the fault state of the faulty node to the entire cluster when the node to be detected is determined to be a faulty node, wherein the reference node directly reports the corresponding fault information to the control role in the cluster when detecting the faulty node;

[0088] The control role detection unit is configured to determine a faulty node in the control role based on a SWIM mechanism.

[0089] In one embodiment, the state determination unit is further configured to:

[0090] When the node to be detected fails to feed back the first detection signal within the first time range, the reference node selects at least two nodes in the corresponding node list and sends iping signals to each of them;

[0091] In response to the iping signal, at least two nodes respectively send a second detection signal to the node to be detected;

[0092] When the node to be detected fails to feed back the second detection signal within the first time range, the reference node determines the node to be detected as a faulty node.

[0093] In one embodiment, the state determination unit is further configured to:

[0094] When the node to be detected fails to feed back the first detection signal within the first time range, determining the node to be detected as a pending node;

[0095] When the node to be detected fails to feed back the first detection signal within the second time range, the node to be detected is determined as a faulty node.

[0096] In one embodiment, the state diffusion unit is further configured to:

[0097] Sort all non-controlling role nodes in the cluster using serial numbers starting from 0;

[0098] Starting from the node with sequence number 0, the usage status of the current node is diffused to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node;

[0099] When spreading to a faulty node or a pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with sequence numbers 2m+1 or 2m+2, where m is the sequence number of the current faulty node or the pending node.

[0100] A third embodiment of the present invention is an electronic device, referring to Figure 5 , which can be understood as a physical device, includes a processor and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the following operations are performed:

[0101] Step S1, in a current node list pre-configured in a reference node in a cluster, at least two nodes to be detected are selected in parallel and a detection signal is sent;

[0102] Step S2, based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node;

[0103] Step S3, when the node to be detected is determined to be a faulty node, the fault status of the faulty node is spread to the entire cluster, wherein when the reference node detects the faulty node, it directly reports the corresponding fault information to the control role in the cluster;

[0104] Step S4: Based on the SWIM mechanism, determine the faulty node in the control role.

[0105] The fourth embodiment of the present invention, the process of the fault detection method based on SWIM in this embodiment is the same as that of the first, second or third embodiment, the difference is that in engineering implementation, this embodiment can be implemented by means of software plus a necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the method of the present invention can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for a device to execute the method described in the embodiment of the present invention.

[0106] In summary, compared with the prior art, the present invention has at least the following advantages:

[0107] 1) The present invention uses the SWIM mechanism to perform storage node fault detection, which can reduce the message load of each cluster member during fault detection;

[0108] 2) The present invention can reduce the time of fault detection and speed up the diffusion of fault information by optimizing the SWIM mechanism;

[0109] 3) The present invention optimizes the SWIM mechanism, so that the control plane can update the cluster metadata table in time and restore the service in time;

[0110] 4) The present invention uses the SWIM mechanism to perform fault detection on the control node, which can speed up the detection time of the main fault.

[0111] Through the description of the specific implementation methods, a deeper and more specific understanding of the technical means and effects adopted by the present invention to achieve the predetermined purpose should be obtained. However, the accompanying drawings are only for reference and illustration purposes and are not intended to limit the present invention.

Claims

1. A fault detection method based on SWIM, characterized in that: include: In a current node list preconfigured in a reference node in the cluster, selecting at least two nodes to be detected in parallel and sending a first detection signal; Based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node; When the node to be detected is determined to be a faulty node, the fault status of the faulty node is spread to the entire cluster, wherein when the reference node detects the faulty node, the reference node directly reports the corresponding fault information to the control role in the cluster; Based on the SWIM mechanism, determining the faulty node in the control role; Wherein, based on the feedback of the node to be detected on the first detection signal, determining the state of the node to be detected, when the node to be detected is determined as a pending node, using other nodes in the node list to determine whether the pending node is a faulty node, includes: When the node to be detected fails to feed back the first detection signal within the first time range, the reference node selects at least two nodes in the corresponding node list and sends iping signals to each of them; In response to the iping signal, at least two of the nodes respectively send a second detection signal to the node to be detected; When the node to be detected fails to feed back the second detection signal within the first time range, the reference node determines the node to be detected as a faulty node.

2. The SWIM-based fault detection method according to claim 1, characterized in that: When the node to be detected fails to feed back the first detection signal within the first time range, determining the node to be detected as a pending node; When the node to be detected fails to feed back the first detection signal within a second time range, the node to be detected is determined as a faulty node.

3. The SWIM-based fault detection method according to claim 1, characterized in that: When the node to be detected is determined to be a faulty node, spreading the fault status of the faulty node to the entire cluster includes: Sort the nodes of non-control roles in the cluster by sequence numbers starting from 0; Starting from the node with sequence number 0, the usage status of the current node is diffused to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node; When spreading to the faulty node or the pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with serial numbers 2m+1 or 2m+2, where m is the serial number of the current faulty node or the pending node.

4. A SWIM-based fault detection device, characterized in that: include: An initialization unit is configured to select at least two nodes to be detected in parallel from a current node list preconfigured in a reference node in the cluster and send a first detection signal; a state judgment unit configured to determine the state of the node to be detected based on the feedback of the node to be detected on the first detection signal, and when the node to be detected is determined as a pending node, determine whether the pending node is a faulty node by using other nodes in the node list; A state diffusion unit is configured to diffuse the fault state of the faulty node to the entire cluster when the node to be detected is determined to be a faulty node, wherein the reference node directly reports the corresponding fault information to the control role in the cluster when detecting the faulty node; a control role detection unit configured to determine a faulty node in the control role; Wherein, the state judgment unit is further configured as follows: When the node to be detected fails to feed back the first detection signal within the first time range, the reference node selects at least two nodes in the corresponding node list and sends iping signals to each of them; In response to the iping signal, at least two of the nodes respectively send a second detection signal to the node to be detected; When the node to be detected fails to feed back the second detection signal within the first time range, the reference node determines the node to be detected as a faulty node.

5. The SWIM-based fault detection equipment according to claim 4, characterized in that: The state determination unit is further configured as follows: When the node to be detected fails to feed back the first detection signal within the first time range, determining the node to be detected as a pending node; When the node to be detected fails to feed back the first detection signal within a second time range, the node to be detected is determined as a faulty node.

6. The SWIM-based fault detection equipment according to claim 4, characterized in that: The state diffusion unit is further configured as: Sort all nodes in the cluster that are not control roles by using serial numbers starting from 0; Starting from the node with sequence number 0, the usage status of the current node is diffused to other nodes with sequence numbers 2n+1 or 2n+2, where n is the sequence number of the current node; When spreading to the faulty node or the pending node, stop spreading to other nodes via the faulty node or the pending node, and spread to the upper-level node of the faulty node or the pending node, skip the faulty node or the pending node, and spread the current state of the faulty node or the pending node to other nodes with serial numbers 2m+1 or 2m+2, where m is the serial number of the current faulty node or the pending node.

7. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the SWIM-based fault detection method as claimed in any one of claims 1 to 3 when executed by the processor.

8. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the SWIM-based fault detection method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Distributed service cluster and routing synchronization method thereof

    CN110120961A

  • Node fault detection method and device

    CN110474787A