CN112506702B - Disaster recovery method, device, equipment and storage medium for data center - Google Patents

Disaster recovery method, device, equipment and storage medium for data center Download PDF

Info

Publication number
CN112506702B
CN112506702B CN202011396543.1A CN202011396543A CN112506702B CN 112506702 B CN112506702 B CN 112506702B CN 202011396543 A CN202011396543 A CN 202011396543A CN 112506702 B CN112506702 B CN 112506702B
Authority
CN
China
Prior art keywords
data center
message
target
subject
preset
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
CN202011396543.1A
Other languages
Chinese (zh)
Other versions
CN112506702A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011396543.1A priority Critical patent/CN112506702B/en
Publication of CN112506702A publication Critical patent/CN112506702A/en
Application granted granted Critical
Publication of CN112506702B publication Critical patent/CN112506702B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of information security, and discloses a disaster recovery method, device, equipment and storage medium for a data center, which are used for improving the safety and reliability of data. The disaster recovery method of the data center comprises the following steps: starting a bidirectional message synchronization service for two preset data centers, and creating a subject message and a corresponding message copy; updating the theme message to a bidirectional message synchronization service, and performing data synchronization processing on the target data center and the backup data center according to the theme message; pushing target topic data to topic messages of the backup data center according to the unique identification value when the heartbeat detection result of the target data center is abnormal; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain the target subscription data. In addition, the present invention relates to blockchain techniques, and subject messages may be stored in blockchain nodes.

Description

