CN112822078B - Method for realizing raft heartbeat report of nodes in different network domains - Google Patents

Method for realizing raft heartbeat report of nodes in different network domains Download PDF

Info

Publication number
CN112822078B
CN112822078B CN202110214215.3A CN202110214215A CN112822078B CN 112822078 B CN112822078 B CN 112822078B CN 202110214215 A CN202110214215 A CN 202110214215A CN 112822078 B CN112822078 B CN 112822078B
Authority
CN
China
Prior art keywords
heartbeat
group
raft
node
network area
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.)
Active
Application number
CN202110214215.3A
Other languages
Chinese (zh)
Other versions
CN112822078A (en
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.)
Shanghai Yunxi Technology Co ltd
Original Assignee
Shanghai Yunxi 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 Shanghai Yunxi Technology Co ltd filed Critical Shanghai Yunxi Technology Co ltd
Priority to CN202110214215.3A priority Critical patent/CN112822078B/en
Publication of CN112822078A publication Critical patent/CN112822078A/en
Application granted granted Critical
Publication of CN112822078B publication Critical patent/CN112822078B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1895Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for short real-time information, e.g. alarms, notifications, alerts, updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for realizing the heartbeat report of each node in different network domains, which relates to the field of distributed database network communication; recording respective heartbeat updating information at a cluster heartbeat collection position according to time through the raft group lengths of all nodes in different network areas, periodically reading the heartbeat updating information at the cluster heartbeat collection position in a classification mode through the raft group lengths in all the nodes and carrying out area broadcasting in each network area, and identifying whether the heartbeat of the nodes which are communicated with each other is normal or not when group members in each network area receive the heartbeat updating information in the network area.

Description

