CN115529224A - Method, system and device for switching HA (host/standby) scenes - Google Patents

Method, system and device for switching HA (host/standby) scenes Download PDF

Info

Publication number
CN115529224A
CN115529224A CN202211130007.6A CN202211130007A CN115529224A CN 115529224 A CN115529224 A CN 115529224A CN 202211130007 A CN202211130007 A CN 202211130007A CN 115529224 A CN115529224 A CN 115529224A
Authority
CN
China
Prior art keywords
equipment
link
state
switching
fault
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211130007.6A
Other languages
Chinese (zh)
Inventor
唐际当
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Sipuling Technology Co Ltd
Original Assignee
Wuhan Sipuling 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 Wuhan Sipuling Technology Co Ltd filed Critical Wuhan Sipuling Technology Co Ltd
Priority to CN202211130007.6A priority Critical patent/CN115529224A/en
Publication of CN115529224A publication Critical patent/CN115529224A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a switching method, a system and a device of HA main and standby scenes, wherein the switching method comprises the following steps: acquiring equipment states of first equipment and second equipment, wherein the equipment states comprise a main equipment state and an alternative state; respectively configuring parameters of address detection service and parameters of address management service for the first equipment and the second equipment through a command line or a graphical interface; judging the fault state of the first link or the second link according to a control equipment response message received by an address detection service in the first equipment and the second equipment; if the first link is faulty, switching the first device to an alternative state and switching the second device to a main state; and if the second link has a fault, switching the first equipment to the main state and switching the second equipment to the alternative state. The equipment in the main setting state and the alternative state is not limited by the switching times, the continuity of the service is guaranteed, and the fault-free forwarding of the network service of the user is guaranteed.

Description

Method, system and device for switching HA (host/standby) scenes
Technical Field
The present application relates to the field of computer network security technologies, and in particular, to a method, a system, and an apparatus for switching between HA master and standby scenarios.
Background
With the rapid popularization and the increasingly deep application of the network, various value-added services, such as an IPTV (Internet Protocol Television), a video conference, etc., are widely deployed, and a network interruption may affect a large amount of services and cause a great loss. Therefore, as the underlying network of the traffic bearer, its reliability is increasingly focused.
In an actual network, service interruption caused by network single-point failure due to various non-technical factors cannot be avoided. Therefore, the method improves the fault tolerance of the system, improves the fault recovery speed, reduces the influence of the fault on the service, and is an effective way for improving the reliability of the system.
The High Availability (HA) active/standby mode is one of two network devices that implement the HA as a master device and the other as a standby device. The main device synchronizes the related configuration and data information to the standby device in real time while performing service configuration and data forwarding. When the main equipment fails or the link of the main equipment is interrupted, the standby equipment becomes new main equipment and takes over the work of the original main equipment to realize the seamless switching of network services. However, when the main device is switched to the standby device, the message is not transmitted and received in the silent state, the HA state is not switched, and even if the link connected to the main device is recovered to be normal, the system cannot sense the link, so that the user service is interrupted. That is to say, after the HA primary/standby mode is switched once, and after the switched primary device link fails, the switching cannot be performed again, which causes interruption of user service and affects user experience.
Disclosure of Invention
The application provides a method, a system and a device for switching an HA (host-host) scene, which are used for solving the problem that in the host-host scene, when a link fails, equipment in a host-host state cannot be switched again after being switched once, so that the service of a user is interrupted.
A switching method for an HA master/standby scenario provided in a first aspect of the present application is a switching system, where the switching system includes a first device, a second device, and a control device, the first device and the second device are respectively connected to a hardware device and the control device, a link between the first device and the control device is a first link, and a link between the second device and the control device is a second link, and the switching method includes: acquiring equipment states of first equipment and second equipment, wherein the equipment states comprise a main equipment state and an alternative state; respectively configuring parameters of address detection service and parameters of address management service for the first equipment and the second equipment through a command line or a graphical interface; judging the fault state of the first link or the second link according to a control equipment response message received by an address detection service in the first equipment and the second equipment; if the first link is faulty, switching the first device to an alternative state and switching the second device to a main state; and if the second link has a fault, switching the first equipment to the main state and switching the second equipment to the alternative state.
Optionally, the address detection service on the device in the master state receives and sends the message based on the interface address; the address detection service on the device in the alternative state sends and receives messages based on the management address service.
Optionally, the method for switching between the active and standby states further includes: if the first link and the second link are both not in failure, the states of the first equipment and the second equipment are kept unchanged, and information is transmitted through the equipment with the equipment state as the main set state.
Optionally, if the second link fails, the method further includes: judging the fault state of the first link; and if the first link is not in failure, switching the first equipment to be in a main setting state and switching the second equipment to be in an alternative state.
Optionally, after the step of determining the fault state of the first link, the method further includes: if the second link and the first link both have faults, the states of the first equipment and the second equipment are kept unchanged, and prompt information is generated and used for prompting the current information transmission interruption.
Optionally, the method further comprises: if the first link has no fault, the states of the first equipment and the second equipment are kept unchanged, and the equipment with the equipment state as the main setting state is controlled to transmit information.
Optionally, the determining the fault state of the first link or the second link according to the response message of the control device received by the address detection service in the first device and the second device includes: controlling an address detection service in the first equipment or the second equipment to send a message to the control equipment; judging whether an address detection service in the first equipment or the second equipment receives a response message sent by the control equipment within a first preset time; if yes, the first link or the second link is not in failure; if not, the first link or the second link has a fault.
Optionally, the handover method further includes: controlling the first equipment to send a heartbeat message to the second equipment, and controlling the second equipment to send the heartbeat message to the first equipment; judging whether the first equipment or the second equipment receives the heartbeat message within second preset time or not; if yes, the second equipment or the first equipment has no fault; and if not, the second equipment or the first equipment has a fault.
A second aspect of the present application provides a switching system for HA primary/standby scenarios, including: the link between the first device and the control device is a first link, the link between the second device and the control device is a second link, and the control device is configured to execute the method provided in the first aspect.
A third aspect of the present application provides a switching device for an HA active/standby scenario, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the method provided in the first aspect.
According to the switching method, address-ip services are configured for the first device and the second device, when a first link of the first device in the main setting state fails, the second device in the alternative state switches the address management service to receive and send messages, and the second device in the alternative state is switched to the main setting state. Meanwhile, when the second link of the second device in the main setting state fails and the first link of the first device in the alternative state recovers due to failure, the first device is switched to the main setting state and the second device is switched to the alternative state, so that normal sending of information is ensured, and the HA state can be seamlessly switched to the flexible hot standby function. The equipment in the main setting state and the alternative state is not limited by the switching times, thereby ensuring the continuity of the service and ensuring the fault-free forwarding of the network service of the user.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a handover method in an embodiment of the present application;
fig. 2 is a flowchart of the present application when the first link and the second link are failure-free;
FIG. 3 is a flowchart illustrating an embodiment of the present invention for determining whether a failure of a first link is recovered;
fig. 4 is a flowchart of a method for determining a failure of a first link and a second link according to an embodiment of the present application;
fig. 5 is a second flowchart of a method for determining a failure of a first link and a second link in an embodiment of the present application;
FIG. 6 is a flowchart of a method for determining a failure of a first device and a second device in an embodiment of the present application;
FIG. 7 is a second flowchart of a handover method according to an embodiment of the present application;
fig. 8 is a schematic diagram of a connection structure of a first device and a second device in a switching system in an embodiment of the present application;
FIG. 9 is a diagram illustrating configuration of an interface address for a first device according to an embodiment of the present application;
FIG. 10 is a diagram illustrating an interface message-ip configured for a first device according to an embodiment of the present application;
FIG. 11 is a diagram illustrating an interface management-ip configured for a second device according to an embodiment of the present application;
fig. 12 is a diagram illustrating configuration of HA functions for a first device according to an embodiment of the present application;
fig. 13 is a diagram illustrating configuration of HA functions for a second device according to an embodiment of the present application;
fig. 14 is a diagram illustrating a configuration of a track function for a first device according to an embodiment of the present application;
fig. 15 shows an embodiment of the present application in which a track function is configured in each of the first device and the second device.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
The HA (High Availability) is used as a hot backup in order to minimize the impact on the network during the state switching. The HA synchronizes some critical information on the master device, such as session information, device configuration information, etc., to the slave device. Therefore, when the main equipment fails or the main link fails, the standby equipment quickly becomes new main equipment to take over the work and bear user services.
In the master-slave mode, the master device responds to various message requests and forwards network traffic; the standby device does not respond to the message request and does not forward the network traffic.
Fig. 1 is a flowchart of a method for switching between HA primary and standby scenarios in this embodiment.
The switching method for the HA master-slave scene provided by the application is mainly applied to a switching system, and when a link of master equipment in a master-slave mode fails and cannot be used for sending services continuously, normal service transmission through the master-slave equipment is realized by switching the master-slave state.
Fig. 12 is a schematic diagram illustrating the configuration of HA functions for the first device, and fig. 13 is a schematic diagram illustrating the configuration of HA functions for the second device.
Specifically, the switching system includes a first device, a second device, and a control device, which are connected to each other, where the first device and the second device are respectively connected to the hardware device and the control device and transmit information to the hardware device, a link between the first device and the control device is a first link, and a link between the second device and the control device is a second link. The switching method comprises the following steps that the control equipment is connected with a network, the control equipment transmits service information to the first equipment and the second equipment through the first link and the second link, and then transmits the service information to the hardware equipment through the first equipment and the second equipment, the hardware equipment can be a computer and the like, and the switching method comprises the following steps:
step S11: the device states of the first device and the second device are obtained.
The method comprises the steps that firstly, a control device obtains device states of a first device and a second device, wherein the device states comprise a main device state and an alternative state. It can be understood that, in the HA master/standby mode, one device is usually a master device (device in master state), and the other device is a standby device (device in alternative state).
For example, in the HA active-standby mode, the state of the first device is configured as the main state, and the state of the second device is configured as the alternative state. As shown in fig. 12 and 13, schematic diagrams of configuring HA functions for a first device and a second device.
Step S12: and respectively configuring parameters of the address detection service and parameters of the address management service for the first device and the second device through a command line or a graphical interface.
Specifically, the address detection service refers to a track, and whether a link has a fault is detected through the track, and it can be understood that the track judges the link fault by receiving a response message of the control device. The address management service is a management-ip. By setting the management-ip, the track in the device in the alternative state can perform address detection based on the management-ip, so that the device in the main setting state and the device in the alternative state can forward the service in the normal state of the link, and therefore, the other device can be switched to the main setting state under the condition that any one device fails, so that the service of a user is not interrupted, and the device in the main setting state and the device in the standby setting state are not limited by the switching times.
Step S13: and judging the fault state of the first link or the second link according to response messages of the control equipment received by the address detection service in the first equipment and the second equipment. If yes, executing step S14; if the judgment result is negative, the operation is finished.
Specifically, the failure status includes failure and no failure, and whether the first link or the second link has a failure may be determined by the status of the track in the first device and the second device receiving the response message sent back by the control device.
Step S14: and if the first link is in fault, switching the first equipment to the standby state and switching the second equipment to the main state.
When the first device is used as a device in a master state, if a first link connected with the first device fails, the first link cannot continue to receive information through a network, and data cannot be transmitted to the hardware device. Specifically, when address detection (track) on the first device fails, which indicates that the first link fails, the HA state needs to be switched to ensure uninterrupted service.
The address detection (track) is a detection technology for sensing a link state and whether a network access Service is normal according to whether a response Message is received or not by using a detection technology for transmitting a destination IP (Internet Protocol, protocol for interconnecting networks), and generally includes a TCP (Transmission Control Protocol) \\ ICMP (Internet Control Message Protocol ) \ DNS (Domain Name Service) mode and the like.
As shown in fig. 9, a schematic diagram of configuring an interface address for a first device is shown.
Step S15: and if the second link has a fault, switching the first equipment to the standby state and switching the second equipment to the main state.
At the moment, the master-standby state of the first device and the second device is switched, the second device replaces the first device as a device in the master-standby state, and data transmission is continued, so that normal service sending is ensured, and the influence of service interruption on normal use of a user is avoided.
It can be understood that, in this step, the first device is in the alternative state and the second device is in the master state before switching, and at this time, if the second link has a failure and the failure of the first link is recovered, it is indicated that the first link is non-failure at this time and the second link has a failure, the first device is switched to the master state and the second device is in the alternative state, thereby implementing continuity of the user service and avoiding loss to the user due to service interruption.
Specifically, the second device takes over the role of the first device to continue forwarding the user traffic. At the moment, the track of the second device transmits and receives packets based on the interface IP and detects whether the target IP is reachable, and meanwhile, the track switching on the first device transmits and receives packets based on the management-IP and detects whether the target IP is reachable so as to judge whether the first link failure is recovered.
In some embodiments, an address detection service on a device in a master state sends and receives messages based on an interface address; the address detection service on the device in the alternative state sends and receives messages based on the management address service.
FIG. 10 is a diagram of a first device configuration interface, management-ip, and FIG. 11 is a diagram of a second device configuration interface, management-ip. Fig. 14 is a schematic diagram of the first device configuring the track function, and fig. 15 is a schematic diagram of the second device configuring the track function.
Specifically, parameters of an address detection service (track) and parameters of an address management service (management-ip) are configured for the first device and the second device. It can be understood that the HA device in the alternative state (taking the first device as the master state, and the second device as the alternative transition state as an example) HAs a problem of not participating in network forwarding, and therefore is accessed through the IP address configured on its interface. To address this issue, a management address parameter (management-ip) may be configured on the device for network management of the device. The user can access the telnet service and web management interface of the device, etc. from the outside. By setting an address-management parameter (management-ip), a device in an alternative state may also participate in network forwarding. Therefore, when the first link fails, the second device can take over the first device to perform network forwarding, and at this time, only the state of the second device is switched to the master state, and the state of the first device is switched to the alternative device. The second device replaces the first device to carry out normal information forwarding, and meanwhile, when the failure of the first link is recovered and the second link fails, state switching can still be carried out, so that the normal information forwarding can be realized through switching no matter which link fails. The equipment in the main setting state and the alternative state is not limited by the switching times on the premise that one side has no fault, thereby ensuring the continuity of the service and ensuring that the network service of the user can realize fault-free forwarding.
If no address-management parameter (management-ip) is configured for the second device of the first device, after the second device is switched to the master state, when the second link address detection fails, because the first device is switched to the alternative state, the silence state part will receive and transmit a message, the address detection fails, and the address detection is always in a fail unavailable state. Then, even when the first link HAs been restored, the address detection is not perceptible, so the HA state will not be switched any more, and the user traffic will be interrupted.
For example, in step S12, the first device configures an address sounding parameter (track) with a type of ICMP and a destination IP of 192.168.2.1, and the second device configures an address sounding parameter (track) with a type of ICMP and a destination IP of 192.168.2.1. The first equipment is in a master state, the track can normally receive and send the packets, the second equipment is in a silent state as the equipment in the alternative state, and the track can select to receive and send the packets based on the management-ip.
Fig. 2 is a schematic flowchart of determining that neither the first link nor the second link has a fault in the embodiment of the present application.
As shown in fig. 2, the method when the first link and the second link are not failed includes:
step S21: and when the first link and the second link are both free from faults, keeping the states of the first equipment and the second equipment unchanged, and controlling the equipment with the equipment state as a main set state to transmit information.
That is, when neither the first link nor the second link fails, the first device and the second device may follow a normal message transmission/reception mode without switching states.
Fig. 3 is a flowchart of determining again whether the first link failure has recovered after the second link failure in this embodiment.
As shown in fig. 3, when the second link has a fault, the switching method is as follows:
step S31: if the second link is faulty;
step S32: judging whether the first link fails: if yes, go to step S34; if not, step S33 is executed.
The purpose of determining the first link at this time is to determine whether the failure of the first link has recovered, since the second link also has a failure due to the current status. It can be understood that the second link at this time is a second link as a device in the master state, and when there is a failure in the link in the master state, it is determined whether the failure in the first link has been recovered, so that when the failure in the first link is recovered, the states of the first device and the second device are switched to ensure normal transmission of the traffic.
Step S33: and switching the first equipment into a main setting state and switching the second equipment into an alternative state.
And after the first link failure is judged to be recovered, switching the first equipment to be in a master state at the moment, and continuously transmitting information through the first equipment. That is, as long as a normal link exists in the first link and the second link, the device connected to the normal link is correspondingly switched, thereby ensuring that the information can be normally transmitted.
After switching, the first device is in a main state, the second device is in an alternative state, the first device takes over the role of the second device to continuously forward the user service, and at the moment, the track of the first device transmits and receives packets based on the interface IP and continuously detects whether the target IP can continuously detect the health state of the first link. And meanwhile, the track on the second equipment is switched to send and receive packets based on the management-IP, and whether the target IP can be reached is detected so as to judge whether the second fault is recovered.
Step S34: keeping the states of the first equipment and the second equipment unchanged, and generating reminding information used for reminding the current information transmission interruption.
At this time, the first link and the second link are both in a failure state, the first device and the second device cannot normally send information, and the state of the switching device is meaningless, so that the current state is maintained, and no switching operation is performed. Meanwhile, as the first link and the second link both have faults and the information cannot be normally transmitted, fault prompt information is generated so as to prompt that the current information transmission is interrupted to prompt a user and facilitate the subsequent processing of the user.
Fig. 4 is a schematic flow chart of the process when the first link is determined to be fault-free.
As shown in fig. 4, when it is determined that the first link is not failed, the handover method includes:
step S41: judging whether the first link fails according to response messages of the control equipment received by the address detection service in the first equipment and the second equipment; if the judgment result is no, executing step S42; if yes, executing step S14;
step S42: if the first link has no fault, keeping the states of the first device and the second device unchanged, and controlling the device with the device state as the main set state to transmit information.
Step S14: switching the first device to the alternative state and switching the second device to the state if the first link fails.
Illustratively, a device in a state mainly set as a first device mainly forwards user traffic through the first device, so as to determine whether to switch the device state by determining a failure state of a first link connected to the first device. That is, when it is determined that the first link does not have a failure, the states of the first device and the second device are kept unchanged, and the first device in the master state continues to forward the traffic, that is, transmit the information. And when the first link has a fault, switching the second equipment to be in a main setting state and the first equipment to be in an alternative state.
Fig. 5 is a schematic flowchart of the process of determining whether the first link and the second link are failed.
As shown in fig. 5, the method for determining the failure of the first link and the second link includes:
step S51: controlling an address detection service in first equipment or second equipment to send a message to control equipment;
step S52: judging whether an address detection service in the first equipment or the second equipment receives a response message sent by the control equipment within a first preset time; if yes, go to step S53; if not, go to step S54;
step S53: the first link or the second link is failure-free;
step S54: either the first link or the second link has a failure.
Specifically, the failure states of the first link and the second link are determined by receiving the message state sent back by the control device. Taking the first link as an example, the first link is a link connected between the control device and the first device, the track service configured in the first device performs an address detection operation, which is mainly implemented by sending a message to the control device by the track service, and if the first link has no fault, the track service receives the message sent back by the control device, so as to determine that the first link has no fault. If the track service does not receive the message sent back by the control device, it is determined that the first link has a fault, and thus the first device cannot receive the network information, and cannot normally send the service to the hardware device. The second link is the same.
Fig. 6 is a schematic flowchart of a process of determining whether the first device and the second device are faulty in the present application.
As shown in fig. 6, the method for determining the failure of the first device and the second device includes:
step S61: controlling the first equipment to send a heartbeat message to the second equipment, and controlling the second equipment to send the heartbeat message to the first equipment;
step S62: judging whether the first equipment or the second equipment receives the heartbeat message within second preset time or not; if yes, go to step S63; if not, step S64 is executed.
Step S63: the second device or the first device is fault-free;
step S64: the second device or the first device has a fault.
Specifically, when the first device or the second device has a failure, the device state is switched. It can be understood that, if the first device fails, the first device also cannot receive the service information sent by the control device, and therefore, the switching method in this embodiment further includes determining a failure state of the first device or the second device.
For example, taking the first device as the master state, if the first device fails, the second device is switched to the device in the master state, so that the second device replaces the device in the master state with the first device to perform normal forwarding of the service.
When the device starts the HA master/standby mode, the device enters an init (initialization state), the device receives a keepalive (heartbeat) message sent from the opposite end, the devices at the two ends negotiate parameters to perform master/standby election, and then one of the device states is set as a master setting state. After the HA neighbor relation is established, the neighbor relation is kept by the heartbeat message, and a timer is started. If the heartbeat message is not received within the time of the timer (the time of the timer is interval × retry times), the self state is set as the main setting state. The state of the device in which the fault occurs is set as the alternative state. And all interfaces of the equipment in the alternative state do not participate in message forwarding. After the parameters of the address management service are configured for the first device and the second device, the device in the alternative state may also participate in forwarding the packet.
The active/standby mode refers to that one of the two devices implementing the HA is in the main state to forward data, and the other is in the alternative state to forward data and serve as the backup of the device in the main state. Therefore, the device in the master state can synchronize the configuration, the flow table information and the authentication user information to the opposite terminal while performing the service. When one of the devices in the main setting state fails or the link is interrupted, the other device in the alternative state is used as the backup of the failed device to take over the work of the original device in the main setting state, thereby realizing the seamless switching of the network service. In the master-slave mode, state information is synchronized between the master device and the slave device through HA heart beat lines. The HA devices are used for mutually notifying the messages of the HA configuration and the HA state of the devices. If a device does not receive a neighbor heartbeat message within a specified time, the HA neighbor can be considered to have failed.
The first equipment and the second equipment mutually send and receive the heartbeat messages, so that when the heartbeat messages sent by the other side are not received, the second equipment or the first equipment is judged to be in fault. For example, if the first device does not receive the heartbeat message sent from the second device within the second preset time, it indicates that the second device has a failure and cannot send the heartbeat message according to the convention, and therefore, it is determined that the second device has a failure. The same holds true for the first device.
For example, in a default state, the message interval time is 200 milliseconds, the retry times are 5 times, and the modification can be performed through keepalive <20-1000> -retry < -3-500 > commands.
For example, fig. 7 is a schematic flowchart of a handover method in an embodiment of the present application.
Step S71: acquiring the equipment states of first equipment and second equipment;
step S72: respectively configuring parameters of address detection service and parameters of address management service for the first equipment and the second equipment through a command line and a graphical interface;
step S73: judging whether the first link fails or not; if yes, executing step S75, otherwise executing step S74;
step S74: keeping the states of the first equipment and the second equipment unchanged, and controlling the equipment with the equipment state as a main setting state to transmit information;
step S75: switching the first equipment into an alternative state and switching the second equipment into a main state;
step S76: judging whether the second link fails or not; if yes, go to step S77; if not, executing step S74;
step S77: judging whether the first link fails or not; if yes, executing step S79, otherwise executing step S78;
step S78: switching the first equipment to a main state and switching the second equipment to an alternative state; and go to step S73;
step S79: keeping the states of the first equipment and the second equipment unchanged, and generating prompt information for prompting the current information transmission interruption.
Exemplarily, as shown in fig. 7, a method for switching between HA primary and standby scenarios according to an embodiment of the present application is provided. In the HA master/slave device, for example, the first device is in a master state, and the second device is in an alternative state. The method comprises the steps of firstly judging the fault condition of a first link connected with first equipment, and switching the main setting state in time under the condition that the fault of the first link is found, so that the continuity of the service is ensured. Specifically, when a failure occurs in the first link, the second link serves as a line for forwarding the service, that is, the second device takes over the first device as a device in the master status for forwarding the service. And when judging that the first link does not have the fault, continuing to forward the service by taking the first equipment as the equipment in the main setting state. In step S76, when the second device is in the master state, it is determined that the second link has failed. If the second link has no fault, the second device continues to forward the service as the device in the main setting state, and when the second link has a fault, the second device needs to continuously judge whether the fault of the first link is recovered. If the second link fails and the failure of the first link is not recovered, the states of the first device and the second device are kept unchanged, and at the moment, the first link and the second link both have failures, prompt information is generated and used for prompting the interruption of current information transmission. If the second link fails and the failure of the first link is recovered, the first link may be used as a link for transmitting traffic, so as to switch the first device to the master state, and the second device switches to the alternative state due to the failure of the second link, and the states of the first device and the second device are the same as the state in the initial state, so that the step is transferred to step S73. That is, as long as the determination result is that both the first link and the second link have a fault, the device states of the first device and the second device can be switched correspondingly by continuously determining the fault states of the first link and the second link, thereby ensuring the continuity of service forwarding.
It should be noted that the steps in fig. 7 have the same steps as those in the aforementioned flowchart, and the step numbers are different only for better explaining the handover method in fig. 7, and do not conflict with the aforementioned flowchart.
In the application, address-management services (management-ip) are configured in the first device and the second device, so that the devices in the alternative states can also have the same service forwarding function as the devices in the main setting state, and when the devices in the main setting state or the links in the main setting state fail, the devices in the alternative states can be switched to the main setting state, thereby ensuring the continuity of service forwarding.
Fig. 8 is a schematic diagram of a handover system according to the present application.
In some embodiments, as shown in fig. 8, an embodiment of the present application further provides a switching system for an HA active/standby scenario, including a first device and a second device that are connected, and a control device. Meanwhile, the first device and the second device are respectively connected with the hardware device and the control device, a link between the first device and the control device is a first link, and a link between the second device and the control device is a second link. The control device is configured to execute the method described in the foregoing embodiment, and therefore the system provided in this embodiment has the function of determining the fault state of the first link or the second link according to the response packet of the control device received by the address detection service in the first device and the second device in the foregoing embodiment; if the first link is faulty, switching the first device to an alternative state and switching the second device to a main state; if the second link has a fault, the method for switching the first device to the primary state and the second device to the alternative state has all beneficial technical effects, which are not described herein again.
In some embodiments, there is further provided a switching apparatus for an HA active-standby scenario, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the method described in the foregoing embodiments. Therefore, the electronic device has the advantages that the fault state of the first link or the second link is judged according to the response message of the control device received by the address detection service in the first device and the second device in the embodiment; if the first link is faulty, switching the first device to an alternative state and switching the second device to a main state; if the second link is faulty, the method for switching the first device to the primary state and switching the second device to the alternative state has all the beneficial technical effects, which are not described herein again.
The embodiments provided in the present application are only a few examples of the general concept of the present application, and do not limit the scope of the present application. Any other embodiments that can be extended by the solution according to the present application without inventive efforts will be within the scope of protection of the present application for a person skilled in the art.

Claims (10)

1. A method for switching between HA (host and standby) scenes is characterized in that the method is used for switching a system, the switching system comprises a first device, a second device and a control device which are connected, the first device and the second device are respectively connected with a hardware device and the control device, a link between the first device and the control device is a first link, a link between the second device and the control device is a second link, and the method comprises the following steps:
acquiring the equipment states of the first equipment and the second equipment, wherein the equipment states comprise a main equipment state and an alternative state;
configuring parameters of address detection service and parameters of address management service for the first device and the second device through a command line or a graphical interface respectively;
judging the fault state of the first link or the second link according to the response message of the control equipment received by the address detection service in the first equipment and the second equipment;
if the first link is faulty, switching the first device to an alternative state and switching the second device to a main state;
and if the second link has a fault, switching the first equipment to a main state and switching the second equipment to an alternative state.
2. The handover method according to claim 1,
the address detection service on the equipment in the main setting state receives and transmits messages based on the interface address; and the address detection service on the equipment in the alternative state receives and sends messages based on the address management service.
3. The handover method according to claim 1, wherein the method further comprises:
if the first link and the second link are both not in failure, the states of the first equipment and the second equipment are kept unchanged, and information is transmitted through equipment with the equipment state as a main set state.
4. The handoff method of claim 1, wherein if said second link fails, said method further comprises:
judging the fault state of the first link;
and if the first link has no fault, switching the first equipment to be in a main state and switching the second equipment to be in an alternative state.
5. The handover method according to claim 4, wherein after the step of determining the failure status of the first link, the method further comprises:
if the second link and the first link both have faults, keeping the states of the first equipment and the second equipment unchanged, and generating prompt information, wherein the prompt information is used for prompting the interruption of current information transmission.
6. The handover method according to claim 1, wherein the method further comprises:
if the first link has no fault, keeping the states of the first equipment and the second equipment unchanged, and controlling the equipment with the equipment state as the main setting state to transmit information.
7. The handover method according to claim 1, wherein the determining the fault status of the first link or the second link according to the response packet of the control device received by the address detection service in the first device and the second device comprises:
controlling an address detection service in the first device or the second device to send a message to the control device;
judging whether an address detection service in the first equipment or the second equipment receives a response message sent by the control equipment within a first preset time;
if so, the first link or the second link is failure-free;
if not, the first link or the second link has a fault.
8. The handover method according to claim 1, wherein the method further comprises:
controlling the first device to send a heartbeat message to the second device, and controlling the second device to send a heartbeat message to the first device;
judging whether the first equipment or the second equipment receives the heartbeat message within second preset time or not;
if so, the second equipment or the first equipment has no fault;
and if not, the second equipment or the first equipment has a fault.
9. A switching system for HA master/slave scenarios is characterized by comprising: the system comprises a first device, a second device and a control device which are connected, wherein the first device and the second device are respectively connected with a hardware device and the control device, a link between the first device and the control device is a first link, a link between the second device and the control device is a second link, and the control device is used for executing the method of any one of claims 1 to 8.
10. An HA master/slave scenario switching apparatus comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the method according to any one of claims 1-8.
CN202211130007.6A 2022-09-16 2022-09-16 Method, system and device for switching HA (host/standby) scenes Pending CN115529224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211130007.6A CN115529224A (en) 2022-09-16 2022-09-16 Method, system and device for switching HA (host/standby) scenes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211130007.6A CN115529224A (en) 2022-09-16 2022-09-16 Method, system and device for switching HA (host/standby) scenes

Publications (1)

Publication Number Publication Date
CN115529224A true CN115529224A (en) 2022-12-27

Family

ID=84697229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211130007.6A Pending CN115529224A (en) 2022-09-16 2022-09-16 Method, system and device for switching HA (host/standby) scenes

Country Status (1)

Country Link
CN (1) CN115529224A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163047A (en) * 2007-11-23 2008-04-16 上海华为技术有限公司 Method and device for implementing rearrangement of main equipment and standby equipment
CN103975318A (en) * 2011-12-06 2014-08-06 博科通迅系统有限公司 Lossless connection failover for mirrored devices
CN110417599A (en) * 2019-08-01 2019-11-05 青岛聚看云科技有限公司 The switching method and node server of main-standby nodes
CN110971462A (en) * 2019-12-09 2020-04-07 深信服科技股份有限公司 Equipment switching method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163047A (en) * 2007-11-23 2008-04-16 上海华为技术有限公司 Method and device for implementing rearrangement of main equipment and standby equipment
CN103975318A (en) * 2011-12-06 2014-08-06 博科通迅系统有限公司 Lossless connection failover for mirrored devices
CN110417599A (en) * 2019-08-01 2019-11-05 青岛聚看云科技有限公司 The switching method and node server of main-standby nodes
CN110971462A (en) * 2019-12-09 2020-04-07 深信服科技股份有限公司 Equipment switching method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9258183B2 (en) Method, device, and system for realizing disaster tolerance backup
JP5676605B2 (en) Primary and standby protection system, method and routing device for user-side multicast service
CN100527716C (en) Method and gateway equipment for resuming service after switching status of main/standby gateway device
EP2837161B1 (en) Method and apparatus for indirectly assessing a status of an active entity
CN101479992B (en) A method and device to realize punch-through of point-to-multipoint network link status
US8107386B2 (en) VPLS N-PE redundancy using pseudo wire fast failover
JP5828954B2 (en) Packet processing method and router during server failure
CN110912780A (en) High-availability cluster detection method, system and controlled terminal
KR101591102B1 (en) Method for router of virtual router redundancy protocol and communication system therefor
US9215607B2 (en) Main/standby switching interface module, network element system, and link information synchronization detection method
JP2010045760A (en) Connection recovery device for redundant system, method and processing program
CN104168193A (en) Virtual router redundancy protocol fault detection method and router equipment
CN101572709A (en) Switching method, system, server and client device of socket connection
WO2021185169A1 (en) Switching method and apparatus, and device and storage medium
CN113132159B (en) Storage cluster node fault processing method, equipment and storage system
WO2007070009A1 (en) Un-interrupted voip radio gateway services through clustering
CN112615914A (en) Method for transmitting multicast hot standby table entries by using border gateway protocol
JP4145274B2 (en) Network equipment
CN109586986B (en) Method, device, equipment and storage medium for switching network equipment
CN101453744B (en) Service control method and apparatus
JP4387937B2 (en) Telephone system and switching system
CN115529224A (en) Method, system and device for switching HA (host/standby) scenes
CN112367179B (en) Link switching method and device
CN111181766B (en) Redundant FC network system and method for realizing dynamic configuration of switch
KR20180099143A (en) Apparatus and method for recovering tcp-session

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