Disaster recovery method, device, equipment and storage medium for data center
Technical Field
The present invention relates to the field of access rules in information security technologies, and in particular, to a disaster recovery method, apparatus, device, and storage medium for a data center.
Background
In a big data application system, asynchronous data transmission is carried out by utilizing a message middleware efficient and reliable message transmission mechanism, and the integration of a distributed computing analysis system is carried out based on data communication, so that the real-time analysis of data is realized. The upstream application pushes data such as logs, database data, service messages and the like to the middleware so that the follow-up open source stream processing framework flink, calculation engine spark or framework store can clean and analyze the data, valuable data can be extracted, and therefore more economic benefits are created for enterprises.
Wherein both the stability and security of the middleware cluster directly affect the direction of the results, possibly leading to system crashes or making erroneous decisions, the multi-data center support and automatic failover capabilities of the message middleware cluster are of paramount importance. At present, when the whole data center fails, the existing operation and maintenance means are required to switch the standby data center, synchronize data and reset the offset, and then restart all service systems. The whole process is complicated, the service program is in a breakdown state for a long time, the disaster recovery switching efficiency of the data center is low, and data loss is caused.
Disclosure of Invention
The invention provides a disaster recovery method, device, equipment and storage medium for a data center, which are used for improving the safety reliability and integrity of data and improving the disaster recovery switching efficiency of the data center.
In order to achieve the above object, a first aspect of the present invention provides a disaster recovery method for a data center, including: starting a bidirectional message synchronization service for two preset data centers, and respectively creating a subject message and a message copy corresponding to each preset data center for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center; updating the subject message into the bidirectional message synchronization service, and monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the subject message through the bidirectional message synchronization service, wherein the subject message has a corresponding unique identification value; when a data pushing request is received and the heartbeat detection result of a target data center is abnormal, acquiring and caching target subject data from the data pushing request, pushing the target subject data to a subject message of a backup data center according to the unique identification value, and pushing data to message copies corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from faults; when a data subscription request is received and the heartbeat detection result of the target data center is abnormal, acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data.
Optionally, in a first implementation manner of the first aspect of the present invention, the opening a bidirectional message synchronization service to two preset data centers, and creating a subject message and a message copy corresponding to each preset data center for each preset data center, where the two preset data centers include a target data center and a backup data center, includes: starting a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center; configuring a first access address for the target data center and configuring a second access address for the backup data center; calling a message middleware cluster interface of a target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center; and calling a message middleware cluster interface of a backup data center based on the second access address to create the subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center.
Optionally, in a second implementation manner of the first aspect of the present invention, the updating the theme message to the bidirectional message synchronization service, performing, by the bidirectional message synchronization service, monitoring and data synchronization processing on the target data center and the backup data center according to the theme message, where the theme message has a corresponding unique identification value, includes: adding the subject message to a white list of a bidirectional message synchronization service, and setting a corresponding unique identification value for the subject message, wherein the unique identification value is used for indicating the access flow limitation to the message middleware cluster of each preset data center; the target data center and the standby data center are respectively connected through the bidirectional message synchronization service, the subject message in the target data center is pushed to the message copy corresponding to the standby data center, and the subject message in the standby data center is pushed to the message copy corresponding to the target data center; and acquiring the consumption position of the theme message from the target data center, and pushing the consumption position of the theme message to the configuration theme of the standby data center, wherein the initial value of the consumption position of the theme message is 0.
Optionally, in a third implementation manner of the first aspect of the present invention, when a data push request is received and an abnormal heartbeat detection result of a target data center exists, target subject data is obtained and cached from the data push request, the target subject data is pushed to a subject message of a backup data center according to the unique identification value, and when a failure of the target data center is recovered, pushing data for a message copy corresponding to each preset data center through the bidirectional message synchronization service includes: when a data push request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data push request to obtain target subject data, and storing the target subject data into a memory database to obtain cached subject data; connecting the backup data center to obtain a connection result, and pushing the cached subject data to the subject message of the backup data center according to the unique identification value when the connection result is that the connection is successful; detecting the target data center through a preset heartbeat detection task, connecting the target data center through the bidirectional message synchronization service when the target data center is in fault recovery, and synchronizing the cached subject data to a subject message of the target data center; pushing the subject message of the target data center to the message copy corresponding to the backup data center, and pushing the subject message of the backup data center to the message copy corresponding to the target data center.
Optionally, in a fourth implementation manner of the first aspect of the present invention, when a data subscription request is received and a heartbeat detection result of a target data center is abnormal, acquiring a consumption location of the target data center from the backup data center according to the data subscription request, and resetting a message copy corresponding to the backup data center according to the consumption location to obtain target subscription data, including: when a data subscription request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data subscription request to obtain a unique identification value of a subject message; subscribing the topic message of the backup data center and the corresponding message copy of the backup data center according to the unique identification value of the topic message; and reading the consumption position of the target data center from the configuration theme of the standby data center, setting a data reading starting value for the theme message of the target data center according to the consumption position, and extracting target subscription data according to the data reading starting value.
Optionally, in a fifth implementation manner of the first aspect of the present invention, before the opening a bidirectional message synchronization service to two preset data centers, and creating a subject message and a message copy corresponding to each preset data center for each preset data center, before the two preset data centers include a target data center and a backup data center, the data center disaster recovery method further includes: a socket connection request is sent to each preset data center through a preset heartbeat detection task, and a socket long connection is established, wherein the socket long connection is used for indicating to push messages to each preset data center respectively; and respectively sending heartbeat packets to each preset data center according to preset frequency to perform heartbeat detection to obtain a heartbeat detection result, wherein the heartbeat detection result is used for indicating whether the connection of each preset data center is abnormal or not.
Optionally, in a sixth implementation manner of the first aspect of the present invention, when the data subscription request is received and there is an abnormality in a heartbeat detection result of the target data center, a consumption location of the target data center is obtained from the backup data center according to the data subscription request, and a message copy corresponding to the backup data center is reset according to the consumption location, so as to obtain target subscription data, and after the data center disaster recovery method further includes: performing data persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center, and statistically analyzing the abnormal heartbeat detection quantity of each preset data center within a preset duration; when the abnormal number of heartbeat detection of each preset data center is larger than a preset threshold value, generating warning information, and pushing the warning information to a target terminal, so that the target terminal prompts target personnel to troubleshoot the preset data center with faults according to the warning information.
The second aspect of the present invention provides a disaster recovery device for a data center, including: the system comprises a creation module, a backup module and a message synchronization module, wherein the creation module is used for starting a bidirectional message synchronization service for two preset data centers and creating a subject message and a message copy corresponding to each preset data center for each preset data center respectively, and the two preset data centers comprise a target data center and the backup data center; the updating module is used for updating the theme message into the bidirectional message synchronization service, monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the theme message through the bidirectional message synchronization service, and the theme message has a corresponding unique identification value; the pushing module is used for acquiring and caching target subject data from the data pushing request when the data pushing request is received and the heartbeat detection result of the target data center is abnormal, pushing the target subject data to the subject message of the backup data center according to the unique identification value, and pushing data to the message copy corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from faults; and the subscription module is used for acquiring the consumption position of the target data center from the backup data center according to the data subscription request and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data when the data subscription request is received and the heartbeat detection result of the target data center is abnormal.
Optionally, in a first implementation manner of the second aspect of the present invention, the creating module is specifically configured to: starting a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center; configuring a first access address for the target data center and configuring a second access address for the backup data center; calling a message middleware cluster interface of a target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center; and calling a message middleware cluster interface of a backup data center based on the second access address to create the subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center.
Optionally, in a second implementation manner of the second aspect of the present invention, the update module is specifically configured to: adding the subject message to a white list of a bidirectional message synchronization service, and setting a corresponding unique identification value for the subject message, wherein the unique identification value is used for indicating the access flow limitation to the message middleware cluster of each preset data center; the target data center and the standby data center are respectively connected through the bidirectional message synchronization service, the subject message in the target data center is pushed to the message copy corresponding to the standby data center, and the subject message in the standby data center is pushed to the message copy corresponding to the target data center; and acquiring the consumption position of the theme message from the target data center, and pushing the consumption position of the theme message to the configuration theme of the standby data center, wherein the initial value of the consumption position of the theme message is 0.
Optionally, in a third implementation manner of the second aspect of the present invention, the pushing module is specifically configured to: when a data push request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data push request to obtain target subject data, and storing the target subject data into a memory database to obtain cached subject data; connecting the backup data center to obtain a connection result, and pushing the cached subject data to the subject message of the backup data center according to the unique identification value when the connection result is that the connection is successful; detecting the target data center through a preset heartbeat detection task, connecting the target data center through the bidirectional message synchronization service when the target data center is in fault recovery, and synchronizing the cached subject data to a subject message of the target data center; pushing the subject message of the target data center to the message copy corresponding to the backup data center, and pushing the subject message of the backup data center to the message copy corresponding to the target data center.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the subscription module is specifically configured to: when a data subscription request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data subscription request to obtain a unique identification value of a subject message; subscribing the topic message of the backup data center and the corresponding message copy of the backup data center according to the unique identification value of the topic message; and reading the consumption position of the target data center from the configuration theme of the standby data center, setting a data reading starting value for the theme message of the target data center according to the consumption position, and extracting target subscription data according to the data reading starting value.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the disaster recovery device for a data center further includes: the connection module is used for respectively sending socket connection requests to each preset data center through preset heartbeat detection tasks and establishing socket long connection, wherein the socket long connection is used for indicating to respectively push messages to each preset data center; the detection module is used for respectively sending heartbeat packets to each preset data center according to preset frequency so as to carry out heartbeat detection and obtain a heartbeat detection result, and the heartbeat detection result is used for indicating whether the connection of each preset data center is abnormal or not.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the disaster recovery device for a data center further includes: the statistics module is used for carrying out data persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center, and carrying out statistics analysis on the abnormal heartbeat detection quantity of each preset data center within a preset duration; and the early warning module is used for generating warning information and pushing the warning information to the target terminal when the abnormal heartbeat detection number of each preset data center is larger than a preset threshold value, so that the target terminal prompts target personnel to troubleshoot the preset data center according to the warning information.
A third aspect of the present invention provides a disaster recovery device for a data center, including: a memory and at least one processor, the memory having instructions stored therein; and the at least one processor calls the instruction in the memory so that the data center disaster recovery equipment executes the data center disaster recovery method.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein that, when executed on a computer, cause the computer to perform the data center disaster recovery method described above.
In the technical scheme provided by the invention, a bidirectional message synchronization service is started for two preset data centers, and a subject message and a message copy corresponding to each preset data center are respectively created for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center; updating the subject message into the bidirectional message synchronization service, and monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the subject message through the bidirectional message synchronization service, wherein the subject message has a corresponding unique identification value; when a data pushing request is received and the heartbeat detection result of a target data center is abnormal, acquiring and caching target subject data from the data pushing request, pushing the target subject data to a subject message of a backup data center according to the unique identification value, and pushing data to message copies corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from faults; when a data subscription request is received and the heartbeat detection result of the target data center is abnormal, acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data. In the embodiment of the invention, the two-way message synchronization service is started for the two preset data centers, and the theme message and the corresponding message copy are created, so that the data synchronization efficiency and accuracy are improved; when the heartbeat detection result of the target data center is abnormal, pushing target subject data to the subject message of the backup data center according to the unique identification value, so that partition resource loss of the data center is reduced; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data, and adopting two preset data centers improves the safety reliability and the integrity of the data and improves the disaster recovery switching efficiency of the data center.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a disaster recovery method for a data center according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another embodiment of a disaster recovery method for a data center according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a disaster recovery architecture of a data center according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of a disaster recovery device for a data center according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another embodiment of a disaster recovery device for a data center according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment of a disaster recovery device for a data center in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a disaster recovery method, a device, equipment and a storage medium for a data center, which are used for improving the safety reliability and the integrity of data by adopting two preset data centers and improving the disaster recovery switching efficiency of the data centers.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For easy understanding, the following describes a specific flow of an embodiment of the present invention, referring to fig. 1, and one embodiment of a disaster recovery method for a data center in the embodiment of the present invention includes:
101. and starting a bidirectional message synchronization service for two preset data centers, and respectively creating a subject message and a message copy corresponding to each preset data center for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center.
The number of the preset data centers may be two or more according to actual service requirements, and is not limited herein. Specifically, the server starts a bidirectional message synchronization service for two preset data centers, wherein the two preset data centers comprise a target data center and a backup data center, and the bidirectional message synchronization service is used for indicating that topic messages needing to be synchronized are automatically matched according to a white list policy; the server creates a subject message and a message copy corresponding to the target data center in a data model zookeeper where the target data center is located; and the server creates a subject message and a message copy corresponding to the backup data center for the zookeeper where the backup data center is located.
It should be noted that, the message copy corresponding to each preset data center is used for backing up the same subject message of another preset data center. For example, two preset data centers DC1 and DC2, where DC1 is a target data center, DC2 is a backup data center, and two-way message synchronization is started between the two preset data centers of the server. When the server creates the xxx Topic message Topic, it also creates a message copy dc2.xxx corresponding to the Topic message xxx and DC1 in DC1, and creates a message copy dc1.xxx corresponding to the Topic message xxx and DC2 in DC2.
Further, the subject message is stored in a blockchain database, and is not limited herein in particular.
It can be understood that the execution body of the present invention may be a disaster recovery device of a data center, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking a server as an execution main body as an example.
102. And updating the topic message into the bidirectional message synchronization service, and monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the topic message through the bidirectional message synchronization service, wherein the topic message has a corresponding unique identification value.
The bidirectional message synchronization service is a synchronization service which is secondarily developed by a server based on an open source component mirrormaker 2. Specifically, the server writes the subject message into a white list in the bidirectional message synchronization service; the server automatically matches the theme messages to be synchronized according to the white list strategy through the bidirectional message synchronization service, and the server respectively detects whether data changes exist in the theme messages in the zookeeper where the target data center is located and the zookeeper where the backup data center is located according to the matched theme messages (namely, the data changes caused by data adding, deleting and modifying processing); when the server detects that any preset data center (target data center or backup data center) is changed, the server calls a preset interface of a message middleware cluster of each preset data center to synchronize data in a changed subject message of each preset data center to a message copy corresponding to another preset data center.
103. When a data pushing request is received and the heartbeat detection result of the target data center is abnormal, target subject data is obtained and cached from the data pushing request, the target subject data is pushed to the subject message of the backup data center according to the unique identification value, and when the target data center is recovered from faults, the data is pushed to the message copy corresponding to each preset data center through the bidirectional message synchronization service.
It can be understood that, in the process of pushing the subject data, the server further performs heartbeat detection on the target data center through a preset heartbeat detection task, so as to obtain a heartbeat detection result of the target data center, wherein the heartbeat detection result of the target data center comprises a normal heartbeat detection and an abnormal heartbeat detection. Wherein the data push request is used to instruct the producer to write data into each of the data-neutral subject messages.
Specifically, when a server receives a data push request and the heartbeat detection result of a target data center is abnormal, the server analyzes the data push request to obtain target subject data and caches the target subject data; the server pushes the target subject data to the subject message of the backup data center according to the unique identification value; the server carries out heartbeat detection on the target data center through a preset heartbeat detection task, and when the target data center is recovered from faults, the server synchronizes data in the subject message of each preset data center to a message copy corresponding to the other preset data center through a bidirectional message synchronization service, so that the data consistency and the data integrity between the target data center and the backup data center are ensured.
For example, when target theme data is pushed to the xxx theme of the target data center DC1, the server caches the target theme data, when the server detects that the DC1 fails, the server cannot sense the heartbeat of the DC1 at the moment, then the server establishes connection with the backup data center DC2, and pushes the cached target theme data to the xxx theme of the DC2, so that the data is ensured not to be lost in the production process.
104. When a data subscription request is received and the heartbeat detection result of the target data center is abnormal, acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data.
It should be noted that, the heartbeat detection performed by the server on the target data center is similar to the execution process of step 103, and detailed descriptions thereof are omitted here. Wherein the data subscription request is used to instruct the consumer to extract data from the subject message of each data center. Specifically, when a server receives a data subscription request and the heartbeat detection result of a target data center is abnormal, the server determines a topic message and a unique identification value of the topic message according to the data subscription request; and the server extracts the consumption position of the target data center from the backup data center according to the unique identification value, resets the message copy corresponding to the backup data center according to the consumption position, and obtains the target subscription data.
In the embodiment of the invention, the two-way message synchronization service is started for two preset data centers, and the subject message and the corresponding message copy are created, so that the data synchronization efficiency and accuracy are improved; when the heartbeat detection result of the target data center is abnormal, pushing target subject data to the subject message of the backup data center according to the unique identification value, so that partition resource loss of the data center is reduced; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data, and adopting two preset data centers improves the safety reliability and the integrity of the data and improves the disaster recovery switching efficiency of the data center.
Referring to fig. 2, another embodiment of a disaster recovery method for a data center in an embodiment of the present invention includes:
201. and starting a bidirectional message synchronization service for two preset data centers, and respectively creating a subject message and a message copy corresponding to each preset data center for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center.
The topic messages can be divided into 1, 2 or more according to different message types. As shown in fig. 3, two preset data centers are a target data center 301 (i.e., DC 1) and a backup data center 302 (i.e., DC 2), and the server creates a subject message in DC1 including xxx, yyy, and/or zzz and a corresponding message copy of dc2.xxx, dc2.yyy, and/or DC2zzz; the server creates a subject message in DC2 including xxx, yyy and/or zzz and the corresponding message copy is dc1.xxx, dc1.yyy and/or DC1zzz. The server may also create other subject messages and corresponding other message copies, which are not limited herein. The server performs data synchronization processing on the topic message between DC1 and DC2 through the bidirectional message synchronization service, so that the data security in the topic message is ensured.
Optionally, the server starts a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center, and the preset instruction can be a preset shell script instruction for starting the service; the server starts a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center; the server configures a first access address for the target data center and a second access address for the backup data center, wherein the first access address and the second access address are different; the server calls a message middleware cluster interface of the target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center; and the server calls a message middleware cluster interface of the backup data center based on the second access address to create a subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center.
202. And updating the topic message into the bidirectional message synchronization service, and monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the topic message through the bidirectional message synchronization service, wherein the topic message has a corresponding unique identification value.
The unique identifier corresponding to the subject message may be a universal unique identifier (universally unique identifier, UUID) or other identifiers, which is not limited herein. It should be noted that each preset data center (target data center or backup data center) has a corresponding consumer interface and producer interface.
Optionally, firstly, the server adds the theme message to a white list in the bidirectional message synchronization service, and sets a corresponding unique identification value for the theme message, further, the server calls a tool class of a java development tool kit jdk to generate a target UUID (unique identification value), the server calls a preset application interface of the kaff card kafka to configure a current limiting rule of a theme message topic corresponding to the target UUID, and the unique identification value is used for indicating that the message middleware cluster of each preset data center is accessed for flow limitation. Then, the server is respectively connected with the target data center and the standby data center through a bidirectional message synchronization service, pushes the subject message in the target data center to the corresponding message copy of the standby data center, and pushes the subject message in the standby data center to the corresponding message copy of the target data center; secondly, the server acquires the consumption position of the subject message from the target data center, and pushes the consumption position of the subject message to the configuration subject (namely, config subject) of the standby data center, wherein the initial value of the consumption position of the subject message is 0.
For example, the server opens producer and consumer tasks at the backup data center DC2 through a two-way message synchronization service; the server calls a consumer interface of the backup data center DC2 through a consumer task to extract data from the theme message xxx of the target data center DC 1; the server pushes the extracted data into the message copy dc1.xxx of DC2 by the producer task invoking the producer interface of the backup data center DC 2.
203. When a data pushing request is received and the heartbeat detection result of the target data center is abnormal, target subject data is obtained and cached from the data pushing request, the target subject data is pushed to the subject message of the backup data center according to the unique identification value, and when the target data center is recovered from faults, the data is pushed to the message copy corresponding to each preset data center through the bidirectional message synchronization service.
It can be understood that the server performs heartbeat detection on the target data centers, and optionally, the server sends socket connection requests to each preset data center through preset heartbeat detection tasks respectively, and establishes socket long connection for indicating to push messages to each preset data center (including the target data center) respectively; the server respectively sends heartbeat packets to each preset data center according to preset frequency to perform heartbeat detection, so as to obtain a heartbeat detection result, wherein the heartbeat detection result is used for indicating whether the connection of each preset data center is abnormal or not. Further, the server sends a heartbeat packet to the target data center according to the preset frequency, and simultaneously starts a timeout timer; if the server receives the response packet of the target data center within the preset time, the server determines that the heartbeat detection result of the target data center is normal, and deletes the overtime timer; if the timeout timer of the server is overtime and the response packet of the target data center is not received, the server determines that the heartbeat detection result of the target data center is abnormal and reconnects.
Optionally, when the server receives the data push request and the heartbeat detection result of the target data center is abnormal, the server analyzes the data push request to obtain target subject data, and stores the target subject data into the memory database to obtain cached subject data; the server is connected with the backup data center to obtain a connection result, and when the connection result is that the connection is successful, the cached theme data is pushed to the theme message of the backup data center according to the unique identification value; the server detects the target data center through a preset heartbeat detection task, and when the target data center is recovered from faults, the server is connected with the target data center through a bidirectional message synchronization service and synchronizes the cached subject data to a subject message of the target data center; the service pushes the subject message of the target data center to the corresponding message copy of the backup data center, and pushes the subject message of the backup data center to the corresponding message copy of the target data center.
204. When a data subscription request is received and the heartbeat detection result of the target data center is abnormal, acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data.
The heartbeat detection process in this step 204 is similar to the heartbeat detection process in step 203, and detailed descriptions thereof are omitted herein. Optionally, when the server receives the data subscription request and the heartbeat detection result of the target data center is abnormal, the server analyzes the data subscription request to obtain a unique identification value of the subject message; subscribing the topic message of the backup data center and the corresponding message copy of the backup data center by the server according to the unique identification value of the topic message; the server reads the consumption position of the target data center from the configuration theme of the standby data center, sets a data reading starting value for the theme message of the target data center according to the consumption position, and extracts target subscription data according to the data reading starting value.
For example, when the server extracts the target subscription data from the topic message xxx in the target data center DC1, the topic message xxx and the corresponding message copy dc2.xxx are also subscribed at the same time, when a disaster occurs in DC1, the server establishes a connection with the backup data center DC2 according to the heartbeat detection result, subscribes to the topic message xxx in DC2 and the corresponding message copy dc1.xxx, and simultaneously configures the consumption location offset in DC1 before from the DC2, resets dc1.xxx to offset (data reading start value), and extracts the target subscription data according to the offset. The server is ensured to continue consuming data from the position before the disaster occurs, and the latest pushed data can be consumed.
205. And carrying out data persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center, and carrying out statistical analysis on the abnormal heartbeat detection quantity of each preset data center within a preset duration.
That is, the server stores the subject message of each preset data center and the corresponding message copy of each preset data center into an in-memory database (e.g., a remote dictionary service); further, the server performs persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center in a manner of a remote dictionary service dataBase (RDB) or an additional file (AOF), so as to quickly restore the data in the memory dataBase. When the cached data of the target data center is abnormal due to faults, the server reloads the data into the memory database by reading the RDB or AOF file. And then, the server statistically analyzes the abnormal quantity of heartbeat detection of each preset data center in the preset time length, wherein the abnormal quantity of heartbeat detection of the target data center and the abnormal quantity of heartbeat detection of the backup data center are included.
206. When the abnormal number of heartbeat detection of each preset data center is larger than a preset threshold value, generating warning information, and pushing the warning information to the target terminal, so that the target terminal prompts target personnel to troubleshoot the preset data center according to the warning information.
For example, if the number of abnormal heartbeat detection errors of the target data center is 15, the number of abnormal heartbeat detection errors of the backup data center is 0, the preset threshold is 5, and the preset duration is 3 minutes, the server determines that the number of abnormal heartbeat detection errors of the target data center is greater than the preset threshold, and the number of abnormal heartbeat detection errors of the backup data center is less than the preset threshold. The server generates corresponding warning information for the target data center, and calls a preset interface to send the warning information to the target terminal, so that the target terminal prompts a target person to troubleshoot the preset data center (namely the target data center) with faults according to the warning information.
Further, the server may further obtain fault information of each preset data center, and generate a statistical report from the number of abnormal heartbeat detection of each preset data center and the fault information of each preset data center.
In the embodiment of the invention, the two-way message synchronization service is started for two preset data centers, and the subject message and the corresponding message copy are created, so that the data synchronization efficiency and accuracy are improved; when the heartbeat detection result of the target data center is abnormal, pushing target subject data to the subject message of the backup data center according to the unique identification value, so that partition resource loss of the data center is reduced; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data, and adopting two preset data centers improves the safety reliability and the integrity of the data and improves the disaster recovery switching efficiency of the data center.
The method for disaster recovery in the data center in the embodiment of the present invention is described above, and the disaster recovery device in the data center in the embodiment of the present invention is described below, referring to fig. 4, an embodiment of the disaster recovery device in the data center in the embodiment of the present invention includes:
the creating module 401 is configured to start a bidirectional message synchronization service for two preset data centers, and create a subject message and a message copy corresponding to each preset data center for each preset data center, where the two preset data centers include a target data center and a backup data center;
the updating module 402 is configured to update the theme message to the bidirectional message synchronization service, monitor and perform data synchronization processing on the target data center and the backup data center according to the theme message through the bidirectional message synchronization service, where the theme message has a corresponding unique identification value;
the pushing module 403 is configured to acquire and cache target topic data from the data pushing request when the data pushing request is received and the heartbeat detection result of the target data center is abnormal, push the target topic data to topic messages of the backup data center according to the unique identification value, and push data to message copies corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from a fault;
And the subscription module 404 is configured to obtain a consumption location of the target data center from the backup data center according to the data subscription request and reset a message copy corresponding to the backup data center according to the consumption location when the data subscription request is received and the heartbeat detection result of the target data center is abnormal, so as to obtain target subscription data.
Further, the subject message is stored in a blockchain database, and is not limited herein in particular.
In the embodiment of the invention, the two-way message synchronization service is started for two preset data centers, and the subject message and the corresponding message copy are created, so that the data synchronization efficiency and accuracy are improved; when the heartbeat detection result of the target data center is abnormal, pushing target subject data to the subject message of the backup data center according to the unique identification value, so that partition resource loss of the data center is reduced; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data, and adopting two preset data centers improves the safety reliability and the integrity of the data and improves the disaster recovery switching efficiency of the data center.
Referring to fig. 5, another embodiment of a disaster recovery device for a data center in an embodiment of the present invention includes:
the creating module 401 is configured to start a bidirectional message synchronization service for two preset data centers, and create a subject message and a message copy corresponding to each preset data center for each preset data center, where the two preset data centers include a target data center and a backup data center;
the updating module 402 is configured to update the theme message to the bidirectional message synchronization service, monitor and perform data synchronization processing on the target data center and the backup data center according to the theme message through the bidirectional message synchronization service, where the theme message has a corresponding unique identification value;
the pushing module 403 is configured to acquire and cache target topic data from the data pushing request when the data pushing request is received and the heartbeat detection result of the target data center is abnormal, push the target topic data to topic messages of the backup data center according to the unique identification value, and push data to message copies corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from a fault;
and the subscription module 404 is configured to obtain a consumption location of the target data center from the backup data center according to the data subscription request and reset a message copy corresponding to the backup data center according to the consumption location when the data subscription request is received and the heartbeat detection result of the target data center is abnormal, so as to obtain target subscription data.
Optionally, the creation module 401 may be further specifically configured to:
starting a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center;
configuring a first access address for a target data center and configuring a second access address for a backup data center;
calling a message middleware cluster interface of a target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center;
and calling a message middleware cluster interface of the backup data center based on the second access address to create a subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center.
Optionally, the updating module 402 may be further specifically configured to:
adding the subject message to a white list of the bidirectional message synchronization service, and setting a corresponding unique identification value for the subject message, wherein the unique identification value is used for indicating that the message middleware cluster of each preset data center is subjected to access flow restriction;
The method comprises the steps of respectively connecting a target data center and a standby data center through a bidirectional message synchronization service, pushing a subject message in the target data center to a message copy corresponding to the standby data center, and pushing the subject message in the standby data center to the message copy corresponding to the target data center;
and acquiring the consumption position of the theme message from the target data center, and pushing the consumption position of the theme message to the configuration theme of the standby data center, wherein the initial value of the consumption position of the theme message is 0.
Optionally, the pushing module 403 may be further specifically configured to:
when a data push request is received and the heartbeat detection result of the target data center is abnormal, analyzing the data push request to obtain target subject data, and storing the target subject data into a memory database to obtain cached subject data;
connecting the backup data center to obtain a connection result, and pushing the cached theme data to the theme message of the backup data center according to the unique identification value when the connection result is that the connection is successful;
detecting a target data center through a preset heartbeat detection task, connecting the target data center through a bidirectional message synchronization service when the target data center is in fault recovery, and synchronizing the cached subject data to a subject message of the target data center;
And pushing the subject message of the target data center to the corresponding message copy of the backup data center, and pushing the subject message of the backup data center to the corresponding message copy of the target data center.
Optionally, the subscription module 404 may be further specifically configured to:
when a data subscription request is received and the heartbeat detection result of the target data center is abnormal, analyzing the data subscription request to obtain a unique identification value of the subject message;
subscribing the topic message of the backup data center and the corresponding message copy of the backup data center according to the unique identification value of the topic message;
reading the consumption position of the target data center from the configuration theme of the standby data center, setting a data reading starting value for the theme message of the target data center according to the consumption position, and extracting target subscription data according to the data reading starting value.
Optionally, the disaster recovery device of the data center further includes:
the connection module 405 is configured to send socket connection requests to each preset data center through preset heartbeat detection tasks, and establish socket long connections, where the socket long connections are used to instruct to push messages to each preset data center respectively;
The detection module 406 is configured to send heartbeat packets to each preset data center according to a preset frequency, so as to perform heartbeat detection, obtain a heartbeat detection result, and indicate whether connection abnormality exists in each preset data center.
Optionally, the disaster recovery device of the data center further includes:
the statistics module 407 is configured to perform data persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center, and perform statistical analysis on the abnormal number of heartbeat detection of each preset data center in a preset duration;
the early warning module 408 is configured to generate warning information and push the warning information to the target terminal when the abnormal number of heartbeat detection of each preset data center is greater than the preset threshold, so that the target terminal prompts a target person to troubleshoot the preset data center according to the warning information.
In the embodiment of the invention, the two-way message synchronization service is started for two preset data centers, and the subject message and the corresponding message copy are created, so that the data synchronization efficiency and accuracy are improved; when the heartbeat detection result of the target data center is abnormal, pushing target subject data to the subject message of the backup data center according to the unique identification value, so that partition resource loss of the data center is reduced; and acquiring the consumption position of the target data center from the backup data center according to the data subscription request, resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data, and adopting two preset data centers improves the safety reliability and the integrity of the data and improves the disaster recovery switching efficiency of the data center.
Fig. 4 and fig. 5 above describe the disaster recovery device of the data center in the embodiment of the present invention in detail from the viewpoint of modularization, and the disaster recovery device of the data center in the embodiment of the present invention is described in detail from the viewpoint of hardware processing below.
Fig. 6 is a schematic structural diagram of a disaster recovery device for a data center, where the disaster recovery device 600 for a data center may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 633 or data 632. Wherein the memory 620 and the storage medium 630 may be transitory or persistent storage. The program stored on storage medium 630 may include one or more modules (not shown), each of which may include a series of instruction operations in data center disaster recovery device 600. Still further, processor 610 may be configured to communicate with storage medium 630 and execute a series of instruction operations in storage medium 630 on data center disaster recovery device 600.
Data center disaster recovery device 600 can also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input/output interfaces 660, and/or one or more operating systems 631, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the data center disaster recovery device configuration shown in fig. 6 does not constitute a limitation on the data center disaster recovery device and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, or may be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the data center disaster recovery method.
The invention also provides a data center disaster recovery device, which comprises a memory and a processor, wherein the memory stores instructions, and when the instructions are executed by the processor, the processor executes the steps of the data center disaster recovery method in the above embodiments.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. The data center disaster recovery method is characterized by comprising the following steps of:
starting a bidirectional message synchronization service for two preset data centers, and respectively creating a subject message and a message copy corresponding to each preset data center for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center;
the two preset data centers are opened with a two-way message synchronization service, and a subject message and a message copy corresponding to each preset data center are respectively created for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center, and the two preset data centers comprise:
Starting a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center;
configuring a first access address for the target data center and configuring a second access address for the backup data center;
calling a message middleware cluster interface of a target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center;
calling a message middleware cluster interface of a backup data center based on the second access address to create the subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center;
updating the subject message into the bidirectional message synchronization service, and monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the subject message through the bidirectional message synchronization service, wherein the subject message has a corresponding unique identification value;
The updating of the subject message into the bidirectional message synchronization service, the monitoring and data synchronization processing are performed on the target data center and the backup data center according to the subject message through the bidirectional message synchronization service, the subject message has a corresponding unique identification value, and the method comprises the following steps:
adding the subject message to a white list of a bidirectional message synchronization service, and setting a corresponding unique identification value for the subject message, wherein the unique identification value is used for indicating the access flow limitation to the message middleware cluster of each preset data center;
the target data center and the backup data center are respectively connected through the bidirectional message synchronization service, the subject message in the target data center is pushed to the message copy corresponding to the backup data center, and the subject message in the backup data center is pushed to the message copy corresponding to the target data center;
acquiring a consumption position of a theme message from the target data center, and pushing the consumption position of the theme message to a configuration theme of a backup data center, wherein the initial value of the consumption position of the theme message is 0;
When a data pushing request is received and the heartbeat detection result of a target data center is abnormal, acquiring and caching target subject data from the data pushing request, pushing the target subject data to a subject message of a backup data center according to the unique identification value, and pushing data to message copies corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from faults;
when a data subscription request is received and the heartbeat detection result of the target data center is abnormal, acquiring the consumption position of the target data center from the backup data center according to the data subscription request, and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data.
2. The method for disaster recovery of a data center according to claim 1, wherein when a data push request is received and there is an abnormality in a heartbeat detection result of a target data center, acquiring and caching target subject data from the data push request, pushing the target subject data to a subject message of a backup data center according to the unique identification value, and when a failure of the target data center is recovered, pushing data to a message copy corresponding to each preset data center through the bidirectional message synchronization service, including:
When a data push request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data push request to obtain target subject data, and storing the target subject data into a memory database to obtain cached subject data;
connecting the backup data center to obtain a connection result, and pushing the cached subject data to the subject message of the backup data center according to the unique identification value when the connection result is that the connection is successful;
detecting the target data center through a preset heartbeat detection task, connecting the target data center through the bidirectional message synchronization service when the target data center is in fault recovery, and synchronizing the cached subject data to a subject message of the target data center;
pushing the subject message of the target data center to the message copy corresponding to the backup data center, and pushing the subject message of the backup data center to the message copy corresponding to the target data center.
3. The method for disaster recovery of a data center according to claim 1, wherein when a data subscription request is received and a heartbeat detection result of a target data center is abnormal, obtaining a consumption location of the target data center from the backup data center according to the data subscription request, and resetting a message copy corresponding to the backup data center according to the consumption location, to obtain target subscription data, includes:
When a data subscription request is received and the heartbeat detection result of a target data center is abnormal, analyzing the data subscription request to obtain a unique identification value of a subject message;
subscribing the topic message of the backup data center and the corresponding message copy of the backup data center according to the unique identification value of the topic message;
reading the consumption position of the target data center from the configuration theme of the backup data center, setting a data reading starting value for the theme message of the target data center according to the consumption position, and extracting target subscription data according to the data reading starting value.
4. A method of disaster recovery for a data center according to any one of claims 1 to 3, wherein, before starting a bidirectional message synchronization service for two preset data centers and creating a subject message and a message copy corresponding to each preset data center for each preset data center, respectively, the two preset data centers include a target data center and a backup data center, the method of disaster recovery for a data center further includes:
a socket connection request is sent to each preset data center through a preset heartbeat detection task, and a socket long connection is established, wherein the socket long connection is used for indicating to push messages to each preset data center respectively;
And respectively sending heartbeat packets to each preset data center according to preset frequency to perform heartbeat detection to obtain a heartbeat detection result, wherein the heartbeat detection result is used for indicating whether the connection of each preset data center is abnormal or not.
5. The method for disaster recovery of a data center according to any one of claims 1 to 3, wherein when a data subscription request is received and a heartbeat detection result of a target data center is abnormal, a consumption location of the target data center is obtained from the backup data center according to the data subscription request, and a message copy corresponding to the backup data center is reset according to the consumption location, so as to obtain target subscription data, and the method for disaster recovery of the data center further comprises:
performing data persistence processing on the subject message of each preset data center and the message copy corresponding to each preset data center, and statistically analyzing the abnormal heartbeat detection quantity of each preset data center within a preset duration;
when the abnormal number of heartbeat detection of each preset data center is larger than a preset threshold value, generating warning information, and pushing the warning information to a target terminal, so that the target terminal prompts target personnel to troubleshoot the preset data center with faults according to the warning information.
6. A data center disaster recovery device, wherein the data center disaster recovery device comprises:
the system comprises a creation module, a backup module and a message synchronization module, wherein the creation module is used for starting a bidirectional message synchronization service for two preset data centers and creating a subject message and a message copy corresponding to each preset data center for each preset data center respectively, and the two preset data centers comprise a target data center and the backup data center;
the two preset data centers are opened with a two-way message synchronization service, and a subject message and a message copy corresponding to each preset data center are respectively created for each preset data center, wherein the two preset data centers comprise a target data center and a backup data center, and the two preset data centers comprise:
starting a bidirectional message synchronization service for two preset data centers through a preset instruction, wherein the two preset data centers comprise a target data center and a backup data center;
configuring a first access address for the target data center and configuring a second access address for the backup data center;
calling a message middleware cluster interface of a target data center based on the first access address to create a subject message and a message copy corresponding to the target data center, wherein the message copy corresponding to the target data center is used for synchronously storing the subject message corresponding to the backup data center;
Calling a message middleware cluster interface of a backup data center based on the second access address to create the subject message and a message copy corresponding to the backup data center, wherein the message copy corresponding to the backup data center is used for synchronously storing the subject message corresponding to the target data center;
the updating module is used for updating the theme message into the bidirectional message synchronization service, monitoring and data synchronization processing are carried out on the target data center and the backup data center according to the theme message through the bidirectional message synchronization service, and the theme message has a corresponding unique identification value;
the updating of the subject message into the bidirectional message synchronization service, the monitoring and data synchronization processing are performed on the target data center and the backup data center according to the subject message through the bidirectional message synchronization service, the subject message has a corresponding unique identification value, and the method comprises the following steps:
adding the subject message to a white list of a bidirectional message synchronization service, and setting a corresponding unique identification value for the subject message, wherein the unique identification value is used for indicating the access flow limitation to the message middleware cluster of each preset data center;
The target data center and the backup data center are respectively connected through the bidirectional message synchronization service, the subject message in the target data center is pushed to the message copy corresponding to the backup data center, and the subject message in the backup data center is pushed to the message copy corresponding to the target data center;
acquiring a consumption position of a theme message from the target data center, and pushing the consumption position of the theme message to a configuration theme of a backup data center, wherein the initial value of the consumption position of the theme message is 0;
the pushing module is used for acquiring and caching target subject data from the data pushing request when the data pushing request is received and the heartbeat detection result of the target data center is abnormal, pushing the target subject data to the subject message of the backup data center according to the unique identification value, and pushing data to the message copy corresponding to each preset data center through the bidirectional message synchronization service when the target data center is recovered from faults;
and the subscription module is used for acquiring the consumption position of the target data center from the backup data center according to the data subscription request and resetting the message copy corresponding to the backup data center according to the consumption position to obtain target subscription data when the data subscription request is received and the heartbeat detection result of the target data center is abnormal.
7. A data center disaster recovery device, the data center disaster recovery device comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the data center disaster recovery device to perform the data center disaster recovery method of any one of claims 1-5.
8. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the data center disaster recovery method of any one of claims 1-5.
CN202011396543.1A 2020-12-03 2020-12-03 Disaster recovery method, device, equipment and storage medium for data center Active CN112506702B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011396543.1A CN112506702B (en) 2020-12-03 2020-12-03 Disaster recovery method, device, equipment and storage medium for data center

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011396543.1A CN112506702B (en) 2020-12-03 2020-12-03 Disaster recovery method, device, equipment and storage medium for data center