Method for realizing raft heartbeat report of nodes in different network domains
Technical Field
The invention discloses a realization method, relates to the field of distributed database network communication, and particularly relates to a realization method for reporting the raft heartbeat of each node in different network domains.
Background
In a distributed network, a loader in heartbeat processing within a single raft group may periodically send heartbeat requests to a follower. Under normal conditions, the timer receives the heartbeat and then carries out heartbeat response, and the heartbeat flow is ended. If the heartbeat request cannot be received in the following period, it indicates that the leader node may have a problem, and the leader election mechanism needs to be triggered again. In order to avoid the occurrence of abnormal conditions of the node raft heartbeats in the cluster, heartbeats of the members of the leader and the follower in all the raft groups need to be regularly read, but because each node contains a considerable number of raft groups, the update workload of the members in each raft group is counted one by one, and is huge.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method for reporting the raft heartbeat of each node in different network domains, solves the problem of reporting the raft heartbeat of each node in different network domains, and is favorable for quickly reading and updating the raft heartbeat of each node in different network domains.
The specific scheme provided by the invention is as follows:
a method for reporting the heartbeat of each node in different network areas includes recording the heartbeat update information of each node in different network areas at a cluster heartbeat collection position according to time by the raft group leader of each node in different network areas,
and periodically reading heartbeat updating information in a cluster heartbeat collecting position in a classified manner through the raft group leader in each node, performing regional broadcast in each network region, and identifying whether the heartbeat of the nodes communicated with each other is normal or not by group members in each network region after receiving the heartbeat updating information in the network region.
Further, in the implementation method for reporting the heartbeat of each node in different network domains, heartbeat update information of each node is written in corresponding positions of a cluster heartbeat collection position according to key fields by a raft group leader according to time.
Further, in the implementation method for reporting the heartbeat of each node in different network domains, according to a set update time division period, heartbeat update information is read in a cluster heartbeat collection position in a classification manner and is broadcasted in respective network areas periodically through the raft group length in each node.
Further, in the implementation method for reporting the raft heartbeat of each node in different network domains, the members in each network domain identify whether the heartbeat of the nodes communicated with each other is normal, if the heartbeat is normal, the updating and reading process is finished, otherwise, whether the group length is reselected in the raft group is judged.
A system for realizing the reporting of the raw heartbeat of each node in different network domains comprises a recording module, a reading and broadcasting module and an identification module,
the recording module records respective heartbeat update information at a cluster heartbeat collection position according to time through the raft group leader of each node in different network areas,
the reading and broadcasting module regularly reads heartbeat updating information in a classification mode at a cluster heartbeat collecting position through a raft group leader in each node and performs regional broadcasting in each network region, and the identification module identifies whether nodes which are communicated with each other are normal in heartbeat after group members in each network region receive the heartbeat updating information in the network region.
Further, in the system for reporting the raft heartbeats of the nodes in different network domains, the recording module writes heartbeat update information of the nodes into corresponding positions of a cluster heartbeat collection position respectively according to the key field by the raft group leader according to time.
Further, in the system for realizing the reporting of the raft heartbeats of the nodes in different network domains, the reading and broadcasting module divides a period according to the set updating time, periodically reads heartbeat updating information in a classification manner at a cluster heartbeat collecting position through the raft group leader in each node, and performs area broadcasting in each network domain.
Further, in the implementation system for reporting the raft heartbeat of each node in different network domains, the identification module identifies whether the heartbeat of the nodes communicating with each other is normal, if so, the identification module notifies the members in each network domain that the flow is finished after updating and reading, otherwise, the identification module notifies the members in each network domain to judge whether the group leader is reselected in the raft group.
The invention has the advantages that:
the invention provides a method for realizing the reporting of the raft heartbeat of each node in different network areas, which records heartbeat updating information at a cluster heartbeat collecting position through the raft group leader of each node in different network areas, reads the heartbeat updating information in a classification way through the raft group leader in each node regularly and carries out regional broadcasting in each network area, and group members in each network area receive the heartbeat updating information in the network area and identify whether the heartbeat of the nodes which are communicated with each other is normal. The method greatly reduces the data read-write pressure of each node, obviously improves the read-write efficiency of the disk, can reduce the storage occupation in proportion and enhances the node refreshment jump stability in the cluster.
Drawings
Fig. 1 is a diagram of a prior art Raft heartbeat.
FIG. 2 is a topological diagram of the node-specific refreshment skip update information writing in the method of the present invention;
fig. 3 is a topological diagram of reading node-to-node heartbeat update information in the method of the present invention.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
The invention provides a method for reporting the heartbeat of each node in different network areas, which records the heartbeat updating information of each node in different network areas at a cluster heartbeat collecting position according to time through the raft group leader of each node in different network areas,
and periodically reading heartbeat updating information in a cluster heartbeat collecting position in a classified manner through the raft group leader in each node, performing regional broadcast in each network region, and identifying whether the heartbeat of the nodes communicated with each other is normal or not by group members in each network region after receiving the heartbeat updating information in the network region.
The method is applied to the cluster, wherein the heartbeat of the members in the Raft group in the node is concentrated into the heartbeat of the node, namely the heartbeat of the Raft group in which the node is positioned is replaced by the breathing heartbeat of the node by taking the node as a unit, and the heartbeat of the node is acquired by the group leader of the node and then is broadcasted to the Raft group members. For the statistics of the node heartbeats, after each node is updated in the heartbeat per se by a leader and a heartbeat collecting position of the cluster in the cluster node, the leader and the heartbeat collecting position of the cluster can be filled in the heartbeat collecting position of the cluster according to heartbeat updating time in rows, a period is set, in each period, the management leader of each regional node carries out regional broadcast on updating information of the corresponding node on the heartbeat collecting position of the cluster in each region through a broadcast protocol, and after each member receives the updating information in the local region, whether the heartbeat of the node communicated with the member is normal or not is identified, so that the heartbeat of the node in each region is ensured to be normal.
In specific applications, in some embodiments of the present invention, the distributed database monitors the heartbeat update status of each node in a multi-point writing and multi-point reading manner when processing the heartbeat of a cluster node, and with reference to fig. 2, six management nodes are taken as an example.
Writing heartbeat updating information: and leading of the six areas are respectively written into six rows of storage spaces in the cluster heartbeat collection position according to the updating time stamps, and synchronous concurrent writing is allowed. When the heartbeat updating information is written, the key field with the partition is already provided, and the heartbeat information stored in the key field is also divided according to the area. After the heartbeat updating information is written in, the tasks of all the writing points are completed, and the group leader communicates with the cluster heartbeat collection part again when the heartbeat is required to be read.
After the update is written in for a period of time, the period is divided according to the set update time, which is generally a period of time, and the group leader of each area will read the previous heartbeat update information in a classified manner, referring to fig. 3. After reading and updating, as shown in fig. 3, the group leader in each area takes the area information managed by the group leader from the whiteboard, and transmits the area information to the group members of the group leader, and after receiving the information, each group member node checks whether the heartbeat of the node communicating with the group leader is normal:
if the updating is normal, the updating and reading process is ended;
if the error is abnormal, whether the leader needs to be reselected in the raft group is judged.
By utilizing the method and the device, the data read-write pressure of each node is reduced, the read-write efficiency of the disk is obviously improved, meanwhile, the storage occupation can be reduced in proportion, and the node-snack jump stability in the cluster is enhanced.
Meanwhile, the invention also provides a system for realizing the raft heartbeat report of each node in different network domains, which comprises a recording module, a reading and broadcasting module and an identification module,
the recording module records respective heartbeat updating information at a cluster heartbeat collecting position according to time through the raft group leader of each node in different network areas,
the reading and broadcasting module regularly reads heartbeat updating information in a classification mode at a cluster heartbeat collecting position through a raft group leader in each node and performs regional broadcasting in each network region, and the identification module identifies whether nodes which are communicated with each other are normal in heartbeat after group members in each network region receive the heartbeat updating information in the network region.
For the information interaction, execution process and other contents between the modules in the system, the specific contents can refer to the description in the embodiment of the method of the present invention because the same conception is based on, and are not described herein again.
It should be noted that not all steps and modules in the processes and system structures in the preferred embodiment described above are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structures described in the above embodiments may be physical structures or logical structures, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities separately, or some components may be implemented together in a plurality of independent devices.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitutions or changes made by the person skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the invention is subject to the claims.

