CN116155695A - Cluster multi-node management method, device, computer equipment and storage medium - Google Patents

Cluster multi-node management method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116155695A
CN116155695A CN202310420182.7A CN202310420182A CN116155695A CN 116155695 A CN116155695 A CN 116155695A CN 202310420182 A CN202310420182 A CN 202310420182A CN 116155695 A CN116155695 A CN 116155695A
Authority
CN
China
Prior art keywords
node
nodes
cluster
queue
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310420182.7A
Other languages
Chinese (zh)
Inventor
柳遵梁
洪远
周杰
闻建霞
许齐
张明明
高宇萍
干忠光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Meichuang Technology Co ltd
Original Assignee
Hangzhou Meichuang Technology Co ltd
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 Hangzhou Meichuang Technology Co ltd filed Critical Hangzhou Meichuang Technology Co ltd
Priority to CN202310420182.7A priority Critical patent/CN116155695A/en
Publication of CN116155695A publication Critical patent/CN116155695A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The embodiment of the invention discloses a cluster multi-node management method, a cluster multi-node management device, computer equipment and a storage medium. The method comprises the following steps: acquiring a heartbeat data packet sent by each node of the cluster multiple nodes; judging whether the corresponding node is a survival node according to the heartbeat data packet; if the corresponding node is not a surviving node, rejecting the non-surviving node; and acquiring the positions of the nodes in the queues from the tail of the queues of the cluster multiple nodes to be filled to the positions of the offline nodes in the queues. By implementing the method of the embodiment of the invention, the problem of overlarge resource consumption caused by a large number of node switching due to the sequential change of the nodes in the prior art can be solved, the relative fixation of the queue nodes is maintained, and the resource consumption caused by the node switching is reduced.

Description