Publications (2)

Publication Number Publication Date
CN112506702A CN112506702A (en) 2021-03-16
CN112506702B true CN112506702B (en) 2024-02-23

Family

ID=74968582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011396543.1A Active CN112506702B (en) 2020-12-03 2020-12-03 Disaster recovery method, device, equipment and storage medium for data center

Country Status (1)

Country Link
CN (1) CN112506702B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174682B (en) * 2022-06-17 2023-07-28 中国银联股份有限公司 Data distribution method, system, center, device and computer readable storage medium
CN115103011B (en) * 2022-06-24 2024-02-09 北京奥星贝斯科技有限公司 Cross-data center service processing method, device and equipment
CN115269235B (en) * 2022-09-28 2022-12-23 深圳华锐分布式技术股份有限公司 Message carrying method, device, equipment and medium based on components of different versions
CN116361038B (en) * 2023-06-02 2023-09-08 山东浪潮科学研究院有限公司 Acceleration computing management method, system, equipment and storage medium
CN116962160B (en) * 2023-09-21 2024-01-12 北京华鲲振宇智能科技有限责任公司 Control method, system, equipment and medium for standby server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118509A (en) * 2007-09-12 2008-02-06 华为技术有限公司 Process, device and system for EMS memory data-base remote disaster tolerance
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
CN108667635A (en) * 2017-03-27 2018-10-16 腾讯科技(深圳)有限公司 A kind of method, equipment and the system of disaster tolerance processing
CN110278109A (en) * 2019-05-21 2019-09-24 阿里巴巴集团控股有限公司 A kind of disaster recovery method and system
WO2020211373A1 (en) * 2019-04-19 2020-10-22 平安科技(深圳)有限公司 Heartbeat packet sending method and apparatus based on intermediate server, and computer device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11036598B2 (en) * 2019-04-06 2021-06-15 Sap Se Notification mechanism for disaster recovery events

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118509A (en) * 2007-09-12 2008-02-06 华为技术有限公司 Process, device and system for EMS memory data-base remote disaster tolerance
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
CN108667635A (en) * 2017-03-27 2018-10-16 腾讯科技(深圳)有限公司 A kind of method, equipment and the system of disaster tolerance processing
WO2020211373A1 (en) * 2019-04-19 2020-10-22 平安科技(深圳)有限公司 Heartbeat packet sending method and apparatus based on intermediate server, and computer device
CN110278109A (en) * 2019-05-21 2019-09-24 阿里巴巴集团控股有限公司 A kind of disaster recovery method and system

