CN110750393B - Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking - Google Patents

Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking Download PDF

Info

Publication number
CN110750393B
CN110750393B CN201910829019.XA CN201910829019A CN110750393B CN 110750393 B CN110750393 B CN 110750393B CN 201910829019 A CN201910829019 A CN 201910829019A CN 110750393 B CN110750393 B CN 110750393B
Authority
CN
China
Prior art keywords
server cluster
message
heartbeat message
main state
vrrp
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
CN201910829019.XA
Other languages
Chinese (zh)
Other versions
CN110750393A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910829019.XA priority Critical patent/CN110750393B/en
Publication of CN110750393A publication Critical patent/CN110750393A/en
Application granted granted Critical
Publication of CN110750393B publication Critical patent/CN110750393B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2028Failover techniques eliminating a faulty processor or activating a spare
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2033Failover techniques switching over of hardware resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention provides a method, a device, a medium and equipment for avoiding network service double-machine hot standby brain cracking, wherein the method comprises the following steps: the first jumper of the first server cluster is arranged on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster; receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster; and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster in the main state to advertise the network service ip. The method and the device do not need extra physical resources related to the heartbeat line or introduce a third party for arbitration, can keep logic simple, and completely avoid the possibility of external service while cerebral rupture.

Description

Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and equipment for avoiding network service dual-computer hot standby brain cracking.
Background
A high availability Cluster, in english, high Availability Cluster, HA Cluster for short, is simply a group of computers that as a whole provide a set of network resources to the user. These individual computer systems are the nodes of the cluster. A high availability cluster (HA cluster) refers to a cluster of hosts that operate as a single system and support (computers) continuous normal operation.
The high availability clusters are presented in order to make the overall service of the clusters as available as possible, thereby reducing the loss caused by computer hardware and software error-prone. If a node fails, its standby node will take care of its duties within a few seconds. Thus, the cluster is never down for the user. The main role of highly available cluster software (e.g. keepalive) is to automate the fault checking and service switching.
A high availability cluster with only two nodes is also called a dual hot standby, i.e. two servers are used to back up each other. When one server fails, the other server can bear the service task, so that the system can be automatically ensured to continuously provide service to the outside without manual intervention. Dual hot standby is one of the highly available clusters.
As shown in fig. 1, service cluster a and service cluster B are dual hot standby, and a and B negotiate a master-standby state through a jumper connection. The data traffic of the service is sent to the service cluster a in the master state.
User access process:
the user requests access to the service of ip address 10.0.0.1, and the server with 10.0.0.1 ip returns the information accessed by the user.
The procedure for the next heartbeat is described here:
the system comprises a server A and a server B, wherein the server A and the server B select the state A as a main state (through priority judgment) through the interactive information of the cardiac jumper. Then the A server with the main state announces the ip address of 10.0.0.1 to the front-end switch, and after the flow passes through the front-end switch, the switch sends the flow to the server A.
The main state server A periodically issues heartbeat messages through heartbeat lines, informs the outside of the current self priority, and the machine B in the standby state keeps the current state when monitoring that the priority of the heartbeat messages sent by the server A is greater than or equal to the priority of the heartbeat messages sent by the server A. When the machine A in the main state goes wrong, service cannot be provided (if a program dies), the priority of the machine B is regulated to send out a heartbeat message, or the heartbeat message cannot be issued (the machine is hung up, or a local network port is not connected), the standby state machine receives the heartbeat message with lower priority than the machine B, or the standby state machine does not receive the heartbeat message for a certain time, actively sends the heartbeat message including the priority of B, after the heartbeat message with higher priority than the machine B is not received in fixed time, the machine B announces the machine B is in the main state, then announces the IP of 10.0.0.1 to a switch at the front end, and a message of a user accessing the IP is sent to the server B through the switch.
As shown in fig. 2, the cause of the brain fracture of the network service dual hot standby is shown, and in a High Availability (HA) system, when the "cardiac jumper" connecting 2 nodes is disconnected, the HA system, which is an integral and coordinated action, is split into 2 independent individuals. The other side fails because of losing contact with each other. The HA software on the two nodes is similar to "split brain" and HAs serious consequences, namely, the 2-side "service" is all up, the service ip is issued to the outside, one ip session flow of the user accessing the service may be respectively issued to the two nodes, and the stateful session causes failure.
At present, the cerebral infarction solving mode
Countermeasures against "split brain" of the HA system are currently agreed on:
1) Redundant heartbeat lines are added, for example: double line (heart beat line is HA) to reduce occurrence probability of split brain; as shown in fig. 3, by adding redundant heartbeat lines, the problem of brain cracking existing in the network service dual-computer hot standby is solved; however, as shown in fig. 3, the problem of brain fracture cannot be solved, but the risk of brain fracture is reduced, and additional network card equipment is also required.
2) An arbitration mechanism is set. For example, a reference IP (such as gateway IP) is set, when the cardiac jumper is completely disconnected, each of the 2 nodes pings the reference IP, and if not, a breakpoint is indicated to be at the home terminal. The network link of the local terminal which is not only the heartbeat but also the external service is broken, and even if the application service is started (or continued) is not used, the competition is actively abandoned, so that one end of the reference IP can be pinged to start the service. More insurance, a party that does not refer to IP simply reboots itself to completely free up shared resources that might otherwise be occupied. As shown in fig. 4, an arbitration mechanism is set to solve the problem of network dual-machine hot standby brain-splitting, as shown in fig. 4, a heart jumper of a server B is broken, and the server B also pings off a third-party gateway, so that the server a is in a main state. The method for solving the problem of network double-machine hot-standby brain cracking by setting a blanking mechanism has the following defects: additional network ports are needed, and the cost is high; in addition, the flow of third party arbitration is added, and the scheme becomes complex. Therefore, in long-term research and development, the inventor has conducted a great deal of research on how to avoid the network service dual-computer hot standby split, and put forward a method for avoiding the network service dual-computer hot standby split to solve one of the above technical problems.
Disclosure of Invention
The invention aims to provide a method, a device, a medium and electronic equipment for avoiding network service dual-computer hot standby brain cracking, which can solve at least one technical problem. The specific scheme is as follows:
according to a first aspect of the present disclosure, there is provided a method for avoiding a network service dual hot standby split brain, including:
a first jumper of a first server cluster is arranged on a first data link of the first server cluster; the second jumper of the second server cluster is arranged on a second data link of the second server cluster;
receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster;
and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster advertising network service ip in the main state.
Optionally, a first jumper of the first server cluster is set on a first data link of the first server cluster; and after a second heartbeat wire of a second server cluster is disposed on a second data link of the second server cluster, the method further includes:
Receiving a first message of the first server cluster, analyzing the received first message, judging whether the first message is an ip message, judging whether the first message is a heartbeat message according to a destination ip corresponding to the first message after judging that the first message is the ip message, and if the destination ip corresponding to the first message is a preset fixed value, judging that the first message is the first heartbeat message of the server cluster; otherwise, if the destination ip corresponding to the first message is not a preset fixed value, the first message is an ip message requested by the user.
Optionally, a first jumper of the first server cluster is set on a first data link of the first server cluster; and after a second heartbeat wire of a second server cluster is disposed on a second data link of the second server cluster, the method further includes:
receiving a second message of the second server cluster, analyzing the received second message, judging whether the second message is an ip message, judging whether the second message is a heartbeat message according to a destination ip corresponding to the second message after judging that the second message is the ip message, and if the destination ip corresponding to the second message is a preset fixed value, judging that the second message is a second heartbeat message of the second server cluster; otherwise, if the destination ip corresponding to the second message is not a preset fixed value, the second message is an ip message requested by the user.
Optionally, the electing a server cluster as a master state from the first server cluster and the second server cluster includes:
judging whether the priority of a first heartbeat message of a first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is smaller than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, determining to elect the first server cluster from the first server cluster and the second server cluster as the server cluster in the main state.
Optionally, after the electing the first server cluster as the server cluster in the master state, the method further includes:
and periodically sending the first heartbeat message of the first server cluster.
Optionally, after the electing the first server cluster as the server cluster in the master state, the method further includes:
and when judging that the second server cluster is in a non-main state, issuing the second heartbeat message and corresponding self priority information, starting a corresponding timer, and setting the second server cluster as the server cluster in the main state when the timer expires, so that the second server cluster in the main state announces the network service ip.
Optionally, the electing a server cluster from the first server cluster and the second server cluster as a master state further includes:
judging whether the priority of a first heartbeat message of a first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is greater than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, modifying the main state of the first server cluster into an alternative state; otherwise, if the first server cluster is judged not to be in the main state, the timer is canceled.
According to a second aspect of the present invention, there is provided a method for avoiding a split brain between a network service dual-server hot standby, comprising:
the device comprises a setting unit, a first data transmission unit and a second data transmission unit, wherein the setting unit is used for setting a first jumper of a first server cluster on a first data link of the first server cluster; the second jumper of the second server cluster is arranged on a second data link of the second server cluster;
the receiving unit is used for receiving a first vrrp heartbeat message sent by the first server cluster and a second vrrp heartbeat message sent by the second server cluster;
And the analysis election unit is used for analyzing the first vrrp heartbeat message received by the receiving unit and the second vrrp heartbeat message received by the receiving unit according to a preset rule, and electing a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster notification network service ip of the main state.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method of avoiding network service dual hot standby brain cracking as defined in any one of the above.
According to a fourth aspect of the present invention, there is provided an electronic device comprising: one or more processors; storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method of avoiding network service dual hot standby brain cracking as claimed in any preceding claim.
Compared with the prior art, the scheme provided by the embodiment of the invention has at least the following beneficial effects: the disclosure provides a method, a device, a medium and electronic equipment for avoiding network service dual-computer hot standby brain cracking, wherein a first jumper of a first server cluster is arranged on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster; receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster; and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster in the main state to advertise the network service ip. The method and the device do not need extra physical resources related to the heartbeat line or introduce a third party for arbitration, can keep logic simple, and completely avoid the possibility of external service while cerebral rupture.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 is a schematic diagram of a prior art process flow of a network service dual hot standby;
FIG. 2 is a schematic diagram showing the cause of the brain-cracking phenomenon in the network service dual-machine hot standby in the prior art;
FIG. 3 is a schematic diagram of a prior art method for solving the problem of brain-cracking in a network service dual-machine hot standby;
FIG. 4 is a schematic diagram of a process flow of another method for solving the problem of brain-cracking occurring in a network service dual-machine hot standby in the prior art;
FIG. 5 is a schematic diagram of a data channel and a cardiac jumper set in a method for avoiding network service dual-machine hot standby brain cracking according to an embodiment of the present invention;
FIG. 6 illustrates a flow chart of a method for avoiding network service dual hot standby brain cracking in accordance with an embodiment of the present invention;
FIG. 7 illustrates a flow chart of a method of electing a server cluster from a first server cluster and a second server cluster as a master state and advertising an ip address in a specific application in accordance with an embodiment of the invention;
FIG. 8 illustrates another method flow diagram for avoiding network service dual hot standby brain cracking in accordance with an embodiment of the present invention;
FIG. 9 shows a schematic diagram of an apparatus for avoiding network service dual hot standby brain cracking according to an embodiment of the present invention;
fig. 10 shows a schematic diagram of an electronic device connection structure according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. 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.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application 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, the "plurality" generally includes at least two.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe … … in embodiments of the present invention, these … … should not be limited to these terms. These terms are only used to distinguish … …. For example, the first … … may also be referred to as the second … …, and similarly the second … … may also be referred to as the first … …, without departing from the scope of embodiments of the present invention.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or device comprising such element.
Alternative embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Example 1
Fig. 5 is a schematic diagram of a data channel and a cardiac jumper set in a method for avoiding network service dual-standby brain burst according to an embodiment of the present invention.
As shown in fig. 5, the method provided by the present invention allows the traffic flowing on the jumper to flow on the original data link.
The first jumper of the first server cluster is arranged on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster; therefore, no extra physical resource related to the heartbeat line is needed, no third party is introduced for arbitration, logic simplicity can be kept, and the possibility of external service while cerebral rupture is completely avoided.
As shown in fig. 6, according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for avoiding a network service dual hot standby brain burst, which specifically includes the following method steps:
s602: the first jumper of the first server cluster is arranged on a first data link of the first server cluster; and a second jumper of the second server cluster is arranged on a second data link of the second server cluster.
In the step, the flow running on the heartbeat line runs on the original data link, so that additional physical resources related to the heartbeat line are not needed, and a third party is not needed to be introduced for arbitration, the logic is kept simple, and the possibility of external service while cerebral rupture is completely avoided.
S604: and receiving a first vrrp heartbeat message sent by the first server cluster and a second vrrp heartbeat message sent by the second server cluster.
In this step, vrrp (virtual router redundancy protocol, virtual routing redundancy protocol) is a routing protocol proposed by IETF to solve the problem of single point failure of a static gateway configured in a local area network, and the standard of the RFC2338 protocol has been proposed in 1998. VRRP is widely used in edge networks, and its design goal is to support IP data traffic failover without confusion in certain situations, allow hosts to use single routers, and maintain connectivity between routers in the event of failure of the actual first-hop router.
S606: and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster in the main state to advertise the network service ip.
In this step, according to a preset rule, the first vrrp heartbeat message and the second vrrp heartbeat message are analyzed, so that the server cluster serving as the main state can be precisely selected from the first server cluster and the second server cluster.
The method provided by the invention can accurately determine the server cluster in the main state from the first server cluster and the second server cluster, and announce the network service ip through the determined server cluster in the main state.
As shown in fig. 7, a flowchart of a method for electing a server cluster as a master state from a first server cluster and a second server cluster and advertising an ip address in a specific application according to an embodiment of the present invention is shown.
From the flowchart shown in fig. 7, it can be known that: after receiving the message, the server distinguishes the flow requested by the user from the flow of the heartbeat message.
Under different application scenarios, the destination ip of the heartbeat message is ip with a fixed value.
In a specific application scene, the destination ip of the heartbeat message is the ip of the vrrp protocol with a fixed value; for example, the destination ip address anchor address of the vrrp protocol is 224.0.0.18.
The server A and the server B elect a main state server by sending a vrrp heartbeat message with the destination ip of 224.0.0.18, and then announce ip 10.0.0.1 to the outside.
In this specific application scenario, the server a may be a first server cluster or a second server cluster; server B may be a first server cluster or a second server cluster.
In addition, the method provided by the invention can also switch the server cluster in the main state, and the first server cluster is the main server cluster within the time set by a certain timer; and the second server cluster is the main server cluster in the time set by another timer.
Optionally, a first jumper in the first server cluster is disposed on a first data link of the first server cluster; and after the second heartbeat line of the second server cluster is disposed on the second data link of the second server cluster, the method further includes:
Receiving a first message of a first server cluster, analyzing the received first message, judging whether the first message is an ip message, judging whether the first message is a heartbeat message according to a destination ip corresponding to the first message after judging that the first message is the ip message, and if the destination ip corresponding to the first message is a preset fixed value, judging that the first message is the first heartbeat message of the server cluster; otherwise, if the destination ip corresponding to the first message is not a preset fixed value, the first message is an ip message requested by the user.
Optionally, a first jumper in the first server cluster is disposed on a first data link of the first server cluster; and after the second heartbeat line of the second server cluster is disposed on the second data link of the second server cluster, the method further includes:
receiving a second message of the second server cluster, analyzing the received second message, judging whether the second message is an ip message, judging whether the second message is a heartbeat message according to a destination ip corresponding to the second message after judging that the second message is the ip message, and if the destination ip corresponding to the second message is a preset fixed value, judging that the second message is a second heartbeat message of the second server cluster; otherwise, if the destination ip corresponding to the second message is not the preset fixed value, the second message is the ip message requested by the user.
Optionally, electing a server cluster from the first server cluster and the second server cluster as the master state includes:
judging whether the priority of the first heartbeat message of the first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is smaller than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, determining to elect the first server cluster from the first server cluster and the second server cluster as the server cluster in the main state.
Optionally, after electing the first server cluster as the server cluster of the master state, the method further comprises:
and periodically sending a first heartbeat message of the first server cluster.
Optionally, after electing the first server cluster as the server cluster of the master state, the method further comprises:
when judging that the second server cluster is in a non-main state, issuing a second heartbeat message and corresponding self priority information, starting a corresponding timer, and setting the second server cluster as the server cluster in the main state when the timer expires, so that the second server cluster in the main state announces the network service ip.
Optionally, electing a server cluster from the first server cluster and the second server cluster as the master state further includes:
judging whether the priority of the first heartbeat message of the first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is greater than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, modifying the main state of the first server cluster into an alternative state; otherwise, if the first server cluster is judged not to be in the master state, the timer is canceled.
Referring to fig. 8, another method flowchart for avoiding network service dual hot standby brain cracking is shown according to an embodiment of the present invention.
As shown in fig. 8, when the server B is disconnected from the line of the switch, the heartbeat line is disconnected, and the data line is also disconnected. The heartbeat line is disconnected, and the servers A and B can not negotiate and can all become a main state, but because the line of the server B is disconnected, the server B can not announce the IP to the outside, and the flow of the exchanger can only be transferred to the server A. The user's traffic will not be sent to both devices and no interruption will occur.
The disclosure provides a method, a device, a medium and electronic equipment for avoiding network service dual-computer hot standby brain cracking, wherein a first jumper of a first server cluster is arranged on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster; receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster; and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster in the main state to advertise the network service ip. The method and the device do not need extra physical resources related to the heartbeat line or introduce a third party for arbitration, can keep logic simple, and completely avoid the possibility of external service while cerebral rupture.
Example 2
Referring to fig. 9, according to a second aspect of the specific embodiment of the present disclosure, the present disclosure provides an apparatus for avoiding a network service dual hot standby brain burst, which specifically includes a setting unit 902, a receiving unit 904, an analysis election unit 906, an announcement unit 908, and the like, and specifically includes:
A setting unit 902, configured to set a first jumper for a first server cluster on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster;
a receiving unit 904, configured to receive a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster;
and the analysis election unit 906 is configured to analyze the first vrrp heartbeat packet received by the receiving unit 904 and the second vrrp heartbeat packet received by the receiving unit 904 according to a preset rule, and elect a server cluster serving as a main state from the first server cluster and the second server cluster, so that the server cluster in the main state advertises the network service ip.
Optionally, the apparatus further includes:
a receiving unit 904 (not shown in fig. 9) for placing a first jumper on a first data link of a first server cluster at the first server cluster; after the second jumper wire of the second server cluster is arranged on the second data link of the second server cluster, receiving the first message of the first server cluster;
A processing unit (not shown in fig. 9) configured to analyze the first packet received by the receiving unit 904, determine whether the first packet is an ip packet, and determine whether the first packet is a heartbeat packet according to a destination ip corresponding to the first packet after determining that the first packet is the ip packet, if the destination ip corresponding to the first packet is a preset fixed value, the first packet is a first heartbeat packet of the server cluster; otherwise, if the destination ip corresponding to the first message is not a preset fixed value, the first message is an ip message requested by the user.
Optionally, the receiving unit 904 is further configured to:
the method comprises the steps that a first jumper of a first server cluster is arranged on a first data link of the first server cluster; after the second jumper wire of the second server cluster is arranged on the second data link of the second server cluster, receiving a second message of the second server cluster;
a processing unit (not shown in fig. 9) configured to analyze the received second packet, determine whether the second packet is an ip packet, and determine whether the second packet is a heartbeat packet according to a destination ip corresponding to the second packet after determining that the second packet is an ip packet, and if the destination ip corresponding to the second packet is a preset fixed value, the second packet is a second heartbeat packet of the second server cluster; otherwise, if the destination ip corresponding to the second message is not the preset fixed value, the second message is the ip message requested by the user.
Optionally, the analysis election unit 906 is specifically configured to:
judging whether the priority of the first heartbeat message of the first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is smaller than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, determining to elect the first server cluster from the first server cluster and the second server cluster as the server cluster in the main state.
Optionally, the apparatus further includes:
a sending unit (not shown in fig. 9) configured to send the first heartbeat message of the first server cluster periodically after the analysis electing unit 906 elects the first server cluster as the server cluster in the master state.
Optionally, the processing unit is further configured to: after the first server cluster is selected as the server cluster in the main state, when the second server cluster is judged to be in the non-main state, the second heartbeat message and the corresponding self priority information are issued, the corresponding timer is started, and when the timer expires, the second server cluster is set as the server cluster in the main state, so that the second server cluster in the main state announces the network service ip.
Optionally, the analysis election unit 906 is specifically further configured to:
judging whether the priority of the first heartbeat message of the first server cluster is greater than or equal to the priority of the first heartbeat message, if the priority of the first heartbeat message of the first server cluster is greater than the priority of the first heartbeat message, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, modifying the main state of the first server cluster into an alternative state; otherwise, if the first server cluster is judged not to be in the master state, the timer is canceled.
The disclosure provides a method, a device, a medium and electronic equipment for avoiding network service dual-computer hot standby brain cracking, wherein a first jumper of a first server cluster is arranged on a first data link of the first server cluster; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster; receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster; and analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster in the main state to advertise the network service ip. The method and the device do not need extra physical resources related to the heartbeat line or introduce a third party for arbitration, can keep logic simple, and completely avoid the possibility of external service while cerebral rupture.
Example 3
As shown in fig. 10, this embodiment provides an electronic device, which is used for avoiding a network service dual-engine hot standby brain-split method, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the one processor, the instructions being executable by the at least one processor to enable the at least one processor to: no extra physical resource related to the heartbeat line is needed, no third party is introduced for arbitration, logic simplicity can be kept, and the possibility of external service while cerebral rupture is completely avoided.
Example 4
The disclosed embodiments provide a non-volatile computer storage medium storing computer executable instructions that are capable of performing the method for avoiding network service dual hot standby brain cracking in any of the method embodiments described above.
Example 5
Referring now to fig. 10, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 10 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 10, the electronic device may include a processing means (e.g., a central processor, a graphics processor, etc.) 1001 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
In general, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 1007 including, for example, a Liquid Crystal Display (LCD), speaker, vibrator, etc.; storage 1008 including, for example, magnetic tape, hard disk, etc.; and communication means 1009. The communication means 1009 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. The above-described functions defined in the method of the embodiment of the present disclosure are performed when the computer program is executed by the processing device 1001.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: no extra physical resource related to the heartbeat line is needed, no third party is introduced for arbitration, logic simplicity can be kept, and the possibility of external service while cerebral rupture is completely avoided. Alternatively, the computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: no extra physical resource related to the heartbeat line is needed, no third party is introduced for arbitration, logic simplicity can be kept, and the possibility of external service while cerebral rupture is completely avoided. Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".

Claims (9)

1. A method for avoiding network service dual-machine hot standby brain cracking, comprising the following steps:
the first jumper of the first server cluster is arranged on a first data link of the first server cluster and the switch; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster and the switch;
receiving a first vrrp heartbeat message sent by a first server cluster and a second vrrp heartbeat message sent by a second server cluster;
analyzing the first vrrp heartbeat message and the second vrrp heartbeat message according to a preset rule, and selecting a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate the server cluster notification network service ip of the main state, wherein the destination ip of the first vrrp heartbeat message and the second vrrp heartbeat message is ip with a fixed value;
the first server cluster is a main server cluster in the time set by the timer; the second server cluster is the main server cluster in the time set by another timer;
the electing a server cluster from the first server cluster and the second server cluster as a master state includes:
Judging whether the priority of a first vrrp heartbeat message of a first server cluster is greater than or equal to the priority of the first vrrp heartbeat message, if not, judging whether the first server cluster is in a main state, and if so, selecting the first server cluster as the server cluster in the main state.
2. The method of claim 1, wherein a first jumper on the first server cluster is disposed on a first data link of the first server cluster; and after a second heartbeat wire of a second server cluster is disposed on a second data link of the second server cluster, the method further includes:
receiving a first message of the first server cluster, analyzing the received first message, judging whether the first message is an ip message, judging whether the first message is a heartbeat message according to a destination ip corresponding to the first message after judging that the first message is the ip message, and if the destination ip corresponding to the first message is a preset fixed value, judging that the first message is a first vrrp heartbeat message of the server cluster; otherwise, if the destination ip corresponding to the first message is not a preset fixed value, the first message is an ip message requested by the user.
3. The method of claim 1, wherein a first jumper on the first server cluster is disposed on a first data link of the first server cluster; and after a second heartbeat wire of a second server cluster is disposed on a second data link of the second server cluster, the method further includes:
receiving a second message of the second server cluster, analyzing the received second message, judging whether the second message is an ip message, judging whether the second message is a heartbeat message according to a destination ip corresponding to the second message after judging that the second message is the ip message, and if the destination ip corresponding to the second message is a preset fixed value, judging that the second message is a second vrrp heartbeat message of the second server cluster; otherwise, if the destination ip corresponding to the second message is not a preset fixed value, the second message is an ip message requested by the user.
4. The method of claim 1, wherein after said electing the first server cluster as the server cluster of the master state, the method further comprises:
and periodically sending the first vrrp heartbeat message of the first server cluster.
5. The method of claim 4, wherein after said electing the first server cluster as the server cluster of the master state, the method further comprises:
and when judging that the second server cluster is in a non-main state, issuing the second vrrp heartbeat message and corresponding self priority information, starting a corresponding timer, and setting the second server cluster as the server cluster in the main state when the timer expires, so that the second server cluster in the main state announces the network service ip.
6. The method of claim 1, wherein the electing a server cluster from the first server cluster and the second server cluster as a master state further comprises:
judging whether the priority of a first vrrp heartbeat message of a first server cluster is greater than or equal to the priority of the first server cluster, if the priority of the first vrrp heartbeat message of the first server cluster is greater than the priority of the first server cluster, further judging whether the first server cluster is in a main state, and if the first server cluster is in the main state, modifying the main state of the first server cluster into an alternative state; otherwise, if the first server cluster is judged not to be in the main state, the timer is canceled.
7. An apparatus for avoiding network service dual-machine hot standby brain cracking, comprising:
the device comprises a setting unit, a first data transmission unit and a second data transmission unit, wherein the setting unit is used for setting a first jumper of a first server cluster on a first data link of the first server cluster and a switch; the second jumper wire of the second server cluster is arranged on a second data link of the second server cluster and the switch;
the receiving unit is used for receiving a first vrrp heartbeat message sent by the first server cluster and a second vrrp heartbeat message sent by the second server cluster;
the analysis election unit is used for analyzing the first vrrp heartbeat message received by the receiving unit and the second vrrp heartbeat message received by the receiving unit according to a preset rule, and electing a server cluster serving as a main state from the first server cluster and the second server cluster so as to facilitate a server cluster notification network service ip of the main state, wherein the destination ip of the first vrrp heartbeat message and the second vrrp heartbeat message is ip with a fixed value;
the first server cluster is a main server cluster in the time set by the timer; the second server cluster is the main server cluster in the time set by another timer;
The electing a server cluster from the first server cluster and the second server cluster as a master state includes:
judging whether the priority of a first vrrp heartbeat message of a first server cluster is greater than or equal to the priority of the first vrrp heartbeat message, if not, judging whether the first server cluster is in a main state, and if so, selecting the first server cluster as the server cluster in the main state.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1 to 6.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1 to 6.
CN201910829019.XA 2019-09-03 2019-09-03 Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking Active CN110750393B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910829019.XA CN110750393B (en) 2019-09-03 2019-09-03 Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910829019.XA CN110750393B (en) 2019-09-03 2019-09-03 Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking

Publications (2)

Publication Number Publication Date
CN110750393A CN110750393A (en) 2020-02-04
CN110750393B true CN110750393B (en) 2023-10-13

Family

ID=69276149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910829019.XA Active CN110750393B (en) 2019-09-03 2019-09-03 Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking

Country Status (1)

Country Link
CN (1) CN110750393B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346925A (en) * 2020-09-25 2021-02-09 南京恩瑞特实业有限公司 Process-level dual-computer hot standby redundancy system and method
CN113377702B (en) * 2021-07-06 2024-03-22 安超云软件有限公司 Method and device for starting two-node cluster, electronic equipment and storage medium
CN114520778A (en) * 2022-01-13 2022-05-20 深信服科技股份有限公司 Connectivity detection method, connectivity detection device, electronic equipment and storage medium
CN115190046B (en) * 2022-04-13 2024-01-23 统信软件技术有限公司 Detection method, detection device and computing equipment of server cluster
CN117851300A (en) * 2022-09-30 2024-04-09 华为云计算技术有限公司 Multi-AZ arbitration system and method
CN115967669B (en) * 2023-03-16 2023-06-27 北京志凌海纳科技有限公司 VRRP (virtual router redundancy protocol) expansion protocol-based brain crack inhibition method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744809A (en) * 2013-12-23 2014-04-23 天泽信息产业股份有限公司 Method for dual-computer hot-standby of vehicle information management system on basis of VRRP
CN105426118A (en) * 2015-10-28 2016-03-23 浪潮(北京)电子信息产业有限公司 Method for heartbeat channel backup by using serial port in double control system
CN105743993A (en) * 2016-03-31 2016-07-06 杭州数梦工场科技有限公司 Message processing method and system
CN106656791A (en) * 2015-10-30 2017-05-10 华为技术有限公司 Device state switching method, device and system
CN106789197A (en) * 2016-12-07 2017-05-31 高新兴科技集团股份有限公司 A kind of cluster election method and system
CN108880866A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of network service system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744809A (en) * 2013-12-23 2014-04-23 天泽信息产业股份有限公司 Method for dual-computer hot-standby of vehicle information management system on basis of VRRP
CN105426118A (en) * 2015-10-28 2016-03-23 浪潮(北京)电子信息产业有限公司 Method for heartbeat channel backup by using serial port in double control system
CN106656791A (en) * 2015-10-30 2017-05-10 华为技术有限公司 Device state switching method, device and system
CN105743993A (en) * 2016-03-31 2016-07-06 杭州数梦工场科技有限公司 Message processing method and system
CN106789197A (en) * 2016-12-07 2017-05-31 高新兴科技集团股份有限公司 A kind of cluster election method and system
CN108880866A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of network service system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
业务运营支撑系统双活容灾建设方案研究;刘郁恒等;《移动通信》;20170228(第04期);全文 *
谢正兰.新一代防火墙技术及应用.西安电子科技大学出版社,2018,第159-163页. *

Also Published As

Publication number Publication date
CN110750393A (en) 2020-02-04

Similar Documents

Publication Publication Date Title
CN110750393B (en) Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
US20170163479A1 (en) Method, Device and System of Renewing Terminal Configuration In a Memcached System
US9992058B2 (en) Redundant storage solution
CN112019914B (en) Screen projection method and device, electronic equipment and computer readable medium
CN112291082B (en) Disaster recovery processing method, terminal and storage medium for machine room
CN112398689A (en) Network recovery method and device, storage medium and electronic equipment
US20190349436A1 (en) Methods, apparatus and systems for resuming transmission link
US11240100B2 (en) Using an out-of-band network to reconfigure a bus interface port
US9706440B2 (en) Mobile communication system, call processing node, and communication control method
US8775617B2 (en) Method for optimizing network performance after a temporary loss of connection
US9088629B2 (en) Managing an electronic conference session
CN115834668B (en) Cluster node control method, device, equipment, storage medium and program product
CN104917800A (en) Method and device for establishing redundancy connection for virtual machine
CN109428821B (en) Server, method for managing routing of mutual backup device and storage medium
US20230119919A1 (en) Service realization using a segmented mpls control plane
JP2008197885A (en) Application abnormal end processing system method therefor and program
CN114244700A (en) Port processing method and device, electronic equipment and computer readable storage medium
CN111182062B (en) Service multi-activity calling method, system and electronic equipment
US20180084015A1 (en) System and method for maintaining a collaborative environment
CN113300950A (en) Data processing method and device, electronic equipment and computer readable medium
CN113179211B (en) Method and device for routing and for setting up a communication connection
US10122588B2 (en) Ring network uplink designation
CN116633827A (en) Link state detection method, device, equipment and computer readable medium
US11909787B1 (en) Videoconference content sharing for public switched telephone network participants

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
GR01 Patent grant
GR01 Patent grant