Disaster recovery processing method, disaster recovery system, electronic equipment and storage medium
By leveraging the collaborative work of production sites, backup sites and disaster recovery sites in the cloud platform, the problems of large network latency, resource redundancy and resource waste in the disaster recovery processing of message middleware are solved, and efficient and reliable disaster recovery processing is achieved.
Patent Information
- Application Number
- CN202411763955.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art has problems such as large network latency, redundancy and waste of resources when disaster recovery processing of message middleware.
A disaster recovery treatment method is adopted to realize disaster recovery treatment of message middleware instances through production sites, backup sites and disaster recovery sites in the cloud platform. The specific steps include backing up the site to obtain the metadata of the message middleware instance from the production site, generating snapshot data and storing it, and creating a message middleware instance with the same configuration, and testing and deployment based on the snapshot data.
It improves the disaster recovery capabilities of message middleware instances, reduces resource consumption and resource waste, avoids network delay problems of cross-regional backups, and ensures business continuity and disaster recovery efficiency.
Smart Images

Figure CN119883728A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a disaster recovery processing method, a disaster recovery system, an electronic device and a storage medium. Background Art
[0002] Message Middleware is a software layer located between applications that can provide efficient and reliable message delivery services. Message Middleware uses asynchronous communication mechanisms to decouple message producers and consumers, solving communication problems between distributed systems. It is often used in business scenarios such as data synchronization, log collection, and stream computing processing.
[0003] In order to ensure the disaster recovery capability of the message middleware, a cross-regional deployment approach is currently usually adopted to deploy copies of the message middleware data in multiple data centers (for example, computer rooms) in different regions, so that the primary copies of the message middleware data are distributed in data centers in different regions. When one of the data centers is unavailable, other data centers can continue to provide services.
[0004] However, due to geographical issues, there is a large network delay between data centers deployed across regions. In addition, the cross-regional deployment method requires setting up server systems with the same configuration in multiple data centers for data backup, which leads to problems of resource redundancy and resource waste. Summary of the invention
[0005] The embodiment of the present invention provides a disaster recovery processing method, a disaster recovery system, an electronic device and a storage medium to solve the problems of large network delay, resource redundancy and resource waste in the process of disaster recovery processing of message middleware in related technologies.
[0006] In order to solve the above problems, an embodiment of the present invention discloses a disaster recovery processing method, which is applied to a cloud platform, wherein the cloud platform includes a production site, a backup site, and a disaster recovery site located in different resource pools; the production site includes at least one first message middleware instance; the method includes:
[0007] The backup site obtains metadata of the first message middleware instance from the production site;
[0008] The backup site generates snapshot data corresponding to the first message middleware instance according to the metadata, and stores the snapshot data;
[0009] The disaster recovery site creates a second message middleware instance; the configuration of the second message middleware instance is the same as that of the first message middleware instance;
[0010] The disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result;
[0011] When the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance and runs the second message middleware instance based on snapshot data corresponding to the first message middleware instance.
[0012] On the other hand, an embodiment of the present invention discloses a disaster recovery system, which is applied to a cloud platform. The disaster recovery system includes a production site, a backup site, and a disaster recovery site located in different resource pools; the production site includes at least one first message middleware instance; wherein,
[0013] The backup site is used to obtain metadata of the first message middleware instance from the production site; generate snapshot data corresponding to the first message middleware instance according to the metadata, and store the snapshot data;
[0014] The disaster recovery site is used to create a second message middleware instance, which has the same configuration as the first message middleware instance; obtain the snapshot data from the backup site, and test the second message middleware instance based on the snapshot data to obtain a disaster recovery test result; and when the first message middleware instance is unavailable and the disaster recovery test result is a successful test, obtain the second message middleware instance, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
[0015] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned disaster recovery processing method.
[0016] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned disaster recovery processing method.
[0017] The embodiments of the present invention include the following advantages:
[0018] The disaster recovery processing method provided by the embodiment of the present invention implements disaster recovery processing of the first message middleware instance in the production site based on the production site, backup site and disaster recovery site located in different resource pools in the cloud platform, thereby improving the disaster recovery capability of the first message middleware instance; in the disaster recovery processing process, the metadata of the first message middleware instance is obtained from the production site through the backup site, and snapshot data corresponding to the first message middleware instance is generated and stored according to the metadata, thereby realizing the backup of the metadata corresponding to the first message middleware instance in the production site. The backup process can be realized through a low-configuration cloud host in the backup site, with less equipment resource occupation, thereby reducing resource consumption and waste in the disaster recovery processing of the first message middleware instance; the disaster recovery site can obtain snapshot data from the backup site, and create a disaster recovery site based on the snapshot data. A second message middleware instance with the same configuration as the first message middleware instance is tested to obtain a disaster recovery test result, which increases the probability of the second message middleware instance created at the disaster recovery site being available, thereby increasing the probability that the disaster recovery site can successfully run the second message middleware instance to implement the business function of the first message middleware instance when the first message middleware instance is unavailable, thereby improving the reliability of the disaster recovery processing process; when the first message middleware instance in the production site is unavailable, the cloud platform can realize the rapid deployment and operation of the second message middleware instance at the disaster recovery site based on the interaction between the backup site and the disaster recovery site, thereby avoiding the network delay problem of cross-regional backup, ensuring the continuity of the corresponding business of the first message middleware instance in the production site, and improving the efficiency of disaster recovery processing for the first message middleware instance. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 This is a flowchart of a disaster recovery processing method provided by an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of the architecture of a disaster recovery system provided by an embodiment of the present invention;
[0022] Figure 3 is a flowchart of a method for testing a second message middleware instance provided by an embodiment of the present invention;
[0023] Figure 4 is a flowchart of a method for obtaining metadata of a first message middleware instance provided by an embodiment of the present invention;
[0024] Figure 5 is a flowchart of a method for generating snapshot data provided by an embodiment of the present invention;
[0025] Figure 6 It is a logical block diagram of a disaster recovery system provided by an embodiment of the present invention;
[0026] Figure 7 The present invention is a block diagram of an electronic device for disaster recovery processing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Method Embodiment
[0029] Reference Figure 1 , shows a flowchart of a disaster recovery processing method provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0030] Step S101: A backup site obtains metadata of a first message middleware instance from a production site.
[0031] Step S102: The backup site generates snapshot data corresponding to the first message middleware instance according to the metadata, and stores the snapshot data.
[0032] Step S103: The disaster recovery site creates a second message middleware instance; the configuration of the second message middleware instance is the same as that of the first message middleware instance.
[0033] Step S104: The disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result.
[0034] Step S105: When the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance and runs the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
[0035] The disaster recovery processing method provided in the embodiment of the present invention is applied to a cloud platform, wherein the cloud platform includes a disaster recovery system; Figure 2, shows a schematic diagram of the architecture of a disaster recovery system provided by an embodiment of the present invention, the disaster recovery system includes a production site, a backup site and a disaster recovery site, a communication connection is established between the production site and the backup site, a communication connection is established between the backup site and the disaster recovery site, and a communication connection may or may not be established between the production site and the disaster recovery site. The production site, the backup site and the disaster recovery site are respectively located in different resource pools of the cloud platform, specifically, the resource pool where the production site is located is the first resource pool, the resource pool where the backup site is located is the second resource pool, and the resource pool where the disaster recovery site is located is the third resource pool.
[0036] It should be noted that Figure 2 Where n is an integer greater than or equal to 1, and m and p are integers greater than or equal to 0.
[0037] The production site includes at least one message cluster, and each message cluster includes at least one first message middleware instance. The first message middleware instance is any message middleware instance in the production site; the first message middleware instance is a message middleware instance created by the production site through the first message middleware management console in the production site.
[0038] The production site is a first cloud host cluster composed of at least one first cloud host, and the first message middleware instance of the production site is deployed in the first cloud host; the number of first message middleware instances deployed in each first cloud host can be determined according to the actual deployment requirements of the user. As an example, there are 0 first message middleware instances deployed in the first cloud host 1 in the production site, 1 first message middleware instance is deployed in the first cloud host 2 in the production site, and 3 first message middleware instances are deployed in the first cloud host 3 in the production site.
[0039] In addition, the production site also includes a first message middleware management station, which is used to create and deploy the first message middleware instance in the first cloud host and provide an interface for obtaining and inputting metadata of the first message middleware deployed in the first cloud host.
[0040] The backup site is a second cloud host cluster composed of at least one second cloud host. Before step S101, the backup site first confirms whether there is a second cloud host for performing the operations corresponding to steps S101 to S102 in the current backup site; when there is a second cloud host for performing the operations corresponding to steps S101 to S102 in the current backup site, the backup site can directly use the second cloud host to perform steps S101 to S102; when there is no second cloud host for performing the operations corresponding to steps S101 to S102 in the current backup site, the backup site can first create a second cloud host for performing the operations corresponding to steps S101 to S102, and then use the second cloud host to perform steps S101 to S102.
[0041] The disaster recovery site is a third cloud host cluster composed of at least one third cloud host, and the disaster recovery site can perform operations corresponding to steps S103 to S105 through the third cloud host. In addition, the disaster recovery site also includes a second message middleware management station, which is used to create and deploy a second message middleware instance in the third cloud host and provide an interface for obtaining and inputting metadata of the second message middleware deployed in the third cloud host.
[0042] The first message middleware management station and / or the second message middleware management station may include but are not limited to: kafka, rocketmq, rabbitmq, etc.
[0043] It should be noted that the first cloud host constituting the production site, the second cloud host constituting the backup site, and the third cloud host constituting the disaster recovery site are different cloud hosts; wherein, the first cloud host and the third cloud host need to run a message middleware instance to realize the business functions of the message middleware instance, and the host configuration of the first cloud host and the third cloud host needs to at least be able to meet the running requirements of the message middleware instance; the second cloud host constituting the backup site needs to perform the operations of metadata acquisition, snapshot data generation, and storage in steps S101 to S102, and therefore the host configuration of the second cloud host constituting the backup site needs to at least be able to meet the operations of metadata acquisition, snapshot data generation, and storage. Generally speaking, the host configuration requirements for the cloud host to perform metadata acquisition, snapshot data generation, and storage operations are usually lower than the host configuration requirements for running a message middleware instance.
[0044] In an embodiment of the present invention, in order to reduce the degree of occupation of device resources by the disaster recovery processing process, the host configuration of the second cloud host can be set to be lower than the host configuration of the first cloud host and the third cloud host, and the host configuration of the first cloud host and the host configuration of the third cloud host are the same or approximately the same.
[0045] In the disaster recovery system, the production site serves as the primary site for the running of the message middleware instance, and the disaster recovery site serves as the secondary site for the running of the message middleware instance. The snapshot data corresponding to the first message middleware instance running in the production site is backed up in the backup site located in the second resource pool; the disaster recovery site implements disaster recovery processing for the first message middleware based on the snapshot data corresponding to the first message middleware instance in the backup site. The production site, backup site and disaster recovery site are respectively located in different resource pools of the cloud platform, which improves the disaster recovery capability of the first message middleware instance in the production site.
[0046] In an embodiment of the present invention, during the normal operation of the first message middleware instance in the production site, the backup site can obtain metadata of the first message middleware instance from the production site according to a first preset period. It can be understood that when the number of first message middleware instances is greater than 1, the backup site can repeatedly perform step S101 to obtain metadata of each first message middleware instance.
[0047] Among them, the first preset period is a preset period for the backup site to obtain the metadata of the first message middleware instance from the production site; specifically, when the frequency of change of the metadata of the first message middleware instance is relatively small, minutes or hours can be used as the time unit of the first preset period. For example, the first preset period can be 10 minutes, 1 hour, 3 hours, etc.
[0048] In step S101, the backup site obtains metadata of the first message middleware instance from the production site in the following manner:
[0049] First, the second cloud host in the backup site sends a metadata acquisition request corresponding to the first message middleware instance to the production site.
[0050] Then, the first cloud host in the production site where the first message middleware instance is deployed obtains the metadata corresponding to the first message middleware instance from the first message middleware instance according to the metadata acquisition request, and sends the metadata corresponding to the first message middleware instance to the second cloud host in the backup site.
[0051] Finally, the second cloud host in the backup site uses the metadata sent by the production site as metadata corresponding to the first message middleware instance.
[0052] The metadata may include, but is not limited to, subject information, subscription group information, and user authority information.
[0053] The topic information is the attribute information of the topic (Topic) corresponding to the first message middleware instance. The topic information may include but is not limited to the topic name, topic system identifier, broker nodes of topic distribution, etc.; wherein, the broker node is the core node of the first message middleware instance, which is used to provide functions such as message storage, forwarding, master-slave synchronization, and data flushing. The topic corresponding to the first message middleware instance refers to the topic obtained by classifying a group of related messages during the message production and message consumption process of the first message middleware instance. Message producers publish messages by specifying topics, and message consumers receive messages by subscribing to topics. A topic can also include multiple partitions, and the data in different partitions are not repeated.
[0054] The subscription group information is the attribute information of the subscription group corresponding to the first message middleware instance. The subscription group information may include but is not limited to the subscription group name, the consumption rules of the message consumers in the subscription group, the broker nodes where the subscription group is distributed, etc. A subscription group refers to a collection used to identify a group of message consumers. Message consumers in the same subscription group jointly consume messages under the topic corresponding to the subscription group. Each subscription group can subscribe to one or more topics.
[0055] User permission information is information related to the permission attributes of the target user corresponding to the first messaging middleware instance in producing and consuming messages under the topic and subscription group corresponding to the first messaging middleware instance. User permission information may include but is not limited to: user ID, key, topic permission, subscription group permission, etc.
[0056] Since the metadata formats of the first message middleware instances created and deployed by different types of first message middleware management stations differ to varying degrees, in an embodiment of the present invention, when the backup site obtains the metadata of the first message middleware instance, it can analyze and assemble the metadata, organize it into metadata of a preset data structure, and encapsulate the metadata of the preset data structure to obtain snapshot data corresponding to the first message middleware instance.
[0057] As an example, referring to Table 1, a list of subject information in metadata of a preset data structure provided by an embodiment of the present invention is shown.
[0058] Table 1
[0059]
[0060] As an example, referring to Table 2, a subscription group information list in metadata of a preset data structure provided by an embodiment of the present invention is shown.
[0061] Table 2
[0062]
[0063] In Table 2, the consumption rules of the message consumer in the process of consuming the messages in the subscription group include whether consumption is allowed, whether to consume from the minimum offset, whether to enable broadcast consumption, the number of retry queues, the number of retry consumption, the consumption mechanism, and the first consumption mechanism.
[0064] As an example, referring to Table 3, a list of user authority information in metadata of a preset data structure provided by an embodiment of the present invention is shown.
[0065] Table 3
[0066]
[0067] After obtaining the snapshot data corresponding to the first message middleware instance, the backup site may store the snapshot data in a first preset storage area. The first preset storage area may be a storage area in the second cloud host.
[0068] In an embodiment of the present invention, after the backup site stores the snapshot data, the disaster recovery site can execute step S103 to create a second message middleware instance; wherein the second message middleware instance has the same configuration as the first message middleware instance, and the second message middleware instance can implement the same business function as the first message middleware instance based on the metadata of the first message middleware instance.
[0069] The configuration of the second message middleware instance is the same as that of the first message middleware instance, which means that the node type and the number of nodes included in the second message middleware instance are the same as the node type and the number of nodes included in the first message middleware instance.
[0070] Specifically, in step S103, the disaster recovery site creates a second message middleware instance, specifically:
[0071] First, the third cloud host in the disaster recovery site obtains the configuration information of the first message middleware instance; the configuration information includes the node type and node number of the nodes in the first message middleware instance; exemplarily, when the first message middleware management station and the second message middleware management station are RocketMQ, the node types in the configuration information include NameServer nodes, broker master nodes and broker slave nodes, and the node numbers in the configuration information include the number of NameServer nodes, the number of broker master nodes, and the number of broker slave nodes. The way in which the third cloud host obtains the configuration information of the first message middleware instance may include but is not limited to: receiving the configuration information of the first message middleware instance input by the user to the disaster recovery site, and obtaining the configuration information of the first message middleware instance from the third preset storage area in the cloud platform; wherein the third preset storage area is the area in the cloud platform used to store the configuration information of the first message middleware instance, and the third cloud host can access the third preset storage area.
[0072] Then, the third cloud host in the disaster recovery site creates and deploys the second message middleware instance locally using the second message middleware management console according to the configuration information.
[0073] It should be noted that the second message middleware instance created by the disaster recovery site in step S103 includes metadata.
[0074] In some embodiments, after storing the snapshot data, the backup site may send a snapshot data update signal to the disaster recovery site. When the disaster recovery site receives the snapshot data update signal, it performs operations corresponding to step S103 and step S104.
[0075] In some embodiments, the disaster recovery site performs operations corresponding to step S103 and step S104 according to a second preset period. The second preset period is a preset period for the disaster recovery site to perform operations corresponding to step S103 and step S104; illustratively, the second preset period may be 3 hours, 1 day, 7 days, 30 days, etc. In an embodiment of the present invention, the duration corresponding to the second preset period may be greater than or equal to the duration corresponding to the first preset period.
[0076] In some embodiments, upon receiving the message middleware test instruction, the disaster recovery site performs operations corresponding to step S103 and step S104. The message middleware test instruction is used to instruct the disaster recovery site to test the second message middleware instance in the disaster recovery site based on the snapshot data in the backup site.
[0077] When the second message middleware instance is created in step S103, the disaster recovery site can obtain snapshot data corresponding to the first message middleware instance from the backup site, and test the second message middleware instance created in step S103 based on the snapshot data, and use the test result as the disaster recovery test result.
[0078] Among them, the backup site can store different versions of snapshot data corresponding to the same first message middleware instance; the snapshot data obtained from the backup site by the disaster recovery site in executing step S104 can be the snapshot data version corresponding to the first message middleware instance indicated by the middleware test instruction, or it can be the latest version of snapshot data corresponding to the first message middleware instance stored in the backup site.
[0079] When the disaster recovery site tests the second message middleware instance based on the snapshot data to obtain the disaster recovery test result, first, the third cloud host in the disaster recovery site parses and processes the snapshot data; then, the third cloud host uses the interface provided by the second message middleware management console to import the metadata of the first message middleware instance in the snapshot data into the second message middleware instance created in step S103, thereby creating a topic, subscription group and user authority in the second message middleware instance that are consistent with the first message middleware instance; finally, the third cloud host runs the second message middleware instance to test the running status of the second message middleware instance, and determines the test result as the disaster recovery test result corresponding to the second message middleware instance.
[0080] During the process of testing the running status of the second message middleware instance, if any program step fails to execute, resulting in the second message middleware instance being unable to successfully run the business function corresponding to the first message middleware instance, the disaster recovery test result obtained by the third cloud host is a test failure, and the error information is fed back to the user so that the user can rectify the second message middleware or the third cloud host in the disaster recovery site according to the error information until the disaster recovery test result is a test success; during the process of testing the running status of the second message middleware instance, if the second message middleware instance can successfully run the business function corresponding to the first message middleware instance, the disaster recovery test result obtained by the third cloud host is a test success.
[0081] When the disaster recovery test result is obtained and the disaster recovery test result is successful, the disaster recovery site can remove the second message middleware instance from the third cloud host to realize the recovery of host resources in the disaster recovery site, thereby increasing the probability of availability of the second message middleware instance created by the disaster recovery site and reducing the occupation and waste of resources in the disaster recovery site by the second message middleware instance.
[0082] When the production site failure or the first message middleware instance failure causes the first message middleware instance to be unavailable, and the disaster recovery test result corresponding to the second message middleware instance obtained by the step S104 test is a successful test, the disaster recovery site can execute step S105 to obtain the second message middleware instance, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
[0083] Specifically, in step S105, the disaster recovery site may obtain the second message middleware instance in the same manner as step S103.
[0084] When the second message middleware instance is obtained, the disaster recovery site can obtain the snapshot data corresponding to the first message middleware instance from the backup site, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance. It should be noted that the snapshot data corresponding to the first message middleware instance obtained by the disaster recovery site from the backup site through step S105 and the snapshot data corresponding to the first message middleware instance obtained from the backup site through step S104 can be snapshot data of the same version or snapshot data of different versions.
[0085] Specifically, the snapshot data corresponding to the first message middleware instance obtained by the disaster recovery site from the backup site in step S105 may be the latest version of snapshot data corresponding to the first message middleware instance in the backup site, or may be the snapshot data version corresponding to the first message middleware instance indicated by the disaster recovery processing instruction input by the user to the disaster recovery site.
[0086] In the embodiment of the present invention, when a communication connection is not established between the production site and the disaster recovery site, and when the first message middleware instance in the production site is unavailable, the user can instruct the third cloud host in the disaster recovery site to perform the operation corresponding to step S105 by inputting a disaster recovery processing instruction corresponding to the first message middleware instance to the disaster recovery site. The disaster recovery processing instruction is used to instruct the disaster recovery site to obtain the second message middleware instance; and to run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance to implement disaster recovery processing for the first message middleware instance; in addition, the disaster recovery processing instruction can also be used to indicate the snapshot data version corresponding to the first message middleware instance.
[0087] When a communication connection is established between the production site and the disaster recovery site, when the first message middleware instance in the production site is unavailable, the production site can send a disaster recovery signal corresponding to the first message middleware instance to the disaster recovery site, and the disaster recovery site can perform the operation corresponding to step S105 according to the disaster recovery signal when receiving the disaster recovery signal.
[0088] In step S105, when the disaster recovery site obtains the snapshot data corresponding to the second message middleware instance and the first message middleware instance, the third cloud host deployed with the second message middleware instance in the disaster recovery site parses and processes the snapshot data; then, the third cloud host uses the interface provided by the second message middleware management console to import the metadata of the first message middleware instance in the snapshot data into the second message middleware instance, thereby creating a topic, subscription group and user authority in the second message middleware instance that are consistent with the first message middleware instance; finally, the third cloud host runs the second message middleware instance to implement the business functions corresponding to the first message middleware instance through the second message middleware instance.
[0089] It is understandable that after step S105, the cloud platform may switch the first message middleware instance used by the business layer to the second message middleware instance in the disaster recovery site.
[0090] The disaster recovery processing method provided by the embodiment of the present invention implements disaster recovery processing of the first message middleware instance in the production site based on the production site, backup site and disaster recovery site located in different resource pools in the cloud platform, thereby improving the disaster recovery capability of the first message middleware instance; in the disaster recovery processing process, the metadata of the first message middleware instance is obtained from the production site through the backup site, and snapshot data corresponding to the first message middleware instance is generated and stored according to the metadata, thereby realizing the backup of the metadata corresponding to the first message middleware instance in the production site. The backup process can be realized through a low-configuration cloud host in the backup site, with less equipment resource occupation, thereby reducing resource consumption and waste in the disaster recovery processing of the first message middleware instance; the disaster recovery site can obtain snapshot data from the backup site, and create a disaster recovery site based on the snapshot data. A second message middleware instance with the same configuration as the first message middleware instance is tested to obtain a disaster recovery test result, which increases the probability of the second message middleware instance created at the disaster recovery site being available, thereby increasing the probability that the disaster recovery site can successfully run the second message middleware instance to implement the business function of the first message middleware instance when the first message middleware instance is unavailable, thereby improving the reliability of the disaster recovery processing process; when the first message middleware instance in the production site is unavailable, the cloud platform can realize the rapid deployment and operation of the second message middleware instance at the disaster recovery site based on the interaction between the backup site and the disaster recovery site, thereby avoiding the network delay problem of cross-regional backup, ensuring the continuity of the corresponding business of the first message middleware instance in the production site, and improving the efficiency of disaster recovery processing for the first message middleware instance.
[0091] Optionally, the snapshot data includes topic information, subscription group information, and user authority information corresponding to the first message middleware instance; in step S104, the disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result, including:
[0092] Step S1041: The disaster recovery site inputs the subject information, the subscription group information, and the user authority information in the snapshot data into the second message middleware instance.
[0093] Step S1042: The disaster recovery site runs the second message middleware instance to perform message production dial testing and message consumption dial testing according to the topic information, the subscription group information and the user authority information.
[0094] Step S1043: The disaster recovery site determines a disaster recovery test result according to a first dial test result obtained by a message production dial test and a second dial test result obtained by a message consumption dial test.
[0095] In the embodiment of the present invention, the snapshot data obtained by the backup site in step S102 includes metadata corresponding to the first message middleware instance, and the metadata includes topic information, subscription group information and user authority information corresponding to the first message middleware instance.
[0096] The disaster recovery site in the cloud platform obtains snapshot data from the backup site and tests the second message middleware instance based on the snapshot data. The process of obtaining the disaster recovery test result can be achieved through operations corresponding to steps S1041 to S1043.
[0097] Specifically, after obtaining the snapshot data from the backup site, the third cloud host with the second message middleware instance created in the disaster recovery site can execute step S1041 to input the subject information, subscription group information and user permission information in the snapshot data into the second message middleware instance through the interface provided by the second message middleware management console, and create a subject, subscription group and user permission in the second message middleware instance that is consistent with the first message middleware instance.
[0098] After inputting the subject information, subscription group information and user permission information into the second message middleware instance, the third cloud host in the disaster recovery site can run the second message middleware instance to perform message production dial test and message consumption dial test according to the subject information, subscription group information and user permission information, so as to verify the availability of the second message middleware instance. The message production dial test is used to test whether the second message middleware instance can achieve the same message production function as the first message middleware instance; the message consumption dial test is used to test whether the second message middleware instance can achieve the same message consumption function as the first message middleware instance.
[0099] Finally, the third cloud host in the disaster recovery site determines the disaster recovery test result according to the first dial test result obtained by the message production dial test and the second dial test result obtained by the message consumption dial test. Specifically, when the first dial test result is a dial test failure and / or the second dial test result is a dial test failure, the third cloud host can determine that the disaster recovery test result is a test failure; when the first dial test result is a dial test success and the second dial test result is also a dial test success, the third cloud host can determine that the disaster recovery test result is a test success.
[0100] Optionally, in step S1042, the disaster recovery site runs the second message middleware instance to perform message production dial test and message consumption dial test according to the topic information, the subscription group information and the user authority information, including:
[0101] Step A11: The disaster recovery site runs the second message middleware instance to perform message production dialing test on the first topic according to the first topic indicated by the topic information and the message production rule corresponding to the first topic.
[0102] Step A12: The disaster recovery site runs the second message middleware instance to perform message consumption dialing on the second topic according to the first subscription group indicated by the subscription group information, the second topic corresponding to the first subscription group, and the message consumption rule corresponding to the first subscription group.
[0103] Step A13: The disaster recovery site connects to the second message middleware instance according to the user name information of the target user indicated by the user authority information, and performs identity authentication of the target user.
[0104] Step A14: When the identity authentication is passed, the disaster recovery site runs the second message middleware instance to perform message production dialing on the third topic for which the target user has message production authority, and performs message consumption dialing on the fourth topic for which the target user has message consumption authority, according to the topic authority indicated by the user authority information.
[0105] Step A15: When the identity authentication is passed, the disaster recovery site runs the second message middleware instance to perform message consumption dialing on the fifth topic corresponding to the second subscription group for which the target user has message consumption authority according to the subscription group authority indicated by the user authority information.
[0106] In the embodiment of the present invention, the process in which the third host in the disaster recovery site runs the second message middleware instance to perform message production dial test and message consumption dial test can be specifically implemented through steps A11 to A15.
[0107] Specifically, in step A11, the third cloud host in the disaster recovery site can run the second message middleware instance to perform message production dialing on the first topic according to the first topic indicated by the topic information and the message production rules corresponding to the first topic, so as to verify whether the second message middleware can implement the message production dialing under the first topic. Referring to Table 1, the first topic is the topic listed in topicName in the topic information, and the message production rules corresponding to the first topic are the rules for message production under the first topic. Specifically, the message production rules corresponding to the first topic may include the number of read queues (readQueueNums), the number of write queues (writeQueueNums), read and write permissions (perm), and whether it is ordered (order).
[0108] In step A12, the third cloud host in the disaster recovery site can run the second message middleware instance to perform message consumption dialing on the second topic according to the first subscription group indicated by the subscription group information, the second topic corresponding to the first subscription group, and the message consumption rule corresponding to the first subscription group, so as to verify whether the second message middleware can implement the message consumption dialing under the topic corresponding to the subscription group. Referring to Table 2, the first subscription group is the subscription group listed in groupName in the subscription group information, and the second topic is at least one topic subscribed to the first subscription group; the message consumption rule corresponding to the first subscription group refers to the rule for message consumption on the second topic subscribed to the first subscription group. Specifically, the message consumption rule corresponding to the first subscription group may include whether consumption is allowed (consumeEnable), whether consumption is from the minimum offset (consumeFromMinEnable), whether broadcast consumption is enabled (consumeBroadcastEnable), the number of retry queues (retryQueueNums), the number of retry consumption times (retryMaxTimes), the consumption mechanism (pullMechanism), and the first consumption mechanism (firstConsumeMechanism).
[0109] In the embodiment of the present invention, the third cloud host may specifically implement steps A13 to A15 in the process of running the second message middleware instance to perform message production dial test and message consumption dial test according to the user authority information.
[0110] In step A13, the third cloud host connects to the second message middleware instance according to the user name information of the target user indicated by the user authority information, and performs identity authentication of the target user. The user name information of the target user includes the user ID (accessKey) and the key (secretKey) corresponding to the user ID; specifically, the third cloud host can use the accessKey and secretKey in the user authority information to connect to the second message middleware instance.
[0111] If the identity authentication of the target user passes, the third cloud host continues to execute step A14 and step A15; if the identity authentication of the target user fails, the third cloud host may determine that the disaster recovery test result is a test failure.
[0112] When the identity authentication of the target user is passed, the third cloud host can execute step A14 according to the topic permissions indicated by the user permission information, and run the second message middleware instance to perform message production dialing test on the third topic for which the target user has message production permissions, and to perform message consumption dialing test on the fourth topic for which the target user has message consumption permissions. Referring to Table 3, topic permissions refer to the message production permissions and message consumption permissions of the topics listed in topicPerms of Table 3; the third cloud host can determine the third topic for which the target user has message production permissions and the fourth topic for which the target user has message consumption permissions according to the topic permissions, and run the second message middleware instance to perform message production dialing test on the third topic, and to perform message consumption dialing test on the fourth topic.
[0113] Accordingly, when the identity authentication of the target user is passed, the third cloud host can also execute step A15 according to the subscription group permissions indicated by the user permission information, and run the second message middleware instance to perform message consumption dialing on the fifth topic corresponding to the second subscription group to which the target user has message consumption permissions. Referring to Table 3, the subscription group permissions refer to the consumption permissions of the subscription group listed in groupPerms of Table 3; the third cloud host can determine the second subscription group to which the target user has message consumption permissions according to the subscription group permissions indicated by the user permission information, and run the second message middleware instance to perform message consumption dialing on the fifth topic subscribed in the second subscription group.
[0114] Reference Figure 3 , shows a flowchart of a method for testing a second message middleware instance provided by an embodiment of the present invention, the method comprising steps S201 to S208:
[0115] Step S201: The disaster recovery site creates a second message middleware instance.
[0116] Step S202: The disaster recovery site obtains snapshot data corresponding to the first message middleware instance from the backup site.
[0117] Step S203: The disaster recovery site extracts metadata of the first message middleware instance from the snapshot data.
[0118] Step S204: The disaster recovery site imports the metadata into the second message middleware instance.
[0119] Step S205: The disaster recovery site runs the second message middleware instance to verify the availability of the second message middleware instance.
[0120] Step S206: Whether to retain the second message middleware instance.
[0121] Specifically, the third cloud host in the disaster recovery site can execute step S208 when confirming that the second message middleware instance is retained in the third cloud host; the third cloud host in the disaster recovery site can execute step S207 when confirming that the second message middleware instance is not retained in the third cloud host.
[0122] Step S207: The disaster recovery site removes the second message middleware instance and reclaims resources.
[0123] Specifically, the third cloud host in the disaster recovery site can remove the second message middleware instance from the third cloud host after confirming that the second message middleware instance will not be retained in the third cloud host, thereby recovering the host resources of the third cloud host in the disaster recovery site.
[0124] Step S208: The disaster recovery site clears metadata in the second message middleware instance and stops the operation of the second message middleware instance.
[0125] Specifically, the third cloud host in the disaster recovery site may clear metadata in the second message middleware instance and stop the operation of the second message middleware instance when confirming to keep the second message middleware instance in the third cloud host.
[0126] The disaster recovery processing method provided by the embodiment of the present invention is that the disaster recovery site obtains snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result, which can discover in advance the problems that may occur in the second message middleware instance during the operation based on the metadata of the first message middleware instance, thereby improving the probability of the second message middleware instance created by the disaster recovery site being available, and further improving the probability that the disaster recovery site successfully runs the second message middleware instance to implement the business function of the first message middleware instance when the first message middleware instance is unavailable, thereby improving the reliability of the disaster recovery processing process.
[0127] Optionally, the production site includes a first message middleware management station and at least one first cloud host, in which at least one first message middleware instance is deployed; the backup site obtaining metadata of the first message middleware instance from the production site in step S101 includes:
[0128] Step S1011: The backup site obtains metadata of the first message middleware instance deployed in the first cloud host from the first cloud host through the interface of the first message middleware management station.
[0129] In an embodiment of the present invention, in the process of obtaining the metadata of the first message middleware instance from the production site, the backup site can directly obtain the metadata of the first message middleware instance from the first cloud host where the first message middleware instance is deployed through the interface provided by the first message middleware management console, thereby simplifying the interaction process between the backup site and the production site in the process of obtaining metadata and improving the efficiency of the backup site in obtaining the metadata of the first message middleware instance.
[0130] As an example, see Figure 4 , shows a flowchart of a method for obtaining metadata of a first message middleware instance provided by an embodiment of the present invention, the method comprising steps S301 to S303:
[0131] Step S301: The backup site determines a first preset period for acquiring metadata.
[0132] Specifically, the backup site can determine the first preset period for obtaining metadata based on the first preset period setting instruction input by the user to the cloud platform or the backup site; the first preset period setting instruction is used to instruct the backup site to obtain the metadata of the first message middleware instance from the production site according to the first preset period.
[0133] Step S302: The backup site calls the interface of the first message middleware management station according to a first preset period to obtain initial metadata of the first message middleware instance.
[0134] Step S303: The backup site converts the initial metadata into a preset data structure to obtain metadata.
[0135] Specifically, since the initial metadata formats of the first message middleware instances created and deployed by different types of first message middleware management stations differ to varying degrees, in an embodiment of the present invention, when the backup site obtains the initial metadata of the first message middleware instance, it can execute step S303 to convert the initial metadata into a preset data structure to obtain metadata.
[0136] Among them, the metadata includes subject information, subscription group information and user permission information; the backup site can convert the format of the subject information into a subject information list with a preset data structure, convert the format of the subscription group information into a subscription group information list with a preset data structure, and convert the format of the user permission information into a user permission information list with a preset data structure.
[0137] Optionally, in step S102, the backup site generates snapshot data corresponding to the first message middleware instance according to the metadata, including:
[0138] Step S1021: The backup site obtains the instance identifier of the first message middleware instance.
[0139] Step S1022: The backup site obtains a target time for creating snapshot data corresponding to the first message middleware instance and a snapshot identifier of the snapshot data.
[0140] Step S1023: The backup site adds the instance identifier, the target time, and the snapshot identifier to the metadata to obtain snapshot data corresponding to the first message middleware instance.
[0141] In an embodiment of the present invention, when the backup site generates snapshot data corresponding to the first message middleware instance based on the metadata, it can first obtain the instance identifier of the first message middleware instance through step S1021, and obtain the target time for creating the snapshot data corresponding to the first message middleware instance and the snapshot identifier of the snapshot data through step S1022; then, add the instance identifier, target time and snapshot identifier to the metadata to obtain the snapshot data corresponding to the first message middleware instance.
[0142] The backup site may obtain the instance identifier of the first message middleware instance from the first cloud host where the first message middleware instance is deployed by calling the interface of the first message middleware management station.
[0143] The target time acquired by the backup site may be a preset time when the backup site generates snapshot data, or the target time may be a time when the backup site starts to execute step S1022.
[0144] The snapshot identifier of the snapshot data is a randomly generated identifier corresponding to the snapshot data in a one-to-one manner. In step S1022, the backup site may randomly generate a snapshot identifier corresponding to the snapshot data currently required to be generated in a one-to-one manner.
[0145] In the process of generating snapshot data, the backup site may add the instance identifier, the target time and the snapshot identifier to the metadata obtained in step S101 to obtain the snapshot data corresponding to the first message middleware instance.
[0146] As an example, referring to Table 4, a snapshot data list provided by an embodiment of the present invention is shown. As shown in Table 4, the snapshot data obtained by the backup site through step S1023 includes an instance identifier, a target time, a snapshot identifier, and a subject information list, a subscription group information list, and a user authority information list constituting metadata.
[0147] Table 4
[0148] Property name Property Type describe id Integer Snapshot ID serviceInstanceId String Instance ID createdTime Timestamp Target time topicList List Topic Information List subscriptionList List Subscription Information List userList List User permission information list
[0149] According to the disaster recovery processing method provided by the embodiment of the present invention, the backup site adds the instance identifier of the first message middleware instance, the target time for creating the snapshot data, and the snapshot identifier of the snapshot data to the metadata during the process of generating snapshot data, so as to obtain the snapshot data corresponding to the first message middleware instance, thereby improving the comprehensiveness of the snapshot data content, which is not only beneficial for the backup site to manage the stored snapshot data, but also beneficial for the disaster recovery site to quickly identify the snapshot data that needs to be obtained from the backup site according to the instance identifier, target time and snapshot identifier.
[0150] Specifically, refer to Figure 5 , shows a flowchart of a method for generating snapshot data provided by an embodiment of the present invention, the method comprising steps S401 to S404:
[0151] Step S401: Encapsulate and obtain snapshot data.
[0152] Specifically, when the backup site obtains the metadata, instance identifier, target time and snapshot identifier, it can add the instance identifier, target time and snapshot identifier to the metadata and encapsulate them to obtain snapshot data corresponding to the first message middleware instance.
[0153] Step S402: Whether the amount of snapshot data in the first preset storage area is greater than or equal to a storage threshold.
[0154] Specifically, before storing the snapshot data obtained in step S401 in the first preset storage area, the backup site first determines whether the amount of snapshot data in the first preset storage area is greater than or equal to the storage threshold; if the amount of snapshot data in the first preset storage area is greater than or equal to the storage threshold, step S404 is executed; if the amount of snapshot data in the first preset storage area is less than the storage threshold, step S403 is executed.
[0155] The storage threshold is the maximum value of the number of snapshot data that can be stored in the first preset storage area.
[0156] Step S403: store the snapshot data in a first preset storage area.
[0157] Specifically, when the amount of snapshot data in the first preset storage area is less than the storage threshold, the backup site may directly store the snapshot data obtained in step S401 in the first preset storage area.
[0158] Step S404: Delete the snapshot data that already exists in the first preset storage area.
[0159] Specifically, when the amount of snapshot data in the first preset storage area is greater than or equal to the storage threshold, the backup site first deletes the snapshot data first stored in the first preset storage area according to the target time in the snapshot data already existing in the first preset storage area, and then repeatedly performs the operation corresponding to step S402 until the amount of snapshot data in the first preset storage area is less than the storage threshold.
[0160] In an embodiment of the present invention, there may be multiple snapshot data stored in the backup site, and the storage space of the first preset storage area in the backup site is limited. When the storage space in the first preset storage area is full, when the backup site subsequently executes step S102 or steps S1021 to S1023 to obtain the latest snapshot data, the backup site may delete the snapshot data first stored in the first preset storage area according to the target time in the snapshot data already existing in the first preset storage area, and store the latest snapshot data in the preset storage area.
[0161] Exemplarily, a maximum of 5 snapshot data can be stored in the first preset storage area. Each time the backup site executes step S102 or steps S1021 to S1023 to obtain the latest snapshot data, it first determines the number of snapshot data already stored in the first preset storage area. When the number of snapshot data is less than 5, the backup site can directly store the latest snapshot data in the first preset storage area. When the number of snapshot data is greater than or equal to 5, the backup site deletes the snapshot data first stored in the first preset storage area according to the target time in each snapshot data in the first preset storage area, and stores the latest snapshot data in the first preset storage area.
[0162] Optionally, in step S104, the disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data, and after obtaining the disaster recovery test result, the method further includes:
[0163] Step S106: The disaster recovery site clears metadata in the second message middleware instance.
[0164] Step S107: The disaster recovery site saves the second message middleware instance to a second preset storage area.
[0165] In an embodiment of the present invention, after executing step S104 to obtain the disaster recovery test result, before executing step S105, the disaster recovery site may first execute step S106 to clear the metadata in the second message middleware instance, and then execute step S107 to save the second message middleware instance to the second preset storage area. The second preset storage area is a storage area in the third cloud host where the second message middleware instance is deployed in the disaster recovery site.
[0166] Optionally, in step S105, when the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance, and runs the second message middleware instance based on the snapshot data corresponding to the first message middleware instance, including:
[0167] Step S1051: When the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance from the preset storage area.
[0168] Step S1052: The disaster recovery site obtains the snapshot data from the backup site, and runs the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
[0169] In an embodiment of the present invention, after step S104, the disaster recovery site saves the second message middleware instance after clearing the metadata to the second preset storage area through steps S106 and S107. During the process of executing step S105, the disaster recovery site can obtain the second message middleware instance from the second preset storage area, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance obtained from the backup site. The disaster recovery site does not need to re-create the second message middleware instance, which simplifies the process of the disaster recovery site obtaining the second message middleware instance when executing step S105, realizes the rapid deployment and operation of the second message middleware instance at the disaster recovery site, ensures the continuity of the business corresponding to the first message middleware instance in the production site, and improves the efficiency of disaster recovery processing for the first message middleware instance.
[0170] In summary, the disaster recovery processing method provided by the embodiment of the present invention implements disaster recovery processing of the first message middleware instance in the production site based on the production site, backup site and disaster recovery site located in different resource pools in the cloud platform, thereby improving the disaster recovery capability of the first message middleware instance; in the disaster recovery processing process, the metadata of the first message middleware instance is obtained from the production site through the backup site, and snapshot data corresponding to the first message middleware instance is generated and stored according to the metadata, thereby realizing the backup of the metadata corresponding to the first message middleware instance in the production site. The backup process can be implemented through a low-configuration cloud host in the backup site, with less equipment resource occupation, thereby reducing resource consumption and waste in the disaster recovery processing of the first message middleware instance; the disaster recovery site can obtain snapshot data from the backup site, and create a disaster recovery site based on the snapshot data. A second message middleware instance with the same configuration as the first message middleware instance is built for testing, and a disaster recovery test result is obtained, which increases the probability of the second message middleware instance created at the disaster recovery site being available, thereby increasing the probability that the disaster recovery site can successfully run the second message middleware instance to implement the business function of the first message middleware instance when the first message middleware instance is unavailable, thereby improving the reliability of the disaster recovery processing process; when the first message middleware instance in the production site is unavailable, the cloud platform can realize the rapid deployment and operation of the second message middleware instance at the disaster recovery site based on the interaction between the backup site and the disaster recovery site, thereby avoiding the network delay problem of cross-regional backup, ensuring the continuity of the corresponding business of the first message middleware instance in the production site, and improving the efficiency of disaster recovery processing for the first message middleware instance.
[0171] Device Embodiment
[0172] Reference Figure 6 , shows a logical block diagram of a disaster recovery system provided by an embodiment of the present invention, which is applied to a cloud platform. The disaster recovery system includes a production site 601, a backup site 602 and a disaster recovery site 603 located in different resource pools; the production site 601 includes at least one first message middleware instance; wherein,
[0173] The backup site 602 is used to obtain metadata of the first message middleware instance from the production site 601; generate snapshot data corresponding to the first message middleware instance according to the metadata, and store the snapshot data;
[0174] The disaster recovery site 603 is used to create a second message middleware instance, which has the same configuration as the first message middleware instance; obtain the snapshot data from the backup site 602, and test the second message middleware instance based on the snapshot data to obtain a disaster recovery test result; and when the first message middleware instance is unavailable and the disaster recovery test result is a successful test, obtain the second message middleware instance, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
[0175] Optionally, the snapshot data includes subject information, subscription group information and user authority information corresponding to the first message middleware instance; the disaster recovery site is specifically used for:
[0176] Inputting the subject information, the subscription group information and the user authority information in the snapshot data into the second messaging middleware instance;
[0177] According to the topic information, the subscription group information and the user authority information, the second message middleware instance is run to perform message production dial test and message consumption dial test;
[0178] The disaster recovery test result is determined based on the first dial test result obtained from the message production dial test and the second dial test result obtained from the message consumption dial test.
[0179] Optionally, the disaster recovery site is specifically used for:
[0180] According to the first topic indicated by the topic information and the message production rule corresponding to the first topic, running the second message middleware instance to perform message production dialing test on the first topic;
[0181] According to the first subscription group indicated by the subscription group information, the second topic corresponding to the first subscription group, and the message consumption rule corresponding to the first subscription group, running the second message middleware instance to perform message consumption dialing test on the second topic;
[0182] Connecting to the second message middleware instance according to the user name information of the target user indicated by the user authority information, and performing identity authentication of the target user;
[0183] If the identity authentication is passed, according to the topic authority indicated by the user authority information, the second message middleware instance is run to perform message production dial test on the third topic for which the target user has message production authority, and to perform message consumption dial test on the fourth topic for which the target user has message consumption authority;
[0184] When the identity authentication is passed, the second message middleware instance is run to perform message consumption dialing on the fifth topic corresponding to the second subscription group for which the target user has message consumption authority according to the subscription group authority indicated by the user authority information.
[0185] Optionally, the production site includes a first message middleware management station and at least one first cloud host, in which at least one first message middleware instance is deployed; the backup site is specifically used to:
[0186] The metadata of the first message middleware instance deployed in the first cloud host is obtained from the first cloud host through the interface of the first message middleware management station.
[0187] Optionally, the backup site is specifically used for:
[0188] Obtaining the instance identifier of the first message middleware instance;
[0189] Obtaining a target time for creating snapshot data corresponding to the first message middleware instance and a snapshot identifier of the snapshot data;
[0190] The instance identifier, the target time, and the snapshot identifier are added to the metadata to obtain snapshot data corresponding to the first message middleware instance.
[0191] Optionally, the disaster recovery site is further used for:
[0192] Clearing metadata in the second message middleware instance;
[0193] The second message middleware instance is saved in a second preset storage area.
[0194] Optionally, the disaster recovery site is specifically used for:
[0195] When the first message middleware instance is unavailable and the disaster recovery test result is a test success, obtaining the second message middleware instance from the preset storage area;
[0196] The snapshot data is obtained from the backup site, and the second message middleware instance is run based on the snapshot data corresponding to the first message middleware instance.
[0197] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0198] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0199] Reference Figure 7 , is a structural block diagram of an electronic device for disaster recovery processing provided by an embodiment of the present invention. Figure 7 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the disaster recovery processing method of the aforementioned embodiment.
[0200] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other editable devices, transistor logic devices, hardware components or any combination thereof. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0201] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.
[0202] The memory may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable ReadOnly), a CD-ROM (Compact Disa Read Only), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0203] The embodiment of the present invention also provides a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor is able to execute Figure 1 The disaster recovery method shown in the figure.
[0204] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0205] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0206] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0207] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0209] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0210] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0211] The above is a detailed introduction to a disaster recovery processing method, a disaster recovery system, an electronic device and a storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A disaster recovery processing method, characterized in that: Applied to a cloud platform, the cloud platform includes a production site, a backup site, and a disaster recovery site located in different resource pools; the production site includes at least one first message middleware instance; the method includes: The backup site obtains metadata of the first message middleware instance from the production site; The backup site generates snapshot data corresponding to the first message middleware instance according to the metadata, and stores the snapshot data; The disaster recovery site creates a second message middleware instance; the configuration of the second message middleware instance is the same as that of the first message middleware instance; The disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result; When the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance and runs the second message middleware instance based on snapshot data corresponding to the first message middleware instance.
2. The method according to claim 1, characterized in that The snapshot data includes the subject information, subscription group information and user authority information corresponding to the first message middleware instance; The disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data to obtain a disaster recovery test result, including: The disaster recovery site inputs the subject information, the subscription group information and the user authority information in the snapshot data into the second message middleware instance; The disaster recovery site runs the second message middleware instance to perform message production dial test and message consumption dial test according to the topic information, the subscription group information and the user authority information; The disaster recovery site determines a disaster recovery test result according to a first dial test result obtained by a message production dial test and a second dial test result obtained by a message consumption dial test.
3. The method according to claim 2, characterized in that The disaster recovery site runs the second message middleware instance to perform message production dial test and message consumption dial test according to the topic information, the subscription group information and the user authority information, including: The disaster recovery site runs the second message middleware instance to perform message production dialing test on the first topic according to the first topic indicated by the topic information and the message production rule corresponding to the first topic; The disaster recovery site runs the second message middleware instance to perform message consumption dialing test on the second topic according to the first subscription group indicated by the subscription group information, the second topic corresponding to the first subscription group, and the message consumption rule corresponding to the first subscription group; The disaster recovery site connects to the second message middleware instance according to the user name information of the target user indicated by the user authority information, and performs identity authentication of the target user; If the identity authentication is passed, the disaster recovery site runs the second message middleware instance to perform message production dial test on the third topic for which the target user has message production authority, and performs message consumption dial test on the fourth topic for which the target user has message consumption authority, according to the topic authority indicated by the user authority information; When the identity authentication is passed, the disaster recovery site runs the second message middleware instance to perform message consumption dialing on the fifth topic corresponding to the second subscription group for which the target user has message consumption authority according to the subscription group authority indicated by the user authority information.
4. The method according to claim 1, characterized in that: The production site includes a first message middleware management station and at least one first cloud host, wherein at least one first message middleware instance is deployed in the first cloud host; The backup site obtains metadata of the first message middleware instance from the production site, including: The backup site obtains metadata of the first message middleware instance deployed in the first cloud host from the first cloud host through the interface of the first message middleware management station.
5. The method according to claim 1, characterized in that The backup site generates snapshot data corresponding to the first message middleware instance according to the metadata, including: The backup site obtains the instance identifier of the first message middleware instance; The backup site obtains a target time for creating snapshot data corresponding to the first message middleware instance and a snapshot identifier of the snapshot data; The backup site adds the instance identifier, the target time, and the snapshot identifier to the metadata to obtain snapshot data corresponding to the first message middleware instance.
6. The method according to claim 1, characterized in that The disaster recovery site obtains the snapshot data from the backup site, and tests the second message middleware instance based on the snapshot data. After obtaining the disaster recovery test result, the method further includes: The disaster recovery site clears metadata in the second message middleware instance; The disaster recovery site saves the second message middleware instance to a second preset storage area.
7. The method according to claim 6, characterized in that When the first message middleware instance is unavailable and the disaster recovery test result is a test success, the disaster recovery site obtains the second message middleware instance, and runs the second message middleware instance based on snapshot data corresponding to the first message middleware instance, including: The disaster recovery site obtains the second message middleware instance from the preset storage area when the first message middleware instance is unavailable and the disaster recovery test result is a test success; The disaster recovery site obtains the snapshot data from the backup site, and runs the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
8. A disaster recovery system, characterized in that: Applied to a cloud platform, the disaster recovery system includes a production site, a backup site, and a disaster recovery site located in different resource pools; the production site includes at least one first message middleware instance; wherein, The backup site is used to obtain metadata of the first message middleware instance from the production site; generate snapshot data corresponding to the first message middleware instance according to the metadata, and store the snapshot data; The disaster recovery site is used to create a second message middleware instance, which has the same configuration as the first message middleware instance; obtain the snapshot data from the backup site, and test the second message middleware instance based on the snapshot data to obtain a disaster recovery test result; and when the first message middleware instance is unavailable and the disaster recovery test result is a successful test, obtain the second message middleware instance, and run the second message middleware instance based on the snapshot data corresponding to the first message middleware instance.
9. An electronic device, characterized in that: include: The electronic device comprises a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to execute the disaster recovery processing method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the disaster recovery processing method according to any one of claims 1 to 7.