Also Published As

Publication number Publication date
CN112506702A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
CN112506702B (en) Disaster recovery method, device, equipment and storage medium for data center
US10491671B2 (en) Method and apparatus for switching between servers in server cluster
CN108847982B (en) Distributed storage cluster and node fault switching method and device thereof
CN100426751C (en) Method for ensuring accordant configuration information in cluster system
CN106789306B (en) Method and system for detecting, collecting and recovering software fault of communication equipment
CN104252500A (en) Method and device for carrying out fault repairing on database management platform
US8943191B2 (en) Detection of an unresponsive application in a high availability system
JP2008217735A (en) Fault analysis system, method and program
CN111046011A (en) Log collection method, system, node, electronic device and readable storage medium
CN110351313B (en) Data caching method, device, equipment and storage medium
CN114064217B (en) OpenStack-based node virtual machine migration method and device
CN117130730A (en) Metadata management method for federal Kubernetes cluster
CN113626238B (en) ctdb service health state monitoring method, system, device and storage medium
CN116781488A (en) Database high availability implementation method, device, database architecture, equipment and product
CN113190620B (en) Method, device, equipment and storage medium for synchronizing data between Redis clusters
CN114554593A (en) Data processing method and device
CN116185697B (en) Container cluster management method, device and system, electronic equipment and storage medium
CN113055203B (en) Method and device for recovering exception of SDN control plane
CN113765690A (en) Cluster switching method, system, device, terminal, server and storage medium
CN111162938A (en) Data processing system and method
CN116264541A (en) Multi-dimension-based database disaster recovery method and device
CN110113395B (en) Shared file system maintenance method and device
CN114020503A (en) Optimization method, system and device for transparent fault switching of distributed file system
WO2024061219A1 (en) Information updating method, apparatus and device, storage medium, and program product
CN112787868A (en) Information synchronization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant