CN111934909A - Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium - Google Patents

Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium Download PDF

Info

Publication number
CN111934909A
CN111934909A CN202010670026.2A CN202010670026A CN111934909A CN 111934909 A CN111934909 A CN 111934909A CN 202010670026 A CN202010670026 A CN 202010670026A CN 111934909 A CN111934909 A CN 111934909A
Authority
CN
China
Prior art keywords
host
public
standby machine
machine
heartbeat information
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
Application number
CN202010670026.2A
Other languages
Chinese (zh)
Other versions
CN111934909B (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.)
Shenzhen Grid Information Technology Co ltd
Original Assignee
Shenzhen Grid Information 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 Shenzhen Grid Information Technology Co ltd filed Critical Shenzhen Grid Information Technology Co ltd
Priority to CN202010670026.2A priority Critical patent/CN111934909B/en
Publication of CN111934909A publication Critical patent/CN111934909A/en
Application granted granted Critical
Publication of CN111934909B publication Critical patent/CN111934909B/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/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method and a device for switching IP resources of a main machine and a standby machine, computer equipment and a storage medium. The method is applied to a standby machine; the method comprises the following steps: detecting the running state of software in the standby machine, and sending heartbeat information of the standby machine to a host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine; receiving heartbeat information of the host returned by the host in response to the heartbeat information of the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer; detecting a public IP; and when the heartbeat communication ratio with the host is 100% in a preset time period, the public IP is detected not to be in the standby machine, and the running state of software in the host is abnormal, the public IP is switched to the standby machine. By adopting the method, the IP resources of the main machine and the standby machine can be switched in time.

Description

Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for switching IP resources of a host and a standby, a computer device, and a storage medium.
Background
With the development of computer technology, it is often necessary to operate a server for a long time in many cases, however, when a server fails for some reason, problems such as interruption of service operation, data loss, etc. are easily caused, and it is difficult to ensure normal service. Therefore, it is necessary to provide a host and a standby machine, during the operation of one server (host), the other server (standby) is in a standby state, the host and the standby machine share the same common IP, and when the host fails, the IP resource of the host can be switched to the standby machine, and the standby machine continues to provide services.
In the conventional method, a standby machine generally sends information to a host machine, and then the running state of the host machine is determined according to whether the response of the host machine can be received, so as to judge whether to switch the IP resources. However, only considering the response condition of the host, comparing the two sides, the operating state of the host cannot be accurately determined, and thus the IP resource switching of the host and the standby cannot be performed in time.
Disclosure of Invention
Therefore, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for switching IP resources of a host and a standby in time in order to solve the above technical problems.
A method for switching IP resources of a main machine and a standby machine is applied to the standby machine; the method comprises the following steps:
detecting the running state of software in the standby machine, and sending heartbeat information of the standby machine to a host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
receiving heartbeat information of the host returned by the host in response to the heartbeat information of the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
detecting a public IP;
when the heartbeat communication ratio with the host is 100% in a preset time period, a public IP is detected not to be in the standby machine, and the running state of software in the host is abnormal, the public IP is switched to the standby machine; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
In one embodiment, the method further comprises:
and when the heartbeat communication ratio with the host is 100% in a preset time period and the public IP is detected to be in the standby machine and the running state of software in the host is normal, removing the public IP from the standby machine.
In one embodiment, the heartbeat information of the standby machine further includes a first public IP resource status; the first public IP resource state is used for representing whether a public IP is in the standby machine or not;
after removing the public IP from the standby, the method further comprises:
generating heartbeat information of the standby machine and feeding back the heartbeat information to the host machine; the first public IP resource state in the fed back heartbeat information of the standby machine represents that the public IP is not on the standby machine; and the first public IP resource state is used for indicating the host to switch the public IP to the host when detecting that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period.
In one embodiment, the method further comprises:
when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold value and the access loss rate of the public IP is detected to be greater than or equal to a preset access loss rate threshold value, switching the public IP to the standby machine;
the heartbeat packet loss rate is a ratio of the number of times that the heartbeat information of the host is not received within a preset time period to the number of times that the heartbeat information of the standby machine should be received and returned by the heartbeat information of the host according to a preset time interval.
In one embodiment, the method further comprises:
when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold value and the access loss rate of the public IP is detected to be less than a preset access loss rate threshold value, continuing to detect the public IP until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold value, and switching the public IP to the standby machine.
A method for switching IP resources of a main host and a standby host is applied to the host; the method comprises the following steps:
receiving heartbeat information of the standby machine, which is sent by the standby machine according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
responding to the heartbeat information of the standby machine, detecting the running state of software in the host machine, and sending the heartbeat information of the host machine to the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
detecting a public IP;
and when the running state of the software in the host is abnormal within a preset time period and the public IP is detected in the host, removing the public IP from the host.
In one embodiment, the method further comprises:
and when the running state of the software in the host is normal within a preset time period, the public IP is detected not to be in the host, and the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value, switching the public IP to the host.
In one embodiment, the heartbeat information of the host further includes a second public IP resource status; the second public IP resource status is used to characterize whether a public IP is on the host;
the method further comprises the following steps:
when the public IP is detected not to be in the host within a preset time period and the access loss rate of the public IP is smaller than a preset access loss rate threshold value, generating heartbeat information of the host and feeding the heartbeat information back to the standby machine; the second public IP resource state in the fed back heartbeat information of the host represents that a public IP is not in the host; the second public IP resource state is used for indicating the standby machine to remove the public IP from the standby machine when detecting that the public IP is in the standby machine;
and continuing to detect the public IP until the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period, and switching the public IP to the host.
A master/standby machine IP resource switching device is arranged in a standby machine; the device comprises:
the first sending module is used for detecting the running state of software in the standby machine and sending heartbeat information of the standby machine to the host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
the first receiving module is used for receiving the heartbeat information of the host computer returned by the host computer in response to the heartbeat information of the standby computer; the heartbeat information of the host computer comprises the running state of software in the host computer;
the first detection module is used for detecting the public IP;
the first switching module is used for switching the public IP to the standby machine when the heartbeat communication ratio of the host machine to the host machine is 100% in a preset time period, the public IP is detected not to be in the standby machine, and the running state of software in the host machine is abnormal; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
A master-slave machine IP resource switching device is arranged in a master machine; the device comprises:
the second receiving module is used for receiving heartbeat information of the standby machine, which is sent by the standby machine according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
the second sending module is used for responding to the heartbeat information of the standby machine, detecting the running state of software in the host machine and sending the heartbeat information of the host machine to the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
the second detection module is used for detecting the public IP;
the second switching module is used for removing the public IP from the host when the running state of the software in the host is abnormal and the public IP is detected in the host within a preset time period.
A computer device includes a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps in the method for switching IP resources of a host and a standby according to the embodiments of the present application.
A computer-readable storage medium, having a computer program stored thereon, where the computer program, when executed by a processor, causes the processor to execute the steps in the IP resource switching method of a host and a standby computer according to the embodiments of the present application.
According to the method, the device, the computer equipment and the storage medium for switching the IP resources of the main machine and the standby machine, the standby machine detects the running state of software in the standby machine, sends heartbeat information of the standby machine containing the running state of the software in the standby machine to the main machine according to the preset time interval, receives the heartbeat information of the running state main machine containing the software in the main machine, which is returned by the main machine in response to the heartbeat information of the standby machine, and switches the public IP to the standby machine when the communication ratio of the heartbeat information of the main machine to the heartbeat information of the main machine is 100% in the preset time period, the public IP is detected not to be in the standby machine, and the running state of the software in the main machine is abnormal. The heartbeat information of the host machine comprises the running state of the software in the host machine, so that the running state of the host machine can be determined according to whether the heartbeat information can be received, the running state of the host machine can be more accurately determined according to the running state of the software in the host machine, the public IP can be detected, and the IP resources of the host machine and the standby machine can be switched in time according to the running state of the software in the host machine and the state of the public IP. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time.
Drawings
FIG. 1 is a diagram of an application environment of a method for switching IP resources of a host and a standby machine in an embodiment;
FIG. 2 is a flowchart illustrating a method for switching IP resources of a host and a standby device according to an embodiment;
FIG. 3 is a schematic diagram illustrating an overall process of the standby machine executing the IP resource switching method of the host and the standby machine in one embodiment;
FIG. 4 is a flowchart illustrating a method for switching IP resources of a host and a standby device according to an embodiment;
FIG. 5 is a flowchart illustrating an overall process of the host executing the method for switching the IP resources of the host and the standby;
FIG. 6 is a diagram illustrating interaction between host and standby machines in one embodiment;
FIG. 7 is a block diagram illustrating an embodiment of a device for switching IP resources of a host/standby device;
FIG. 8 is a block diagram illustrating an embodiment of a device for switching IP resources of a host/standby device;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for switching the IP resources of the host and the standby machine can be applied to the application environment shown in figure 1. The standby machine 102 and the host 104 communicate with each other by sending heartbeat information through a network. Both the standby machine 102 and the host machine 104 can be servers. When the host fails, the IP resource of the host can be switched to the standby machine, and the standby machine continues to provide service.
In an embodiment, as shown in fig. 2, a method for switching IP resources of a primary/secondary device is provided, which is described by taking the method applied to the secondary device in fig. 1 as an example, and includes the following steps:
s202, detecting the running state of software in the standby machine, and sending heartbeat information of the standby machine to the host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine.
The heartbeat information (i.e., heartbeat packet) is used between the host and the standby to send the state of the host to the standby at regular time. The heartbeat information is sent according to a preset time interval. The running state of the software in the standby machine is the preset running state of the software in the standby machine, which needs to be monitored. The running state of the software is the running process of the software.
In one embodiment, the user can preset at least one software which needs to monitor the running state in the standby machine. It can be understood that the preset software which needs to monitor the running state in the standby machine is all or part of the software in the standby machine.
In one embodiment, the running state of the software in the standby machine can comprise normal and abnormal.
Specifically, the standby machine detects the running state of software needing to monitor the running state in the preset standby machine, and sends heartbeat information of the standby machine to the host machine at regular time according to a preset time interval. The heartbeat information of the standby machine comprises the detected running state of software needing to monitor the running state in the preset standby machine.
S204, receiving the heartbeat information of the host returned by the host in response to the heartbeat information of the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer.
The running state of the software in the host is the running state of the software which needs to be monitored in the preset host.
In one embodiment, a user may preset at least one software in the host that needs to monitor the operating state. It can be understood that the software that needs to monitor the operation state in the preset host computer is all or part of the software in the host computer.
In one embodiment, the operating state of the software in the host may include normal and abnormal.
Specifically, after receiving the heartbeat information of the standby machine sent by the standby machine, the host responds to the heartbeat information of the standby machine, detects the running state of software in the host, and feeds back the heartbeat information of the host to the standby machine. The heartbeat information of the host computer comprises the detected running state of software needing to monitor the running state in the preset host computer. And the standby machine receives the heartbeat information of the host machine returned by the host machine in response to the heartbeat information of the standby machine.
S206, detecting the public IP.
In one embodiment, detecting the public IP may include reading an IP local to the standby machine to determine whether the public IP is on the standby machine, detecting whether the public IP is accessible (i.e., whether the public IP is online), and so on.
In one embodiment, the standby may remain snooping the public IP at all times.
S208, when the heartbeat communication ratio with the host is 100% in a preset time period, the public IP is not in the standby machine and the running state of software in the host is abnormal, the public IP is switched to the standby machine; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
The preset time period is a preset time period for judging whether to switch the IP resources, namely, in the preset time period, if the condition of switching the IP resources is met, the IP resources are switched; if the condition for switching the IP resources is not met, the IP resources are not switched, timing is repeated, whether the condition for switching the IP resources is met in the preset time period is judged, and the like.
In one embodiment, the preset time period may be set according to requirements, for example, the preset time period may be set to 5 seconds or 4 seconds.
Specifically, when the following three conditions are simultaneously satisfied within the preset time period: 1. the heartbeat communication ratio with the host is 100 percent, namely, the standby machine sends heartbeat information of the standby machine to the host according to a preset time interval in a preset time period, and the heartbeat information of the host returned by the host can be received each time; 2. the standby machine detects that the public IP is not in the standby machine as a result detected by the public IP; 3. the running state of the software in the host machine contained in the heartbeat information of the host machine received by the standby machine is abnormal, and the standby machine switches the public IP to the standby machine (namely, the standby machine is connected with the public IP).
As shown in fig. 3, a schematic overall flow chart of the method for executing IP resource switching between the host and the standby machines is shown. The method in this embodiment corresponds to fig. 3 where the heartbeat communication ratio between the standby machine and the host is 100% in a preset time period, and detects the public IP, and when it is detected that the public IP is not in the standby machine and the running state of software in the host is abnormal, switches the public IP to the standby machine, which is a flow path.
In one embodiment, when the heartbeat communication ratio of the standby machine to the host machine is 100% in a preset time period and the public IP is not detected in the standby machine and the running state of the software in the host machine is normal, the standby machine does not switch the public IP until the running state of the software in the host machine included in the received heartbeat information of the host machine is abnormal, the public IP is switched to the standby machine.
The method for switching the IP resources of the main machine and the standby machine comprises the steps of detecting the running state of software in the standby machine, sending heartbeat information of the standby machine containing the running state of the software in the standby machine to the host machine according to a preset time interval, receiving heartbeat information of the host machine containing the running state of the software in the host machine returned by the host machine in response to the heartbeat information of the standby machine, and switching the public IP to the standby machine when the communication ratio of the heartbeat information of the host machine to the heartbeat information of the host machine is 100% in a preset time period, the public IP is detected not to be in the standby machine, and the running state of the software in the host machine is abnormal. The heartbeat information of the host machine comprises the running state of the software in the host machine, so that the running state of the host machine can be determined according to whether the heartbeat information can be received, the running state of the host machine can be more accurately determined according to the running state of the software in the host machine, the public IP can be detected, IP resources of the main machine and the standby machine can be switched in time according to the running state of the software in the host machine and the state of the public IP, and the accuracy of switching the IP resources of the main machine and the standby machine is improved. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time. In addition, the public IP is switched in time according to the software running state in the heartbeat information, so that the data loss in the switching process caused by too slow public IP switching can be avoided, and the integrity of the data is ensured.
In one embodiment, the method further comprises the steps of: and when the heartbeat communication ratio with the host machine in a preset time period is 100%, the public IP is detected to be in the standby machine, and the running state of the software in the host machine is normal, removing the public IP from the standby machine.
Specifically, the standby device can detect the public IP, and when the following 3 conditions are simultaneously satisfied within a preset time period: 1. the heartbeat communication ratio of the standby machine and the host machine is 100 percent, namely, the standby machine sends heartbeat information of the standby machine to the host machine according to a preset time interval in a preset time period, and the heartbeat information of the host machine returned by the host machine can be received each time; 2. the standby machine detects that the public IP is in the standby machine; 3. when the running state of the software in the host machine contained in the heartbeat information of the host machine received by the standby machine is normal, based on the principle of preferentially ensuring the normal service of the host machine, the public IP is removed from the standby machine (namely, the standby machine is disconnected from the public IP), so that the host machine can be normally connected with the public IP, and the phenomenon that the public IP is connected by a plurality of servers simultaneously to cause public IP connection conflict is avoided.
The method in this embodiment corresponds to fig. 3, in which the heartbeat communication ratio between the standby machine and the host is 100% in a preset time period, the public IP is detected, and when the public IP is detected to be in the standby machine and the running state of software in the host is normal, the public IP is removed from the standby machine, which is a flow path.
In one embodiment, when the standby machine has a heartbeat communication ratio of 100% with the host machine within a preset time period and detects that the public IP is in the standby machine and the running state of the software in the host machine is abnormal, the public IP is not removed from the standby machine until the running state of the software in the host machine contained in the received heartbeat information of the host machine is normal, the public IP is removed from the standby machine.
In this embodiment, when the standby device has a heartbeat communication ratio of 100% with the host device within a preset time period and detects that the public IP is in the standby device and the running state of the software in the host device is normal, the public IP is removed from the standby device, and the host device is preferentially guaranteed to perform service under the condition that the software state in the host device is normal, so that the host device can normally connect the public IP, and public IP connection conflicts caused by simultaneous connection of a plurality of servers to the public IP are avoided. In addition, the IP resources of the host and the standby machine can be switched in time according to the running state of the software in the host and the detected public IP state. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time.
In one embodiment, the heartbeat information of the standby machine further includes a first public IP resource status. The first public IP resource state is used to characterize whether the public IP is on standby. After the step of removing the public IP from the standby, the method further comprises the steps of: generating heartbeat information of the standby machine and feeding back the heartbeat information to the host machine; the first public IP resource state in the fed back heartbeat information of the standby machine represents that the public IP is not on the standby machine; and the first public IP resource state is used for indicating the host to switch the public IP to the host when detecting that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period.
Wherein, the access loss rate is the ratio of the number of times of not accessing the public IP in a preset time period to the total number of times of trying to access the public IP. It is understood that the total number of attempts to access the public IP includes the number of times that the public IP is not accessed and the number of times that the public IP is accessed. The preset access loss rate threshold is a preset threshold condition for judging that the public IP is not online (namely, the public IP is not connected with the host and the standby machine) when the access loss rate is greater than or equal to the threshold.
In one embodiment, the first public IP resource state may include a public IP standby and a public IP off standby.
Specifically, the standby machine may send heartbeat information to the host at regular time intervals, and after the public IP is removed from the standby machine, the first public IP resource state in the heartbeat information generated and sent by the standby machine to the host indicates that the public IP is not on the standby machine. The host may switch the public IP to the host (i.e., the host is connected to the public IP) when detecting that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold (i.e., it is determined that the public IP is not online) within a preset time period after receiving heartbeat information sent by the standby machine and including a first public IP resource state representing that the public IP is not on the standby machine.
In this embodiment, the heartbeat information of the standby machine further includes a first public IP resource state used for representing whether the public IP is in the standby machine, so that after the public IP is removed from the standby machine, the standby machine can feed back to the host that the public IP is not in the standby machine through the heartbeat information, and the host can switch the public IP to the host in time according to the heartbeat information fed back by the standby machine. In addition, the host detects the public IP and can further confirm that the public IP is not on line, so that the problem that a plurality of servers are connected with the public IP at the same time to cause public IP connection conflict is avoided. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time.
In one embodiment, the method further comprises the steps of: and when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold and the access loss rate of the public IP is detected to be greater than or equal to a preset access loss rate threshold, switching the public IP to the standby machine.
The heartbeat packet loss rate is a ratio of the number of times that the heartbeat information of the host is not received in a preset time period to the number of times that the heartbeat information of the standby machine should be received and returned by the host according to a preset time interval.
Specifically, after the standby machine sends the heartbeat information of the standby machine to the host machine, when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold, it indicates that the host machine may have a problem, and when the standby machine detects that the access loss rate of the public IP is greater than or equal to the preset access loss rate threshold in the preset time period, the public IP is switched to the standby machine (that is, the standby machine is connected with the public IP).
The method in this embodiment corresponds to fig. 3, when the heartbeat packet loss rate of the standby machine in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold, and the access loss rate of the public IP is detected to be greater than or equal to the preset access loss rate threshold (that is, the public IP is not online) by detecting the public IP, the public IP is switched to the standby machine, which is a flow path.
In this embodiment, when the heartbeat packet loss rate of the standby machine in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold, the standby machine can timely determine that the host may have a problem, and because the standby machine cannot receive heartbeat information, the running state of software in the host and whether the IP is in the host cannot be determined, so that the standby machine can determine whether to switch the public IP by detecting the public IP, and when the standby machine detects that the public IP is not online, the public IP can be timely switched to the standby machine. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time.
In one embodiment, the method further comprises the steps of: when the heartbeat packet loss rate in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold value and the access loss rate of the public IP is detected to be less than the preset access loss rate threshold value, the public IP is continuously detected until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold value, and the public IP is switched to the standby machine.
Specifically, after the standby machine sends heartbeat information of the standby machine to the host machine, when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold, it indicates that the host machine may have a problem, and when the standby machine detects that the access loss rate of the public IP is less than the preset access loss rate threshold (that is, the public IP is determined to be online) and the public IP is not in the standby machine in the preset time period, the public IP is continuously detected (the public IP is not switched) until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold (that is, the public IP is determined to be offline), and the public IP is switched to the standby machine.
It can be understood that when the heartbeat packet loss rate in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold, it indicates that the host may have a problem, but by detecting the public IP, it is detected that the public IP is online in the preset time period and the public IP is not on the standby machine, which indicates that the host is normally connected with the public IP, the host does not have a problem, and therefore, the standby machine does not switch the public IP, continues to detect the public IP, and switches the public IP to the standby machine until the public IP is not online in the preset time period.
It can be understood that the heartbeat packet loss rate in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold, but the public IP is detected to be online and the public IP is not in the standby machine, possibly because the standby machine cannot receive heartbeat information of the host because the host is provided with a firewall and the like.
The method in this embodiment corresponds to the flow path that the heartbeat packet loss rate of the standby machine in fig. 3 in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold, then the public IP is detected, and when the public IP is detected to be online and not in the standby machine, the public IP continues to be detected.
In one embodiment, when the heartbeat packet loss rate of the standby machine in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold, the public IP is detected, and when the access loss rate of the public IP is detected to be less than the preset access loss rate threshold (namely, the public IP is judged to be online) and the public IP is in the standby machine, the standby machine does not switch the public IP (namely, the standby machine is kept connected with the public IP).
In this embodiment, when the heartbeat packet loss rate of the standby machine in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold, the public IP is detected, when the public IP is detected to be online and the public IP is not in the standby machine, it is determined that the host has no problem, the public IP continues to be detected, and the public IP is switched to the standby machine until the public IP is not online in the preset time period. The public IP is switched on the one hand based on whether heartbeat information is received or not, but the state of the host is further confirmed by detecting the public IP, so that the public IP can be switched more accurately, and the false switching of the public IP is avoided.
In an embodiment, as shown in fig. 4, a method for switching IP resources of a primary host and a secondary host is provided, which is described by taking the method applied to the host in fig. 1 as an example, and includes the following steps:
s402, receiving heartbeat information of the standby machine, which is sent by the standby machine according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine.
Specifically, the standby machine detects the running state of software needing to monitor the running state in the preset standby machine, and sends heartbeat information of the standby machine to the host machine at regular time according to a preset time interval. The host receives the heartbeat information of the standby machine sent by the standby machine. The heartbeat information of the standby machine comprises the detected running state of software needing to monitor the running state in the preset standby machine.
S404, responding to the heartbeat information of the standby machine, detecting the running state of software in the host machine, and sending the heartbeat information of the host machine to the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer.
Specifically, the host computer responds to the heartbeat information of the standby computer, detects the running state of software in the host computer, and sends the heartbeat information of the host computer to the standby computer. The heartbeat information of the host computer comprises the detected running state of software needing to monitor the running state in the preset host computer.
It can be understood that what types of information are included in the heartbeat information of the standby machine received by the host computer, and the host computer feeds back the heartbeat information including the corresponding types of information to the standby machine in response to the heartbeat information of the standby machine.
S406, detecting the public IP.
In one embodiment, detecting the public IP may include reading an IP local to the host to determine whether the public IP is on the host, detecting whether the public IP is accessible (i.e., whether the public IP is online), and so on.
In one embodiment, the host may keep snooping the public IP at all times.
S408, when the running state of the software in the host is abnormal in the preset time period and the public IP is detected in the host, removing the public IP from the host.
Specifically, when the host detects that the running state of the software in the host is abnormal within a preset time period and detects that the public IP is in the host, the public IP is removed from the host (i.e., the host disconnects the public IP).
In one embodiment, the heartbeat information of the host further includes a second public IP resource status. The second public IP resource status is used to characterize whether the public IP is hosted. And when the host detects that the running state of the software in the host is abnormal within a preset time period, removing the public IP from the host, and sending a second public IP resource state representing that the public IP is not in the host to the standby machine through heartbeat information. And the standby machine determines that the running state of the software in the host is abnormal and the public IP is not in the host according to the received heartbeat information of the host, detects the public IP, and switches the public IP to the standby machine (namely, the standby machine is connected with the public IP) when detecting that the access loss rate of the public IP in a preset time period is greater than or equal to a preset access loss rate threshold value and the public IP is not in the standby machine.
Fig. 5 is a schematic overall flow chart of the method for the host to perform the IP resource switching between the host and the standby. The method in this embodiment corresponds to a flow path in which, when the running state of software in the host in fig. 5 is abnormal, the host removes the public IP from the host.
In the method for switching the IP resources of the main machine and the standby machine, the main machine receives heartbeat information of the standby machine, responds to the heartbeat information of the standby machine, detects the running state of software in the main machine, and sends the heartbeat information of the main machine containing the running state of the software in the main machine to the standby machine. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the IP resources of the host and the standby machines can be further guaranteed to be switched in time.
In one embodiment, the method further comprises the steps of: and when the running state of the software in the host is normal within a preset time period, the public IP is detected not to be in the host, and the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value, switching the public IP to the host.
Specifically, when the following 3 conditions are simultaneously satisfied within a preset time period: 1. the host computer detects that the running state of software in the host computer is normal; 2. the host detects that the public IP is not in the host; 3. and the host detects that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold (namely, the public IP is judged to be offline), and the public IP is switched to the host (namely, the host is connected with the public IP).
The method in this embodiment corresponds to a flow path that the running state of software in the host in fig. 5 is normal, and when the host detects that the public IP is not online, the public IP is switched to the host.
In one embodiment, when the running state of the software in the host is normal and the host detects that the public IP is online and the public IP is at the host, the public IP is not switched (i.e., the host remains connected to the public IP).
In this embodiment, the host can switch the public IP to the host in time according to the running state of the software in the host and the state of the public IP.
In one embodiment, the heartbeat information of the host further includes a second public IP resource status. The second public IP resource status is used to characterize whether the public IP is hosted. The method also includes the steps of: when the public IP is detected not to be in the host within the preset time period and the access loss rate of the public IP is smaller than the preset access loss rate threshold value, generating heartbeat information of the host and feeding the heartbeat information back to the standby machine; the second public IP resource state in the feedback heartbeat information of the host represents that the public IP is not in the host; the second public IP resource state is used for indicating the standby machine to remove the public IP from the standby machine when the standby machine detects that the public IP is in the standby machine; and continuing to detect the public IP until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold value, and switching the public IP to the host.
In one embodiment, the second public IP resource state may include a public IP on-host and a public IP off-host.
Specifically, when the following three conditions are simultaneously satisfied within the preset time period: 1. the host computer detects that the running state of software in the host computer is normal; 2. the host detects that the public IP is not in the host; 3. when the host detects that the access loss rate of the public IP is smaller than a preset access loss rate threshold (namely, the public IP is judged to be online), the second public IP resource state in the heartbeat information fed back to the host of the standby machine represents that the public IP is not in the host. The standby machine receives the heartbeat information of the host machine sent by the host machine, and determines that the running state of software in the host machine is normal and the public IP is not in the host machine according to the heartbeat information of the host machine, then the public IP is continuously detected, and when the standby machine detects that the public IP is in the standby machine, the public IP is removed from the standby machine (namely, the standby machine is disconnected from the public IP). The host continues to detect the public IP until the access loss rate of the public IP is detected to be smaller than a preset access loss rate threshold (namely, the public IP is judged to be offline, and the public IP is removed by the standby machine), and the public IP is switched to the host (namely, the host is connected with the public IP).
In this embodiment, when the host detects that the public IP is not in the host and the public IP is online, heartbeat information including a second public IP resource state representing that the public IP is not in the host is generated and fed back to the standby machine, so that the standby machine removes the public IP from the standby machine in time according to the second public IP resource state in the heartbeat information of the host and the state of software in the host. The host machine can switch the public IP to the host machine in time when detecting that the public IP is not on line through public IP detection.
Fig. 6 is a schematic diagram of interaction between a host and a standby machine according to embodiments of the present application, in which the host and the standby machine send heartbeat information to each other, and the host and the standby machine can detect a public IP by sending a software state (i.e., an operating state of software in the host and the standby machine) through the heartbeat information.
It should be understood that although the steps in the flowcharts of fig. 2 and 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 7, a device 700 for switching IP resources of a host/standby device is provided, and the device is disposed in the standby device. The device includes: a first sending module 702, a first receiving module 704, a first detecting module 706 and a first switching module 708, wherein:
a first sending module 702, configured to detect an operating state of software in the standby device, and send heartbeat information of the standby device to the host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine.
A first receiving module 704, configured to receive the heartbeat information of the host returned by the host in response to the heartbeat information of the standby device; the heartbeat information of the host computer comprises the running state of software in the host computer.
The first detecting module 706 is configured to detect a public IP.
A first switching module 708, configured to switch the public IP to the standby machine when the heartbeat communication ratio with the host is 100% in a preset time period, and it is detected that the public IP is not in the standby machine and the running state of software in the host is abnormal; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
In one embodiment, the first switching module 708 is further configured to remove the public IP from the standby machine when the heartbeat communication ratio with the host machine is 100% within a preset time period and the public IP is detected to be in the standby machine and the running state of the software in the host machine is normal.
In one embodiment, the heartbeat information of the standby machine further includes a first public IP resource status. The first public IP resource state is used to characterize whether the public IP is on standby. The first sending module 702 is further configured to generate heartbeat information of the standby device and feed the heartbeat information back to the host; the first public IP resource state in the fed back heartbeat information of the standby machine represents that the public IP is not on the standby machine; and the first public IP resource state is used for indicating the host to switch the public IP to the host when detecting that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period.
In an embodiment, the first switching module 708 is further configured to switch the public IP to the standby device when the heartbeat packet loss rate in the preset time period is greater than or equal to a preset heartbeat packet loss rate threshold and it is detected that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold. The heartbeat packet loss rate is a ratio of the number of times that the heartbeat information of the host is not received in a preset time period to the number of times that the heartbeat information of the standby machine should be received and returned by the host according to a preset time interval.
In an embodiment, the first switching module 708 is further configured to, when the heartbeat packet loss rate in the preset time period is greater than or equal to the preset heartbeat packet loss rate threshold and it is detected that the access loss rate of the public IP is less than the preset access loss rate threshold, continue to detect the public IP until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold, and switch the public IP to the standby device.
In one embodiment, as shown in fig. 8, a device 800 for switching IP resources of a host and a standby host is provided, and the device is disposed in the host. The device includes: a second receiving module 802, a second sending module 804, a second detecting module 806 and a second switching module 808, wherein:
a second receiving module 802, configured to receive heartbeat information of the standby device sent by the standby device according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine.
A second sending module 804, configured to respond to the heartbeat information of the standby device, detect an operating state of software in the host, and send the heartbeat information of the host to the standby device; the heartbeat information of the host computer comprises the running state of software in the host computer.
A second detecting module 806, configured to detect a public IP.
The second switching module 806 is configured to remove the public IP from the host when the operating status of the software in the host is abnormal and the public IP is detected in the host.
In one embodiment, the second switching module 806 is further configured to switch the public IP to the host when the running state of the software in the host is normal within a preset time period, the public IP is detected not to be present in the host, and the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold.
In one embodiment, the heartbeat information of the host further includes a second public IP resource status. The second public IP resource status is used to characterize whether the public IP is hosted. The second sending module 804 is further configured to generate heartbeat information of the host and feed the heartbeat information back to the standby machine when it is detected that the public IP is not located in the host within the preset time period and the access loss rate of the public IP is smaller than the preset access loss rate threshold; the second public IP resource state in the feedback heartbeat information of the host represents that the public IP is not in the host; the second public IP resource state is used for indicating the standby machine to remove the public IP from the standby machine when the standby machine detects that the public IP is in the standby machine; and continuing to detect the public IP until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold value, and switching the public IP to the host.
In the IP resource switching device for the main and standby machines, the operating state of the software in the standby machine is detected, heartbeat information of the standby machine including the operating state of the software in the standby machine is sent to the host machine, then the heartbeat information of the host machine including the operating state of the software in the host machine, which is returned by the host machine in response to the heartbeat information of the standby machine, is received, and when the public IP is detected not to be in the standby machine and the operating state of the software in the host machine is abnormal, the public IP is switched to the standby machine. The heartbeat information of the host machine comprises the running state of the software in the host machine, so that the running state of the host machine can be determined according to whether the heartbeat information can be received, the running state of the host machine can be more accurately determined according to the running state of the software in the host machine, the public IP can be detected, and the IP resources of the host machine and the standby machine can be switched in time according to the running state of the software in the host machine and the state of the public IP. In addition, in a preset time period, when a preset switching condition is met, the IP resources can be switched in time, and the situation that the switching cannot be carried out in time due to too much time is not needed, so that the switching of the IP resources of the host and the standby machines is further ensured in time. In addition, the public IP is switched in time according to the software running state in the heartbeat information, so that the data loss in the switching process caused by too slow public IP switching can be avoided, and the integrity of the data is ensured.
For specific limitations of the IP resource switching device of the host and the standby machines, reference may be made to the above limitations of the IP resource switching method of the host and the standby machines, which are not described herein again. All or part of each module in the host-standby machine IP resource switching device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing service data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a method for switching the IP resources of the main and standby machines.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for switching IP resources of a main machine and a standby machine is characterized in that the method is applied to the standby machine; the method comprises the following steps:
detecting the running state of software in the standby machine, and sending heartbeat information of the standby machine to a host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
receiving heartbeat information of the host returned by the host in response to the heartbeat information of the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
detecting a public IP;
when the heartbeat communication ratio with the host is 100% in a preset time period, a public IP is detected not to be in the standby machine, and the running state of software in the host is abnormal, the public IP is switched to the standby machine; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
2. The method of claim 1, further comprising:
and when the heartbeat communication ratio with the host is 100% in a preset time period and the public IP is detected to be in the standby machine and the running state of software in the host is normal, removing the public IP from the standby machine.
3. The method of claim 2, wherein the heartbeat information of the standby machine further includes a first public IP resource status; the first public IP resource state is used for representing whether a public IP is in the standby machine or not;
after removing the public IP from the standby, the method further comprises:
generating heartbeat information of the standby machine and feeding back the heartbeat information to the host machine; the first public IP resource state in the fed back heartbeat information of the standby machine represents that the public IP is not on the standby machine; and the first public IP resource state is used for indicating the host to switch the public IP to the host when detecting that the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period.
4. The method of claim 1, further comprising:
when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold value and the access loss rate of the public IP is detected to be greater than or equal to a preset access loss rate threshold value, switching the public IP to the standby machine;
the heartbeat packet loss rate is a ratio of the number of times that the heartbeat information of the host is not received within a preset time period to the number of times that the heartbeat information of the standby machine is sent at preset time intervals and the returned heartbeat information of the host is received;
when the heartbeat packet loss rate in a preset time period is greater than or equal to a preset heartbeat packet loss rate threshold value and the access loss rate of the public IP is detected to be less than a preset access loss rate threshold value, continuing to detect the public IP until the access loss rate of the public IP in the preset time period is greater than or equal to the preset access loss rate threshold value, and switching the public IP to the standby machine.
5. A method for switching IP resources of a main host and a standby host is characterized in that the method is applied to the host; the method comprises the following steps:
receiving heartbeat information of the standby machine, which is sent by the standby machine according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
responding to the heartbeat information of the standby machine, detecting the running state of software in the host machine, and sending the heartbeat information of the host machine to the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
detecting a public IP;
and when the running state of the software in the host is abnormal within a preset time period and the public IP is detected in the host, removing the public IP from the host.
6. The method of claim 5, wherein the heartbeat information for the host further includes a second public IP resource status; the second public IP resource status is used to characterize whether a public IP is on the host; the method further comprises the following steps:
when the running state of software in the host is normal within a preset time period, the public IP is detected not to be in the host, and the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value, switching the public IP to the host;
when the public IP is detected not to be in the host within a preset time period and the access loss rate of the public IP is smaller than a preset access loss rate threshold value, generating heartbeat information of the host and feeding the heartbeat information back to the standby machine; the second public IP resource state in the fed back heartbeat information of the host represents that a public IP is not in the host; the second public IP resource state is used for indicating the standby machine to remove the public IP from the standby machine when detecting that the public IP is in the standby machine; and continuing to detect the public IP until the access loss rate of the public IP is greater than or equal to a preset access loss rate threshold value in a preset time period, and switching the public IP to the host.
7. An IP resource switching device of a main machine and a standby machine is characterized in that the device is arranged in the standby machine; the device comprises:
the first sending module is used for detecting the running state of software in the standby machine and sending heartbeat information of the standby machine to the host according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
the first receiving module is used for receiving the heartbeat information of the host computer returned by the host computer in response to the heartbeat information of the standby computer; the heartbeat information of the host computer comprises the running state of software in the host computer;
the first detection module is used for detecting the public IP;
the first switching module is used for switching the public IP to the standby machine when the heartbeat communication ratio of the host machine to the host machine is 100% in a preset time period, the public IP is detected not to be in the standby machine, and the running state of software in the host machine is abnormal; the heartbeat communication ratio is a ratio of the number of times of actually receiving the heartbeat information of the host within a preset time period to the number of times of receiving the returned heartbeat information of the host by sending the heartbeat information of the standby machine according to a preset time interval.
8. An IP resource switching device of a main host and a standby host is characterized in that the device is arranged in a host; the device comprises:
the second receiving module is used for receiving heartbeat information of the standby machine, which is sent by the standby machine according to a preset time interval; the heartbeat information of the standby machine comprises the running state of software in the standby machine;
the second sending module is used for responding to the heartbeat information of the standby machine, detecting the running state of software in the host machine and sending the heartbeat information of the host machine to the standby machine; the heartbeat information of the host computer comprises the running state of software in the host computer;
the second detection module is used for detecting the public IP;
the second switching module is used for removing the public IP from the host when the running state of the software in the host is abnormal and the public IP is detected in the host within a preset time period.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010670026.2A 2020-07-13 2020-07-13 Main-standby machine IP resource switching method, device, computer equipment and storage medium Active CN111934909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010670026.2A CN111934909B (en) 2020-07-13 2020-07-13 Main-standby machine IP resource switching method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010670026.2A CN111934909B (en) 2020-07-13 2020-07-13 Main-standby machine IP resource switching method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111934909A true CN111934909A (en) 2020-11-13
CN111934909B CN111934909B (en) 2023-06-13

Family

ID=73312873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010670026.2A Active CN111934909B (en) 2020-07-13 2020-07-13 Main-standby machine IP resource switching method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111934909B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596197A (en) * 2021-09-26 2021-11-02 武汉四通信息服务有限公司 Address switching method and device, electronic equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080198740A1 (en) * 2007-02-20 2008-08-21 Inventec Corporation Service take-over system of multi-host system and method therefor
EP2400726A1 (en) * 2010-06-25 2011-12-28 Societé Française du Radiotéléphone Method for identifying a local network identified by a public IP address
CN103490914A (en) * 2012-06-08 2014-01-01 华耀(中国)科技有限公司 Switching system and switching method for multi-machine hot standby of network application equipment
CN103731294A (en) * 2013-03-28 2014-04-16 深圳市金溢科技有限公司 Method, device and system for two-machine hot-standby communication
CN104243719A (en) * 2013-06-08 2014-12-24 中国移动通信集团公司 Heartbeat period determining method, system and device for long connection in mobile communication network
CN104660441A (en) * 2013-11-25 2015-05-27 北京信威通信技术股份有限公司 Method, device and system for achieving high reliability of server
CN106095526A (en) * 2016-06-06 2016-11-09 腾讯科技(深圳)有限公司 Virtual Server Cluster and the dispositions method of server, device and system
CN106559267A (en) * 2016-11-25 2017-04-05 聚好看科技股份有限公司 The master-slave switching method of Redis, device and redis systems
CN107919994A (en) * 2017-12-13 2018-04-17 南京熊猫电子股份有限公司 Realize the method and server of network service two-node cluster hot backup
US20180183750A1 (en) * 2016-12-28 2018-06-28 Alibaba Group Holding Limited Methods and devices for switching a virtual internet protocol address
CN109344014A (en) * 2018-09-26 2019-02-15 新华三大数据技术有限公司 A kind of main/standby switching method, device and communication equipment
CN111162941A (en) * 2019-12-26 2020-05-15 浪潮云信息技术有限公司 Method for automatically managing virtual IP (Internet protocol) in Kubernetes environment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080198740A1 (en) * 2007-02-20 2008-08-21 Inventec Corporation Service take-over system of multi-host system and method therefor
EP2400726A1 (en) * 2010-06-25 2011-12-28 Societé Française du Radiotéléphone Method for identifying a local network identified by a public IP address
CN103490914A (en) * 2012-06-08 2014-01-01 华耀(中国)科技有限公司 Switching system and switching method for multi-machine hot standby of network application equipment
CN103731294A (en) * 2013-03-28 2014-04-16 深圳市金溢科技有限公司 Method, device and system for two-machine hot-standby communication
CN104243719A (en) * 2013-06-08 2014-12-24 中国移动通信集团公司 Heartbeat period determining method, system and device for long connection in mobile communication network
CN104660441A (en) * 2013-11-25 2015-05-27 北京信威通信技术股份有限公司 Method, device and system for achieving high reliability of server
CN106095526A (en) * 2016-06-06 2016-11-09 腾讯科技(深圳)有限公司 Virtual Server Cluster and the dispositions method of server, device and system
CN106559267A (en) * 2016-11-25 2017-04-05 聚好看科技股份有限公司 The master-slave switching method of Redis, device and redis systems
US20180183750A1 (en) * 2016-12-28 2018-06-28 Alibaba Group Holding Limited Methods and devices for switching a virtual internet protocol address
CN107919994A (en) * 2017-12-13 2018-04-17 南京熊猫电子股份有限公司 Realize the method and server of network service two-node cluster hot backup
CN109344014A (en) * 2018-09-26 2019-02-15 新华三大数据技术有限公司 A kind of main/standby switching method, device and communication equipment
CN111162941A (en) * 2019-12-26 2020-05-15 浪潮云信息技术有限公司 Method for automatically managing virtual IP (Internet protocol) in Kubernetes environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596197A (en) * 2021-09-26 2021-11-02 武汉四通信息服务有限公司 Address switching method and device, electronic equipment and storage medium
CN113596197B (en) * 2021-09-26 2021-12-21 武汉四通信息服务有限公司 Address switching method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111934909B (en) 2023-06-13

Similar Documents

Publication Publication Date Title
EP3142011B9 (en) Anomaly recovery method for virtual machine in distributed environment
CN108173911B (en) Micro-service fault detection processing method and device
CN111651291B (en) Method, system and computer storage medium for preventing split brain of shared storage cluster
CN106533805B (en) Micro-service request processing method, micro-service controller and micro-service architecture
US9210059B2 (en) Cluster system
CN107508694B (en) Node management method and node equipment in cluster
CN112217658B (en) Stacking and splitting processing method and device
CN112769652B (en) Node service monitoring method, device, equipment and medium
CN109768884A (en) The implementation method of communication system and its high availability, device and computer equipment
CN114168071B (en) Distributed cluster capacity expansion method, distributed cluster capacity expansion device and medium
CN108924772B (en) Short message sending method and device, computer equipment and storage medium
CN114531373A (en) Node state detection method, node state detection device, equipment and medium
CN111934909B (en) Main-standby machine IP resource switching method, device, computer equipment and storage medium
CN108092829B (en) Cluster splitting processing method, SDN controller and storage medium
CN113489149A (en) Power grid monitoring system service master node selection method based on real-time state perception
CN117201507A (en) Cloud platform switching method and device, electronic equipment and storage medium
CN113098709B (en) Network recovery method and device based on distributed networking system and computer equipment
CN114840495A (en) Database cluster split-brain prevention method, storage medium and device
CN111211924A (en) Method and device for controlling single point high availability of computing node
CN112612652A (en) Distributed storage system abnormal node restarting method and system
CN113157493A (en) Backup method, device and system based on ticket checking system and computer equipment
CN111651294B (en) Node abnormality detection method and device
CN115086219B (en) Virtual router determining method, device and computer readable storage medium
CN111209145A (en) Virtual machine disaster tolerance-based service self-healing method, equipment and storage medium
CN110297741B (en) Background task monitoring method and device

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