Cluster multi-node management method, device, computer equipment and storage medium
Technical Field
The present invention relates to a node management method, and more particularly, to a cluster multi-node management method, a cluster multi-node management device, a computer device, and a storage medium.
Background
In some cluster nodes it is desirable that the support nodes are ordered to ensure that the nodes remain in a relatively fixed session, e.g. the cluster nodes need to stay connected to a database, and the switching of such connections belongs to a relatively resource consuming operation. In a large-scale cluster, the relative balance of resource use among nodes is required to be ensured, and in order to achieve the aim, the cluster nodes are required to maintain and ensure the corresponding sequence, and the node sequence and related information are stored in a database; rights are necessary to view or modify node information, as well as the node itself storing its own related information.
In summary, in a scenario where support nodes are ordered in cluster nodes to ensure that the nodes maintain relatively fixed sessions, a change in the order of the nodes may cause a large number of nodes to switch, thus causing excessive consumption of resources.
Therefore, it is necessary to design a new method to solve the problem of excessive resource consumption caused by a large number of node switches due to the sequential change of the nodes in the prior art.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a cluster multi-node management method, a cluster multi-node management device, computer equipment and a storage medium.
In order to achieve the above purpose, the present invention adopts the following technical scheme: the cluster multi-node management method comprises the following steps:
acquiring a heartbeat data packet sent by each node of the cluster multiple nodes;
judging whether the corresponding node is a survival node according to the heartbeat data packet;
if the corresponding node is not a surviving node, rejecting the non-surviving node;
and acquiring the positions of the nodes in the queues from the tail of the queues of the cluster multiple nodes to be filled to the positions of the offline nodes in the queues.
The further technical scheme is as follows: the node carries node information, and the node information comprises a node identification code, the last report time of the node, the time of adding the node into a queue and the position of the node in the queue.
The further technical scheme is as follows: the node identification code has the authority to search the node information.
The further technical scheme is as follows: before the heartbeat data packet sent by each node of the cluster multiple nodes is obtained, the method further comprises the following steps:
when a new node is added into the cluster, a node identification code is acquired, the node identification code is stored in the new node, and the new node is added into the tail part of the queue.
The further technical scheme is as follows: the node identification code is formed by combining network environment, time stamp and node information.
The further technical scheme is as follows: the method for obtaining the positions of the nodes from the tail of the multi-node cluster queue to the offline node in the queue comprises the following steps:
determining the position of the offline node in the queue according to the node identification code of the offline node so as to obtain a target position;
acquiring nodes from the tail of a multi-node cluster queue to obtain nodes to be inserted;
filling the node to be inserted into the target position.
The further technical scheme is as follows: the step of judging whether the corresponding node is a surviving node according to the heartbeat data packet comprises the following steps:
judging whether the time difference between the reporting time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range;
if the time difference between the reporting time of the last sending heartbeat data packet and the current time of the heartbeat data packet is not in the set range, determining that the corresponding node is not a survival node.
The invention also provides a cluster multi-node management device, which comprises:
the data packet acquisition unit is used for acquiring heartbeat data packets sent by each node of the cluster multiple nodes;
the judging unit is used for judging whether the corresponding node is a survival node according to the heartbeat data packet;
the rejecting unit is used for rejecting non-surviving nodes if the corresponding nodes are not surviving nodes;
and the filling unit is used for acquiring the positions of the nodes from the tail of the multi-node cluster queue to the offline node in the queue.
The invention also provides a computer device which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method when executing the computer program.
The present invention also provides a storage medium storing a computer program which, when executed by a processor, performs the above-described method.
Compared with the prior art, the invention has the beneficial effects that: the invention judges whether the node survives or not through the heartbeat data packet sent by the node, deletes the node if the node survives, and acquires the node from the tail of the queue to fill the position of the offline node in the queue, so as to solve the problem of overlarge resource consumption caused by a large number of node switching caused by the sequential change of the node in the prior art, keep the relative fixation of the queue node, and reduce the resource consumption caused by the node switching.
The invention is further described below with reference to the drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application scenario of a cluster multi-node management method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a cluster multi-node management method according to an embodiment of the present invention;
FIG. 3 is a schematic sub-flowchart of a cluster multi-node management method according to an embodiment of the present invention;
FIG. 4 is a schematic sub-flowchart of a cluster multi-node management method according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a cluster multi-node management method according to another embodiment of the present invention;
FIG. 6 is a schematic block diagram of a cluster multi-node management device provided by an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a shim cell of a clustered multi-node management device provided by an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a judging unit of the cluster multi-node management device according to the embodiment of the present invention;
FIG. 9 is a schematic block diagram of a cluster multi-node management device according to another embodiment of the present invention;
fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic application scenario diagram of a cluster multi-node management method according to an embodiment of the present invention. Fig. 2 is a schematic flowchart of a cluster multi-node management method according to an embodiment of the present invention. The cluster multi-node management method is applied to a server, and the server performs data interaction with the cluster multi-nodes, manages the cluster multi-nodes and ensures the sequence of node queues; when the nodes in the queue are offline, the offline nodes are automatically removed from the queue, and the positions of the nodes in the queue where the offline nodes are located are filled from the tail part of the queue, so that the positions of most nodes are relatively fixed, and the influence caused by the change of the queue is reduced; when a new node is added into the cluster, the new node is automatically added into the tail part of the queue of the cluster node, so that the queue is ensured to be relatively orderly.
Fig. 2 is a flowchart of a cluster multi-node management method according to an embodiment of the present invention. As shown in fig. 2, the method includes the following steps S110 to S150.
S110, obtaining heartbeat data packets sent by each node of the cluster multi-nodes.
In this embodiment, the heartbeat packet refers to heartbeat information of the node, where the heartbeat information is a criterion for determining whether the node is in an offline state.
And S120, judging whether the corresponding node is a survival node according to the heartbeat data packet.
In this embodiment, the identifier of the node is obtained from the heartbeat packet, then the identifier of the node is used to obtain the relevant information corresponding to the node from the queue, and then the validity check is performed on the heartbeat information by combining the obtained node information corresponding to the heartbeat.
In this embodiment, the node carries node information, where the node information includes a node identifier, a time of a last report of the node, a time of adding the node to the queue, and a position of the node in the queue. The node identification code has the authority to search the node information.
Specifically, searching node information corresponding to the identifier in a space of storing the node information in a database includes: node identification code, time of last report of node, time of node joining into queue, position of node in queue; the node identification code and the database are mutually trusted marks, wherein the node identification code has the authority of searching node information.
That is, the node identification code may be obtained from within the heartbeat packet, and the node identification code is used to search the database for node information.
There may be various ways to store the node information of the queue, and in the case that the space of the database storing the queue is a table in the database, the queue position and the node information are determined according to the time when the node is automatically added.
In one embodiment, referring to fig. 3, the step S120 may include steps S121 to S123.
S121, judging whether the time difference between the report time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range;
s122, if the time difference between the report time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is not in a set range, determining that the corresponding node is not a survival node;
and S123, if the time difference between the reporting time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range, determining that the corresponding node is a survival node.
The criterion for judging whether the node survives is that the last reporting time and the current reporting time of the node are within a certain range, such as 1 minute, if the node is in the cluster multiple nodes, that is, the node is one of the cluster multiple nodes, the time synchronization problem of the multiple nodes needs to be noted.
Specifically, the node identification code is used for searching the related information of the offline node in the queue, wherein the last heartbeat reporting time in the node is compared with the time of the current service management, and the last heartbeat reporting time and the current server management time are considered to be offline if the last heartbeat reporting time and the current server management time are out of a certain range.
S130, if the corresponding node is not a surviving node, rejecting the non-surviving node;
s140, acquiring the node filling from the tail of the multi-node cluster queue to the position of the offline node in the queue.
In one embodiment, referring to fig. 4, the step S140 may include steps S141 to S143.
S141, determining the position of the offline node in the queue according to the node identification code of the offline node so as to obtain a target position.
In this embodiment, the target location refers to the location of the offline node in the queue.
And determining node information according to the node identification code, and determining the position of the offline node in the queue from the node information.
S142, acquiring the nodes from the tail of the multi-node cluster queue to obtain the node to be inserted.
In this embodiment, the node to be inserted refers to a node at the tail of the queue of the cluster multi-node, that is, the last node in the cluster multi-node.
S143, filling the node to be inserted into the target position.
In this embodiment, when the offline node in the queue is deleted, the node at the tail of the queue needs to be filled to the offline node position.
And S150, if the corresponding node is a survival node, updating the heartbeat time of the corresponding node, and executing the step S110.
If the heartbeat data packet is legal and the node information is stored in the queue, the last reporting time of the nodes in the queue is updated according to the current system management time, and if the cluster node is a multi-cluster, the problem of time synchronization of cluster management needs to be paid attention to.
If the heartbeat data packet is legal and the node information does not exist in the queue, the cluster node manager is informed to carry out the node adding step, the node information reported by the heartbeat data packet can be covered by the node information generated by the manager, and the corresponding node is informed to update the cluster information in time.
And carrying out survivability scanning on the nodes one by one in the queue at regular time, if the nodes are offline, deleting the offline nodes from the queue, and filling the tail nodes of the queue into the positions of the offline nodes.
In this embodiment, a label is applied to the node queue manager at the time of starting, and the label information is continuously reported at the time of heartbeat; the node sends the data packet of the self information to the node heartbeat receiver for storage at regular time. And under the condition that the space of the database for storing the node information is a table in the database, the preset account is given authority for reading the node queue information in advance. And sending the database connection information data packet and the secret key corresponding to the node to the corresponding node function for storage.
For example: cluster multi-node initial state: node 1, node 2, node 3, node 4, node 5; when node 2 loses heartbeat, namely becomes a non-surviving node, deleting node 2, and clustering multiple nodes are as follows: node 1, node 3, node 4, node 5; changing the complement of node 5 to node 2, forming the final queue: node 1, node 5, node 3, node 4.
When the node survival state scanning result shows that the node does not receive the heartbeat for more than the set time, locking the node, judging whether the identification code of the node exists in the list, if so, deleting the node, and carrying out bit filling operation from the node at the tail of the queue. The node survival state scanning result shows that the node does not receive the heartbeat and does not exceed the set time, and the scanning is continued; and when the node heartbeat needs to be updated, judging whether the identification number exists in the node queue, if so, updating the node heartbeat time, if not, locking the node, judging whether the identification number exists in the list, and if not, adding the node to the tail of the queue.
The method of the present embodiment is applied to some cluster nodes that require support nodes to be ordered, ensuring that the nodes remain in a relatively fixed session, e.g., the cluster nodes need to remain connected to a database, and the switching of such connections is a relatively resource-consuming operation. In a large-scale cluster, the relative balance of resource use among nodes is required to be ensured, and in order to achieve the aim, the cluster nodes are required to maintain and ensure the corresponding sequence, and the node sequence and related information are stored in a database; rights are necessary to view or modify node information. Meanwhile, the node itself stores the related information of itself.
According to the cluster multi-node management method, whether the node survives or not is judged through the heartbeat data packet sent by the node, if the node survives, the node is deleted, and the position of the offline node in the queue is filled from the tail part of the queue, so that the problem that a large number of nodes are switched due to the sequential change of the node in the prior art is solved, the relative fixation of the queue nodes is maintained, and the resource consumption caused by the node switching is reduced.
Fig. 5 is a flowchart of a cluster multi-node management method according to another embodiment of the present invention. As shown in fig. 5, the cluster multi-node management method of the present embodiment includes steps S210 to S260. Steps S220 to S260 are similar to steps S110 to S150 in the above embodiment, and are not described herein. Step S210 added in the present embodiment is described in detail below.
S210, when a new node is added into the cluster, a node identification code is acquired, the node identification code is stored in the new node, and the new node is added into the tail of the queue.
In this embodiment, the node identification code is formed according to a combination of a network environment, a time stamp, and node information.
When the node is registered in the cluster for the first time, generating a unique identification code according to the combination of the network environment, the time stamp, related node information and the like, storing the corresponding identification code in a cluster manager, and adding the identification code into the tail of a queue; meanwhile, the node manager generates link session information of the database according to the mode of the node sequence position, and the link session information is sent to the node to be used by the node.
In the case where network environment, time stamp and related node information cannot be obtained, the uniqueness of the label can be ensured by managing and maintaining a unique label.
When the node reports the registration information, the cluster manager needs to perform relevant verification on the node information, so that the situations of repeated registration, invalid registration, illegal renting and measurement and the like are prevented.
When the node is added to the queue call, the node is firstly locked, and when the identification code is not in the list, a new node is added to the tail of the queue.
For example: cluster multi-node initial state: node 1, node 2, node 3, node 4, node 5; when a new node 6 is added to the queue, the cluster multi-node is: node 1, node 3, node 4, node 5, node 6; when node 2 loses heartbeat, namely becomes a non-surviving node, deleting node 2, and clustering multiple nodes are as follows: node 1, node 3, node 4, node 5, node 6; changing the complement of node 5 to node 2, forming the final queue: node 1, node 6, node 3, node 4, node 5.
Fig. 6 is a schematic block diagram of a cluster multi-node management device 300 according to an embodiment of the present invention. As shown in fig. 6, the present invention also provides a cluster multi-node management apparatus 300 corresponding to the above cluster multi-node management method. The cluster multi-node management apparatus 300 includes a unit for performing the above-described cluster multi-node management method, and may be configured in a server. Specifically, referring to fig. 6, the cluster multi-node management apparatus 300 includes a packet acquisition unit 302, a determination unit 303, a culling unit 304, a padding unit 305, and an updating unit 306.
A data packet obtaining unit 302, configured to obtain a heartbeat data packet sent by each node of the cluster multiple nodes; a judging unit 303, configured to judge whether the corresponding node is a surviving node according to the heartbeat packet; a culling unit 304, configured to cull non-surviving nodes if the corresponding node is not a surviving node; and the filling unit 305 is used for acquiring the positions of the nodes from the tail of the queue of the cluster multi-node to the offline node in the queue. And the updating unit 306 is configured to update the heartbeat time of the corresponding node if the corresponding node is a surviving node, and execute the heartbeat data packet sent by each node of the acquired cluster multi-node.
In one embodiment, as shown in FIG. 7, the shim cell 305 includes a location determination sub-cell 3051, a node acquisition sub-cell 3052, and an insertion sub-cell 3053.
A position determining subunit 3051, configured to determine a position of the offline node in the queue according to the node identifier of the offline node, so as to obtain a target position; a node acquiring subunit 3052, configured to acquire a node from the tail of the queue of the multiple nodes of the cluster, so as to obtain a node to be inserted; an inserting subunit 3053, configured to pad the node to be inserted onto the target location.
In one embodiment, as shown in fig. 8, the determining unit 303 includes a time determining subunit 3031, a first determining subunit 3032, and a second determining subunit 3033.
A time judging subunit 3031, configured to judge whether a time difference between a reporting time of a heartbeat data packet sent by a node last time and a current time of the heartbeat data packet is within a set range; the first determining subunit 3032 is configured to determine that the corresponding node is not a surviving node if a time difference between a reporting time of the last sending of the heartbeat packet by the node and a current time of the heartbeat packet is not within a set range. The second determining subunit 3033 is configured to determine that the corresponding node is a surviving node if a time difference between a reporting time of the last sending of the heartbeat packet by the node and a current time of the heartbeat packet is within a set range.
Fig. 9 is a schematic block diagram of a cluster multi-node management apparatus 300 according to another embodiment of the present invention. As shown in fig. 9, the cluster multi-node management apparatus 300 of the present embodiment is added with the joining unit 301 on the basis of the above-described embodiment.
And the adding unit 301 is configured to obtain a node identifier when a new node is added to the cluster, store the node identifier in the new node, and add the new node to the tail of the queue.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the cluster multi-node management apparatus 300 and each unit may refer to the corresponding description in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The clustered multi-node management apparatus 300 described above may be implemented in the form of a computer program that can run on a computer device as shown in fig. 10.
Referring to fig. 10, fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a server, where the server may be a stand-alone server or may be a server cluster formed by a plurality of servers.
With reference to FIG. 10, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a clustered multi-node management method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a clustered multi-node management method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of a portion of the architecture in connection with the present application and is not intended to limit the computer device 500 to which the present application is applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
acquiring a heartbeat data packet sent by each node of the cluster multiple nodes; judging whether the corresponding node is a survival node according to the heartbeat data packet; if the corresponding node is not a surviving node, rejecting the non-surviving node; and acquiring the positions of the nodes in the queues from the tail of the queues of the cluster multiple nodes to be filled to the positions of the offline nodes in the queues.
The node carries node information, wherein the node information comprises a node identification code, the last report time of the node, the time of adding the node into a queue and the position of the node in the queue.
The node identification code has the authority to search the node information.
In one embodiment, before implementing the step of acquiring the heartbeat packet sent by each node of the plurality of nodes, the processor 502 further implements the following steps:
when a new node is added into the cluster, a node identification code is acquired, the node identification code is stored in the new node, and the new node is added into the tail part of the queue.
The node identification code is formed by combining network environment, time stamp and node information.
In an embodiment, when implementing the step of filling the position of the offline node in the queue from the acquiring node at the tail of the queue of the plurality of nodes, the processor 502 specifically implements the following steps:
determining the position of the offline node in the queue according to the node identification code of the offline node so as to obtain a target position; acquiring nodes from the tail of a multi-node cluster queue to obtain nodes to be inserted; filling the node to be inserted into the target position.
In an embodiment, when implementing the step of determining whether the corresponding node is a surviving node according to the heartbeat packet, the processor 502 specifically implements the following steps:
judging whether the time difference between the reporting time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range; if the time difference between the reporting time of the last sending heartbeat data packet and the current time of the heartbeat data packet is not in the set range, determining that the corresponding node is not a survival node.
It should be appreciated that in embodiments of the present application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a heartbeat data packet sent by each node of the cluster multiple nodes; judging whether the corresponding node is a survival node according to the heartbeat data packet; if the corresponding node is not a surviving node, rejecting the non-surviving node; and acquiring the positions of the nodes in the queues from the tail of the queues of the cluster multiple nodes to be filled to the positions of the offline nodes in the queues.
The node carries node information, wherein the node information comprises a node identification code, the last report time of the node, the time of adding the node into a queue and the position of the node in the queue.
The node identification code has the authority to search the node information.
In one embodiment, before executing the computer program to implement the step of obtaining heartbeat packets sent by each node of the cluster multi-node, the processor further implements the steps of:
when a new node is added into the cluster, a node identification code is acquired, the node identification code is stored in the new node, and the new node is added into the tail part of the queue.
The node identification code is formed by combining network environment, time stamp and node information.
In one embodiment, when the processor executes the computer program to implement the step of filling the bits in the queue from the tail acquisition node to the offline node in the queue of the cluster multi-node, the steps are specifically implemented as follows:
determining the position of the offline node in the queue according to the node identification code of the offline node so as to obtain a target position; acquiring nodes from the tail of a multi-node cluster queue to obtain nodes to be inserted; filling the node to be inserted into the target position.
In one embodiment, when the processor executes the computer program to implement the step of determining whether the corresponding node is a surviving node according to the heartbeat packet, the following steps are specifically implemented:
judging whether the time difference between the reporting time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range; if the time difference between the reporting time of the last sending heartbeat data packet and the current time of the heartbeat data packet is not in the set range, determining that the corresponding node is not a survival node.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The cluster multi-node management method is characterized by comprising the following steps:
acquiring a heartbeat data packet sent by each node of the cluster multiple nodes;
judging whether the corresponding node is a survival node according to the heartbeat data packet;
if the corresponding node is not a surviving node, rejecting the non-surviving node;
and acquiring the positions of the nodes in the queues from the tail of the queues of the cluster multiple nodes to be filled to the positions of the offline nodes in the queues.
2. The method of claim 1, wherein the node carries node information, and the node information includes a node identification code, a time of a last report of the node, a time of a joining of the node into a queue, and a position of the node in the queue.
3. The clustered multi-node management method of claim 2, wherein the node identification code has authority to find the node information.
4. The method for managing multiple nodes of a cluster according to claim 2, wherein before obtaining the heartbeat packet sent by each node of the multiple nodes of the cluster, the method further comprises:
when a new node is added into the cluster, a node identification code is acquired, the node identification code is stored in the new node, and the new node is added into the tail part of the queue.
5. The method of claim 4, wherein the node identification code is formed based on a combination of network environment, time stamp and node information.
6. The method of claim 2, wherein the step of obtaining the positions of the nodes from the tail of the queue of the plurality of nodes to be filled to the offline node in the queue comprises:
determining the position of the offline node in the queue according to the node identification code of the offline node so as to obtain a target position;
acquiring nodes from the tail of a multi-node cluster queue to obtain nodes to be inserted;
filling the node to be inserted into the target position.
7. The method of claim 1, wherein determining whether the corresponding node is a surviving node according to the heartbeat packet comprises:
judging whether the time difference between the reporting time of the last heartbeat data packet sent by the node and the current time of the heartbeat data packet is within a set range;
if the time difference between the reporting time of the last sending heartbeat data packet and the current time of the heartbeat data packet is not in the set range, determining that the corresponding node is not a survival node.
8. A clustered multi-node management apparatus comprising:
the data packet acquisition unit is used for acquiring heartbeat data packets sent by each node of the cluster multiple nodes;
the judging unit is used for judging whether the corresponding node is a survival node according to the heartbeat data packet;
the rejecting unit is used for rejecting non-surviving nodes if the corresponding nodes are not surviving nodes;
and the filling unit is used for acquiring the positions of the nodes from the tail of the multi-node cluster queue to the offline node in the queue.
9. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-7.
10. A storage medium storing a computer program which, when executed by a processor, performs the method of any one of claims 1 to 7.
CN202310420182.7A 2023-04-19 2023-04-19 Cluster multi-node management method, device, computer equipment and storage medium Pending CN116155695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310420182.7A CN116155695A (en) 2023-04-19 2023-04-19 Cluster multi-node management method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310420182.7A CN116155695A (en) 2023-04-19 2023-04-19 Cluster multi-node management method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116155695A true CN116155695A (en) 2023-05-23

Family

ID=86373992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310420182.7A Pending CN116155695A (en) 2023-04-19 2023-04-19 Cluster multi-node management method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116155695A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103281211A (en) * 2013-06-13 2013-09-04 黑龙江工程学院 Large-scale network node grouping management system and management method
US20160164716A1 (en) * 2013-08-30 2016-06-09 Nec Europe Ltd. Method for operating a distributed computing system and a distributed computing system
CN106933659A (en) * 2015-12-30 2017-07-07 华为技术有限公司 The method and apparatus of managing process
CN110031722A (en) * 2019-04-03 2019-07-19 郑州轨道交通信息技术研究院 A kind of processing method and its device of real time fail report adhesion
CN110109733A (en) * 2019-04-29 2019-08-09 东北大学 Virtual Machine Worker queue and redundancy queue update method towards different aging scenes
CN112084072A (en) * 2020-09-11 2020-12-15 重庆紫光华山智安科技有限公司 Method, system, medium and terminal for improving disaster tolerance capability of PostgreSQL cluster
CN115102887A (en) * 2022-07-15 2022-09-23 济南浪潮数据技术有限公司 Cluster node monitoring method and related equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103281211A (en) * 2013-06-13 2013-09-04 黑龙江工程学院 Large-scale network node grouping management system and management method
US20160164716A1 (en) * 2013-08-30 2016-06-09 Nec Europe Ltd. Method for operating a distributed computing system and a distributed computing system
CN106933659A (en) * 2015-12-30 2017-07-07 华为技术有限公司 The method and apparatus of managing process
CN110031722A (en) * 2019-04-03 2019-07-19 郑州轨道交通信息技术研究院 A kind of processing method and its device of real time fail report adhesion
CN110109733A (en) * 2019-04-29 2019-08-09 东北大学 Virtual Machine Worker queue and redundancy queue update method towards different aging scenes
CN112084072A (en) * 2020-09-11 2020-12-15 重庆紫光华山智安科技有限公司 Method, system, medium and terminal for improving disaster tolerance capability of PostgreSQL cluster
CN115102887A (en) * 2022-07-15 2022-09-23 济南浪潮数据技术有限公司 Cluster node monitoring method and related equipment