Claims (8)

1. A method for reporting the heartbeat of each node in different network areas is characterized in that the heartbeat update information of each raft group is recorded at a cluster heartbeat collecting position according to time by the group length of the raft group to which each node in different network areas belongs,
and periodically classifying and reading heartbeat updating information of the network area at the cluster heartbeat collecting position through the group leader of the raft group to which each node belongs, and performing area broadcasting in the network area to which each node belongs, wherein the heartbeat updating information in the network area is received by group members of the raft group in each network area, and whether the heartbeat of the nodes which are communicated with each other in the network area is normal is identified.
2. The method as claimed in claim 1, wherein the heartbeat update information of each node is written in the corresponding position of the cluster heartbeat collection position according to the key field according to the time by the group length of the raft group to which each node belongs.
3. The method as claimed in claim 1 or 2, wherein according to the set update time division period, the heartbeat update information of the network area is read in a classification manner at the cluster heartbeat collection site through the group length of the raft group to which each node belongs, and the heartbeat update information is broadcasted in the network area to which each node belongs.
4. The method as claimed in claim 3, wherein the group members of the raft group in each network area identify whether the heartbeat of the nodes communicating with each other is normal, if so, the updating and reading process is finished, otherwise, whether the group length in the raft group is reselected is judged.
5. A system for reporting the heartbeat of each node in different network domains is characterized by comprising a recording module, a reading and broadcasting module and an identification module,
the recording module records respective heartbeat updating information at a cluster heartbeat collecting position according to time through the group leader of the raft group to which each node belongs in different network areas,
the reading and broadcasting module regularly reads heartbeat updating information of the network area in a classification mode at the cluster heartbeat collecting position through the group length of the raft group to which each node belongs and performs regional broadcasting in the network area to which each node belongs, and the identification module identifies whether the heartbeat of the nodes which are communicated with each other in the network area is normal or not after the group members of the raft group in each network area receive the heartbeat updating information in the network area.
6. The system as claimed in claim 5, wherein the recording module writes heartbeat update information of each node into a corresponding position of a cluster heartbeat collection location according to the key field by the group length of the raft group to which each node belongs according to time.
7. The system according to claim 5 or 6, wherein the read broadcast module divides a period according to a set update time, periodically classifies and reads heartbeat update information of a network area at a cluster heartbeat collection location according to a group length of a raft group to which each node belongs, and performs area broadcast in the network area to which each node belongs.
8. The system as claimed in claim 7, wherein the identification module identifies whether the heartbeat of the nodes communicating with each other is normal, if the heartbeat is normal, the flow is finished after the update and reading of the group members of the raft group in the respective network area is notified, otherwise, the group members in the respective network area are notified to determine whether to reselect the group leader in the raft group.
CN202110214215.3A 2021-02-26 2021-02-26 Method for realizing raft heartbeat report of nodes in different network domains Active CN112822078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110214215.3A CN112822078B (en) 2021-02-26 2021-02-26 Method for realizing raft heartbeat report of nodes in different network domains

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110214215.3A CN112822078B (en) 2021-02-26 2021-02-26 Method for realizing raft heartbeat report of nodes in different network domains

