CN115543684A - Dual-computer hot standby method and electronic equipment - Google Patents

Dual-computer hot standby method and electronic equipment Download PDF

Info

Publication number
CN115543684A
CN115543684A CN202110730630.4A CN202110730630A CN115543684A CN 115543684 A CN115543684 A CN 115543684A CN 202110730630 A CN202110730630 A CN 202110730630A CN 115543684 A CN115543684 A CN 115543684A
Authority
CN
China
Prior art keywords
service
state
time
server
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110730630.4A
Other languages
Chinese (zh)
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.)
BYD Co Ltd
Original Assignee
BYD 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 BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN202110730630.4A priority Critical patent/CN115543684A/en
Publication of CN115543684A publication Critical patent/CN115543684A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1466Management of the backup or restore process to make the backup process non-disruptive

Abstract

The application discloses a dual-computer hot standby method and electronic equipment, wherein the method comprises the following steps: acquiring first state information of a first service, wherein the first service is used for providing a target service to the outside at a first moment, and the first state information represents an operating state of the first service; judging whether a preset switching condition is met or not according to the first state information; and executing master-slave service switching processing under the condition that the preset switching condition is met, so as to provide the target service externally through a second service at a second time, wherein the first service and the second service are operated on different servers, and the second time is later than the first time. The method can conveniently and quickly realize the smooth switching of the master service and the slave service by monitoring the running state of the first service without respectively carrying out complex configuration on the server where the master service and the slave service are positioned and configuring the failover cluster.

Description

Dual-computer hot standby method and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a dual-computer hot standby method and an electronic device.
Background
Currently, a database, for example, database software such as Oracle, mySql, etc., is generally used to store and manage data, and in order to ensure that a database service can continuously and stably operate, a plurality of database servers are generally configured and managed based on a dual-server hot-standby method, and the plurality of database servers can use a shared storage device to persistently store data. Generally, at the same time, only one database server in the system operates as a master node (master), and other database servers are in a monitoring mode as slave nodes (slave) by default and do not provide data storage and management services to the outside; when the master node operates abnormally, a slave node is activated and is converted into a new master node to continuously provide data storage and management services for the outside.
The existing dual-computer hot standby method generally requires a user to manually modify configuration information in each server, such as a computer name, an Internet Protocol (IP) address, and the like, for a plurality of database servers, and then implements dual-computer hot standby of the plurality of database servers by installing a Domain Name System (DNS) server and configuring a failover cluster (failover cluster). In later maintenance and operation and maintenance, the method needs a user to frequently modify or check the configuration information in each database server, and has the problems of complicated configuration steps and difficult operation and maintenance.
In the above, the database service is taken as an example to illustrate the possible problems of the existing dual-computer hot-standby method. In practice, the above problems may also exist for other network services that need to run continuously and stably, such as enterprise application services. Therefore, it is necessary to provide a dual-device hot-standby method to solve the above problems.
Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a new technical solution for dual-computer hot standby.
In a first aspect of the present disclosure, a dual-computer hot standby method is provided, where the method includes:
acquiring first state information of a first service, wherein the first service is used for providing a target service to the outside at a first moment, and the first state information represents an operating state of the first service; judging whether a preset switching condition is met or not according to the first state information; and executing master-slave service switching processing under the condition that the preset switching condition is met, so as to provide the target service externally through a second service at a second time, wherein the first service and the second service are operated on different servers, and the second time is later than the first time.
Optionally, the first service and the second service provide the target service to the outside based on the same storage container, and an arbitration area is disposed on the storage container; the acquiring first state information of the first service includes: and acquiring the first state information from the arbitration zone.
Optionally, the obtaining the first status information from the arbitration zone includes: acquiring a first timestamp and a second timestamp, wherein the first timestamp is actual time corresponding to the first moment, the second timestamp is time which is updated to the arbitration zone at a third moment and represents that the first service is in a normal running state, and the third moment is not earlier than the second moment; acquiring an absolute value of a difference value of the first timestamp and the second timestamp; and setting the first state information as information indicating that the first service is in an abnormal operation state under the condition that the absolute value of the difference is not less than a preset threshold value.
Optionally, an active server field is set in the arbitration region, and the active server field is used for storing information of an active server; and executing master-slave service switching processing under the condition that the preset switching condition is judged to be met, wherein the master-slave service switching processing comprises the following steps: under the condition that the first state information shows that the first service is in an abnormal operation state, obtaining the second service and first information of a first server where the second service is located from pre-configured slave services; and updating the first information to the field of the active server, so as to trigger the first server to start the second service according to a preset mechanism, and provide the target service to the outside through the second service at the second moment.
Optionally, after updating the first information to the active server field, the method further comprises: sending a first request message to the first server to request the first server to directly start the second service.
Optionally, after updating the first information to the active server field, the method further comprises: changing the state of the storage container to a first state, wherein the first state represents that the storage container is in an unloaded state; and closing the first service.
Optionally, the changing the state of the storage container to a first state includes: unloading the storage container.
Optionally, after performing the master-slave service switching process, the method further includes: monitoring the state of the storage container at a fourth time, and/or receiving a second request message sent by the first server, wherein the second request message is used for requesting a second server where the first service is located to start the first service, and the fourth time is later than the second time; mounting the storage container to change the state of the storage container to a second state when the state of the storage container is a first state; acquiring second information of the active server at the current moment from the active server field; and starting the first service to provide the target service externally through the first service at the fourth time under the condition that the second information is the information of the first server.
Optionally, the first service includes a database service and a database monitoring service corresponding to the database service.
In a second aspect of the present disclosure, there is also provided an electronic device, including:
a memory for storing executable instructions;
a processor configured to execute the electronic device according to the control of the instruction to perform the method according to the first aspect of the present disclosure.
One advantageous effect of the present disclosure is that, according to the embodiment of the present disclosure, when performing the primary and secondary service switching, the DNS server may not need to be installed and configured, and the failover cluster also does not need to be configured, but the first service of the target service may be provided to the outside at the first time, that is, in the process of the primary service running, the first state information indicating the running state of the first service is obtained to determine whether the preset switching condition is currently satisfied, and in the case of determining that the preset switching condition is satisfied, the primary and secondary service switching processing may be performed, so that the target service is provided to the outside at the second time through the second service that is switched and runs on another server, that is, the secondary service. Therefore, the method provided by the embodiment of the disclosure can conveniently and quickly realize the smooth switching of the master service and the slave service by monitoring the running state of the master service without respectively performing complex configuration on the server where the master service and the slave service are located and configuring the failover cluster.
Other features of the present disclosure and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic diagram of a framework of a conventional failover cluster.
Fig. 2 is a schematic flowchart of a dual-computer hot standby method according to an embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a framework of dual-computer hot-standby processing according to an embodiment of the disclosure.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of parts and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as exemplary only and not as limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< method example >
During the operation of application software, for example, an integrated operation dispatching system for performing operation management on trains, a large amount of monitoring data is generated. These monitoring data can be used for performance analysis, troubleshooting, defect prediction, system management, and system optimization of the system. Therefore, to facilitate management of data, such data may be typically stored in a database for use by the system as needed. As described in the background art, in order to ensure that a database service or other similar services can continuously and stably operate, the services can be generally managed in a dual-server hot-standby manner.
For convenience of illustration, in the embodiment of the present disclosure, a service that needs dual-computer hot standby is taken as an example of a database service. Referring to fig. 1, which is a schematic diagram of a framework of a conventional failover cluster, for facilitating understanding of the present application, a detailed description will be given below of possible problems of a conventional dual-computer hot-standby method with reference to fig. 1.
As shown in fig. 1, the existing dual-server hot-standby method needs the following steps for two servers to be dual-server hot-standby, i.e., server1 and server 2, respectively, to configure a failover cluster, so as to implement dual-server hot-standby of a service: step 1, adding a DNS server in two servers; step 2, establishing a fault transfer cluster in the two servers; step 3, performing DNS configuration in both servers, for example, configuring a manager of DNS, adding a DNS Zone (Zone), and the like, and adding information of the two servers, for example, a computer name and an IP address, into a newly-built DNS Zone; step 4, selecting one server optionally, for example, creating a failover cluster manager in the server1, and adding the two servers to the created cluster; step 5, in the server for creating the fault transfer cluster, the name of the created cluster is configured, and an IP address planned for the server participating in the dual-computer hot standby in advance is filled in the management configuration; step 6, in the server 2, the server 2 is connected to the cluster configured in the step 4 and the step 5 through a failover cluster manager; and 7, adding the services which need to be subjected to dual-computer hot standby in the cluster and the storage space corresponding to each type of service in the two servers into the cluster so as to facilitate the cluster to manage the services.
After the deployment of the failover cluster is completed through the configuration, in practical application, the cluster manages the services added to the cluster server according to default rules, and cannot be flexibly modified according to the requirements of users; moreover, when the devices in the cluster need to be added or modified, the configuration steps in fig. 1 need to be repeated, which causes the problems of complicated configuration steps and difficult operation and maintenance.
To solve the above problem, an embodiment of the present disclosure provides a dual-server hot-standby method, please refer to fig. 2, which is a schematic flow chart of the dual-server hot-standby method provided in the embodiment of the present disclosure, and the method may be implemented in a server, specifically, may be implemented by a service monitoring tool in the server, where the service monitoring tool is configured to monitor a state of a corresponding service to determine whether to execute a master-slave service switching process; of course, as the technology advances, the method can also be applied to other devices, for example, to a terminal device, as required, and is not limited herein. In this embodiment, if no special description is given, the method is applied to a server, and a service to be subjected to master-slave service switching is taken as a database service for example.
As shown in fig. 2, the method of the present embodiment may include the following steps S2100-S2300, which will be described in detail below.
Step S2100 obtains first state information of a first service, where the first service is configured to provide a target service to an external device at a first time, and the first state information indicates an operating state of the first service.
Specifically, in this embodiment, the first service may be a service that is in a working state at a first time, that is, a current time and provides a target service to the outside, where in a process that the first service is responsible for providing the target service to the outside, the first service may also be referred to as a main service, an active service, and the like.
The target service is a service that the first service can provide to the outside, for example, if the first service is a database service, the target service may correspond to a data access service, a data management service, and the like.
For example, in an integrated operation dispatching system for performing operation management on trains, in order to persistently store monitoring data generated by the system, the system may comprise a plurality of database servers, and the plurality of database servers provide data access and management services for the system in a dual-machine hot-standby manner; at this time, the database service in a certain database server for receiving and responding to the data access request of the system at the same time may be referred to as a first service.
It should be noted that the first service may include a plurality of services. For example, in the case that the database software used is an Oracle database, since the Oracle database needs to simultaneously run an Oracle running service and an Oracle listening service when providing a service to the outside, in this case, the first service may include the Oracle running service and the Oracle listening service, where the Oracle listening service, i.e., listener, is responsible for managing communication between the Oracle database and the client. In addition, in a case that the first service is another type of service, for example, an enterprise application class service, the first service may only include the one service, and is not limited herein.
In one embodiment, the first service and the second service provide the target service outside based on the same storage container pair, and an arbitration area is arranged on the storage container; the acquiring first state information of the first service includes: and acquiring the first state information from the arbitration zone.
Wherein the obtaining the first state information from the arbitration zone comprises: acquiring a first time stamp and a second time stamp, wherein the first time stamp is actual time corresponding to the first time, the second time stamp is time which is updated to the arbitration zone at a third time and represents that the first service is in a normal operation state, and the third time is not earlier than the second time; acquiring an absolute value of a difference value of the first timestamp and the second timestamp; and setting the first state information as information indicating that the first service is in an abnormal operation state under the condition that the absolute value of the difference is not less than a preset threshold value.
Please refer to fig. 3, which is a schematic diagram of a dual-computer hot standby processing framework according to an embodiment of the disclosure. In fig. 3, taking the service that needs dual-server hot-standby as an example of an Oracle database service, the following describes how to obtain the first status information in detail with reference to fig. 3.
As shown in fig. 3, in the embodiment of the present disclosure, in order to conveniently and accurately implement dual-computer hot standby, a service monitor tool may be installed in advance on all servers installed with Oracle database software, so that the service monitor tool executes the dual-computer hot standby method provided in the embodiment of the present disclosure.
In practice, database services on different database servers may often provide database storage and management services outside of the same storage container. For example, by storing instance data of an Oracle database instance in a storage area of a disk array; for example, server1 may mount a storage area on the disk array through a network, so that a locally running database service, for example, server1 provides data storage and management service to the outside based on instance data in the storage area; when the server1 operates abnormally, the storage area can be unloaded by the server1, and other servers, such as the server 2 mount the storage area, so that the database service on the machine can be continuously provided to the data storage and management service outwards based on the storage area; since the detailed processing of how the server mounts and unloads the storage area in the disk array is described in detail in the prior art, it is not described here again.
As shown in fig. 3, in the embodiment of the present disclosure, the database services of different database servers may provide the database storage and management services to the outside based on the same storage container, i.e., disk array.
At the initial moment, the service monitoring tool installed on each database server can arbitrate the database service on one database server of the plurality of database servers as the main service according to the preset master-slave arbitration logic.
Wherein the preset master-slave arbitration logic may be at least one of: arbitrating a main database server according to historical operating data corresponding to a plurality of database servers to be arbitrated; arbitrating a main database server according to an execution sequence pre-configured by a user; the master database server is arbitrated according to a predetermined consensus algorithm (consensus glgorithm).
The historical operating data can be data such as a system log of a database server, a database operating log and the like.
The arbitration of the master database server according to the preset consensus algorithm may be: and selecting a main database server from a plurality of database servers based on a Raft protocol.
As shown in fig. 3, an arbitration area is further divided on the disk array used by each database service, and the arbitration area is provided with relevant arbitration information such as an active server field and an active service running time field, where the active server field is used to store information of an active server, and the active service running time is used to indicate the latest normal running time of an active service that provides a target service to the outside at the present time.
Specifically, after obtaining an active service that provides a database service to the outside at the current time, that is, after obtaining the first service; in order to accurately determine the time for switching between the master service and the slave service in the subsequent process, the service monitor1 installed on the server where the first service is located may write the relevant information of the server, for example, the name of the computer, the IP address, and other information into the arbitration area of the disk array.
Then, in the process that the first service provides the target service to the outside, the service monitoring tool monitor1 may monitor the running state of the first service at preset time intervals, and update the timestamp corresponding to a certain time into the active service running time of the arbitration region under the condition that the first service runs normally at the certain time, so that other processing threads in the monitor1 may determine whether to execute the master-slave service switching processing according to the timestamp in the normal running time field.
For example, the first service may be an Oracle running service and an Oracle listening service on the server 1; when monitor1 on server1 monitors that the running states of the two services are normal at time "15. In addition, other processing threads of monitor1 may further obtain a timestamp of the current time as a first timestamp at a preset time interval, obtain a timestamp stored in an active service running time field of the arbitration region as a second timestamp, and determine whether the main service at the current time, that is, the first service is abnormal or not by comparing an absolute value of a difference between the two timestamps with a preset threshold, so as to obtain first state information of the first service.
In the existing dual-computer hot standby method based on the failover cluster, the switching time of the master-slave service is usually determined according to the heartbeat packet, in this case, when the heartbeat packet is sent too frequently, the problem of network congestion may be brought, and if the heartbeat packet is sent too slowly, the problem of inaccurate switching time may be caused. As can be seen from the above description, in the embodiment of the present disclosure, by updating the latest uptime of the active service in the active service runtime field of the arbitration zone, the time for performing the master-slave service switching can be conveniently and accurately determined, so as to avoid the above problems.
After step S2100, executing step S2200, and determining whether a preset switching condition is met according to the first state information; and executing step S2300, and if it is determined that the preset switching condition is met, executing a master-slave service switching process to provide the data storage service to the outside through a second service at a second time, where the first service and the second service are run on different servers, and the second time is later than the first time.
Specifically, in the process of running the first service, after the first state information is obtained, it may be determined whether the master-slave service switching process is satisfied according to the first state information.
In one embodiment, an active server field is arranged in the arbitration zone and used for storing information of an active server; and executing master-slave service switching processing under the condition that the preset switching condition is judged to be met, wherein the master-slave service switching processing comprises the following steps: under the condition that the first state information shows that the first service is in an abnormal operation state, obtaining the second service and first information of a first server where the second service is located from pre-configured slave services; and updating the first information to the active server field, so as to trigger the first server to start the second service according to a preset mechanism, and provide the target service through the second service at the second moment.
Referring to fig. 3, specifically, when the obtained first state information identifies that the first service is in an abnormal operation state, that is, the absolute difference between the timestamp of the current actual time and the timestamp stored in the active service operation time in the arbitration region is greater than the preset threshold, it may be determined that the master-slave service switching process needs to be performed at the current time, so as to switch the standby slave service to the new master service, and further provide the target service to the outside through the second service.
Specifically, at the first time, when it is determined that the master-slave service switching process needs to be executed, a service monitor running on the server where the first service is located may rearbitrate a new master server, that is, select a new master server from servers where the preconfigured slave services are located, and write information of the new master server into an active server field of the arbitration zone, so as to trigger the service monitor running on the new master server to start the second service on the server itself according to the field, and the second service continues to provide the target service to the outside based on the instance data in the disk array storage area.
In one embodiment, after updating the first identification to the active server field, the method further comprises: sending a first request message to the first server to request the first server to directly start the second service.
Specifically, after writing the information of the first server where the second service is located into the arbitration region, the service monitoring tool running on the first server reads the information in the active server field according to a preset mechanism, and starts the second service as a new main service at a second time later than the first time to provide a target service to the outside when judging that the information is the information of the server where the second service is located. However, since the service monitoring tool running on the first server reads the information in the field of the active server according to a preset mechanism, for example, according to a preset time interval, a problem that the master and slave services cannot be switched in time may occur.
In order to solve the problem, after the service monitoring tool running on the second server where the first service is located writes the information of the first server into the active server field of the arbitration zone, the service monitoring tool can also send a first request message to the first server at the same time to request the first server to directly start the second service to provide the target service to the outside in time.
In addition, when performing the master-slave switching process, after updating the information of the new master server, that is, the first information of the first server, to the active server field of the arbitration area, in order to enable the new master service, that is, the second service, to provide the target service to the outside in time based on the data in the disk array storage area, the method provided in this embodiment further includes: changing the state of the storage container to be a first state, wherein the first state represents that the storage container is in an unloading state; and closing the first service.
In a specific implementation, the changing the state of the storage container to the first state may specifically be unloading, by a server where the first service is located, the storage container, for example, an arbitration area and a storage area in a disk array, so that a server where the second service is located may mount the arbitration area and the storage area.
Of course, in specific implementation, the arbitration area and the storage area may also be set as a shared storage that can be accessed by multiple servers at the same time, and only the master service has read-write permission to the arbitration area and the storage area at the same time, so that it is not necessary to perform the unloading and mounting operations when performing the master-slave service switching process.
After the old main service at the first time is switched to the new main service at the second time, namely the second service, through the processing, the second service can serve as the main service at the second time to provide target service to the outside; in the process that the second service provides the target service to the outside, the service monitoring tool running on the second server where the first service is located can enter a monitoring state to monitor whether the first service needs to be switched again as the main service.
That is, after the master-slave service switching process is executed, the method provided in this embodiment further includes: monitoring the state of the storage container at a fourth time, and/or receiving a second request message sent by the first server, wherein the second request message is used for requesting a second server where the first service is located to start the first service, and the fourth time is later than the second time; mounting the storage container to change the state of the storage container to a second state when the state of the storage container is a first state; acquiring second information of the active server at the current moment from the active server field; and starting the first service to provide the target service externally through the first service at the fourth time under the condition that the second information is the information of the first server.
That is, in the process that the second service provides the target service to the outside based on the storage container, for example, the storage area in the disk array and the arbitration area as the master service at the second time, when it is necessary to perform the master-slave service switching process again and arbitrate that the first service is as the master service again, the service monitoring tool on the server where the first service is located may change the state of the storage container to the first state, that is, the uninstalled state, when it is monitored, or, in the case of receiving the second request message sent by the server where the second service is located, re-mount the storage container to read the information in the active server field of the arbitration area, and in the case that the information is consistent with the own information, for example, the name of the computer, start the first service on the own server and provide the target service to the outside based on the data in the storage area on the re-mounted storage container at the fourth time.
To sum up, in the dual-server hot-standby method provided in this embodiment, when performing the main-standby service switching, the DNS server does not need to be installed and configured, and the failover cluster does not need to be configured, but the first service of the target service may be provided externally at the first time, that is, in the process of the main service running, the first state information indicating the running state of the first service is obtained to determine whether the preset switching condition is currently satisfied, and in the case of determining that the preset switching condition is satisfied, the main-standby service switching process may be executed, so that the target service is provided externally from the service through the second service that is switched and runs on another server at the second time, that is, the preset switching condition is satisfied. Therefore, the method provided by the embodiment of the disclosure can conveniently and quickly realize the smooth switching of the master service and the slave service by monitoring the running state of the master service without respectively performing complex configuration on the server where the master service and the slave service are located and configuring the failover cluster.
< apparatus embodiment >
Corresponding to the above method embodiment, in this embodiment, an electronic device is further provided, please refer to fig. 4, which is a schematic structural diagram of an electronic device provided in the embodiment of the present disclosure.
As shown in fig. 4, the electronic device 4000 may include a processor 4200 and a memory 4000, the memory 4100 for storing executable instructions; the processor 4200 is configured to operate the electronic device according to the control of the instructions to perform a dual-server hot-standby method according to any of the embodiments of the present disclosure.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer-readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the market, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims (10)

1. A dual-computer hot standby method is characterized by comprising the following steps:
acquiring first state information of a first service, wherein the first service is used for providing a target service to the outside at a first time, and the first state information represents an operating state of the first service;
judging whether a preset switching condition is met or not according to the first state information; and the number of the first and second groups,
and executing master-slave service switching processing under the condition that the preset switching condition is met, so as to provide the target service externally through a second service at a second time, wherein the first service and the second service are operated on different servers, and the second time is later than the first time.
2. The method of claim 1, wherein the first service and the second service provide the target service outside based on a same storage container, and wherein an arbitration region is disposed on the storage container;
the acquiring first state information of the first service includes:
and acquiring the first state information from the arbitration zone.
3. The method of claim 2, wherein the obtaining the first status information from the arbitration zone comprises:
acquiring a first time stamp and a second time stamp, wherein the first time stamp is actual time corresponding to the first time, the second time stamp is time which is updated to the arbitration zone at a third time and represents that the first service is in a normal operation state, and the third time is not earlier than the second time;
acquiring an absolute value of a difference value of the first timestamp and the second timestamp;
and setting the first state information as information indicating that the first service is in an abnormal operation state under the condition that the absolute value of the difference is not less than a preset threshold value.
4. The method according to claim 2, wherein an active server field is provided in the arbitration zone, and the active server field is used for storing information of an active server;
and executing master-slave service switching processing under the condition that the preset switching condition is judged to be met, wherein the master-slave service switching processing comprises the following steps:
under the condition that the first state information shows that the first service is in an abnormal operation state, obtaining the second service and first information of a first server where the second service is located from pre-configured slave services; and the number of the first and second groups,
and updating the first information to the field of the active server, so as to trigger the first server to start the second service according to a preset mechanism, and providing the target service to the outside through the second service at the second moment.
5. The method of claim 4, wherein after updating the first information to the active server field, the method further comprises:
sending a first request message to the first server to request the first server to directly start the second service.
6. The method of claim 4, wherein after updating the first information to the active server field, the method further comprises:
changing the state of the storage container to a first state, wherein the first state represents that the storage container is in an unloaded state; and the number of the first and second groups,
closing the first service.
7. The method of claim 6, wherein said changing the state of the storage container to a first state comprises:
unloading the storage container.
8. The method of claim 4, wherein after performing the master-slave service switching process, the method further comprises:
monitoring the state of the storage container at a fourth time, and/or receiving a second request message sent by the first server, wherein the second request message is used for requesting a second server where the first service is located to start the first service, and the fourth time is later than the second time;
mounting the storage container to change the state of the storage container to a second state when the state of the storage container is a first state;
acquiring second information of the active server at the current moment from the active server field;
and starting the first service under the condition that the second information is the information of the first server, so as to externally provide the target service through the first service at the fourth time.
9. The method of claim 1, wherein the first service comprises a database service and a database listening service corresponding to the database service.
10. An electronic device, comprising:
a memory for storing executable instructions;
a processor configured to execute the electronic device to perform the method according to the control of the instruction, wherein the method is as claimed in any one of claims 1 to 9.
CN202110730630.4A 2021-06-29 2021-06-29 Dual-computer hot standby method and electronic equipment Pending CN115543684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110730630.4A CN115543684A (en) 2021-06-29 2021-06-29 Dual-computer hot standby method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110730630.4A CN115543684A (en) 2021-06-29 2021-06-29 Dual-computer hot standby method and electronic equipment

