CN110417599A - The switching method and node server of main-standby nodes - Google Patents
The switching method and node server of main-standby nodes Download PDFInfo
- Publication number
- CN110417599A CN110417599A CN201910707395.1A CN201910707395A CN110417599A CN 110417599 A CN110417599 A CN 110417599A CN 201910707395 A CN201910707395 A CN 201910707395A CN 110417599 A CN110417599 A CN 110417599A
- Authority
- CN
- China
- Prior art keywords
- node server
- role
- score value
- standby
- service
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0659—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
- H04L41/0661—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
- H04L41/0836—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols 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
This application discloses a kind of switching method of main-standby nodes and node servers, are related to data interaction field.Host node server can send the first change detection score value to standby node server, and standby node server can detect whether to meet role switching instruction according to the first change detection score value and the second change detection score value of itself.It can be master node roles by role switching after determining that meeting role switching instructs, and send role switching instruction to host node server, role switching can be standby node role by host node server.Since standby node server can be after detecting that meeting role switching instructs, switch role, and role switching instruction is sent to host node server, realize the switching of the role of host node server and standby node server, therefore without setting detection node server so as to the switching of the role of lower cost realization node server.
Description
Technical field
This application involves data interaction field, in particular to the switching method and node server of a kind of main-standby nodes.
Background technique
The computer in computer and private clound in public cloud can pass through Virtual Private Network (virtual
Private network, VPN) interaction data, which may include two VPN node server groups, one of VPN node
Server group can be established with the computer in public cloud and be communicated to connect, another VPN node server group can be with private clound
In computer establish communication connection.Wherein, each VPN node server group may include master (master) node serve
Device (also referred to as host node) and one are spare (backup) node server (also referred to as standby node), the master node server
For forwarding data.
In the related technology, it is also typically included in each VPN node server group: detection node server.The detection node
Server can be with the viability of the real-time detection master node server, it can whether detects the master node server
Delay machine.If detect the master node server delay machine, which can be switched to backup
Node server, and backup node server is switched to master node server.
But in the related technology, realize that master node server and backup node take by detection node server
The higher cost of the role switching of business device.
Summary of the invention
This application provides a kind of switching method of main-standby nodes and node servers, can solve the relevant technologies and pass through
Detection node server realization master node server is asked with the higher cost of the role switching of backup node server
Topic.The technical solution is as follows:
On the one hand, a kind of switching method of main-standby nodes is provided, standby node server is applied to;The method packet
It includes:
The first change detection score value that host node server is sent is received, the first change detection score value is according to
What the role of host node server and service availability determined, wherein the role of the host node server is master node roles,
The service availability includes that service can be used or service unavailable;
Determine that the second change detection score value of the standby node server, the second change detection score value are according to institute
What the role and the service availability for stating standby node server determined, wherein the role of the standby node server is
Standby node role;
If determining the standby node service according to the first change detection score value and the second change detection score value
Device meets role switching condition, is master node roles by the role switching of the standby node server;
Role switching instruction is sent to the host node server, the role switching instruction is used to indicate the host node
The role switching of the host node server is standby node role by server.
On the other hand, a kind of switching method of main-standby nodes is provided, host node server, the method packet are applied to
It includes:
The first change detection score value is sent to standby node server, the first change detection score value is according to the master
What the role of node server and service availability determined, wherein the role of the host node server is master node roles, institute
Stating service availability includes that service can be used or service unavailable;
The role switching instruction that the standby node server is sent is received, the role switching instruction is the spare section
Point server is detecting the standby node server according to the first change detection score value and the second change detection score value
It is sent when meeting role switching condition, wherein the second change detection score value is the standby node server according to institute
What the role and the service availability for stating standby node server determined, the role of the standby node server is spare section
Point role;
It is instructed in response to the role switching, is standby node role by the role switching of the host node server.
Another aspect provides a kind of switching device of main-standby nodes, is applied to standby node server;Described device packet
It includes:
Receiving module, for receiving the first change detection score value of host node server transmission, first change detection
Score value is determined according to the role of the host node server and service availability, wherein the angle of the host node server
Color is master node roles, and the service availability includes that service can be used or service unavailable;
Determining module, for determining the second change detection score value of the standby node server, the second switching inspection
Surveying score value is determined according to the role of the standby node server and the service availability, wherein the standby node
The role of server is standby node role;
Switching module, for determining institute according to the first change detection score value and the second change detection score value
It is main angle of rotation of joint by the role switching of the standby node server when stating standby node server and meeting role switching condition
Color;
Sending module, for sending role switching instruction to the host node server, the role switching instruction is used for
Indicate the host node server by the role switching of the host node server be standby node role.
In another aspect, providing a kind of switching device of main-standby nodes, it is applied to host node server, described device packet
It includes:
Sending module, for sending the first change detection score value, first change detection point to standby node server
Value is that the host node server is determined according to the role of the host node server and service availability, wherein the master
The role of node server is master node roles, and the service availability includes that service can be used or service unavailable;
Receiving module, the role switching instruction sent for receiving the standby node server, the role switching refer to
Order be the standby node server detected according to the first change detection score value and the second change detection score value it is described
Standby node server meets to be sent when role switching condition, wherein the second change detection score value is the spare section
Point server determines according to the role of the standby node server and the service availability, the standby node server
Role be standby node role;
The role switching of the host node server is standby for instructing in response to the role switching by switching module
With node role.
In another aspect, providing a kind of node server, the node server includes: processor, memory and deposits
The computer program that can be run on the memory and on the processor is stored up, the processor executes the computer journey
The switching method of the main-standby nodes as described in terms of above-mentioned is realized when sequence.
In another aspect, providing a kind of computer readable storage medium, it is stored in the computer readable storage medium
Instruction, when the computer readable storage medium is run on computers, so that computer is executed as described in terms of above-mentioned
The switching method of main-standby nodes.
In another aspect, a kind of switching system of main-standby nodes is provided, and the system comprises: multiple node servers;
There are a host node server and at least one standby node server in the multiple node server,
The host node server includes the switching device of the main-standby nodes applied to host node server as described in terms of above-mentioned, often
A standby node server includes the switching of the main-standby nodes applied to standby node server as described in terms of above-mentioned
Device.
Technical solution bring beneficial effect provided by the present application includes at least:
This application provides a kind of switching method of main-standby nodes and node server, host node server can be to standby
The first change detection score value is sent with node server, standby node server can be according to the first change detection score value and oneself
Second change detection score value of body detects whether to meet role switching instruction.After determination meets role switching instruction, it can incite somebody to action
Role switching is master node roles, and sends role switching instruction to host node server, and host node server can be by role
It is switched to standby node role.Since standby node server can switch role after detecting that meeting role switching instructs,
And to host node server send role switching instruction, therefore without setting detection node server realize host node server with
The switching of the role of standby node server, so as to the switching of the role of lower cost realization node server.And
And since the change detection score value of host node server and standby node server is determined according to the availability of node server
, therefore the high availability of the switching system can be realized under the premise of node server is survived.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 is a kind of structural schematic diagram of the switching system of main-standby nodes provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of keep-alive client provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of the switching method of main-standby nodes provided in an embodiment of the present invention;
Fig. 4 is the flow chart of the switching method of another main-standby nodes provided in an embodiment of the present invention;
Fig. 5 is the flow chart of the switching method of another main-standby nodes provided in an embodiment of the present invention;
Fig. 6 is a kind of flow chart of the method for the first change detection of determination score value provided in an embodiment of the present invention;
Fig. 7 is a kind of flow chart of the method for the second change detection of determination score value provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of the switching device of main-standby nodes provided in an embodiment of the present invention;
Fig. 9 is the structural schematic diagram of the switching device of another main-standby nodes provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram of the switching device of another main-standby nodes provided in an embodiment of the present invention;
Figure 11 is a kind of structural schematic diagram of node server provided in an embodiment of the present invention;
Figure 12 is showing for a kind of private clound communicated using switching system and public cloud provided in an embodiment of the present invention
It is intended to.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Detection node server in the related technology is only capable of detecting the viability of the master node server, can not examine
The service availability for surveying master node server, i.e., cannot detect whether master node server can forward data.Its
In, which includes that service is available and service unavailable, and service is available can to forward data, services and unavailable then can not
Forward data.But when the non-delay machine of master node server, the service availability of the master node server may be clothes
It is engaged in unavailable, i.e., the master node server can not forward data.For example, when the disk in master node server
When memory space is smaller, or when the VPN agent client in master node server is unable to run, the master node
Server cannot forward data.And at this time detection node server due to detecting the non-delay machine of master node server,
Backup node server can't be switched to master node server, cause the VPN node server group that can not forward
Data, to cannot achieve the high availability of the VPN node server group.
In the related technology, the computer of private clound can be communicated by router with VPN node server group.The road
By the address Internet protocol (internet protocol, IP) for being stored with master node server in the routing table of device.In
During backup node server is switched to master node server, it is also necessary to will be in the routing table of router
The IP address of master node server is revised as the IP address of backup node server.But to the IP in routing table
Location is modified, and may will affect the normal communication of other communication links of private clound, and risk is larger.
Fig. 1 is a kind of structural schematic diagram of the switching system of main-standby nodes provided in an embodiment of the present invention.As shown in Figure 1,
The switching system may include: multiple node servers 110, any two node serve in multiple node server 110
Device 110 can establish communication connection by cable network or wireless network.
Wherein, the role of a node server in multiple node server 110 is master node roles, remaining section
The role of point server is standby node role, that is to say that there are a host node servers in multiple node server, and
Multiple standby node servers.
Optionally, each node server can be VPN node server.
In embodiments of the present invention, keep-alive (keepalived) client can be installed in each node server.Ginseng
See Fig. 2, script file, the can be detected configured with first service detection script file, role in the keepalived client
Two service detection script files, role switching script file.
In embodiments of the present invention, each node server after actuation, can run the keepalived client.
That is, each node server can load the script file in keepalived client after actuation.Each node server
Script file can be detected to detect the role of the node server by loading node role, and can be according to detecting
Role determines role's score value of node server.Each node server can be opened by loading role switching script file
Or the network interface card in closed node server, to realize the switching of the role of node server.Each node server can lead to
Load first service detection script file and second service detection script file are crossed to detect its service availability, and can basis
The service availability determines the service score value of the node server.
Optionally, first service detection script file can be VPN service detection (check_vpn_service) script
File, which detects script file can examine (restart_vpn_service) script file for VPN service again.It should
Role, which detects script file, can detect (check_backup_state) script file for stand-by state.The role switching script
File can be the resilient interconnection fidonetFido address (elastic internet protocol, EIP) and virtual IP
The address (virtual internet protocol, VIP) switches (switch_eip_vip) script file.Wherein, the VIP
Location and the address EIP can be that each node server is pre-stored, and the VIP stored in each node server
Location is identical, and the address EIP of storage is identical.
Fig. 3 is a kind of flow chart of the switching method of main-standby nodes provided in an embodiment of the present invention, which can be with
Applied to switching device, which be can be set in standby node server or the switching device can be spare
Node server.Wherein, which can be VPN node server.Referring to Fig. 3, this method may include:
Step 101 receives the first change detection score value that host node server is sent.
First change detection score value is that host node server is determined according to its role and service availability, wherein main section
The role of point server is master node roles, and service availability includes that service can be used or service unavailable.
Step 102, the second change detection score value for obtaining standby node server.
The second change detection score value is that standby node server is determined according to its role and service availability, wherein
The role of standby node server is standby node role, and service availability includes that service can be used or service unavailable.
If step 103, according to the first change detection score value and the second change detection score value, determine that standby node server is full
The role switching of standby node server is master node roles by sufficient role switching condition.
The role switching condition may include: the first change detection score value less than the second change detection score value.
Step 104 sends role switching instruction to host node server.
It is standby node that role switching instruction, which is used to indicate host node server for the role switching of host node server,
Role.
In conclusion the embodiment of the invention provides a kind of switching method of main-standby nodes, standby node server can be with
The the first change detection score value sent according to the second change detection score value and host node server, it is determined whether meet role
Switching condition.Determine meet role switching condition when, can be master node roles by role switching, and to host node server
Send role switching instruction.Due to standby node server determine meet role switching condition when, can switch role, and to
Host node server sends role switching instruction, so that host node server switches role, there is no need to detection node clothes are arranged
Device be engaged in realize the switching of the role of host node server and standby node server, so as to be realized with a low cost host node
The role switching of server and standby node server.It, can be to avoid also, due to no setting is required detection node server
The waste of resource.
Fig. 4 is the flow chart of the switching method of another main-standby nodes provided in an embodiment of the present invention, and this method can answer
For switching device, which be can be set in host node server or the switching device can take for host node
Business device.Wherein, which can be VPN node server.Referring to fig. 4, this method may include:
Step 201 sends the first change detection score value to standby node server.
The first change detection score value can be what host node server was determined according to its role and service availability.Its
In, the role of host node server is master node roles, and service availability includes that service can be used or service unavailable.
Step 202 receives the role switching instruction that standby node server is sent.
Wherein, role switching instruction is that standby node server is examined according to the first change detection score value and the second switching
Score value is surveyed, detects and sends when it meets role switching condition.
Step 203 is instructed in response to role switching, is standby node role by the role switching of host node server.
Master node roles can be switched to standby node angle after receiving role switching instruction by host node server
Color that is to say and be switched to standby node server.
In conclusion host node server can connect the embodiment of the invention provides a kind of switching method of main-standby nodes
Host node can be serviced after receiving role switching instruction by receiving the role switching instruction that standby node server is sent
The role switching of device is standby node role.Therefore without setting detection node server to realize host node server and spare
The switching of the role of node server, so as to the role to be realized with a low cost host node server and standby node server
Switching.Also, it, can be to avoid the waste of resource due to no setting is required detection node server.
Fig. 5 is the flow chart of the switching method of another main-standby nodes provided in an embodiment of the present invention, and this method can answer
For switching system shown in FIG. 1.Referring to Fig. 5, this method may include:
Step 301, host node server determine the first change detection score value.
Host node server after actuation, can determine the first change detection score value.The first change detection score value can be with
It is that host node server is determined according to its role and service availability.Wherein, the role of the host node server is host node
Role, the service availability include that service can be used or service unavailable.If the service of the host node server is available, the main section
Point server can forward data.If the service of the host node server is unavailable, which can not forwarding number
According to.
Fig. 6 is a kind of flow chart of the method for the first change detection of determination score value provided in an embodiment of the present invention.Referring to figure
6, the process of above-mentioned the first change detection of determination score value may include:
Step 3011 obtains the second initial value.
Optionally, which can be preconfigured in host node server, and second initial value
It is pre-set to can be operator.
It should be noted that in embodiments of the present invention, which can be according to the initial of node server
What role determined, and will not change with the variation of the role of node server.
It is exemplary, it is assumed that corresponding second initial value of master node roles is 100, if the initial angle of some node server
Color is master node roles, then the second initial value that the node server obtains every time is 100.
Step 3012, role's score value that host node server is determined according to the role of host node server.
In embodiments of the present invention, role and the role's score value of node server be can store in the host node server
The first corresponding relationship.Host node server can be according to its role inquiry first corresponding relationship, so that it is determined that its role point
Value.In first corresponding relationship, the corresponding role's score value of standby node role is first role score value, and master node roles are corresponding
Role's score value be second role score value.Wherein, the first role score value and the second role score value can be pre-stored,
And the first role score value is less than second role score value.For example, the first role score value can be 0, which can
Think 20.
Optionally, after the starting of host node server, check_backup_state script file can be loaded, the check_
Backup_state script file can return to role identification, and host node server can determine the main section according to the role identification
The role of point server.Wherein, which includes first role mark or second role mark, if check_backup_
State script file returns to first role mark, then host node server can determine that its role is master node roles.If should
Check_backup_state script file returns to second role mark, then host node server can determine that its role is spare
Node role.Later, host node server can determine the host node according to the role determined and the first corresponding relationship
Role's score value of server.Wherein, first role mark and second role mark can be pre-set.Optionally, should
First role mark can be false, and second role mark can be ture.
It is exemplary, it is assumed that first role is identified as false, and second role is identified as ture, and first role score value is 0, the
Two role's score values are 20.The role identification that the check_backup_state file returns is false, then the host node server
It can determine that the role of the host node server is master node roles, can determine its role's score value according to master node roles later
It is 0.
Step 3013, the service score value that host node server is determined according to the service availability of host node server.
In embodiments of the present invention, the service availability and service of node server are also stored in the host node server
Second corresponding relationship of score value.Host node server can inquire second corresponding relationship according to its service availability, thus really
Fixed its services score value.In second corresponding relationship, service can be first service score value with corresponding service score value, and service can not
It is second service score value with corresponding service score value.Wherein, the first service score value and the second service score value can be in advance
Storage, and the first service score value is greater than second service score value.For example, the first service score value can be 50, this second jiao
Color score value can be 0.
Optionally, which can load check_vpn_service script file or restart_vpn_
Service script file, the check_vpn_service script file and restart_vpn_service script file are equal
Service identifiers can be returned to, host node server can determine the service availability of host node server according to the service identifiers.
Wherein, which includes first service mark or second service mark.If check_vpn_service script file, or
The restart_vpn_service script file returns to first service mark, then host node server can determine that its service can
With.If check_vpn_service script file or the restart_vpn_service script file return to second service mark
Know, then host node server can determine that its service is unavailable.Wherein, first service mark and second service mark can be pre-
First it is arranged.Optionally, first service mark can be success, and second role mark can be failure.
It should be noted that host node server is after actuation, the service availability of host node server can be first detected.
When the service for detecting host node server is available, main section directly can be determined according to the service availability of host node server
The service score value of point server.When the service for detecting host node server is unavailable, host node server is restarted, according to weight
The service availability of host node server after opening determines the service score value of host node server.Optionally, host node server
When detecting that service is unavailable, which can restart at least once, such as can restart once or twice.
For example, host node server is after actuation, check_vpn_service script file can be first loaded, if should
Check_vpn_service script file returns to first service mark, then host node server can be directly according to first service
Mark determines that service is available, and then determines that it services score value according to the second corresponding relationship.If the check_vpn_service script
File returns to second service mark, then host node server can restart.Host node server after restarting can load
Restart_vpn_service script file, and the service mark that can be returned according to restart_vpn_service script file
Knowledge and the second corresponding relationship determine the service score value of the host node server.
Since host node server is when detecting that service is unavailable, can restart, and can detecte the main section after restarting
The service availability of point server determines service score value according to the service availability after restarting, it is ensured that the master detected
The reliability of the service availability of node server ensures that the accuracy of determining service score value.
It is exemplary, it is assumed that first service is identified as success, and second role is identified as failure, and first service score value is
50, second service score value is 0.The service identifiers that the check_vpn_service file returns are success, then the host node
Server can determine that the service of the host node server can be used, and directly basis can take its available determining service score value later
It is 50.Assuming that the return of check_vpn_service file is identified as failure, then host node server can determine its clothes
It is engaged in unavailable, can restart.Host node server after restarting loads restart_vpn_service file, it is assumed that should
What restart_vpn_service file returned is identified as failure, then the host node server can determine that its service can not
With, later can according to the unavailable determination of the service its service score value be 0.
The sum of second initial value, role's score value and service score value are determined as the first change detection point by step 3014
Value.
It is exemplary, it is assumed that the second initial value that host node server obtains is 100, and determining role's score value is 0, is determined
Service score value be 50, then the host node server can determine the first change detection score value be 150.Assuming that host node server
The second initial value obtained is 100, and determining role's score value is 0, and determining service score value is 0, then the host node server
It can determine that the first change detection score value is 100.
Step 302, host node server send the first change detection score value to standby node server.
The first change detection score value can be sent to standby by host node server after determining the first change detection score value
Use node server.
Optionally, the host node server and standby node server can be based on Virtual Router Redundacy Protocol (virtual
Route redundancy protocol, VRRP) it is communicated.It that is to say, which can be by VRRP to standby
The first change detection score value is sent with node server.
It should be noted that in embodiments of the present invention, which can execute primary every detection cycle
First change detection score value determines operation, that is to say, which can update one time first every detection cycle
Change detection score value, and updated first change detection score value is sent to standby node node server.Optionally, the detection
Period can be it is pre-set, such as the detection cycle can be 1 second (s).
Step 303, standby node server determine the second change detection score value.
Second change detection score value can be what standby node server was determined according to its role and service availability,
In, the role of standby node server is standby node role.The service availability includes that service can be used or service unavailable.If
The service of the standby node server is available, then the standby node server can forward data.If the standby node server
Service it is unavailable, then the standby node server can not forward data.
Fig. 7 is a kind of flow chart of the method for the second change detection of determination score value provided in an embodiment of the present invention.Referring to figure
7, the process of above-mentioned the second change detection of determination score value may include:
Step 3031 obtains the first initial value.
Optionally, which it is pre-stored to can be standby node server, is that operator sets in advance
It sets, and first initial value is less than the second initial value.
It should be noted that the first first score value can be according to the decision of the initial roles of node server, and not
It can change with the variation of the role of node server.
It is exemplary, it is assumed that corresponding first initial value of standby node role is 90, if some node server is initial
Role is standby node role, then the first initial value that the node server obtains every time is 90.
Step 3032, role's score value that standby node server is determined according to the role of standby node server.
In embodiments of the present invention, it also can store first corresponding relationship in the standby node server.Standby node
Server can be according to its role inquiry first corresponding relationship, so that it is determined that its role's score value.
In embodiments of the present invention, after the starting of standby node server, check_backup_state script can be loaded
File.The check_backup_state script file can return to role identification, and standby node server can be according to the angle
Colour code knows the role for determining the standby node server.If check_backup_state script file returns to first role mark
Know, then standby node server can determine that its role is master node roles.If the check_backup_state script file
Second role mark is returned to, then standby node server can determine that its role is standby node role.Later, standby node takes
Business device can determine role's score value of the standby node server according to the role determined and the first corresponding relationship.
It is exemplary, it is assumed that first role is identified as false, and second role is identified as true, and first role score value is 0, the
Two role's score values are 20.The role identification that the check_backup_state file returns is true, then the standby node service
Device can determine that the role of the standby node server is standby node role, can be determined later according to standby node role
Its role's score value is 20.
Step 3033, the service score value that standby node server is determined according to the service availability of standby node server.
In embodiments of the present invention, second corresponding relationship has also been can store in the standby node server.Spare section
Point server can inquire second corresponding relationship according to its service availability, so that it is determined that it services score value.
Optionally, standby node server after actuation, can load check_vpn_service script file.It should
Check_vpn_service script file can return to service identifiers, and standby node server can be true according to the service identifiers
Determine the service availability of standby node server.If check_vpn_service script file returns to first service mark, standby
It can determine that its service is available with node server.If check_vpn_service script file returns to second service mark,
Host node server can determine that its service is unavailable.
It is exemplary, it is assumed that the first service is identified as success, and second service is identified as failure, first service score value
It is 50, second service score value is 0.The service identifiers for the mark that the check_vpn_service file returns are failure, then
The standby node server can determine that its service is unavailable, its service score value can be later 0 according to the unavailable determination of service.
The sum of first initial value, role's score value and service score value are determined as the second change detection point by step 3034
Value.
It is exemplary, it is assumed that the first initial value that standby node server obtains is 90, and determining role's score value is 20, really
Fixed service score value is 0, then the standby node server can determine that the second change detection score value is 110.
Step 304, standby node server detect whether to meet role switching condition.
If standby node server, which detects, meets role switching instruction, step 305 can be executed.If detecting discontented
When the foot role switching condition, then current role can be kept.
In embodiments of the present invention, which may include: the first change detection score value less than the second switching
Detect score value.It that is to say, standby node server can compare first switching after receiving the first change detection score value
The size for detecting score value and the second change detection score value, when determining the first change detection score value less than second change detection
When score value, that is, it can determine that the standby node server meets role switching condition.When determining that the first change detection score value is not small
When the second change detection score value, that is, it can determine that the standby node server is unsatisfactory for role switching condition.
It is exemplary, it is assumed that the second change detection score value of standby node server is 110, the first change detection received
Score value is 150, since 150 are greater than 110, then can determine the role switching condition that is unsatisfactory for, standby node server can be kept
Current role.Assuming that the first change detection score value received is 100, since 100 less than 110, then it can determine and meet angle
Color switching command, the i.e. executable step 305 of the standby node server.
Optionally, since host node server can send the first switching inspection to standby node server every detection cycle
Score value is surveyed, correspondingly, the standby node server can receive the first change detection score value every detection cycle.If host node
Server delay machine, host node server can not send the first change detection score value every detection cycle, correspondingly, standby node takes
Business device can not receive the first change detection score value in each detection cycle.Therefore, which can also wrap
Include: difference at the time of current time and the last time receive the first change detection score value is greater than the detection cycle.
It is exemplary, it is assumed that the detection cycle is 1s, and standby node server the last time receives the first change detection point
It is at the time of value 7 ' (divides) 30 " (second), current time be 7 ' 33 ", since the difference of 7 ' 33 " with 7 ' 30 " is 3s, greater than the detection
Period, therefore standby node server can determine and meet role switching condition, i.e., executable step 305.
The role switching of standby node server is master node roles by step 305, standby node server.
Standby node server, then can will be based on standby node role switching after detecting and meeting role switching condition
Node role.It that is to say, which can be switched to host node server.
In embodiments of the present invention, network interface card is installed in the standby node server, be loaded in the network interface card address EIP with
And the address VIP, and the address EIP can be identical as the address EIP loaded in the network interface card of host node server, which can
With identical as the address VIP loaded in the network interface card of host node server.
Wherein, the address VIP and the address EIP can be pre-stored data receiver in each node server
Address that is to say each node server address to be accessed in the switching system.
Since host node server needs to forward data, and before forwarding data, it is thus necessary to determine that the ground of the receiving end of data
Location, therefore standby node server can activate the network interface card, by the address VIP after detecting that meeting role switching instructs
And standby node role switching to realize the switching of role, i.e., is by EIP address binding on the standby node server
Master node roles.
Optionally, which can load keepalived after detecting and meeting role switching condition
Switch_eip_vip script file in client, to activate the network interface card in standby node server, to realize the address VIP
And the binding of the address EIP.
It is exemplary, it is assumed that the address VIP of the receiving end of data is 172.31.4.5, and the address EIP is 123.103.52.24,
The address VIP that then network interface card of the standby node server is loaded is 172.31.4.5, and the address EIP is 123.103.52.24.
It should be noted that in embodiments of the present invention, its role switching is master node roles by standby node server
Later, role identification and service availability can also occur to change accordingly.
Step 306, standby node server send role switching instruction to host node server.
Standby node server can send role to host node server and cut after detecting and meeting role switching condition
Change instruction.Wherein, it is spare section that role switching instruction, which is used to indicate host node server for the role switching of host node server,
Point role.
Step 307, host node server are instructed in response to role switching, are spare by the role switching of host node server
Node role.
Master node roles can be switched to standby node angle after receiving role switching instruction by host node server
Color.It that is to say, which can be switched to standby node server.
In embodiments of the present invention, network interface card is also installed in the host node server, be loaded in the network interface card address VIP with
And the address EIP.The address VIP and the address EIP, it is identical as the address loaded in the network interface card in standby node server.
Since the role of standby node server has been switched to master node roles, host node server no longer needs to turn
Send out data.After host node server receives role switching instruction, host node server can close the network interface card, with realization pair
The role switching of host node server is spare section to realize role switching by the unbundlings of the address VIP and the address EIP
Point role.
Optionally, which can load the switch_eip_vip file in keepalived client,
With the network interface card closed in host node server, to realize the unbundlings of the address VIP and the address EIP.
It should be noted that in embodiments of the present invention, host node server by its role switching be slave node role it
Afterwards, role identification and service availability can also occur to change accordingly.
It should also be noted that, after standby node server is switched to host node server, it can be to standby node service
Device sends instruction message, to notify its current role of all standby node servers.It that is to say, the standby node server
After being switched to host node server, instruction message can be broadcasted, standby node server is notified, is bundled with the address VIP at present
With the address EIP, i.e., it is new host node server.Wherein, above-mentioned node server is located in same network segment, i.e., each section
The IP address and subnet mask phase and available identical network address of point server.
It should also be noted that, if the switching system includes two or more standby node servers, host node
For server after sending the first change detection score value, each standby node server can be according to the second change detection of itself point
Value and the first change detection score value determine whether to meet role switching condition.Any in multiple standby node server
Standby node server determine meet role switching condition when, the second change detection score value of itself can be broadcasted, and connect
Receive the second change detection score value of the transmission for the standby node server that other meet role switching condition.When the standby node takes
Business device determines that the second change detection score value of itself is greater than the second change detection point of other standby node servers received
When value, can by its role switching be master node roles, it is rear to other standby node servers send instruction message.
Hereafter to include two node servers in the switching system, one of them is main node server, another is
For standby node server, the switching method of master/slave device provided in an embodiment of the present invention is introduced.
Assuming that the first initial value of spare node server storage is 90, the second initial value that host node server is deposited
It is 100, it is check_vpn_service script file that first service, which detects script file, and role detects script file and is
Check_backup_state script file, role switching script file are switch_eip_vip script file, and first
Role identification is false, and first role score value is 0, and second role is identified as ture, and second role score value is 20, first service
It is identified as success, first service score value is 50, and second service is identified as failure, and second service score value is 0.
On the one hand, when host node server survives (i.e. non-delay machine), and the case where the service of host node server can be used
Under, the parameters in the host node server and standby node server can be as shown in table 1:
Table 1
As it can be seen from table 1 the check_backup_state script file in host node server returns in the case of this kind
It returns second role and identifies false, then its role's score value is 0;Check_vpn_service script file returns to first service mark
Success, then it is 50 that it, which services score value,.Therefore, host node server can determine that its first change detection score value is 150.
Check_backup_state script file in standby node server returns to second role and identifies ture, then
Its role's score value is 20;Check_vpn_service script file returns to second service and identifies failure, then it services score value
It is 0.Therefore, standby node server can determine that its second change detection score value is 120.It is main since 120 less than 150
Network interface card in node server is kept it turned on, and the address VIP and EIP address binding are on host node server.
On the other hand, when the service of host node server is unavailable, the host node server and standby node server
In parameters can be as shown in table 2:
Table 2
From table 2 it can be seen that the check_backup_state script file in host node server returns in the case of this kind
It returns first role and identifies false, then its role's score value is 0;Check_vpn_service script file returns to second service mark
Failure, then it is 0 that it, which services score value,.Therefore, host node server can determine that its first change detection score value is 100.
Check_backup_state script file in standby node server returns to second role and identifies ture, then
Its role's score value is 20;Check_vpn_service script file returns to second service and identifies failure, then it services score value
It is 0.Therefore, standby node server can determine that its second change detection score value is 110.It is standby at this time since 110 greater than 100
Meet role switching instruction with node server, therefore can be master node roles by standby node role switching, and can be to
Host node server sends role switching instruction, so that master node roles are switched to stand-by equipment role by host node server.
The parameters in host node server and standby node server after switching can be as shown in table 3:
Table 3
From table 3 it can be seen that switching after host node server in check_backup_state script file return
Second role identifies ture, then its role's score value is 20;Check_vpn_service script file returns to second service mark
Failure, then it is 0 that it, which services score value,.Therefore, the host node server after switching can determine that the second change detection score value is
120。
Check_backup_state script file in standby node server after switching returns to second role mark
Know false, then its role's score value is 0;Check_vpn_service script file return first service identify success, then its
Servicing score value is 50.Therefore, the standby node server after switching can determine that the first change detection score value is 140.Due to 120
Less than 140, therefore the network interface card in standby node server is kept it turned on, and the address VIP and EIP address binding take in host node
It is engaged on device.
Another aspect, if the service of the standby node server of switching is unavailable, host node server and standby node
Parameters in server can be as shown in table 4:
Table 4
From table 4, it can be seen that the check_backup_state foot in host node server in the case of this kind, after switching
This document returns to second role and identifies ture, then its role's score value is 20;Check_vpn_service script file returns to first
Service identifiers failure, then it is 0 that it, which services score value,.Therefore, the host node server after switching can determine the second change detection
Score value is 120.
Check_backup_state script file in standby node server after switching returns to second role mark
Know false, then its role's score value is 0;Check_vpn_service script file return second service identify failure, then its
Servicing score value is 0.Therefore, the standby node server after switching can determine that the first change detection score value is 90.Due to 90 small
Host node server in 120, therefore after switching at this time meets role switching instruction, can will be based on standby node role switching
Node role, and role switching instruction can be sent to the standby node server after switching, so that the standby node after switching
Master node roles are switched to stand-by equipment role by server.
The parameters in host node server and standby node server after switching again can be as shown in table 5.
Table 5
As can be seen from Table 5, the check_backup_state script file in host node server after switching again
It returns to second role and identifies false, then its role's score value is 0;Check_vpn_service script file returns to first service mark
Know success, then it is 50 that it, which services score value,.Therefore, the host node server after switching again can determine the first change detection
Score value is 150.
The check_backup_state script file in standby node server after switching again returns to second jiao
Colour code knows ture, then its role's score value is 20;Check_vpn_service script file returns to second service and identifies failure,
It is 0 that then it, which services score value,.Therefore, the standby node server after switching again can determine that the second change detection score value is 120.
Since 120 less than 150, the network interface card in host node server is kept it turned on, and the address VIP and EIP address binding are in master
On node server.
In another aspect, host node server can not load above-mentioned script when host node server does not survive (i.e. delay machine)
File can not send the first change detection score value every detection cycle, which can not be inscribed in detection cycle
The first change detection score value of host node server transmission is received, standby node server can be directly by standby node angle at this time
Color is switched to master node roles.The score value of standby node server after switching is as shown in table 6:
Table 6
Optionally, the sequencing of the step of switching method of main-standby nodes provided in an embodiment of the present invention can be fitted
Work as adjustment, step according to circumstances can also accordingly be increased and decreased, such as step 306 synchronous with step 305 can execute, Huo Zhe
It is executed before step 306;Or step 303 can also execute before step 302.Any technology people for being familiar with the art
Within the technical scope of the present application, the method that can readily occur in variation should all cover within the protection scope of invention member,
Therefore it repeats no more.
In conclusion host node server can the embodiment of the invention provides a kind of node switching method of main-standby nodes
To send the first change detection score value to standby node server, standby node server can be according to first change detection point
Value and the second change detection score value of itself detect whether to meet role switching instruction.After determining that meeting role switching instructs,
It can be master node roles by role switching, and send role switching instruction, host node server to host node server
It is standby node role by role switching.Since standby node server can be cut after detecting that meeting role switching instructs
Role is changed, and sends role switching instruction to host node server, realizes host node therefore without setting detection node server
The switching of the role of server and standby node server, so as to the role's of lower cost realization node server
Switching.Also, due to the change detection score value of host node server and standby node server be according to node server can
It is determined with property, therefore can realize the high availability of the switching system under the premise of node server is survived.
Fig. 8 is a kind of structural schematic diagram of the switching device of main-standby nodes provided in an embodiment of the present invention.The switching device
It can be set in standby node server or the switching device can be standby node server.Referring to Fig. 8, the device
May include:
Receiving module 401, for receiving the first change detection score value of host node server transmission.
Wherein, which determined according to the role of the host node server and service availability,
Wherein, the role of the host node server is master node roles, which includes that service can be used or service unavailable.
Determining module 402, for determining the second change detection score value of the standby node server.
The second change detection score value is determined according to the role of the standby node server and the service availability,
In, the role of the standby node server is standby node role.
Switching module 403, for determining that this is standby according to the first change detection score value and the second change detection score value
It is master node roles by the role switching of the standby node server when meeting role switching condition with node server.
Sending module 404, for sending role switching instruction to the host node server.
It is spare that role switching instruction, which is used to indicate the host node server for the role switching of the host node server,
Node role.
Optionally, which includes: that the first change detection score value is less than the second change detection score value.
Optionally, which can be used for: receive the host node server is sent every detection cycle first
Change detection score value;The role switching condition includes:
Difference at the time of current time and the last time receive the first change detection score value is greater than the detection cycle.
Optionally, network interface card is installed in the standby node server, which has the address EIP and the address VIP, and
The address EIP loaded in the address EIP and the network interface card of host node server is identical, the net of the address VIP and host node server
The address VIP loaded in card is identical;The switching module 404 can be used for: activation network interface card.
Optionally, which can be used for:
Obtain the first initial value;
Role's score value of the standby node server is determined according to the role of the standby node server;
The service score value of the standby node server is determined according to the service availability of the standby node server;
The sum of first initial value, role's score value and the service score value are determined as the second change detection score value.
In conclusion a kind of switching device of main-standby nodes of the embodiment of the present invention, the switching device can be cut according to second
Change the first change detection score value that detection score value and host node server are sent, it is determined whether meet role switching condition.In
It determines when meeting role switching condition, can be master node roles by the role switching of standby node server, and to host node
Server sends role switching instruction.Since the switching device is when determination meets role switching condition, role can be switched, and
Role switching instruction is sent to host node server, so that host node server switches role, there is no need to detection node is arranged
Server is to realize the switching of the role of host node server and standby node server, so as to be realized with a low cost main section
The role switching of point server and standby node server.Also, it due to no setting is required detection node server, can keep away
Exempt from the waste of resource.
Fig. 9 is a kind of structural schematic diagram of the switching device of main-standby nodes provided in an embodiment of the present invention.The switching device
It can be set in main-standby nodes server or the switching device can be the host node server.Referring to Fig. 9, the device
May include:
Sending module 501, for sending the first change detection score value to standby node server.
The first change detection score value is determined according to the role of the host node server and service availability, wherein
The role of the host node server is master node roles, which includes that service can be used or service unavailable.
Receiving module 502, for receiving the role switching instruction of standby node server transmission.
Role switching instruction is that the standby node server is examined according to the first change detection score value and the second switching
Score value is surveyed, detects that the standby node server meets and is sent when role switching condition, wherein the second change detection score value
It is that the standby node server is determined according to the role of the standby node server and the service availability, wherein this is spare
The role of node server is standby node role.
The role switching of the host node server is spare for instructing in response to the role switching by switching module 503
Node role.
In conclusion the switching device can receive the embodiment of the invention provides a kind of switching device of main-standby nodes
The role switching instruction that standby node server is sent can be by host node server after receiving role switching instruction
Role switching be standby node role.Therefore without setting detection node server to realize host node server and spare section
The switching of the role of point server, so as to the role to be realized with a low cost host node server and standby node server
Switching.Also, it, can be to avoid the waste of resource due to no setting is required detection node server.
Optionally, which is equipped with network interface card, which has the address EIP and the address VIP, and should
The address EIP loaded in the address EIP and the network interface card of standby node server is identical, the address VIP and standby node server
The address VIP loaded in network interface card is identical;The switching module 503 is used for: closing network interface card.
Figure 10 is the switching device of another main-standby nodes provided in an embodiment of the present invention.Referring to Figure 10, which may be used also
To include:
Module 504 is obtained, for obtaining the second initial value;
First determining module 505, for determining the role of the host node server according to the role of the host node server
Score value;
Second determining module 506, for determining the host node server according to the service availability of the host node server
Service score value;
Third determining module 507, for determining the sum of second initial value, role's score value and the service score value
For the first change detection score value.
Optionally, which is used for:
Detect the service availability of the host node server;
When the service for detecting the host node server is available, determined according to the service availability of the host node server
The service score value of the host node server;
When the service for detecting the host node server is unavailable, the host node server is restarted, after restarting
The service availability of host node server determines the service score value of the host node server.
Optionally, which is used for:
The first change detection score value is sent to the standby node server every detection cycle.
In conclusion the switching device can receive the embodiment of the invention provides a kind of switching device of main-standby nodes
The role switching instruction that standby node server is sent can be by host node server after receiving role switching instruction
Role switching be standby node role.Therefore without setting detection node server to realize host node server and spare section
The switching of the role of point server, so as to the role to be realized with a low cost host node server and standby node server
Switching.Also, it, can be to avoid the waste of resource due to no setting is required detection node server.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description
It with the specific work process of each module, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
Figure 11 is a kind of structural schematic diagram of node server provided in an embodiment of the present invention.Referring to Figure 11, node clothes
Business device 110 may include: processor 1101, memory 1102 and be stored on the memory and can run on the processor
Computer program, the switching method of the main-standby nodes as being somebody's turn to do in terms of above-mentioned is realized when which executes the computer program.
The embodiment of the invention also provides a kind of computer readable storage medium, stored in the computer readable storage medium
There is instruction, when the computer readable storage medium is run on computers, so that computer executes the above method such as and implements
The switching method for the main-standby nodes that example provides.Optionally, which can be read-only memory, disk or CD etc..
The embodiment of the invention also provides a kind of switching systems of main-standby nodes.Referring to Fig. 1, which may include: more
A node server 110.There are a host node server and at least one slave node services in multiple node server
Device.Wherein, which may include such as the main-standby nodes provided by the above embodiment applied to host node server
Switching device, such as Fig. 9 or device shown in Fig. 10.Each standby node server includes answering as provided by the above embodiment
The switching device of main-standby nodes for standby node server, such as device shown in Fig. 8.
Optionally, each node server can be VPN node server.
If the computer of computer and private clound in public cloud is by the switching system interaction data, private referring to Figure 12
There is the computer in cloud 20 that can establish with a switching system to communicate to connect, the computer in public cloud 30 can be with another
Switching system establishes communication connection.It may include two node servers in each switching system, one of them is host node clothes
Business device, another is standby node server.Since the node server in the switching system is in switching, corresponding node clothes
Business device can activate network interface card or close network interface card, that is, can ensure that the forwarding of data.Wherein, VIP may be implemented when activating network interface card
The unbundlings of the address VIP and the address EIP can be realized when closing network interface card for the binding of location and the address EIP.Therefore, privately owned
For node server in cloud when carrying out the switching of main-standby nodes, it is not necessary to modify the routing tables in router, that is, can ensure that data
Forwarding.
The foregoing is merely the exemplary embodiments of the application, all in spirit herein not to limit the application
Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.
Claims (11)
1. a kind of switching method of main-standby nodes, which is characterized in that be applied to standby node server;The described method includes:
The first change detection score value that host node server is sent is received, the first change detection score value is according to the main section
What the role of point server and service availability determined, wherein the role of the host node server is master node roles, described
Service availability includes that service can be used or service unavailable;
Determine that the second change detection score value of the standby node server, the second change detection score value are according to described standby
It is determined with the role of node server and the service availability, wherein the role of the standby node server is spare
Node role;
If determining that the standby node server is full according to the first change detection score value and the second change detection score value
The role switching of the standby node server is master node roles by sufficient role switching condition;
Role switching instruction is sent to the host node server, the role switching instruction is used to indicate the host node service
The role switching of the host node server is standby node role by device.
2. the method according to claim 1, wherein the role switching condition includes:
The first change detection score value is less than the second change detection score value.
3. the method according to claim 1, wherein the first switching inspection for receiving host node server and sending
Survey score value, comprising:
Receive the first change detection score value that the host node server is sent every detection cycle;
The role switching condition includes:
Difference at the time of current time and the last time receive the first change detection score value is greater than the detection cycle.
4. described the method according to claim 1, wherein be equipped with network interface card in the standby node server
The net card loading address flexible Internet protocol EIP and the address virtual IP VIP, and the address EIP with it is described
The address EIP loaded in the network interface card of host node server is identical, adds in the network interface card of the address VIP and the host node server
The address VIP of load is identical;The role switching by the standby node server is master node roles, comprising:
Activate the network interface card.
5. method according to any one of claims 1 to 4, which is characterized in that the determination standby node server
Second change detection score value, comprising:
Obtain the first initial value;
Role's score value of the standby node server is determined according to the role of the standby node server;
The service score value of the standby node server is determined according to the service availability of the standby node server;
The sum of first initial value, role's score value and described service score value are determined as the second change detection point
Value.
6. a kind of switching method of main-standby nodes, which is characterized in that be applied to host node server, which comprises
The first change detection score value is sent to standby node server, the first change detection score value is the host node service
Device is determined according to the role of the host node server and service availability, wherein the role of the host node server is
Master node roles, the service availability include that service can be used or service unavailable;
The role switching instruction that the standby node server is sent is received, the role switching instruction is the standby node clothes
Business device is detecting that the standby node server meets according to the first change detection score value and the second change detection score value
It is sent when role switching condition, wherein the second change detection score value is the standby node server according to described standby
It is determined with the role of node server and the service availability, the role of the standby node server is standby node angle
Color;
It is instructed in response to the role switching, is standby node role by the role switching of the host node server.
7. according to the method described in claim 6, it is characterized in that, the host node server is equipped with network interface card, the network interface card
The EIP for being loaded with the address EIP and the address VIP, and being loaded in the network interface card of the address EIP and the standby node server
Location is identical, and the address VIP loaded in the address VIP and the network interface card of the standby node server is identical;It is described by the master
The role switching of node server is standby node role, comprising:
Close the network interface card.
8. according to the method described in claim 6, it is characterized in that, sending the first switching inspection to standby node server described
It surveys before score value, the method also includes:
Obtain the second initial value;
Role's score value of the host node server is determined according to the role of the host node server;
The service score value of the host node server is determined according to the service availability of the host node server;
The sum of second initial value, role's score value and described service score value are determined as the first change detection point
Value.
9. according to the method described in claim 8, it is characterized in that, the service availability according to the host node server
Determine the service score value of the host node server, comprising:
Detect the service availability of the host node server;
When the service for detecting the host node server is available, determined according to the service availability of the host node server
The service score value of the host node server;
When the service for detecting the host node server is unavailable, the host node server is restarted, after restarting
The service availability of the host node server determines the service score value of the host node server.
10. according to any method of claim 6 to 9, which is characterized in that described to send first to standby node server
Change detection score value, comprising:
The first change detection score value is sent to the standby node server every detection cycle.
11. a kind of node server, which is characterized in that the node server includes: processor, memory and is stored in institute
The computer program that can be run on memory and on the processor is stated, the processor executes real when the computer program
Existing main/standby switching method as claimed in claim 1 to 5, or realize as described in claim 6 to 10 is any active and standby are cut
Change method.
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 true CN110417599A (en) | 2019-11-05 |
CN110417599B 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) |
Cited By (1)
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 (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102006189A (en) * | 2010-11-25 | 2011-04-06 | 中兴通讯股份有限公司 | Primary access server determination method and device for dual-machine redundancy backup |
CN104679604A (en) * | 2015-02-12 | 2015-06-03 | 大唐移动通信设备有限公司 | Method and device for switching between master node and standby node |
US20160197853A1 (en) * | 2015-01-05 | 2016-07-07 | Brocade Communications Systems, Inc. | Distributed bidirectional forwarding detection protocol (d-bfd) for cluster of interconnected switches |
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 |
CN109344014A (en) * | 2018-09-26 | 2019-02-15 | 新华三大数据技术有限公司 | A kind of main/standby switching method, device and communication equipment |
-
2019
- 2019-08-01 CN CN201910707395.1A patent/CN110417599B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102006189A (en) * | 2010-11-25 | 2011-04-06 | 中兴通讯股份有限公司 | Primary access server determination method and device for dual-machine redundancy backup |
US20160197853A1 (en) * | 2015-01-05 | 2016-07-07 | Brocade Communications Systems, Inc. | Distributed bidirectional forwarding detection protocol (d-bfd) for cluster of interconnected switches |
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 |
CN109344014A (en) * | 2018-09-26 | 2019-02-15 | 新华三大数据技术有限公司 | A kind of main/standby switching method, device and communication equipment |
Cited By (1)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN110417599B (en) | 2022-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108475251B (en) | Virtual network, hot swapping, hot scaling and disaster recovery for containers | |
CN107547654B (en) | Distributed object storage cluster, deployment and service method and system | |
US8266473B2 (en) | Disaster recovery architecture | |
CN109802985B (en) | Data transmission method, device, equipment and readable storage medium | |
TWI736657B (en) | Method and device for switching virtual internet protocol address | |
CN104935672B (en) | Load balancing service high availability implementation method and equipment | |
EP2232828B1 (en) | Failover in a host concurrently supporting multiple virtual ip addresses across multiple adapters | |
JP4805912B2 (en) | Anomaly management method for multi-agent systems | |
CN108234191A (en) | The management method and device of cloud computing platform | |
EP3210367B1 (en) | System and method for disaster recovery of cloud applications | |
US20080232356A1 (en) | Internet protocol compliant private branch electronic exchange and a method for redundantly configuring terminal interfaces | |
JP2004519024A (en) | System and method for managing a cluster containing multiple nodes | |
US9582386B2 (en) | System and method for maintaining a copy of a cloud-based computing environment and restoration thereof | |
CN113242299A (en) | Disaster recovery system, method, computer device and medium for multiple data centers | |
EP3257231B1 (en) | Distributed gateways | |
CN110417599A (en) | The switching method and node server of main-standby nodes | |
CN112887330A (en) | Structure and method for realizing network ACL isolation floating IP | |
CN115567383A (en) | Network configuration method, host server, device, and storage medium | |
US20230146880A1 (en) | Management system and management method | |
CN114153655A (en) | Disaster tolerance system creating method, disaster tolerance method, device, equipment and medium | |
WO2020032169A1 (en) | Failure recovery control method, communication device, communication system, and program | |
CN115865608B (en) | Network management method, system, electronic equipment and computer storage medium | |
US9019964B2 (en) | Methods and systems for routing application traffic | |
US20240073140A1 (en) | Facilitating elasticity of a network device | |
JP5307223B2 (en) | Disaster recovery architecture |
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 |