CN113395188A - Method and system for determining working state of server - Google Patents
Method and system for determining working state of server Download PDFInfo
- Publication number
- CN113395188A CN113395188A CN202110655803.0A CN202110655803A CN113395188A CN 113395188 A CN113395188 A CN 113395188A CN 202110655803 A CN202110655803 A CN 202110655803A CN 113395188 A CN113395188 A CN 113395188A
- Authority
- CN
- China
- Prior art keywords
- server
- standby
- main
- central node
- state
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- 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/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- 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
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Environmental & Geological Engineering (AREA)
- Hardware Redundancy (AREA)
Abstract
The embodiment of the invention discloses a method and a system for determining the working state of a server. The method comprises the following steps: when a central node is configured in the system, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node; when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule; the main server is a server which is currently working, and the standby server is a server which is not currently working. According to the technical scheme of the embodiment of the invention, if abnormal heartbeat between the main server and the standby server is detected in the scene with the central node and without the central node, the system can quickly select one server as the server in the working state.
Description
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a system for determining the working state of a server.
Background
As people rely on information technology more and more, the loss of telecommunication equipment caused by service interruption due to hardware damage during operation is greater and greater, and therefore, the reliability of the telecommunication equipment has become a focus of attention of operators.
The dual-server hot standby uses two servers which are mutually backup to jointly execute the same service, wherein one server is a main server, and the other server is a standby server. Once the main server fails, the standby server will replace the main server in a short time through software diagnosis and detection, such as a heartbeat detection mechanism, so as to ensure the uninterrupted operation of the system. The inventor discovers that in the process of implementing the invention: in a scene with or without a center, when heartbeat detection between the main server and the standby server is abnormal, the system cannot correctly judge the working state of the main server and the standby server.
Disclosure of Invention
The embodiment of the invention provides a method and a system for determining the working state of a server, which are used for realizing that the system can quickly select one server as the server in the working state if abnormal heartbeat between a main server and a standby server is detected in the scenes with a central node and without the central node.
In a first aspect, an embodiment of the present invention provides a method for determining a working state of a server, where the method includes:
when a central node is configured in the system, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node;
when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule;
the main server is a server which is currently working, and the standby server is a server which is not currently working.
Optionally, before the central node selects one of the primary server and the standby server as a server in a working state according to registration conditions of the primary server and the standby server with the central node, the method further includes:
the main server and the standby server judge whether a central node is configured in the system or not;
if the system is configured with a central node, the main server and the standby server periodically send registration requests to the central node.
Optionally, the selecting, by the central node, one of the primary server and the standby server as a server in a working state according to registration conditions of the primary server and the standby server with the central node includes:
the central node determines the fault states of the main server and the standby server according to the registration requests periodically sent by the main server and the standby server;
the central node matches the fault states of the main server and the standby server with the first state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
Optionally, the central node matches the fault states of the primary server and the standby server with the first state determination rule, and selects one of the primary server and the standby server as a server in a working state, where the method includes:
if the main server and the standby server are in normal states, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a fault state, the central node selects the standby server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a normal state after fault recovery, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the standby server is in a fault state, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the standby server is in a normal state after the fault is recovered, the central node selects the main server as the server in the working state.
Optionally, after the central node matches the fault states of the primary server and the standby server with the first state determination rule, and selects one of the primary server and the standby server as a server in the working state, the method further includes:
the central node sends a notification message to the main server and the standby server, wherein the notification message comprises the working states of the main server and the standby server;
the standby server judges whether to switch the states according to the working states of the main server and the standby server;
and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state.
Optionally, if it is detected that the heartbeat between the primary server and the standby server is abnormal, the standby server selects one of the primary server and the standby server as a server in a working state according to a second state determination rule, including:
the standby server determines the fault state of the main server according to whether the detection data packet periodically sent by the main server can be received or not;
and if the heartbeat abnormality between the main server and the standby server is detected, the standby server matches the fault state of the main server with the second state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
Optionally, the matching, by the standby server, the fault state of the main server with the second state determination rule, and selecting one of the main server and the standby server as a server in a working state includes:
if the main server is in a normal state, the standby server selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the main server is in a fault state, the standby server selects the standby server as the server in the working state.
Optionally, after the standby server matches the fault state of the primary server with the second state decision rule, and selects one server from the primary server and the standby server as a server in the working state, the method further includes:
the standby server judges whether to switch the states according to the working states of the main server and the standby server;
and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state.
Optionally, the determining, by the primary server and the standby server, whether the central node is configured in the system includes:
the main server and the standby server inquire whether a configuration record of the central node exists in a database or not;
and if the configuration record of the central node exists, determining that the central node is configured in the system, otherwise, determining that the central node is not configured in the system.
In a second aspect, an embodiment of the present invention further provides a system for determining a working state of a server, where the system at least includes a primary server and a standby server, the primary server is a currently working server, and the standby server is a currently non-working server;
the standby server is used for selecting one server from the main server and the standby server as a server in a working state according to a second state judgment rule if abnormal heartbeat between the main server and the standby server is detected when the central node is not configured in the system;
and if the system is provided with the central node, the central node is used for selecting one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node.
According to the technical scheme of the embodiment of the invention, when the system is configured with the central node, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node; when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that the working state of the main server and the standby server cannot be correctly judged when heartbeat detection between the main server and the standby server is abnormal in the prior art is solved, and if the heartbeat abnormality between the main server and the standby server is detected in a scene with a central node and without the central node, the system can quickly select one server as the server in the working state.
Drawings
Fig. 1a is a flowchart of a method for determining a working state of a server according to a first embodiment of the present invention;
FIG. 1b is a schematic diagram of an application scenario in the first embodiment of the present invention;
fig. 2 is a flowchart of a method for determining a working state of a server according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server operating state determination system in a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1a is a flowchart of a method for determining a working state of a server according to a first embodiment of the present invention, which is applicable to a case where working states of a primary server and a standby server are determined when a heartbeat detection between the primary server and the standby server is abnormal. As shown in fig. 1a, the method comprises:
and 110, when the central node is configured in the system, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node.
The main server is a server which is currently working, and the standby server is a server which is not currently working.
The main server and the standby server are two servers which are mutually backup and execute the same service together. For example, the video server 1 and the video server 2 in fig. 1b are backup for each other, and the video storage server 1 and the video storage server 2 are backup for each other. For two servers which are backed up with each other, only one server can be in a working state to provide service for a client, and the other server can only be in a non-working state. As a backup server. In this embodiment, a server currently operating is referred to as a primary server, and a server not currently operating is referred to as a standby server. The standby server may continue to provide service in place of the primary server when the primary server fails.
Optionally, the selecting, by the central node, one of the main server and the standby server as a server in a working state according to registration conditions of the main server and the standby server with the central node may include: the central node determines the fault states of the main server and the standby server according to the registration requests periodically sent by the main server and the standby server; the central node matches the fault states of the main server and the standby server with the first state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
In this embodiment, if it is determined that the system is configured with the central node, both the primary server and the standby server periodically send registration requests to the central node, and the central node determines whether the primary server and the standby server are in a failure state according to the registration requests periodically sent by the primary server and the standby server. If the central node receives the registration requests sent by the main server and the standby server, the main server is allowed to be successfully registered, the standby server is allowed to be failed to be registered, and therefore the main server is in a normal state; the standby server is in a failure state; if the central node only receives a registration request sent by one server, the server is allowed to be successfully registered, the server is in a normal state, and the other server is failed to be registered and is in a fault state; if the central node does not receive the registration request, the primary server and the standby server both fail to register and are in a failure state.
In this embodiment, the central node may obtain a first state determination rule in a scenario in which the central node is present, arbitrate the working states of the primary server and the standby server according to whether the primary server and the standby server are in a failure state, and select one of the primary server and the standby server as a server in the working state to provide a service to the client.
Optionally, the matching, by the central node, the fault states of the main server and the standby server with the first state determination rule, and selecting one of the main server and the standby server as a server in a working state may include: if the main server and the standby server are in normal states, the central node selects the main server as a server in a working state; or if the main server is in a fault state, the central node selects the standby server as the server in the working state; or if the main server is in a normal state after fault recovery, the central node selects the main server as a server in a working state; or if the standby server is in a fault state, the central node selects the main server as the server in the working state; or, if the standby server is in a normal state after the failure recovery, the central node selects the main server as the server in the working state.
In this embodiment, when the system initially configures the primary server and the standby server, the primary server is in an operating state by default, and the standby server is in an inoperative state. Therefore, when the heartbeat detection between the main server and the standby server is abnormal, if the main server is in a normal state, including a normal state in which the failure does not occur and a normal state recovered from the failure, the central node selects the main server as a working state and the main server continues to provide service for the client no matter whether the standby server is in the normal state or not; and selecting the standby server as the standby server of the main server continuously when the standby server is in the non-operating state.
If the main server is in a fault state and the standby server is in a normal state, the main server cannot provide service for the client at the moment, in order to maintain normal operation of the system, the central node selects the standby server to be in a working state, and the standby server replaces the main server to provide service for the client; the primary server is selected to be inactive. However, when the primary server recovers from the failure, the central node may reselect the primary server to the active state.
If the main server and the standby server are in a failure state, namely the main server and the standby server cannot provide service for the client, at the moment, the central node can maintain default settings, select the main server to be in a working state, and select the standby server to be in a non-working state.
The conditions causing the server to be in the failure state may include a device shutdown caused by power failure and a device stand-alone mode caused by network failure. When the server is powered off, the server cannot communicate with other equipment; when the server is in the offline stand-alone mode, the server can communicate with other servers.
And step 120, when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule.
In this embodiment, a heartbeat detection mechanism may be used to detect whether the primary server and the standby server are in a failure state. The heartbeat detection mechanism is that a main server and a standby server mutually and periodically send detection data packets to each other, if the two sides do not receive the detection data packets from each other, the heartbeat between the two sides is considered to be abnormal, and at least one of the main server and the standby server is not on line and is in a fault state. If the system is not provided with the central node, the standby server can be used for arbitrating the working states of the main server and the standby server, and one of the main server and the standby server is selected to provide services for the client.
Optionally, if it is detected that the heartbeat between the primary server and the standby server is abnormal, the standby server selects one of the primary server and the standby server as a server in a working state according to the second state determination rule, which may include: the standby server determines the fault state of the main server according to whether the detection data packet periodically sent by the main server can be received or not; and if the heartbeat abnormality between the main server and the standby server is detected, the standby server matches the fault state of the main server with the second state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
In this embodiment, if the system is not configured with a central node, when the heartbeat detection is abnormal, the primary server and the standby server periodically send detection packets to each other to detect whether the two sides are online, that is, determine whether the two sides are in a failure state. Since the standby server is a server which is not currently operating, the operating state of the server can be determined by the standby server. The standby server considers that the standby server is in a normal state, so that the fault state of the main server is determined only according to whether the standby server can receive the detection data packet periodically sent by the main server. Specifically, if the standby server receives a detection data packet sent by the main server, the main server is considered to be in a normal state; and if the detection data packet sent by the main server is not received, the main server is considered to be in a failure state.
When detecting that the heartbeat between the main server and the standby server is abnormal, the standby server may select one of the main server and the standby server as a server in a working state according to the fault states of the main server and the standby server and a preset second state judgment rule in a centerless scene, and provide a service to the client.
Optionally, the matching, by the standby server, the fault state of the main server with the second state determination rule, and selecting one server from the main server and the standby server as a server in a working state may include: if the main server is in a normal state, the standby server selects the main server as a server in a working state; or if the main server is in a failure state, the standby server selects the standby server as the server in the working state.
In this embodiment, if the primary server is in a normal state, including a normal state in which no failure occurs and a normal state in which the primary server is always in a normal state and is recovered from a failure, the standby server regards that the primary server is online, selects the primary server as an operating state, and the primary server continues to provide services for the client, and simultaneously selects the standby server as an inactive state and continues to serve as a standby server of the primary server. And if the main server is in a fault state and the standby server considers that the main server is not on line, selecting the standby server to be in a working state, replacing the main server to provide service for the client, and selecting the main server to be in a non-working state.
It should be noted that, when the standby server does not receive the detection packet sent by the main server, it may be that the standby server fails, and the main server is normal. At this time, the standby server determines that the standby server is normal, and the main server fails, so that the standby server is selected to be in an operating state by mistake. However, since the backup server must notify the client of the switching when the server transmits the status switching, even if the backup server erroneously selects itself to be in an operating status when the backup server fails, the switching failure message cannot be transmitted to the client, and thus the server switching is not actually performed, or the main server provides a service to the client.
According to the technical scheme of the embodiment of the invention, when the system is configured with the central node, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node; when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that the working state of the main server and the standby server cannot be correctly judged when heartbeat detection between the main server and the standby server is abnormal in the prior art is solved, and if the heartbeat abnormality between the main server and the standby server is detected in a scene with a central node and without the central node, the system can quickly select one server as the server in the working state.
Example two
Fig. 2 is a flowchart of a method for determining a working state of a server in a second embodiment of the present invention, which is further detailed based on the above embodiment. The following describes a method for determining a working state of a server provided in this embodiment with reference to fig. 2, including the following steps:
In this embodiment, since the system where the main server and the standby server are located may or may not be configured with the central node, the processing schemes for the heartbeat abnormality between the main server and the standby server are different in the scenario with the central node and the scenario without the central node. Therefore, the main server and the standby server need to determine in advance whether to configure the central node in the system.
Optionally, the determining, by the primary server and the standby server, whether the central node is configured in the system may include: the main server and the standby server inquire whether a configuration record of the central node exists in a database or not; and if the configuration record of the central node exists, determining that the central node is configured in the system, otherwise, determining that the central node is not configured in the system.
In this embodiment, because the system configuration operation may generate a corresponding configuration file, the primary server and the standby server may query whether there is a configuration record for configuring the central node in the database, if there is configuration record data for the central node in the database, the central node is inevitably configured in the system, and if there is no configuration record data for the central node queried in the database, it may be determined that there is no configuration central node in the system.
In this embodiment, if the system is configured with a central node, the central node may obtain a first state determination rule in a scenario where the central node is present, arbitrate the working states of the main server and the standby server according to whether the main server and the standby server are in a failure state, and select one server from the main server and the standby server as a working state to provide a service to the client.
Optionally, after the central node matches the fault states of the main server and the standby server with the first state determination rule, and selects one server from the main server and the standby server as a server in a working state, the method may further include: the central node sends a notification message to the main server and the standby server, wherein the notification message comprises the working states of the main server and the standby server; the standby server judges whether to switch the states according to the working states of the main server and the standby server; and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state.
In this embodiment, in a scenario with a central node, if the central node has selected one server as a working state, the working states of the primary server and the standby server need to be carried in the notification message and sent to the primary server and the standby server. After receiving the notification message, the standby server extracts the working state of each server from the notification message and judges whether state switching is needed, that is, whether the servers capable of working change, and if so, the standby server needs to switch states. For example, if the main server fails, the standby server is selected to be in a working state and needs to work in place of the main server; or, the main server is recovered from the failure, and is reselected to be in a working state, and when providing service for the client, state switching is required.
At this time, the standby server sends a server working state switching message to the client through the application service associated with the standby server, so that the client actively establishes communication connection with the server which currently provides the service. Therefore, for the application scenario shown in fig. 1b, the remote video monitoring project can normally operate after the working states of the main server and the standby server are switched.
It should be noted that all the working state switching needs the standby server to notify the client through the application service of the standby server.
And step 240, the standby server determines the fault state of the main server according to whether the detection data packet periodically sent by the main server can be received or not.
And step 250, if the heartbeat abnormality between the main server and the standby server is detected, the standby server matches the fault state of the main server with the second state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
In this embodiment, if the system is not configured with the central node, when detecting that the heartbeat between the main server and the standby server is abnormal, the standby server may obtain the second state determination rule in the scenario without the central node, arbitrate the working states of the main server and the standby server according to whether the main server is in a failure state, select one of the main server and the standby server as the working state, and provide a service to the client.
Optionally, after the standby server matches the fault state of the primary server with the second state determination rule, and selects one server from the primary server and the standby server as a server in the working state, the method may further include: the standby server judges whether to switch the states according to the working states of the main server and the standby server; and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state.
In this embodiment, after determining the operating state of each server, the standby server may determine whether to perform state switching, that is, determine whether the server that can operate changes, and if so, perform state switching. For example, if the main server fails, the standby server is selected to be in a working state and needs to work in place of the main server; or, the main server is recovered from the failure, and is reselected to be in a working state, and when providing service for the client, state switching is required. At this time, the standby server sends a server working state switching message to the client through the application service associated with the standby server, so that the client actively establishes communication connection with the server which currently provides the service.
According to the technical scheme of the embodiment of the invention, when a central node is configured in a system, if abnormal heartbeat between a main server and a standby server is detected, the central node selects one server from the main server and the standby server as a server in a working state according to a first state judgment rule; when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that the working state of the main server and the standby server cannot be correctly judged when heartbeat detection between the main server and the standby server is abnormal in the prior art is solved, and if the heartbeat abnormality between the main server and the standby server is detected in a scene with a central node and without the central node, the system can quickly select one server as the server in the working state.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a system for determining a working state of a server according to a third embodiment of the present invention, which is applicable to a case of determining a working state of a primary server and a secondary server when a heartbeat detection between the primary server and the secondary server is abnormal. As shown in fig. 3, the system includes at least a primary server 310 and a standby server 320; the primary server 310 is a currently working server, and the standby server 320 is a currently non-working server;
the standby server 320 is used for selecting one of the main server 310 and the standby server 320 as a server in a working state according to a second state judgment rule if the heartbeat abnormality between the main server 310 and the standby server 320 is detected when a central node is not configured in the system;
if the system is configured with a central node, the central node is configured to select one of the primary server 310 and the standby server 320 as a server in an operating state according to the registration condition of the primary server and the standby server with the central node.
Optionally, the primary server 310 and the standby server 320 are further configured to:
before the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node, judging whether the central node is configured in the system;
if the system is configured with a central node, a registration request is periodically sent to the central node.
Optionally, the central node is specifically configured to:
determining fault states of the main server and the standby server according to the registration requests periodically sent by the main server and the standby server;
and if the heartbeat abnormality between the main server and the standby server is detected, matching the fault states of the main server and the standby server with the first state judgment rule, and selecting one server from the main server and the standby server as a server in a working state.
Optionally, the central node is specifically configured to:
if the main server and the standby server are in normal states, selecting the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a fault state, selecting the standby server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a normal state after fault recovery, selecting the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the standby server is in a fault state, selecting the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the standby server is in a normal state after the fault is recovered, selecting the main server as the server in the working state.
Optionally, the central node is further configured to: matching the fault states of the main server and the standby server with a first state judgment rule at the central node, and sending a notification message to the main server and the standby server after selecting one server from the main server and the standby server as a server in a working state, wherein the notification message comprises the working states of the main server and the standby server;
and if the state is switched, sending a server working state switching message to the client through the application service associated with the standby server so as to enable the client to be connected with the server in the working state at present.
Optionally, the standby server 320 is specifically configured to:
determining the fault state of the main server according to whether a detection data packet periodically sent by the main server can be received or not;
and if the heartbeat abnormality between the main server and the standby server is detected, matching the fault state of the main server with the second state judgment rule, and selecting one server from the main server and the standby server as a server in a working state.
Optionally, the standby server 320 is specifically configured to:
if the main server is in a normal state, selecting the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the main server is in a failure state, selecting the standby server as the server in the working state.
Optionally, the standby server 320 is further configured to:
after the standby server matches the fault state of the main server with the second state judgment rule and selects one server from the main server and the standby server as a working state, judging whether to switch the states according to the working states of the main server and the standby server;
and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state.
Optionally, the primary server 310 and the standby server 320 are specifically configured to:
inquiring whether a configuration record of the central node exists in a database;
and if the configuration record of the central node exists, determining that the central node is configured in the system, otherwise, determining that the central node is not configured in the system.
According to the technical scheme of the embodiment of the invention, when the system is configured with the central node, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node; when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that the working state of the main server and the standby server cannot be correctly judged when heartbeat detection between the main server and the standby server is abnormal in the prior art is solved, and if the heartbeat abnormality between the main server and the standby server is detected in a scene with a central node and without the central node, the system can quickly select one server as the server in the working state.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method for determining the working state of a server is characterized by comprising the following steps:
when a central node is configured in the system, the central node selects one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node;
when the central node is not configured in the system, if abnormal heartbeat between the main server and the standby server is detected, the standby server selects one server from the main server and the standby server as a server in a working state according to a second state judgment rule;
the main server is a server which is currently working, and the standby server is a server which is not currently working.
2. The method of claim 1, wherein before the central node selects one of the primary server and the standby server as the server in the working state according to the registration of the primary server and the standby server with the central node, the method further comprises:
the main server and the standby server judge whether a central node is configured in the system or not;
if the system is configured with a central node, the main server and the standby server periodically send registration requests to the central node.
3. The method of claim 2, wherein the central node selects one of the primary server and the standby server as the server in the working state according to the registration of the primary server and the standby server with the central node, comprising:
the central node determines the fault states of the main server and the standby server according to the registration requests periodically sent by the main server and the standby server;
the central node matches the fault states of the main server and the standby server with a first state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
4. The method of claim 3, wherein the central node matches the failure status of the primary server and the backup server with the first status decision rule, and selects one of the primary server and the backup server as the server in the working status, comprising:
if the main server and the standby server are in normal states, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a fault state, the central node selects the standby server as a server in a working state; alternatively, the first and second electrodes may be,
if the main server is in a normal state after fault recovery, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
if the standby server is in a fault state, the central node selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the standby server is in a normal state after fault recovery, the central node selects the main server as a server in a working state.
5. The method according to any one of claim 4, wherein after the central node matches the failure status of the primary server and the backup server with the first status decision rule, and selects one of the primary server and the backup server as the server in the working status, the method further comprises:
the method comprises the steps that a central node sends notification messages to a main server and a standby server, wherein the notification messages comprise the working states of the main server and the standby server;
the standby server judges whether to switch the states according to the working states of the main server and the standby server;
and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state at present.
6. The method of claim 1, wherein if the heartbeat anomaly between the primary server and the standby server is detected, the standby server selects one of the primary server and the standby server as the server in the working state according to a second state judgment rule, comprising:
the standby server determines the fault state of the main server according to whether the detection data packet periodically sent by the main server can be received or not;
and if the heartbeat abnormality between the main server and the standby server is detected, the standby server matches the fault state of the main server with a second state judgment rule, and selects one server from the main server and the standby server as a server in a working state.
7. The method of claim 6, wherein the backup server matches the failure status of the primary server with a second status decision rule, and selects one of the primary server and the backup server as the server in the working status, comprising:
if the main server is in a normal state, the standby server selects the main server as a server in a working state; alternatively, the first and second electrodes may be,
and if the main server is in a fault state, the standby server selects the standby server as a server in a working state.
8. The method of claim 7, wherein after the backup server matches the failure status of the primary server with the second status decision rule and selects one of the primary server and the backup server as the server in the working status, the method further comprises:
the standby server judges whether to switch the states according to the working states of the main server and the standby server;
and if the state is switched, the standby server sends a server working state switching message to the client through the associated application service so as to enable the client to be connected with the server in the working state at present.
9. The method of claim 2, wherein the determining whether the central node is configured in the system by the primary server and the backup server comprises:
the main server and the standby server inquire whether a configuration record of the central node exists in a database or not;
and if the configuration record of the central node exists, determining that the central node is configured in the system, otherwise, determining that the central node is not configured in the system.
10. A server working state determining system is characterized by at least comprising a main server and a standby server, wherein the main server is a currently working server, and the standby server is a currently non-working server;
the standby server is used for selecting one of the main server and the standby server as a server in a working state according to a second state judgment rule if abnormal heartbeat between the main server and the standby server is detected when a central node is not configured in the system;
and if the system is provided with the central node, the central node is used for selecting one server from the main server and the standby server as a server in a working state according to the registration condition of the main server and the standby server to the central node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110655803.0A CN113395188B (en) | 2021-06-11 | 2021-06-11 | Method and system for determining working state of server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110655803.0A CN113395188B (en) | 2021-06-11 | 2021-06-11 | Method and system for determining working state of server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113395188A true CN113395188A (en) | 2021-09-14 |
CN113395188B CN113395188B (en) | 2023-08-08 |
Family
ID=77620730
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110655803.0A Active CN113395188B (en) | 2021-06-11 | 2021-06-11 | Method and system for determining working state of server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113395188B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102523127A (en) * | 2011-12-30 | 2012-06-27 | 网宿科技股份有限公司 | Master server and slave server switching method and system utilizing same |
CN102684929A (en) * | 2012-06-06 | 2012-09-19 | 广东威创视讯科技股份有限公司 | Dual-computer hot redundancy back-up method and dual-computer hot redundancy back-up system |
CN102868560A (en) * | 2012-09-28 | 2013-01-09 | 南京恩瑞特实业有限公司 | System and method for realizing hot standby of servers |
CN103346903A (en) * | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
CN103530200A (en) * | 2012-07-04 | 2014-01-22 | 腾讯科技(深圳)有限公司 | Server hot backup system and method |
CN103560922A (en) * | 2013-11-18 | 2014-02-05 | 北京特立信电子技术股份有限公司 | Disaster recovery method and system |
-
2021
- 2021-06-11 CN CN202110655803.0A patent/CN113395188B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102523127A (en) * | 2011-12-30 | 2012-06-27 | 网宿科技股份有限公司 | Master server and slave server switching method and system utilizing same |
CN102684929A (en) * | 2012-06-06 | 2012-09-19 | 广东威创视讯科技股份有限公司 | Dual-computer hot redundancy back-up method and dual-computer hot redundancy back-up system |
CN103530200A (en) * | 2012-07-04 | 2014-01-22 | 腾讯科技(深圳)有限公司 | Server hot backup system and method |
CN102868560A (en) * | 2012-09-28 | 2013-01-09 | 南京恩瑞特实业有限公司 | System and method for realizing hot standby of servers |
CN103346903A (en) * | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
CN103560922A (en) * | 2013-11-18 | 2014-02-05 | 北京特立信电子技术股份有限公司 | Disaster recovery method and system |
Also Published As
Publication number | Publication date |
---|---|
CN113395188B (en) | 2023-08-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9237092B2 (en) | Method, apparatus, and system for updating ring network topology information | |
US8117337B2 (en) | Method and device for implementing link pass through in point-to-multipoint network | |
CN107612754B (en) | Bidirectional forwarding link fault detection method and device and network node equipment | |
JP6308534B2 (en) | Network protection method, network protection device, off-ring node, and system | |
CN104901834A (en) | Method and system for automatically switching between network servers | |
CN111585797B (en) | Ethernet link switching method, device, equipment and computer readable storage medium | |
CN105634848A (en) | Virtual router monitoring method and apparatus | |
WO2011150780A1 (en) | Method for triggering route switching and service provider-end provider edge device | |
CN110830310B (en) | Cross-data-center disaster backup method and BRAS system | |
CN113395188B (en) | Method and system for determining working state of server | |
JP7064132B2 (en) | Fault monitoring system and fault monitoring method | |
WO2016074570A1 (en) | Security monitoring method and system | |
JP2000324121A (en) | System changeover device in network management system and its method | |
CN113824595B (en) | Link switching control method and device and gateway equipment | |
JP2009003491A (en) | Server switching method in cluster system | |
US20200296607A1 (en) | Channel establishment method and base station | |
JP2006254096A (en) | Ip telephone system | |
JP2738362B2 (en) | Network connection device | |
JPH1168790A (en) | Lan emulation server duplicate system | |
CN115102897B (en) | Stacking splitting protection method based on link aggregation | |
JP2959510B2 (en) | Address resolution server switching system in ATM data communication network | |
JP6204397B2 (en) | COMMUNICATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM | |
CN115842751B (en) | Link detection method, device, system, equipment and readable storage medium | |
JP7119957B2 (en) | Switch device and failure detection program | |
JP4628823B2 (en) | IP phone system |
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 |