Publications (1)

Publication Number Publication Date
CN115543684A true CN115543684A (en) 2022-12-30

Family

ID=84717329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110730630.4A Pending CN115543684A (en) 2021-06-29 2021-06-29 Dual-computer hot standby method and electronic equipment

Country Status (1)

Country Link
CN (1) CN115543684A (en)

Similar Documents

Publication Publication Date Title
CN107534570B (en) Computer system, method and medium for virtualized network function monitoring
US9647891B2 (en) Managing network configurations
CN111756571B (en) Cluster node fault processing method, device, equipment and readable medium
JP6325001B2 (en) Method and system using recursive event listeners in nodes of hierarchical data structures
US10198212B2 (en) Distributed backup system
US9130943B1 (en) Managing communications between client applications and application resources of on-premises and cloud computing nodes
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
US11438249B2 (en) Cluster management method, apparatus and system
US20220138036A1 (en) Safely recovering workloads within a finite timeframe from unhealthy cluster nodes
CN110609656B (en) Storage management method, electronic device, and computer program product
CN108964977B (en) Node exception handling method and system, storage medium and electronic device
CN107508700B (en) Disaster recovery method, device, equipment and storage medium
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN114531373A (en) Node state detection method, node state detection device, equipment and medium
CN112751693B (en) Data processing method and device of distributed storage system and electronic equipment
US9442746B2 (en) Common system services for managing configuration and other runtime settings of applications
US20170187575A1 (en) System and method for customizing standard device-orientated services within a high scale deployment
CN115543684A (en) Dual-computer hot standby method and electronic equipment
US9678799B2 (en) Dynamic correlated operation management for a distributed computing system
US9880855B2 (en) Start-up control program, device, and method
US10972343B2 (en) System and method for device configuration update
US11599352B2 (en) Method of creating an intelligent upgrade flow for a heterogeneous data center
US20230388205A1 (en) Cluster availability monitoring and alerting
JP2013046372A (en) Fault detection device, network configuration estimation device and fault detection method
US10623265B1 (en) System and method for logical configuration of distributed systems

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