Publications (2)

Publication Number Publication Date
CN112822078A CN112822078A (en) 2021-05-18
CN112822078B true CN112822078B (en) 2023-01-13

Family

ID=75865674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110214215.3A Active CN112822078B (en) 2021-02-26 2021-02-26 Method for realizing raft heartbeat report of nodes in different network domains

Country Status (1)

Country Link
CN (1) CN112822078B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114866395B (en) * 2022-04-29 2024-03-22 中国建设银行股份有限公司 Method and device for communication of heartbeat of multi-group distributed consistency protocol cluster

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051470A (en) * 2012-11-29 2013-04-17 中标软件有限公司 Cluster and control method for magnetic disk heartbeat of cluster
CN105681074A (en) * 2015-12-29 2016-06-15 北京同有飞骥科技股份有限公司 Method and device for enhancing reliability and availability of dual-computer clusters

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544758B (en) * 2017-08-29 2020-07-10 新华三云计算技术有限公司 Disk heartbeat detection method and device for cluster
US20190363940A1 (en) * 2018-05-23 2019-11-28 Nokia Solutions And Networks Oy Methods, apparatuses and computer-readable mediums for group-based scalable network resource controller clusters
CN111526186A (en) * 2020-04-10 2020-08-11 河海大学 Distributed server cluster configuration method based on Raft

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051470A (en) * 2012-11-29 2013-04-17 中标软件有限公司 Cluster and control method for magnetic disk heartbeat of cluster
CN105681074A (en) * 2015-12-29 2016-06-15 北京同有飞骥科技股份有限公司 Method and device for enhancing reliability and availability of dual-computer clusters

Also Published As

Publication number Publication date
CN112822078A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
KR100943178B1 (en) Method for routing and allocating resources in wireless sensor network
CN105306860B (en) A kind of Video data storage method and device
CN112822078B (en) Method for realizing raft heartbeat report of nodes in different network domains
CN112751772B (en) Data transmission method and system
CN114979158B (en) Resource monitoring method, system, equipment and computer readable storage medium
CN112948064B (en) Data reading method, device and system
CN102404760B (en) Method and device for real-time measurement of system performance
CN113595836A (en) Heartbeat detection method of high-availability cluster, storage medium and computing node
CN113495889A (en) Distributed object storage method and device, electronic equipment and storage medium
CN112865311A (en) Method and device for monitoring message bus of power system
CN109086149A (en) A kind of method that micro services interface calls analysis of central issue
CN101719131A (en) Method, device and system for processing report data
CN110232086A (en) A kind of information management system based on Internet of Things
CN110007864A (en) A kind of data processing method, device, equipment and readable storage medium storing program for executing
CN112751722B (en) Data transmission quality monitoring method and system
CN101499935B (en) Alarm processing method for WiMAX base station
CN113595776B (en) Monitoring data processing method and system
CN107332725B (en) Method for rapidly analyzing PCAP message
CN111711930B (en) Cluster head election method, system, terminal equipment and computer readable storage medium
CN113992333A (en) Data authorization method and system based on block chain
CN110417624B (en) Request statistical method, device and storage medium
CN112925943A (en) Data processing method, device, server and storage medium
CN115133952B (en) S mode probability response method, medium and device based on double random factors
US20220405306A1 (en) Database replication system and method, source end device, and destination end device
CN117453150B (en) Method for implementing multiple instances of video storage scheduling service

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
TA01 Transfer of patent application right

Effective date of registration: 20221215

Address after: Room 305-22, Building 2, No. 1158 Zhangdong Road and No. 1059 Dangui Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Applicant after: Shanghai Yunxi Technology Co.,Ltd.

Address before: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Applicant before: Inspur cloud Information Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant