CN110417599B - Main/standby node switching method and node server - Google Patents

Main/standby node switching method and node server Download PDF

Info

Publication number
CN110417599B
CN110417599B CN201910707395.1A CN201910707395A CN110417599B CN 110417599 B CN110417599 B CN 110417599B CN 201910707395 A CN201910707395 A CN 201910707395A CN 110417599 B CN110417599 B CN 110417599B
Authority
CN
China
Prior art keywords
node server
role
switching
score
standby
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
CN201910707395.1A
Other languages
Chinese (zh)
Other versions
CN110417599A (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.)
Qingdao Jukanyun Technology Co ltd
Original Assignee
Qingdao Jukanyun 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 Qingdao Jukanyun Technology Co ltd filed Critical Qingdao Jukanyun Technology Co ltd
Priority to CN201910707395.1A priority Critical patent/CN110417599B/en
Publication of CN110417599A publication Critical patent/CN110417599A/en
Application granted granted Critical
Publication of CN110417599B publication Critical patent/CN110417599B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
    • 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/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • 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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application discloses a method for switching a main node and a standby node and a node server, and relates to the field of data interaction. The main node server may send a first switching detection score to the standby node server, and the standby node server may detect whether a role switching instruction is satisfied according to the first switching detection score and a second switching detection score of the standby node server. After the role switching instruction is determined to be met, the role can be switched to the role of the main node, the role switching instruction is sent to the main node server, and the main node server can switch the role to the role of the standby node. The standby node server can switch roles after detecting that the role switching instruction is met, and sends the role switching instruction to the main node server, so that the role switching between the main node server and the standby node server can be realized without setting a detection node server, and the role switching of the node server can be realized at lower cost.

Description

Main/standby node switching method and node server
Technical Field
The present application relates to the field of data interaction, and in particular, to a method for switching a master node and a slave node and a node server.
Background
Computers in the public cloud and computers in the private cloud may interact data via a Virtual Private Network (VPN), which may include two VPN node server groups, where one VPN node server group may establish a communication connection with computers in the public cloud and the other VPN node server group may establish a communication connection with computers in the private cloud. Each VPN node server group may include a master node server (also referred to as a master node) for forwarding data and a backup node server (also referred to as a backup node).
In the related art, each VPN node server group typically further includes: and detecting the node server. The detecting node server can detect the survivability of the master node server in real time, namely whether the master node server is down or not can be detected. If the master node server is detected to be down, the master node server can be switched to a backup node server, and the backup node server can be switched to the master node server.
However, in the related art, the cost of switching the roles of the master node server and the backup node server by the detection node server is high.
Disclosure of Invention
The application provides a method for switching a main node and a standby node and a node server, which can solve the problem that the cost for realizing role switching between a master node server and a backup node server by detecting the node server in the related art is high. The technical scheme is as follows:
on one hand, a method for switching a main node and a standby node is provided, which is applied to a standby node server; the method comprises the following steps:
receiving a first switching detection score sent by a main node server, wherein the first switching detection score is determined according to the role of the main node server and service availability, the role of the main node server is a main node role, and the service availability comprises service availability or service unavailability;
determining a second switch detection score for the backup node server, the second switch detection score being determined based on the role of the backup node server and the service availability, wherein the role of the backup node server is a backup node role;
if the standby node server is determined to meet the role switching condition according to the first switching detection score and the second switching detection score, switching the role of the standby node server to the role of the main node;
and sending a role switching instruction to the main node server, wherein the role switching instruction is used for indicating the main node server to switch the role of the main node server into a standby node role.
On the other hand, a method for switching a main node and a standby node is provided, which is applied to a main node server, and the method comprises the following steps:
sending a first switching detection score to a standby node server, wherein the first switching detection score is determined according to the role of the main node server and service availability, the role of the main node server is a main node role, and the service availability comprises service availability or service unavailability;
receiving a role switching instruction sent by the standby node server, wherein the role switching instruction is sent when the standby node server detects that the standby node server meets a role switching condition according to the first switching detection score and a second switching detection score, the second switching detection score is determined by the standby node server according to the role of the standby node server and the service availability, and the role of the standby node server is a standby node role;
and responding to the role switching instruction, and switching the role of the main node server to the standby node role.
In another aspect, a switching device for a primary and a standby node is provided, which is applied to a standby node server; the device comprises:
a receiving module, configured to receive a first switching detection score sent by a master node server, where the first switching detection score is determined according to a role of the master node server and service availability, where the role of the master node server is a master node role, and the service availability includes service availability or service unavailability;
a determining module, configured to determine a second handover detection score of the standby node server, where the second handover detection score is determined according to a role of the standby node server and the service availability, and the role of the standby node server is a standby node role;
the switching module is used for switching the role of the standby node server to the role of the main node when the standby node server is determined to meet the role switching condition according to the first switching detection score and the second switching detection score;
and the sending module is used for sending a role switching instruction to the main node server, wherein the role switching instruction is used for indicating the main node server to switch the role of the main node server to the role of the standby node.
In another aspect, a device for switching between a master node and a slave node is provided, where the device is applied to a master node server, and the device includes:
a sending module, configured to send a first switching detection score to a standby node server, where the first switching detection score is determined by the master node server according to a role of the master node server and service availability, where the role of the master node server is a master node role, and the service availability includes service availability or service unavailability;
a receiving module, configured to receive a role switching instruction sent by the standby node server, where the role switching instruction is sent by the standby node server when it is detected that the standby node server satisfies a role switching condition according to the first switching detection score and a second switching detection score, where the second switching detection score is determined by the standby node server according to the role of the standby node server and the service availability, and the role of the standby node server is a standby node role;
and the switching module is used for responding to the role switching instruction and switching the role of the main node server into the role of the standby node.
In still another aspect, a node server is provided, which includes: the switching method comprises a processor, a memory and a computer program which is stored on the memory and can be run on the processor, wherein the processor executes the computer program to realize the switching method of the main and standby nodes.
In still another aspect, a computer-readable storage medium is provided, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is caused to execute the method for switching between a main node and a standby node according to the above aspect.
In another aspect, a system for switching between a main node and a standby node is provided, where the system includes: a plurality of node servers;
the node servers include a main node server and at least one standby node server, the main node server includes the switching device applied to the main and standby nodes of the main node server, and each standby node server includes the switching device applied to the main and standby nodes of the standby node server.
The beneficial effect that technical scheme that this application provided brought includes at least:
the application provides a main node and standby node switching method and a node server, wherein a main node server can send a first switching detection score to a standby node server, and the standby node server can detect whether a role switching instruction is met or not according to the first switching detection score and a second switching detection score of the standby node server. After the role switching instruction is determined to be met, the role can be switched to the role of the main node, the role switching instruction is sent to the main node server, and the main node server can switch the role to the role of the standby node. The standby node server can switch roles after detecting that the role switching instruction is met, and sends the role switching instruction to the main node server, so that the role switching between the main node server and the standby node server can be realized without setting a detection node server, and the role switching of the node server can be realized at lower cost. And, because the switch detection scores of the primary node server and the backup node server are determined according to the availability of the node servers, the high availability of the switching system can be realized on the premise that the node servers survive.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a switching system of a main/standby node according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a keep-alive client according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for switching between active and standby nodes according to an embodiment of the present invention;
fig. 4 is a flowchart of another switching method for a main/standby node according to an embodiment of the present invention;
fig. 5 is a flowchart of another method for switching between active and standby nodes according to an embodiment of the present invention;
FIG. 6 is a flow chart of a method of determining a first handover detection score according to an embodiment of the present invention;
FIG. 7 is a flowchart of a method for determining a second handover detection score according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a switching device of a main/standby node according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another switching device of a main/standby node according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another switching device of a main/standby node according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a node server according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a private cloud and a public cloud that communicate using a switching system 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, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The detecting node server in the related art can only detect the survivability of the master node server, and cannot detect the service availability of the master node server, that is, cannot detect whether the master node server can forward data. The service availability includes service availability and service unavailability, the service is available to forward data, and the service is unavailable to forward data. However, when the master node server is not down, the service availability of the master node server may be unavailable for service, i.e., the master node server cannot forward data. For example, when the storage space of a disk in the master node server is small, or when the VPN proxy client in the master node server cannot operate, the master node server cannot forward data. At this time, the detection node server does not switch the backup node server to the master node server because it detects that the master node server is not down, so that the VPN node server group cannot forward data, and thus cannot realize high availability of the VPN node server group.
In the related art, computers of a private cloud may communicate with a VPN node server group through a router. The routing table of the router stores an Internet Protocol (IP) address of a master node server. In the process of switching the backup node server into the master node server, the IP address of the master node server in the routing table of the router needs to be modified into the IP address of the backup node server. However, modifying the IP address in the routing table may affect normal communication of other communication links of the private cloud, which is a high risk.
Fig. 1 is a schematic structural diagram of a switching system of a main/standby node according to an embodiment of the present invention. As shown in fig. 1, the switching system may include: a plurality of node servers 110, any two node servers 110 in the plurality of node servers 110 can establish communication connection through a wired network or a wireless network.
The role of one node server in the node servers 110 is the role of the master node, and the roles of the remaining node servers are the roles of the standby nodes, that is, there are one master node server and a plurality of standby node servers in the node servers.
Alternatively, each node server may be a VPN node server.
In the embodiment of the present invention, a keep alive (keepalived) client may be installed in each node server. Referring to fig. 2, the keepalived client may be configured with a first service detection script file, a role detection script file, a second service detection script file, and a role switching script file.
In the embodiment of the invention, each node server can run the keepalived client after being started. That is, each node server can load the script file in the keepalived client after being started. Each node server may detect the role of the node server by loading the node role detection script file, and may determine the role score of the node server according to the detected role. Each node server can start or close the network card in the node server by loading the role switching script file, thereby realizing the role switching of the node server. Each node server may detect its service availability by loading the first service detection script file and the second service detection script file, and may determine a service score for the node server based on the service availability.
Optionally, the first service detection script file may be a VPN service detection (check _ VPN _ service) script file, and the second service detection script file may be a VPN service re-detection (restart _ VPN _ service) script file. The role detection script file may be a standby state detection (check _ backup _ state) script file. The role switching script file may be an Elastic Internet Protocol (EIP) address and a Virtual Internet Protocol (VIP) address switching (switch _ EIP _ VIP) script file. The VIP address and the EIP address may be pre-stored in each node server, and the VIP address and the EIP address stored in each node server are the same.
Fig. 3 is a flowchart of a switching method for a main/standby node according to an embodiment of the present invention, where the switching method may be applied to a switching device, and the switching device may be disposed in a standby node server, or the switching device may be the standby node server. The standby node server can be a VPN node server. Referring to fig. 3, the method may include:
step 101, receiving a first switching detection score sent by a master node server.
The first switch detection score is determined by the master node server based on its role as master node and service availability, including service availability or service unavailability.
And 102, acquiring a second switching detection score of the standby node server.
The second switch detection score is determined by the backup node server based on its role and service availability, wherein the role of the backup node server is the backup node role and the service availability includes service availability or service unavailability.
And 103, if the standby node server meets the role switching condition according to the first switching detection score and the second switching detection score, switching the role of the standby node server to the role of the main node.
The role switching condition may include: the first handover detection score is less than the second handover detection score.
And step 104, sending a role switching instruction to the main node server.
The role switching instruction is used for instructing the main node server to switch the role of the main node server to the role of the standby node.
In summary, the embodiments of the present invention provide a method for switching a primary node and a standby node, where a standby node server may determine whether a role switching condition is satisfied according to a second switching detection score and a first switching detection score sent by a primary node server. When the role switching condition is determined to be met, the role can be switched to the main node role, and a role switching instruction is sent to the main node server. The backup node server can switch roles when determining that the role switching condition is met, and sends a role switching instruction to the main node server so as to enable the main node server to switch roles. In addition, the detection node server is not required to be arranged, so that the waste of resources can be avoided.
Fig. 4 is a flowchart of another switching method for a main/standby node according to an embodiment of the present invention, where the method may be applied to a switching device, and the switching device may be disposed in a main node server, or the switching device may be the main node server. Wherein, the main node server can be a VPN node server. Referring to fig. 4, the method may include:
step 201, sending the first switching detection score to the standby node server.
The first handover detection score may be determined by the master node server based on its role and service availability. The role of the main node server is the main node role, and the service availability comprises service availability or service unavailability.
Step 202, receiving a role switching instruction sent by the standby node server.
And the role switching instruction is sent by the standby node server when detecting that the standby node server meets the role switching condition according to the first switching detection score and the second switching detection score.
And step 203, responding to the role switching instruction, and switching the role of the main node server to the role of the standby node.
After receiving the role switching instruction, the master node server may switch the role of the master node to the role of the standby node, that is, switch to the standby node server.
In summary, the embodiments of the present invention provide a method for switching a main node and a standby node, where a main node server may receive a role switching instruction sent by a standby node server, and after receiving the role switching instruction, may switch a role of the main node server to a standby node role. Therefore, the detection node server does not need to be arranged to realize the role switching of the main node server and the standby node server, so that the role switching of the main node server and the standby node server can be realized at low cost. In addition, the detection node server is not required to be arranged, so that the waste of resources can be avoided.
Fig. 5 is a flowchart of another switching method for a main/standby node according to an embodiment of the present invention, where the method may be applied to the switching system shown in fig. 1. Referring to fig. 5, the method may include:
step 301, the primary node server determines a first handover detection score.
The primary node server, upon startup, may determine a first handover detection score. The first handover detection score may be determined by the master node server based on its role and service availability. Wherein the role of the master node server is a master node role, and the service availability includes service availability or service unavailability. The master node server can forward data if the services of the master node server are available. If the service of the home node server is not available, the home node server cannot forward the data.
Fig. 6 is a flowchart of a method for determining a first handover detection score according to an embodiment of the present invention.
Referring to fig. 6, the above process of determining the first handover detection score may include:
and step 3011, obtaining a second initial score.
Alternatively, the second initial score may be pre-configured in the master node server, and the second initial score may be pre-set by the operator.
It should be noted that, in the embodiment of the present invention, the second initial score may be determined according to the initial role of the node server, and may not change with the change of the role of the node server.
For example, it is assumed that the second initial score corresponding to the master node role is 100, and if the initial role of a certain node server is the master node role, the second initial score obtained by the node server each time is 100.
Step 3012, determine the role score of the primary node server according to the role of the primary node server.
In the embodiment of the present invention, the master node server may store a first correspondence between a role of the node server and a role score. The primary node server may query the first correspondence according to its role, thereby determining its role score. In the first corresponding relationship, the role score corresponding to the standby node role is a first role score, and the role score corresponding to the main node role is a second role score. The first character score and the second character score may be pre-stored, and the first character score is smaller than the second character score. For example, the first character score may be 0 and the second character score may be 20.
Optionally, after the master node server is started, a check _ backup _ state script file may be loaded, the check _ backup _ state script file may return a role identifier, and the master node server may determine the role of the master node server according to the role identifier. The role identifier includes a first role identifier or a second role identifier, and if the check _ backup _ state script file returns the first role identifier, the master node server may determine that the role thereof is the master node role. If the check _ backup _ state script file returns a second role identifier, the master node server may determine that its role is a standby node role. Then, the master node server may determine a role score of the master node server according to the determined role and the first correspondence. The first role identifier and the second role identifier may be preset. Alternatively, the first role identification may be false and the second role identification may be tune.
For example, assume that the first persona is identified as false, the second persona is identified as true, the first persona score is 0, and the second persona score is 20. If the role identifier returned by the check _ backup _ state file is false, the master node server may determine that the role of the master node server is the master node role, and then may determine that the role score of the master node server is 0 according to the master node role.
Step 3013, determine the service score of the master node server based on the service availability of the master node server.
In the embodiment of the present invention, a second corresponding relationship between the service availability and the service score of the node server is further stored in the master node server. The primary node server may query the second correspondence based on its service availability to determine its service score. In the second corresponding relationship, the service available corresponding service score is the first service score, and the service unavailable corresponding service score is the second service score. The first service score and the second service score may be pre-stored, and the first service score is greater than the second service score. For example, the first service score may be 50 and the second role score may be 0.
Optionally, the master node server may load a check _ vpn _ service script file or a restart _ vpn _ service script file, where the check _ vpn _ service script file and the restart _ vpn _ service script file may both return a service identifier, and the master node server may determine the service availability of the master node server according to the service identifier. Wherein the service identification comprises a first service identification or a second service identification. If the check _ vpn _ service script file or the restart _ vpn _ service script file returns the first service identifier, the master node server may determine that its service is available. If the check _ vpn _ service script file or the restart _ vpn _ service script file returns the second service identifier, the master node server may determine that the service is unavailable. The first service identifier and the second service identifier may be preset. Optionally, the first service identifier may be success, and the second role identifier may be failure.
It should be noted that, after the master node server is started, the service availability of the master node server may be detected first. When the service availability of the main node server is detected, the service score of the main node server can be directly determined according to the service availability of the main node server. And when the service of the main node server is detected to be unavailable, restarting the main node server, and determining the service score of the main node server according to the service availability of the restarted main node server. Optionally, the master node server may be restarted at least once, for example once or twice, upon detecting that the service is not available.
For example, after the master node server is started, the check _ vpn _ service script file may be loaded first, and if the check _ vpn _ service script file returns the first service identifier, the master node server may determine that the service is available directly according to the first service identifier, and further determine the service score according to the second correspondence. If the check _ vpn _ service script file returns the second service identifier, the master node server may be restarted. The restarted main node server can load a restart _ vpn _ service script file, and can determine the service score of the main node server according to the service identifier returned by the restart _ vpn _ service script file and the second corresponding relation.
The main node server can be restarted when detecting that the service is unavailable, the service availability of the restarted main node server can be detected, and the service score is determined according to the service availability after restarting, so that the reliability of the detected service availability of the main node server is ensured, and the accuracy of the determined service score is ensured.
For example, assume that the first service is identified as success, the second role is identified as failure, the first service score is 50, and the second service score is 0. If the service identifier returned by the check _ vpn _ service file is success, the master node server may determine that the service of the master node server is available, and then may determine that the service score is 50 directly according to the availability for taking. Assuming that the identifier returned by the check _ vpn _ service file is failure, the master node server may determine that its service is not available, i.e., may restart. And the restarted main node server loads a restart _ vpn _ service file, and if the identifier returned by the restart _ vpn _ service file is failure, the main node server can determine that the service is unavailable, and then can determine that the service score is 0 according to the unavailability of the service.
Step 3014, determine the sum of the second initial score, the character score, and the service score as the first handover detection score.
For example, assuming that the primary node server obtains a secondary initial score of 100, a determined role score of 0, and a determined service score of 50, the primary node server may determine the primary handover detection score of 150. Assuming that the second initial score obtained by the master node server is 100, the determined role score is 0, and the determined service score is 0, the master node server may determine that the first handover detection score is 100.
Step 302, the primary node server sends a first switch detect score to the backup node server.
The primary node server, upon determining the first handover detection score, may send the first handover detection score to the backup node server.
Optionally, the primary node server and the standby node server may communicate based on a Virtual Route Redundancy Protocol (VRRP). That is, the master node server may send the first handover detection score to the standby node server via VRRP.
It should be noted that, in the embodiment of the present invention, the main node server may perform the operation of determining the first switching detection score every detection period, that is, the main node server may update the first switching detection score every detection period, and send the updated first switching detection score to the standby node server. Alternatively, the detection period may be preset, for example, the detection period may be 1 second(s).
Step 303, the standby node server determines a second switch detection score.
The second switch detection score may be determined by the backup node server based on its role and service availability, wherein the role of the backup node server is the backup node role. The service availability includes service availability or service unavailability. The backup node server is able to forward data if the service of the backup node server is available. If the service of the standby node server is unavailable, the standby node server cannot forward the data.
Fig. 7 is a flowchart of a method for determining a second handover detection score according to an embodiment of the present invention.
Referring to fig. 7, the above process of determining the second handover detection score may include:
step 3031, obtaining a first initial score.
Optionally, the first initial score may be pre-stored by the standby node server and preset by an operator, and the first initial score is smaller than the second initial score.
It should be noted that the first initial score may be determined according to the initial role of the node server, and may not change with the change of the role of the node server.
For example, it is assumed that the first initial score corresponding to the role of the standby node is 90, and if the initial role of a certain node server is the role of the standby node, the first initial score obtained by the node server each time is 90.
Step 3032, determining the role score of the standby node server according to the role of the standby node server.
In the embodiment of the present invention, the standby node server may also store the first corresponding relationship. The standby node server may query the first correspondence according to its role, thereby determining its role score.
In the embodiment of the present invention, after the standby node server is started, a check _ backup _ state script file may be loaded. The check _ backup _ state script file may return a role identifier, and the standby node server may determine the role of the standby node server according to the role identifier. If the check _ backup _ state script file returns the first role identification, the standby node server may determine that its role is the master node role. If the check _ backup _ state script file returns the second role identifier, the standby node server may determine that the role thereof is the standby node role. Then, the standby node server may determine a role score of the standby node server according to the determined role and the first correspondence.
For example, assume that the first role identification is false, the second role identification is true, the first role score is 0, and the second role score is 20. If the role identifier returned by the check _ backup _ state file is true, the standby node server may determine that the role of the standby node server is the standby node role, and then may determine that the role score of the standby node server is 20 according to the standby node role.
And step 3033, determining the service score of the standby node server according to the service availability of the standby node server.
In the embodiment of the present invention, the standby node server may also store the second corresponding relationship. The standby node server may query the second correspondence based on its service availability to determine its service score.
Optionally, after the standby node server is started, the check _ vpn _ service script file may be loaded. The check _ vpn _ service script file may return a service identifier, and the standby node server may determine the service availability of the standby node server according to the service identifier. If the check _ vpn _ service script file returns the first service identification, the standby node server may determine that its service is available. If the check _ vpn _ service script file returns a second service identification, the primary node server may determine that its service is not available.
For example, assume that the first service identifier is success, the second service identifier is failure, the first service score is 50, and the second service score is 0. If the service identifier of the identifier returned by the check _ vpn _ service file is failure, the standby node server may determine that the service is unavailable, and then may determine that the service score is 0 according to the unavailability of the service.
Step 3034, determining the sum of the first initial score, the role score and the service score as a second switching detection score.
For example, assuming that the backup node server obtains a first initial score of 90, a determined role score of 20, and a determined service score of 0, the backup node server may determine that the second handover detection score is 110.
Step 304, the standby node server detects whether the role switching condition is satisfied.
If the standby node server detects that the role switch command is satisfied, step 305 may be performed. If it is detected that the role switching condition is not satisfied, the current role can be maintained.
In this embodiment of the present invention, the role switching condition may include: the first handover detection score is less than the second handover detection score. That is, after receiving the first switching detection score, the standby node server may compare the first switching detection score with the second switching detection score, and when it is determined that the first switching detection score is smaller than the second switching detection score, it may be determined that the standby node server satisfies the role switching condition. And when the first switching detection score is not smaller than the second switching detection score, determining that the standby node server does not meet the role switching condition.
For example, assuming that the second switching detection score of the standby node server is 110 and the received first switching detection score is 150, since 150 is greater than 110, it may be determined that the role switching condition is not satisfied, and the standby node server may maintain the current role. Assuming that the received first handover detection score is 100, since 100 is less than 110, it can be determined that the role switch command is satisfied, and the standby node server can perform step 305.
Optionally, because the primary node server may send the first handover detection score to the standby node server every detection period, correspondingly, the standby node server may receive the first handover detection score every detection period. If the main node server is down, the main node server cannot send the first switching detection score every detection period, and correspondingly, the standby node server cannot receive the first switching detection score in each detection period. Therefore, the role switching condition may further include: the difference between the current time and the time when the first switching detection score is received last time is greater than the detection period.
For example, assuming that the detection period is 1s, the time when the standby node server receives the first handover detection score for the last time is 7 '(minutes) 30 ″ (seconds), and the current time is 7' 33 ″, since the difference between 7 '33 ″ and 7' 30 is 3s, which is greater than the detection period, the standby node server may determine that the role switching condition is satisfied, and may perform step 305.
Step 305, the backup node server switches the role of the backup node server to the role of the master node.
After detecting that the role switching condition is met, the standby node server can switch the role of the standby node to the role of the main node. That is, the standby node server may switch to the primary node server.
In the embodiment of the present invention, a network card is installed in the standby node server, an EIP address and a VIP address are loaded in the network card, the EIP address may be the same as the EIP address loaded in the network card of the primary node server, and the VIP address may be the same as the VIP address loaded in the network card of the primary node server.
The VIP address and the EIP address may be addresses of data receiving terminals pre-stored in each node server, that is, addresses to be accessed by each node server in the switching system.
Because the main node server needs to forward data and the address of the receiving end of the data needs to be determined before the data is forwarded, after the standby node server detects that the role switching instruction is met, the network card can be activated to bind the VIP address and the EIP address on the standby node server, so that the role switching is realized, namely, the role of the standby node is switched to the role of the main node.
Optionally, after detecting that the role switching condition is satisfied, the standby node server may load a switch _ EIP _ VIP script file in the keepalive client to activate a network card in the standby node server, so as to implement the binding of the VIP address and the EIP address.
For example, assuming that the VIP address of the data receiving end is 172.31.4.5 and the EIP address is 123.103.52.24, the VIP address loaded by the network card of the standby node server is 172.31.4.5 and the EIP address is 123.103.52.24.
It should be noted that, in the embodiment of the present invention, after the standby node server switches the role thereof to the role of the master node, the role identification and the service availability of the standby node server also change accordingly.
Step 306, the standby node server sends a role switching instruction to the main node server.
The standby node server may send a role switching instruction to the master node server after detecting that the role switching condition is satisfied. The role switching instruction is used for indicating the main node server to switch the role of the main node server to the role of the standby node.
Step 307, the master node server responds to the role switching instruction to switch the role of the master node server to the role of the standby node.
After receiving the role switching instruction, the master node server may switch the role of the master node to the role of the standby node. That is, the primary node server may switch to a backup node server.
In the embodiment of the present invention, a network card is also installed in the primary node server, and the network card is loaded with the VIP address and the EIP address. The VIP address and the EIP address are the same as those loaded in the network card in the standby node server.
Since the role of the standby node server has been switched to the role of the primary node, the primary node server need not forward the data. After the master node server receives the role switching instruction, the master node server can close the network card to realize the unbinding of the VIP address and the EIP address, so that the role switching is realized, namely, the role of the master node server is switched to the role of the standby node.
Optionally, the master node server may load a switch _ EIP _ VIP file in the keepalive client to close the network card in the master node server, so as to achieve unbinding of the VIP address and the EIP address.
It should be noted that, in the embodiment of the present invention, after the master node server switches the role of the master node server to the role of the standby node, the role identification and the service availability of the master node server also change correspondingly.
It should be noted that, after the standby node server is switched to the primary node server, an indication message may be sent to the standby node server to notify all the standby node servers of the current roles. That is, after the standby node server is switched to the primary node server, an indication message may be broadcast to notify the standby node server that the VIP address and the EIP address are currently bound, that is, the standby node server is the new primary node server. The node servers are located in the same network segment, namely the IP address and the subnet mask phase of each node server are the same as the obtained network address.
It should be further noted that, if the switching system includes two or more standby node servers, after the primary node server sends the first switching detection score, each standby node server may determine whether the role switching condition is satisfied according to its own second switching detection score and the first switching detection score. When determining that the role switching condition is satisfied, any one of the standby node servers may broadcast its own second switching detection score and receive second switching detection scores sent by other standby node servers satisfying the role switching condition. When the standby node server determines that the second switching detection score of the standby node server is larger than the received second switching detection scores of other standby node servers, the role of the standby node server can be switched to the role of the main node, and then an indication message is sent to other standby node servers.
The following describes a method for switching a master device and a slave device according to an embodiment of the present invention, by taking an example in which the switching system includes two node servers, one of which is a master node server and the other of which is a slave node server.
Assuming that a first initial score stored by the standby node server is 90, a second initial score stored by the main node server is 100, the first service detection script file is a check _ vpn _ service script file, the role detection script file is a check _ backup _ state script file, the role switching script file is a switch _ eip _ vip script file, the first role is identified as false, the first role score is 0, the second role is identified as true, the second role score is 20, the first service identifier is success, the first service score is 50, the second service identifier is failure, and the second service score is 0.
In one aspect, when the primary node server is alive (i.e., not down) and the service of the primary node server is available, the parameters of the primary node server and the backup node server may be as shown in table 1:
TABLE 1
Figure GDA0003508508670000161
As can be seen from table 1, in this case, if the check _ backup _ state script file in the master node server returns the second role identifier false, the role score is 0; and if the check _ vpn _ service script file returns the first service identification success, the service score is 50. Thus, the primary node server may determine that its first handover detection score is 150.
Returning a second role identifier (tue) by a check _ backup _ state script file in the standby node server, wherein the role score of the second role identifier (tue) is 20; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the standby node server may determine that its second switch detection score is 120. Since 120 is less than 150, the network card in the primary node server remains on, and the VIP address and the EIP address are bound to the primary node server.
On the other hand, when the service of the primary node server is not available, the parameters in the primary node server and the backup node server may be as shown in table 2:
TABLE 2
Figure GDA0003508508670000162
As can be seen from table 2, in this case, if the check _ backup _ state script file in the primary node server returns the first role identifier false, the role score is 0; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the primary node server may determine that its first handover detection score is 100.
Returning a second role identifier (tue) by a check _ backup _ state script file in the standby node server, wherein the role score of the second role identifier (tue) is 20; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the standby node server may determine that its second switch detection score is 110. Since 110 is greater than 100, at this time, the backup node server satisfies the role switching instruction, so that the role of the backup node may be switched to the role of the master node, and a role switching instruction may be sent to the master node server, so that the master node server switches the role of the master node to the role of the backup device.
The parameters of the switched primary node server and backup node server may be as shown in table 3:
TABLE 3
Figure GDA0003508508670000171
As can be seen from table 3, when the check _ backup _ state script file in the switched master node server returns the second role identifier true, the role score is 20; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the master node server after the handover may determine that the second handover detection score is 120.
Returning a second role identifier false to a check _ backup _ state script file in the switched standby node server, wherein the role score of the second role identifier false is 0; and if the check _ vpn _ service script file returns the first service identification success, the service score is 50. Thus, the backup node server after the switchover may determine that the first switchover detection score is 140. Since 120 is less than 140, the network card in the standby node server remains on, and the VIP address and the EIP address are bound to the primary node server.
In yet another aspect, if the service of the switched backup node server is not available, the parameters in the primary node server and the backup node server may be as shown in table 4:
TABLE 4
Figure GDA0003508508670000181
As can be seen from table 4, in this case, if the check _ backup _ state script file in the switched master node server returns the second role identifier true, the role score is 20; and if the check _ vpn _ service script file returns the first service identification failure, the service score is 0. Thus, the master node server after the handover may determine that the second handover detection score is 120.
Returning a second role identifier false to a check _ backup _ state script file in the switched standby node server, wherein the role score of the second role identifier false is 0; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the standby node server after the switchover may determine that the first switchover detection score is 90. Since 90 is less than 120, at this time, the switched primary node server satisfies the role switching instruction, the role of the standby node can be switched to the primary node role, and the role switching instruction can be sent to the switched standby node server, so that the switched standby node server switches the role of the primary node to the role of the standby device.
The parameters of the primary node server and the backup node server after the switchover can be as shown in table 5.
TABLE 5
Figure GDA0003508508670000182
As can be seen from table 5, when the check _ backup _ state script file in the master node server after the second switching returns the second role identifier false, the role score is 0; and if the check _ vpn _ service script file returns the first service identification success, the service score is 50. Thus, the master node server after the re-switch may determine that the first switch detection score is 150.
Returning a second role identifier (true) to the check _ backup _ state script file in the spare node server after the second switching, wherein the role score of the second role identifier (tu) is 20; and if the check _ vpn _ service script file returns the second service identification failure, the service score is 0. Thus, the backup node server after the re-switchover may determine that the second switchover detection score is 120. Since 120 is less than 150, the network card in the master node server remains on, and the VIP address and the EIP address are bound to the master node server.
On the other hand, when the main node server does not survive (i.e., is down), the main node server cannot load the script file and cannot send the first switching detection score every detection period, the standby node server cannot receive the first switching detection score sent by the main node server in the detection period, and at this time, the standby node server can directly switch the role of the standby node to the role of the main node. The score of the backup node server after switching is shown in table 6:
TABLE 6
Figure GDA0003508508670000191
Optionally, the order of the steps of the method for switching between a master node and a standby node according to the embodiment of the present invention may be appropriately adjusted, or the steps may be increased or decreased according to the situation, for example, step 306 may be executed synchronously with step 305, or executed before step 306; or step 303 may be performed before step 302. Any method that can be easily conceived by those skilled in the art within the technical scope disclosed in the present application is also covered by the scope of the invention, and thus, the detailed description thereof is omitted.
In summary, the embodiments of the present invention provide a node switching method for active/standby nodes, where a primary node server may send a first switching detection score to a standby node server, and the standby node server may detect whether a role switching instruction is satisfied according to the first switching detection score and a second switching detection score of the standby node server. After the role switching instruction is determined to be met, the role can be switched to the role of the main node, the role switching instruction is sent to the main node server, and the main node server can switch the role to the role of the standby node. The standby node server can switch roles after detecting that the role switching instruction is met, and sends the role switching instruction to the main node server, so that the role switching between the main node server and the standby node server can be realized without setting a detection node server, and the role switching of the node server can be realized at lower cost. And, because the switch detection scores of the primary node server and the backup node server are determined according to the availability of the node servers, the high availability of the switching system can be realized on the premise that the node servers survive.
Fig. 8 is a schematic structural diagram of a switching device of a main/standby node according to an embodiment of the present invention. The switching means may be provided in the standby node server, or the switching means may be the standby node server. Referring to fig. 8, the apparatus may include:
the receiving module 401 is configured to receive a first handover detection score sent by a master node server.
Wherein the first handover detection score is determined based on a role of the master node server and service availability, wherein the role of the master node server is a master node role and the service availability includes service availability or service unavailability.
A determining module 402, configured to determine a second handover detection score for the standby node server.
The second switch detection score is determined based on the role of the backup node server and the service availability, wherein the role of the backup node server is a backup node role.
A switching module 403, configured to switch the role of the standby node server to the role of the master node when it is determined that the standby node server satisfies the role switching condition according to the first switching detection score and the second switching detection score.
A sending module 404, configured to send a role switching instruction to the master node server.
The role switching instruction is used for instructing the main node server to switch the role of the main node server to the standby node role.
Optionally, the role switching condition includes: the first handover detection score is less than the second handover detection score.
Optionally, the receiving module 401 may be configured to: receiving a first switching detection score sent by the main node server every other detection period; the role switching conditions include:
the difference between the current time and the time when the first switching detection score is received last time is larger than the detection period.
Optionally, a network card is installed in the standby node server, the network card is loaded with an EIP address and a VIP address, the EIP address is the same as the EIP address loaded in the network card of the main node server, and the VIP address is the same as the VIP address loaded in the network card of the main node server; the switching module 403 may be configured to: and activating the network card.
Optionally, the determining module 402 may be configured to:
acquiring a first initial score;
determining the role score of the standby node server according to the role of the standby node server;
determining the service score of the standby node server according to the service availability of the standby node server;
and determining the sum of the first initial score, the role score and the service score as a second switching detection score.
In summary, in an embodiment of the present invention, a switching device for a master node and a standby node may determine whether a role switching condition is satisfied according to a second switching detection score and a first switching detection score sent by a master node server. When the role switching condition is determined to be met, the role of the standby node server can be switched to the role of the main node, and a role switching instruction is sent to the main node server. The switching device can switch roles when determining that the role switching condition is met, and sends a role switching instruction to the main node server to enable the main node server to switch roles, so that the detection node server is not required to be arranged to realize the role switching of the main node server and the standby node server, and the role switching of the main node server and the standby node server can be realized at low cost. In addition, the detection node server is not required to be arranged, so that the waste of resources can be avoided.
Fig. 9 is a schematic structural diagram of a switching device of a main/standby node according to an embodiment of the present invention. The switching device may be disposed in the main node server, or the switching device may be the main node server. Referring to fig. 9, the apparatus may include:
a sending module 501, configured to send the first handover detection score to the standby node server.
The first switch detection score is determined based on a role of the master node server and service availability, wherein the role of the master node server is a master node role and the service availability includes service availability or service unavailability.
A receiving module 502, configured to receive a role switching instruction sent by the standby node server.
The role switching instruction is sent when the standby node server detects that the standby node server meets the role switching condition according to the first switching detection score and a second switching detection score, wherein the second switching detection score is determined by the standby node server according to the role of the standby node server and the service availability, and the role of the standby node server is the standby node role.
A switching module 503, configured to switch the role of the master node server to the role of the standby node in response to the role switching instruction.
In summary, embodiments of the present invention provide a switching device for a primary and a standby node, where the switching device may receive a role switching instruction sent by a standby node server, and after receiving the role switching instruction, may switch a role of a primary node server to a role of a standby node. Therefore, the detection node server does not need to be arranged to realize the role switching of the main node server and the standby node server, so that the role switching of the main node server and the standby node server can be realized at low cost. In addition, the detection node server is not required to be arranged, so that the waste of resources can be avoided.
Optionally, the master node server is provided with a network card, the network card is loaded with an EIP address and a VIP address, the EIP address is the same as the EIP address loaded in the network card of the standby node server, and the VIP address is the same as the VIP address loaded in the network card of the standby node server; the switching module 503 is configured to: and closing the network card.
Fig. 10 is a switching device of a main/standby node according to another embodiment of the present invention. Referring to fig. 10, the apparatus may further include:
an obtaining module 504, configured to obtain a second initial score;
a first determining module 505, configured to determine a role score of the master node server according to the role of the master node server;
a second determining module 506, configured to determine a service score of the master node server according to service availability of the master node server;
a third determining module 507, configured to determine a sum of the second initial score, the role score, and the service score as the first handover detection score.
Optionally, the second determining module 506 is configured to:
detecting service availability of the master node server;
when the service of the main node server is detected to be available, determining the service score of the main node server according to the service availability of the main node server;
and when the service of the main node server is detected to be unavailable, restarting the main node server, and determining the service score of the main node server according to the service availability of the restarted main node server.
Optionally, the sending module 501 is configured to:
and sending a first switching detection score to the standby node server every detection period.
In summary, the embodiments of the present invention provide a switching device for a main node and a standby node, where the switching device may receive a role switching instruction sent by a standby node server, and after receiving the role switching instruction, may switch a role of a main node server to a role of the standby node. Therefore, the detection node server does not need to be arranged to realize the role switching of the main node server and the standby node server, so that the role switching of the main node server and the standby node server can be realized at low cost. In addition, the detection node server is not required to be arranged, so that the waste of resources can be avoided.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 11 is a schematic structural diagram of a node server according to an embodiment of the present invention. Referring to fig. 11, the node server 110 may include: a processor 1101, a memory 1102 and a computer program stored on the memory and operable on the processor, the processor implementing the method for switching between active and standby nodes according to the above aspect when executing the computer program.
The embodiment of the present invention further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer is enabled to execute the method for switching between active and standby nodes according to the foregoing method embodiment. Alternatively, the storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The embodiment of the invention also provides a system for switching the main and standby nodes. Referring to fig. 1, the system may include: a plurality of node servers 110. The plurality of node servers include a master node server and at least one standby node server. The master node server may include a switching device applied to the master node of the master node server according to the foregoing embodiments, such as the device shown in fig. 9 or fig. 10. Each standby node server includes a switching device applied to the main standby node of the standby node server, such as the device shown in fig. 8, provided in the above embodiment.
Alternatively, each node server may be a VPN node server.
If the computers in the public cloud and the computers in the private cloud interact data through the switching system, referring to fig. 12, the computers in the private cloud 20 may establish a communication connection with one switching system, and the computers in the public cloud 30 may establish a communication connection with another switching system. Each switching system may include two node servers, one of which is a primary node server and the other of which is a backup node server. When the node servers in the switching system are switched, the corresponding node servers can activate the network card or close the network card, so that the forwarding of data can be ensured. The binding of the VIP address and the EIP address can be realized when the network card is activated, and the unbinding of the VIP address and the EIP address can be realized when the network card is closed. Therefore, when the node server in the private cloud switches the main node and the standby node, the forwarding of the data can be ensured without modifying a routing table in the router.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (11)

1. A method for switching a main node and a standby node is characterized by being applied to a standby node server, wherein the standby node server is a Virtual Private Network (VPN) server; the method comprises the following steps:
receiving a first switching detection score sent by a main node server, wherein the first switching detection score is determined according to the role of the main node server and service availability, the role of the main node server is the main node role, the service availability comprises service availability or service unavailability, the service availability refers to the capability of forwarding data, and the service unavailability refers to the capability of forwarding data;
determining a second switching detection score of the standby node server, the second switching detection score being determined according to the role of the standby node server and the service availability, wherein the role of the standby node server is a standby node role;
if the standby node server is determined to meet the role switching condition according to the first switching detection score and the second switching detection score, switching the role of the standby node server to the role of the main node;
and sending a role switching instruction to the main node server, wherein the role switching instruction is used for indicating the main node server to switch the role of the main node server into a standby node role.
2. The method of claim 1, wherein the role switch condition comprises:
the first handover detection score is less than the second handover detection score.
3. The method of claim 1, wherein receiving the first handover detection score sent by the master node server comprises:
receiving a first switching detection score sent by the main node server every other detection period;
the role switching condition includes:
and the difference value between the current time and the time when the first switching detection score is received last time is larger than the detection period.
4. The method of claim 1, wherein a network card is installed in the backup node server, the network card is loaded with an Elastic Internet Protocol (EIP) address and a Virtual Internet Protocol (VIP) address, the EIP address is the same as the EIP address loaded in the network card of the primary node server, and the VIP address is the same as the VIP address loaded in the network card of the primary node server; the switching the role of the standby node server to the role of the main node comprises:
and activating the network card.
5. The method according to any of claims 1 to 4, wherein said determining a second handover detection score for said standby node server comprises:
acquiring a first initial score;
determining the role score of the standby node server according to the role of the standby node server;
determining the service score of the standby node server according to the service availability of the standby node server;
determining a sum of the first initial score, the role score, and the service score as a second handover detection score.
6. A method for switching a main node and a standby node is characterized by being applied to a main node server, wherein the main node server is a VPN server; the method comprises the following steps:
sending a first switching detection score to a standby node server, wherein the first switching detection score is determined by the main node server according to the role of the main node server and service availability, the role of the main node server is the main node role, the service availability comprises service availability or service unavailability, the service availability refers to the capability of forwarding data, and the service unavailability refers to the capability of not forwarding data;
receiving a role switching instruction sent by the standby node server, wherein the role switching instruction is sent when the standby node server detects that the standby node server meets a role switching condition according to the first switching detection score and a second switching detection score, the second switching detection score is determined by the standby node server according to the role of the standby node server and the service availability, and the role of the standby node server is a standby node role;
and responding to the role switching instruction, and switching the role of the main node server to the standby node role.
7. The method of claim 6, wherein the primary node server has a network card installed, wherein the network card is loaded with an EIP address and a VIP address, wherein the EIP address is the same as the EIP address loaded in the network card of the backup node server, and wherein the VIP address is the same as the VIP address loaded in the network card of the backup node server; the switching the role of the master node server to the role of the standby node includes:
and closing the network card.
8. The method of claim 6, wherein prior to said sending the first handover detection score to the standby node server, the method further comprises:
acquiring a second initial score;
determining a role score of the main node server according to the role of the main node server;
determining a service score of the main node server according to the service availability of the main node server;
determining a sum of the second initial score, the role score, and the service score as a first handover detection score.
9. The method of claim 8, wherein determining the service score for the master node server based on the service availability of the master node server comprises:
detecting service availability of the master node server;
when the service of the main node server is detected to be available, determining the service score of the main node server according to the service availability of the main node server;
and when the service of the main node server is detected to be unavailable, restarting the main node server, and determining the service score of the main node server according to the service availability of the restarted main node server.
10. The method according to any of claims 6 to 9, wherein said sending a first handover detection score to the standby node server comprises:
and sending a first switching detection score to the standby node server every other detection period.
11. A node server, the node server comprising: a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for switching between main and standby nodes according to any one of claims 1 to 5, or implements the method for switching between main and standby nodes according to any one of claims 6 to 10 when executing the computer program.
CN201910707395.1A 2019-08-01 2019-08-01 Main/standby node switching method and node server Active CN110417599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910707395.1A CN110417599B (en) 2019-08-01 2019-08-01 Main/standby node switching method and node server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910707395.1A CN110417599B (en) 2019-08-01 2019-08-01 Main/standby node switching method and node server

Publications (2)

Publication Number Publication Date
CN110417599A CN110417599A (en) 2019-11-05
CN110417599B true CN110417599B (en) 2022-07-05

Family

ID=68365118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910707395.1A Active CN110417599B (en) 2019-08-01 2019-08-01 Main/standby node switching method and node server

Country Status (1)

Country Link
CN (1) CN110417599B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115529224A (en) * 2022-09-16 2022-12-27 武汉思普崚技术有限公司 Method, system and device for switching HA (host/standby) scenes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679604A (en) * 2015-02-12 2015-06-03 大唐移动通信设备有限公司 Method and device for switching between master node and standby node
CN108075971A (en) * 2017-12-25 2018-05-25 新华三技术有限公司 A kind of main/standby switching method and device
CN108880917A (en) * 2018-08-23 2018-11-23 华为技术有限公司 Switching method, device and turn control separation system of control plane equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006189B (en) * 2010-11-25 2014-09-10 中兴通讯股份有限公司 Primary access server determination method and device for dual-machine redundancy backup
US10003552B2 (en) * 2015-01-05 2018-06-19 Brocade Communications Systems, Llc. Distributed bidirectional forwarding detection protocol (D-BFD) for cluster of interconnected switches
CN109344014B (en) * 2018-09-26 2022-02-11 新华三大数据技术有限公司 Main/standby switching method and device and communication equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679604A (en) * 2015-02-12 2015-06-03 大唐移动通信设备有限公司 Method and device for switching between master node and standby node
CN108075971A (en) * 2017-12-25 2018-05-25 新华三技术有限公司 A kind of main/standby switching method and device
CN108880917A (en) * 2018-08-23 2018-11-23 华为技术有限公司 Switching method, device and turn control separation system of control plane equipment

Also Published As

Publication number Publication date
CN110417599A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
AU2004306913B2 (en) Redundant routing capabilities for a network node cluster
US9219641B2 (en) Performing failover in a redundancy group
CN108075971B (en) Main/standby switching method and device
US9992058B2 (en) Redundant storage solution
CN110572318B (en) Main/standby switching method and router
CN113169895A (en) N +1 redundancy for virtualization services with low latency failover
CN111314098A (en) Method and device for realizing VIP address drift in HA system
US9344363B2 (en) Information processing system, relay device, information processing device, and information processing method
CN110535947B (en) Storage device cluster configuration node switching method, device and equipment
CN113726581B (en) Method and device for restoring factory configuration of network equipment and network equipment
CN110417599B (en) Main/standby node switching method and node server
JP5039975B2 (en) Gateway device
EP3474501B1 (en) Network device stacking
CN111835684B (en) Network isolation monitoring method and system for haproxy equipment
CN114978910B (en) Time sensitivity realization method and system of virtualization core network
CN115665035A (en) Information processing method and device, first node and storage medium
CN113055236B (en) Method, device, equipment and storage medium for processing fault of cluster service node
CN111835544B (en) Monitoring method and system of virtual router based on user mode protocol stack
CN105915455B (en) Method and device for realizing position identification separation protocol multi-homing
CN114422335A (en) Communication method, communication device, server and storage medium
CN114143905B (en) Session establishing method, communication system, electronic device and storage medium
US20230269168A1 (en) Method and apparatus for establishing border gateway protocol bgp peer, device, and system
US9019964B2 (en) Methods and systems for routing application traffic
CN112804077B (en) Data protection method, controller, control plane device and storage medium
CN115567383A (en) Network configuration method, host server, device, and storage medium

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