Similar Documents

Publication Publication Date Title
US9357403B2 (en) Conflict handling in self-organizing networks
US20230105343A1 (en) NF SERVICE CONSUMER RESTART DETECTION USING DIRECT SIGNALING BETWEEN NFs
CN112534776A (en) Method and apparatus for detecting network function failure and restart in network environment
EP1117223A1 (en) Communication protocol
CN111052091A (en) Method for forming consensus in a network and nodes constituting the network
US10581619B2 (en) Certificate management method, device, and system
US20190132727A1 (en) Methods and apparatus for use in reducing signal latency in a mobile network with use of localized unified data management (udm) entities
US20100050235A1 (en) Methods and apparatus for reducing the effectiveness of chosen location attacks in a peer-to-peer overlay network
US20180145890A1 (en) Service registration method and usage method, and related apparatus
CN111538763A (en) Method for determining main node in cluster, electronic equipment and storage medium
CN113010313A (en) Load balancing method and device, electronic equipment and computer storage medium
CN115277712B (en) Distributed lock service providing method, device and system and electronic equipment
CN114080016B (en) Method and device for synchronizing context information of user equipment and network equipment
CN116155695A (en) Cluster multi-node management method, device, computer equipment and storage medium
CN113709776A (en) Communication method, device and system
WO2022083385A1 (en) Network nodes and methods therein for providing backup network function
JP7254166B2 (en) Apparatus, methods, computer programs, and computer program products supporting mutually exclusive access to network slices
US11190432B2 (en) Method and first node for managing transmission of probe messages
US11940976B2 (en) Technique for concurrency control
CN113900728A (en) Method, system, electronic device and storage medium for synchronous configuration
EP4127930A1 (en) Methods and apparatuses for enhanced 5gc restoration when a network function (nf) set is deployed in the network
CN111858100A (en) BMC message transmission method and related device
CN117478510B (en) Configuration backup method of network equipment, network equipment and storage medium
CN115277379B (en) Distributed lock disaster recovery processing method and device, electronic equipment and storage medium
KR102460910B1 (en) Data storage method for preventing data duplication and data platform applying the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230523