CN113395188B - Method and system for determining working state of server - Google Patents

Method and system for determining working state of server Download PDF

Info

Publication number
CN113395188B
CN113395188B CN202110655803.0A CN202110655803A CN113395188B CN 113395188 B CN113395188 B CN 113395188B CN 202110655803 A CN202110655803 A CN 202110655803A CN 113395188 B CN113395188 B CN 113395188B
Authority
CN
China
Prior art keywords
server
standby
main
state
central node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110655803.0A
Other languages
Chinese (zh)
Other versions
CN113395188A (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.)
Beijing Feixun Digital Technology Co ltd
Original Assignee
Beijing Feixun Digital 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 Beijing Feixun Digital Technology Co ltd filed Critical Beijing Feixun Digital Technology Co ltd
Priority to CN202110655803.0A priority Critical patent/CN113395188B/en
Publication of CN113395188A publication Critical patent/CN113395188A/en
Application granted granted Critical
Publication of CN113395188B publication Critical patent/CN113395188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 working state according to the registration condition of the main server and the standby server to the central node; when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging 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 provided by the embodiment of the invention, under the scenes with the central node and without the central node, if the heartbeat abnormality between the main server and the standby server is detected, the system can quickly select one server as the server in the working state.

Description

Method and system for determining working state of server
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 more and more on information technology, the loss of service interruption caused by hardware damage in operation of telecommunication equipment is also increasing, and thus reliability of telecommunication equipment has become an important point of attention of operators.
The dual hot standby uses two servers which are mutually backed up to jointly execute the same service, wherein one server is a main server, and the other server is a standby server. Once the primary server fails, the secondary server will replace the primary server in a short period of time through software diagnostics, such as a heartbeat detection mechanism, to ensure uninterrupted operation of the system. The inventors found in the course of implementing the present invention that: in the system, under the scene with a center or without a center, when the heartbeat detection between the main server and the standby server is abnormal, the working state of the main server and the standby server cannot be accurately judged.
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 of the working state under the scene of having a central node and having no central node if the heartbeat abnormality between a main server and a standby server is detected.
In a first aspect, an embodiment of the present invention provides a method for determining a working state of a server, including:
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 working state according to the registration condition of the main server and the standby server to the central node;
when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging 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 server from the main server and the standby server as the working state according to the registration condition of the main server and the standby server to the central node, the method further includes:
the main server and the standby server judge whether a central node is configured in the system;
if a central node is configured in the system, the main server and the standby server periodically send registration requests to the central node.
Optionally, the central node selects one server from the main server and the standby server as a working state according to the registration condition of the main server and the standby server to the central node, and the method 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 the working state.
Optionally, the central node matches the failure states of the primary server and the standby server with the first state determination rule, and selects one server from the primary server and the standby server as the working state, including:
if the main server and the standby server are in a normal state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a fault state, the central node selects the standby server as a server in a working state; or alternatively, the process may be performed,
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 alternatively, the process may be performed,
if the standby server is in a fault state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
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.
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 the 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 working states of the main server and the standby server;
the standby server judges whether to switch states according to the working states of the main server and the standby server;
if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the working state at present.
Optionally, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to the 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;
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 the working state.
Optionally, the standby server matches the failure state of the primary server with the second state determination rule, and selects one server from the primary server and the standby server as the working state, including:
if the main server is in a normal state, the standby server selects the main server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a fault state, the standby server selects the standby server as a server in a working state.
Optionally, after the standby server matches the failure state of the primary server with the second state determination rule, selecting one of the primary server and the standby server as the server in the working state, the method further includes:
the standby server judges whether to switch states according to the working states of the main server and the standby server;
if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the working state at present.
Optionally, the main server and the standby server determine whether a central node is configured in the system, including:
the main server and the standby server inquire whether a configuration record of the central node exists in the database;
if the configuration record of the central node exists, the central node is determined to be configured in the system, otherwise, the central node is determined not to be configured in the system.
In a second aspect, the embodiment of the invention also provides a server working state determining system, which at least comprises 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 server from the main server and the standby server as a working state according to a second state judging rule if the heartbeat abnormality between the main server and the standby server is detected when the central node is not configured in the system;
if the system is configured with a central node, the central node is used for selecting one server from the main server and the standby server as 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, 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 working state according to the registration condition of the main server and the standby server to the central node; when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that in the prior art, when heartbeat detection between the main server and the standby server is abnormal, the working state of the main server and the standby server cannot be judged correctly is solved, and the system can be used for quickly selecting one server as the server in the working state if the heartbeat abnormality between the main server and the standby server is detected under the scene of having a center node and having no center node.
Drawings
FIG. 1a is a flowchart of a method for determining an operating state of a server according to a first embodiment of the present invention;
fig. 1b is a schematic diagram of an application scenario in a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for determining a server operating state according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server operation state determining system according to a third embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1a is a flowchart of a method for determining an operating state of a server according to a first embodiment of the present invention, where the present embodiment is applicable to a case where the operating states of a main server and a standby server are determined when an abnormality is detected in a heartbeat between the main server and the standby server. 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 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 commonly execute the same service. For example, in fig. 1b, the video server 1 and the video server 2 are backed up with each other, and the video storage server 1 and the video storage server 2 are also backed up with each other. For two servers that are backup to each other, only one server may be in an active state, providing services to the client, while the other server may only be in an inactive state. As a backup server. In this embodiment, a server currently in operation is referred to as a primary server, and a server currently not in operation is referred to as a backup server. The backup server may continue to provide service in place of the primary server when the primary server fails.
Optionally, the central node selects one server from the main server and the standby server as the working state according to the registration condition of the main server and the standby server to the central node, and the method 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 the working state.
In this embodiment, if it is determined that the system is configured with a central node, the main server and the standby server both need to periodically send a registration request to the central node, and the central node determines whether the main server and the standby server are in a failure state according to the registration request periodically sent by the main server and the standby server. If the central node receives the registration requests sent by the main server and the standby server, the registration of the main server is allowed to succeed, and the registration of the standby server is failed, so that the main server is in a normal state; the standby server is in a fault state; if the center node only receives a registration request sent by one server, the server is allowed to register successfully, the server is in a normal state, and the other server fails to register and is in a fault state; if the central node does not receive the registration request, both the primary server and the backup server fail to register, both in a failed state.
In this embodiment, the central node may obtain a first state determination rule in the scenario where the central node exists, 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 fault state, and select one of the main server and the standby server as the server in the working state to provide services to the client.
Optionally, the central node matches the failure states of the primary server and the standby server with the first state determining rule, and selects one server from the primary server and the standby server as the working state, which may include: if the main server and the standby server are in a normal state, 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 a server in a 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 a server in a working state; or if the standby server is in a normal state after fault recovery, the central node selects the main server as the server in the working state.
In this embodiment, when the system initially configures the main server and the standby server, the default main server is in an operating state, and the standby server is in an inactive state. Therefore, when the heartbeat 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 no fault occurs and a normal state in which the main server is recovered from the fault, the central node selects the main server as a working state no matter whether the standby server is in a normal state or not, and the main server continues to provide services for the client; and selecting the standby server to be in an inactive state, and continuing to serve as the standby server of the main server.
If the main server is in a fault state and the standby server is in a normal state, at the moment, the main server cannot provide service for the client, in order to maintain the normal operation of the system, the central node selects the standby server as a working state, and the standby server replaces the main server to provide service for the client; and selecting the main server as an inactive state. However, when the primary server recovers from the failure, the central node may reselect the primary server to an operational state.
If the main server and the standby server are in a fault state, that is, the main server and the standby server cannot provide services for the client, the central node can maintain default setting, and select the main server to be in a working state and the standby server to be in a non-working state.
The condition that the server is in the fault state may include a device shutdown caused by power failure and a device stand-alone mode caused by network disconnection. When the server is powered off, the server cannot communicate with other devices; when the server is in the off-network stand-alone mode, communication with other servers is possible.
And 120, when no central node is configured in the system, if the heartbeat abnormality between the main server and the standby server is detected, selecting one server from the main server and the standby server as a working state according to a second state judging rule by the standby server.
In this embodiment, a heartbeat detection mechanism may be used to detect whether the primary server and the backup server are in a failure state. The heartbeat detection mechanism is that a main server and a standby server periodically send detection data packets to each other, and 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, at least one of the main server and the standby server is not online, and the main server and the standby server are in a fault state. If the system is not provided with a central node, the working states of the main server and the standby server can be arbitrated by utilizing the standby server, and one of the main server and the standby server is selected to provide service for the client.
Optionally, if the heartbeat between the main server and the standby server is detected to be abnormal, the standby server selects one of the main server and the standby server as the server in the working state according to the second state determination rule, and 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; 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 the working state.
In this embodiment, if no central node is configured in the system, when the heartbeat detection is abnormal, the primary server and the backup server periodically send detection data packets to each other to detect whether the two parties are online, i.e. determine whether they are in a fault state. Since the backup server is a currently inactive server, the active state of the server can be determined by the backup 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 the detection data packet sent by the main server, the main server is considered to be in a normal state; if the detection data packet sent by the main server is not received, the main server is considered to be in a fault state.
When detecting that the heartbeat between the main server and the standby server is abnormal, the standby server can select one server from the main server and the standby server as a working state according to a preset second state judgment rule under a centerless scene according to the fault states of the main server and the standby server, and provide services for the client.
Optionally, the standby server matches the failure state of the primary server with the second state determination rule, and selects one server from the primary server and the standby server as the working state, which 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 fault state, the standby server selects the standby server as a server in a working state.
In this embodiment, if the main server is in a normal state, including a normal state in which no failure has occurred and a normal state in which the main server is recovered from the failure, the standby server considers that the main server is online, selects the main server as a working state, continues to provide services for the client by the main server, and simultaneously selects the standby server as a non-working state, and continues to serve as a standby server of the main server. If the main server is in a fault state, the standby server considers that the main server is not on line, the standby server is selected to be in a working state, the main server is replaced to provide service for the client, and the main server is selected to be in an inactive state.
It should be noted that, when the standby server does not receive the detection data 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 itself is normal, but the main server fails, and the standby server is erroneously selected to be in an operating state. However, when the server fails, the client must be notified of the switching by the backup server, and therefore, when the backup server fails, even if the backup server erroneously selects itself to be in an operating state, the message of the switching failure cannot be transmitted to the client, and therefore, the server is not actually switched, or the service is provided to the client by the primary server.
According to the technical scheme, 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 working state according to the registration condition of the main server and the standby server to the central node; when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that in the prior art, when heartbeat detection between the main server and the standby server is abnormal, the working state of the main server and the standby server cannot be judged correctly is solved, and the system can be used for quickly selecting one server as the server in the working state if the heartbeat abnormality between the main server and the standby server is detected under the scene of having a center node and having no center node.
Example two
Fig. 2 is a flowchart of a method for determining a server operating state in the second embodiment of the present invention, which is further refined on the basis of the foregoing embodiment. The following describes a method for determining the working state of a server according to the present embodiment with reference to fig. 2, including the following steps:
step 210, the main server and the standby server determine whether a central node is configured in the system, if yes, step 220 is executed, otherwise step 240 is executed.
In this embodiment, because the system in which the main server and the standby server are located may or may not be configured with a central node, the processing schemes for the heartbeat exception between the main server and the standby server are different in the scene with the central node and the scene without the central node. Therefore, the primary server and the backup server need to judge in advance whether or not to configure the center node in the system.
Optionally, the determining, by the primary server and the backup server, whether to configure a central node in the system may include: the main server and the standby server inquire whether a configuration record of the central node exists in the database; if the configuration record of the central node exists, the central node is determined to be configured in the system, otherwise, the central node is determined not to be configured in the system.
In this embodiment, since the system configuration operation generates a corresponding configuration file, the primary server and the backup server may query whether the database has a configuration record of configuring the central node, if the database has configuration record data of the central node, the central node is necessarily configured in the system, and if the database does not query the configuration record data of the central node, it may be determined that the central node is not configured in the system.
Step 220, 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.
In step 230, the central node matches the failure states of the primary server and the standby server with the first state determination rule, and selects one server from the primary server and the standby server as the working state.
In this embodiment, if a central node is configured in the system, the central node may acquire a first state determination rule in a scenario in which the central node is present, arbitrate 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 of the main server and the standby server as a server in the working state to provide services to the client.
Optionally, after the central node matches the failure 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 the server in the 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 working states of the main server and the standby server; the standby server judges whether to switch states according to the working states of the main server and the standby server; if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the working state at present.
In this embodiment, in the scenario with the central node, if the central node has selected one server as the working state, the working states of the main server and the standby server need to be carried in the notification message and sent to the main server and the standby server. After receiving the notification message, the standby server extracts the working state of each server from the notification message, judges whether the state switching is required, namely judges whether the working server is changed, and if so, the state switching is required. For example, if the primary server fails, the secondary server is selected to be in an operational state, and needs to operate in place of the primary server; or the main server is recovered from the fault and is selected as the working state again, and when the service is provided for the client, the state switching is needed.
At this time, the standby server may send 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 that provides the service at present. 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 working state switches require the backup server to notify the client through the application service of the backup server.
Step 240, the standby server determines the failure state of the main server according to whether the detection data packet periodically sent by the main server can be received.
Step 250, if the heartbeat between the main server and the standby server is abnormal, 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 the working state.
In this embodiment, if no central node is configured in the system, when detecting that a heartbeat between the main server and the standby server is abnormal, the standby server may acquire a second state determination rule in a scenario without a central node, arbitrate the working states of the main server and the standby server according to whether the main server is in a fault state, and select one of the main server and the standby server as a server in the working state to provide services to the client.
Optionally, after the standby server matches the failure state of the primary server with the second state determination rule, selecting one of the primary server and the standby server as the server in the working state may further include: the standby server judges whether to switch states according to the working states of the main server and the standby server; if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the working state at present.
In this embodiment, after determining the working states of the servers, the standby server may determine whether a state switch is required, that is, determine whether a server that can work changes, and if so, the standby server needs to switch states. For example, if the primary server fails, the secondary server is selected to be in an operational state, and needs to operate in place of the primary server; or the main server is recovered from the fault and is selected as the working state again, and when the service is provided for the client, the state switching is needed. At this time, the standby server may send 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 that provides the service at present.
According to the technical scheme, when the central node is configured in the system, if the heartbeat abnormality between the main server and the standby server is detected, the central node selects one server from the main server and the standby server as a working state according to a first state judgment rule; when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that in the prior art, when heartbeat detection between the main server and the standby server is abnormal, the working state of the main server and the standby server cannot be judged correctly is solved, and the system can be used for quickly selecting one server as the server in the working state if the heartbeat abnormality between the main server and the standby server is detected under the scene of having a center node and having no center node.
Example III
Fig. 3 is a schematic structural diagram of a server operation state determining system according to a third embodiment of the present invention, where the present embodiment is applicable to a case of determining an operation state of a primary server and a secondary server when an abnormal heartbeat is detected between the primary server and the secondary server. As shown in fig. 3, the system includes at least a main server 310 and a standby server 320; the primary server 310 is a currently operating server, and the backup server 320 is a currently inactive server;
a standby server 320, configured to select one server from the main server 310 and the standby server 320 as a working state according to a second state determination rule if an abnormal heartbeat between the main server 310 and the standby server 320 is detected when no central node is configured in the system;
if a central node is configured in the system, the central node is configured to select one server from the main server 310 and the standby server 320 as a working state according to the registration condition of the main server and the standby server with respect to the central node.
Optionally, the primary server 310 and the backup server 320 are further configured to:
before a central node selects one server from a main server and a standby server as 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 a central node is configured in the system, a registration request is periodically sent to the central node.
Optionally, the central node is specifically configured to:
determining 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;
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 a first state judgment rule, and selecting one server from the main server and the standby server as a working state.
Optionally, the central node is specifically configured to:
if the main server and the standby server are in a normal state, selecting the main server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a fault state, selecting the standby server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a normal state after fault recovery, the main server is selected as a server in a working state; or alternatively, the process may be performed,
if the standby server is in a fault state, selecting the main server as a server in a working state; or alternatively, the process may be performed,
and if the standby server is in a normal state after fault recovery, selecting the main server as a server in a working state.
Optionally, the central node is further configured to: the method comprises the steps that fault states of a main server and a standby server are matched with a first state judging rule at a central node, after one server serving as a working state is selected from the main server and the standby server, notification messages are sent to the main server and the standby server, and the notification messages comprise the working states of the main server and the standby server;
the backup server 320 is further configured to: judging whether to perform state switching according to the working states of the main server and the standby server;
and if the state switching is carried out, sending a server working state switching message to the client through the application service associated with the standby server so that the client is connected with the server in the working state at present.
Optionally, the backup server 320 is specifically configured to:
determining a 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, matching the fault state of the main server with a second state judgment rule, and selecting one server from the main server and the standby server as a working state.
Optionally, the backup 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; or alternatively, the process may be performed,
and if the main server is in a fault state, selecting the standby server as a server in a working state.
Optionally, the backup server 320 is further configured to:
after the standby server matches the fault state of the main server with the second state judgment rule, selecting one server from the main server and the standby server as a working state, judging whether to switch states according to the working states of the main server and the standby server;
if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the working state at present.
Optionally, the primary server 310 and the backup server 320 are specifically configured to:
inquiring whether a configuration record of a central node exists in a database;
if the configuration record of the central node exists, the central node is determined to be configured in the system, otherwise, the central node is determined not to be configured in the system.
According to the technical scheme, 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 working state according to the registration condition of the main server and the standby server to the central node; when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging rule; the main server is a currently working server, the standby server is a currently non-working server, the problem that in the prior art, when heartbeat detection between the main server and the standby server is abnormal, the working state of the main server and the standby server cannot be judged correctly is solved, and the system can be used for quickly selecting one server as the server in the working state if the heartbeat abnormality between the main server and the standby server is detected under the scene of having a center node and having no center node.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (6)

1. A method for determining an operating state of a server, comprising:
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 working state according to the registration condition of the main server and the standby server to the central node;
when a central node is not configured in the system, if the heartbeat between the main server and the standby server is abnormal, the standby server selects one server from the main server and the standby server as a working state according to a second state judging rule;
the main server is a server which is currently working, and the standby server is a server which is not currently working;
the central node selects one server from the main server and the standby server as a working state according to the registration condition of the main server and the standby server to the central node, and the central node comprises:
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 working state;
the central node matches the fault states of the main server and the standby server with a first state judgment rule, selects one server from the main server and the standby server as a working state, and comprises the following steps:
if the main server and the standby server are in a normal state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a fault state, the central node selects the standby server as a server in a working state; or alternatively, the process may be performed,
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 alternatively, the process may be performed,
if the standby server is in a fault state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
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;
if the heartbeat abnormality 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 working state according to a second state judging rule, and the method comprises the following steps:
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;
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 working state;
the backup 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 backup server as a working state, and the method comprises the following steps:
if the main server is in a normal state, including a normal state in which no fault is generated and a normal state recovered from the fault, the standby server selects the main server as a server in a working state; or alternatively, the process may be performed,
and if the main server is in a fault state, the standby server selects the standby server as a server in a working state.
2. The method of claim 1, further comprising, before the center node selects one of the primary server and the backup server as the server of the operational state based on registration of the primary server and the backup server with the center node:
the main server and the standby server judge whether a central node is configured in the system;
if a central node is configured in the system, the main server and the standby server periodically send registration requests to the central node.
3. The method of claim 1, wherein matching the failure states of the primary server and the backup server with the first state determination rule at the central node, after selecting one of the primary server and the backup server as the server in the operating state, further comprises:
the central node sends notification messages to the main server and the standby server, wherein the notification messages comprise working states of the main server and the standby server;
the standby server judges whether to switch states according to the working states of the main server and the standby server;
if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the current working state.
4. The method of claim 1, further comprising, after the backup server matches the failure state of the primary server with the second state determination rule, selecting one of the primary server and the backup server as the server in the working state:
the standby server judges whether to switch states according to the working states of the main server and the standby server;
if the state switching is carried out, the standby server sends a server working state switching message to the client through the associated application service so that the client is connected with the server in the current working state.
5. 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 the database;
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.
6. The 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 server from the main server and the standby server as a working state according to a second state judging rule if the heartbeat abnormality between the main server and the standby server 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 used for selecting one server from the main server and the standby server as a working state according to the registration condition of the main server and the standby server to the central node;
the central node selects one server from the main server and the standby server as a working state according to the registration condition of the main server and the standby server to the central node, and the central node comprises:
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 working state;
the central node matches the fault states of the main server and the standby server with a first state judgment rule, selects one server from the main server and the standby server as a working state, and comprises the following steps:
if the main server and the standby server are in a normal state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
if the main server is in a fault state, the central node selects the standby server as a server in a working state; or alternatively, the process may be performed,
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 alternatively, the process may be performed,
if the standby server is in a fault state, the central node selects the main server as a server in a working state; or alternatively, the process may be performed,
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;
if the heartbeat abnormality 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 working state according to a second state judging rule, and the method comprises the following steps:
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;
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 working state;
the backup 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 backup server as a working state, and the method comprises the following steps:
if the main server is in a normal state, including a normal state in which no fault is generated and a normal state recovered from the fault, the standby server selects the main server as a server in a working state; or alternatively, the process may be performed,
and if the main server is in a fault state, the standby server selects the standby server as a server in a working state.
CN202110655803.0A 2021-06-11 2021-06-11 Method and system for determining working state of server Active CN113395188B (en)

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 CN113395188A (en) 2021-09-14
CN113395188B true 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)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
CN113395188A (en) 2021-09-14

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
KR101591102B1 (en) Method for router of virtual router redundancy protocol and communication system therefor
US7719956B2 (en) Trunk network system for multipoint-to-multipoint relay
US20140359340A1 (en) Subscriptions that indicate the presence of application servers
JP6308534B2 (en) Network protection method, network protection device, off-ring node, and system
CN104901834A (en) Method and system for automatically switching between network servers
EP2774323B1 (en) Method, communication system and non-transitory computer readable medium for optimizing network performance after a temporary loss of connection
CN113395188B (en) Method and system for determining working state of server
CN110830310B (en) Cross-data-center disaster backup method and BRAS system
JP2000324121A (en) System changeover device in network management system and its method
JP7064132B2 (en) Fault monitoring system and fault monitoring method
CN113824595B (en) Link switching control method and device and gateway equipment
JP2009003491A (en) Server switching method in cluster system
JP2006254096A (en) Ip telephone system
US20200296607A1 (en) Channel establishment method and base station
JP3111935B2 (en) LAN emulation server redundant system
JP2738362B2 (en) Network connection device
JP2959510B2 (en) Address resolution server switching system in ATM data communication network
CN115102897B (en) Stacking splitting protection method based on link aggregation
CN112714461B (en) DAMA satellite network central station protection switching method
JP4781697B2 (en) IP phone system
JP4628823B2 (en) IP phone system
JP2006254111A (en) Ip telephone system
JPH09274573A (en) Backup 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