Method and device for rapidly recovering cross-cluster disaster recovery, electronic equipment and storage medium

文档序号:7382 发布日期:2021-09-17 浏览:30次 中文

1. A method for cross-cluster disaster recovery, the method comprising:

a blank disk is created by the disaster recovery cluster and is mounted to a local directory;

the disaster recovery cluster receives data of the service cluster and backups the data to the local directory;

when the service cluster fails, the disaster recovery cluster maps the backup data to at least one virtual machine of the disaster recovery cluster through a local directory, and the at least one virtual machine of the disaster recovery cluster takes over the service.

2. The method of claim 1, wherein a format of backup data in the local directory is the same as a format of data in the service cluster.

3. The method for cross-cluster disaster recovery fast recovery as recited in claim 1 wherein the blank disk format created by the disaster recovery cluster is different from or the same as the data format of the service cluster.

4. The method of claim 1, wherein a capacity of the blank disk is the same as a data capacity of the service cluster.

5. The method for cross-cluster disaster recovery fast as recited in claim 1 wherein the number of blank disks created by the disaster recovery cluster is one.

6. The method according to claim 1, wherein the disaster recovery cluster receives and backs up data of the service cluster according to a set period.

7. An apparatus for fast recovery across a cluster disaster recovery, the apparatus comprising:

the mounting module is used for creating a blank disk for the disaster recovery backup cluster and mounting the blank disk to a local directory;

the backup module is used for receiving the data of the service cluster by the disaster recovery cluster and backing up the data into the local directory;

and the recovery module is used for mapping the backup data to at least one virtual machine of the disaster backup cluster through a local directory when the service of the service cluster fails, and taking over the service by the at least one virtual machine of the disaster backup cluster.

8. The apparatus according to claim 7, wherein a format of the backup data in the local directory is the same as a format of the data in the service cluster.

9. An electronic device, comprising:

at least one processor; and

a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of cross-cluster disaster recovery fast recovery as recited in any one of claims 1 to 6.

10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for cross-cluster disaster recovery fast recovery as claimed in any one of claims 1 to 6.

Background

The cloud data center disaster tolerance technology is a technology which copies data and application systems in a local production site to a remote disaster backup site through an electronic network, and when the local production site cannot provide services continuously due to disasters such as fire, earthquake and the like, the disaster backup site takes over various services operated by an original production site, so that various service services provided by a data center can be prevented or hardly influenced by disasters to the greatest extent. Wherein, the production site and the disaster recovery site have network connection. Due to factors such as construction cost and construction time, different storage technologies are adopted when a data center is constructed, for example, some storage can only be in a raw format, some storage can only be in a qcow2 format, if disaster recovery is performed between two data centers, when a problem occurs in a main data center, a standby data center takes over services, and the disk format needs to be converted into a format which can be recognized by the data center, wherein the conversion of the format is a quite long process, and a large amount of cpu and disk IO resources are consumed, which is very unfavorable for rapid service switching.

The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.

Disclosure of Invention

The invention aims to provide a cross-cluster disaster recovery method and device, electronic equipment and a storage medium, which can quickly take over various services of a business cluster by a disaster recovery cluster when the business cluster has a disaster and cannot continuously provide the services, and can quickly realize backup and recovery among the clusters under the condition that storage is not supported or the storage types are different.

In order to achieve the above object, an embodiment of the present invention provides a method for fast recovery of cross-cluster disaster recovery.

In one or more embodiments of the invention, the method comprises: a blank disk is created by the disaster recovery cluster and is mounted to a local directory; the disaster recovery cluster receives data of the service cluster and backups the data to the local directory; and when the service of the service cluster fails, the disaster recovery cluster maps the backup data to at least one virtual machine of the disaster recovery cluster through a local directory, and the at least one virtual machine of the disaster recovery cluster takes over the service.

In one or more embodiments of the present invention, a format of the backup data in the local directory is the same as a format of the data in the service cluster.

In one or more embodiments of the present invention, a blank disk format created by the disaster recovery cluster is different from or the same as a data format of the service cluster.

In one or more embodiments of the present invention, a capacity of the blank disk is the same as a data capacity of the service cluster.

In one or more embodiments of the present invention, the number of the blank disks created and mounted by the disaster recovery cluster is one.

In one or more embodiments of the present invention, the disaster recovery cluster receives and backs up data of the service cluster according to a set period.

In another aspect of the present invention, an apparatus for cross-cluster disaster recovery fast recovery is provided, which includes a mount module, a backup module, and a recovery module.

And the mounting module is used for creating a blank disk for the disaster recovery backup cluster and mounting the blank disk to the local directory.

And the backup module is used for receiving the data of the service cluster by the disaster recovery cluster and backing up the data to the local directory.

And the recovery module is used for mapping the backup data to at least one virtual machine of the disaster backup cluster through a local directory when the service of the service cluster fails, and taking over the service by the at least one virtual machine of the disaster backup cluster.

In one or more embodiments of the present invention, a format of the backup data in the local directory is the same as a format of the data in the service cluster.

In one or more embodiments of the present invention, a blank disk format created by the disaster recovery cluster is different from or the same as a data format of the service cluster.

In one or more embodiments of the present invention, a capacity of the blank disk is the same as a data capacity of the service cluster.

In one or more embodiments of the present invention, the number of the blank disks created and mounted by the disaster recovery cluster is one.

In one or more embodiments of the invention, the backup module is further configured to: and the disaster recovery cluster receives the data of the service cluster according to a set period and performs backup.

In another aspect of the present invention, there is provided an electronic device including: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of cross-cluster disaster recovery fast recovery as described above.

In another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for cross-cluster disaster recovery fast recovery as described.

Compared with the prior art, according to the method for rapidly recovering the cross-cluster disaster recovery in the embodiment of the invention, when the service cluster has a disaster and cannot continuously provide the service, the disaster recovery cluster can rapidly take over various services of the service cluster, so that various services provided by the data center are not influenced by the disaster to the greatest extent, and the service cannot be interrupted. In addition, the cross-cluster disaster recovery quick recovery method can quickly realize backup and recovery among clusters under the condition that storage is not supported or the storage types are different.

Drawings

Fig. 1 is a flowchart of a cross-cluster disaster recovery fast recovery method according to an embodiment of the present invention;

fig. 2 is an architecture diagram of a single virtual machine of a cross-cluster disaster recovery fast recovery method according to an embodiment of the present invention;

fig. 3 is an architecture diagram of multiple virtual machines of a cross-cluster disaster recovery fast recovery method according to an embodiment of the present invention;

FIG. 4 is a hardware block diagram of a cross-cluster disaster recovery fast recovery computing device, according to an embodiment of the invention.

Detailed Description

The following detailed description of the present invention is provided in conjunction with the accompanying drawings, but it should be understood that the scope of the present invention is not limited to the specific embodiments.

Throughout the specification and claims, unless explicitly stated otherwise, the word "comprise", or variations such as "comprises" or "comprising", will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.

Some concepts related to the embodiments of the present invention are described below.

Disaster backup: refers to the process of using technology, management and related resources to ensure that critical data, critical data processing systems and critical business can be restored after a disaster occurs. In this sense, the goal of disaster recovery is to ensure that critical services continue to run and to reduce unplanned downtime. The disaster recovery system in the information field can be understood as a comprehensive system which takes a storage system as a basic support system, a network as a basic transmission means, a fault tolerance, a backup software and hardware technology as a direct technical means and a management technology as an important auxiliary means.

The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting. The invention is not limited to the mutual disaster recovery between qcow2 and RAW, but is also applicable to other virtualized disk formats, such as vmdk, vdi, vpc and the like.

Example 1

Referring to fig. 1 to 2, a method for cross-cluster disaster recovery in an embodiment of the present invention is described, which includes the following steps.

In step S101, the disaster recovery cluster creates a blank disk and mounts the blank disk to the local directory.

In this embodiment, the disaster recovery cluster creates a blank disk 202 in a qcow2 format in advance, mounts the blank disk 202 to a local directory 203, where mounting is to connect the disk to an existing directory, and after the disk is mounted, any operation on the directory is equivalent to an operation on the disk.

In step S102, the disaster recovery cluster receives the data of the service cluster and backs up the data to the local directory.

In a normal working state, the service cluster can send data to the disaster recovery backup cluster according to a set period, correspondingly, the disaster recovery backup cluster can receive and backup the data of the service cluster according to the set period, wherein the backup data format backed up by the disaster recovery backup cluster into the local directory is the same as the data format of the service cluster.

In this embodiment, the blank disk 202 is a disk with a qcow2 format, and the disk 204 in the service cluster is a disk with a RAW format. During the backup process, the disaster recovery cluster stores the backup data in the original format (i.e., RAW format) to the blank disk 202 mounted on the local directory 203.

In a Linux system, a blank disk created in a disaster recovery cluster and a disk in a service cluster are different in format for a virtual machine, but are files for the cluster, and the virtual machine in the cluster can directly read the files in the disk file format. Therefore, by creating a blank disk in advance and mounting the blank disk to the local directory, after the data in the service cluster is backed up in the blank disk, the virtual machine of the disaster recovery cluster can directly read the backup data in the service cluster through the directory as required without converting the format of the data.

In step S103, when the service cluster fails, the disaster-tolerant backup cluster maps the backup data to at least one virtual machine of the disaster-tolerant backup cluster through the local directory, and the virtual machine of the disaster-tolerant backup cluster takes over the service.

In this embodiment, the local directory in the disaster recovery cluster may correspond to only one virtual machine. When the service cluster fails, the disaster recovery cluster maps the backup data to the virtual machine 201 of the disaster recovery cluster through the local directory 203, and the virtual machine 201 of the disaster recovery cluster takes over the service. Because the data formats actually used by the service cluster and the disaster recovery cluster are the same, the data format conversion when the virtual machine of the disaster recovery cluster uses data is avoided, so that when the disaster recovery cluster is recovered, the virtual machine 202 can quickly pull up the backup data and provide services.

Example 2

Referring to fig. 1 and 3, a method for cross-cluster disaster recovery in accordance with another embodiment of the present invention is described, which includes the following steps.

In step S101, the disaster recovery cluster creates a blank disk and mounts the blank disk to the local directory.

In this embodiment, the disaster recovery cluster creates a blank disk 304 in a RAW format in advance, and mounts the blank disk 304 to the local directory 305. The blank disk 304 is a disk in a RAW format, the disks 306, 307, and 308 in the service cluster are disks in a qcow2 format, the disks in the RAW format and the disks in the qcow2 format are files for the cluster, and the virtual machines in the cluster can directly read the files in the disk file format. Therefore, when the disaster recovery cluster is recovered, the virtual machine 301, the virtual machine 302, and the virtual machine 303 can directly read the backup data thereof through the directory as needed without converting the format of the data, and the disaster recovery cluster can quickly take over the service.

In the Linux system, a disk can be partitioned by mounting the disk to a directory. In this embodiment, a blank disk 304 is mounted on the local directory 305 to implement disk partitioning, data in the disks 306, 307, and 308 in the service cluster are backed up to the disaster recovery cluster in an original format, and the capacity of the blank disk 304 is the same as the sum of the capacities of the disks 306, 307, and 308 in the service cluster. The number of the mounted blank disks 304 in the disaster recovery cluster is one, so that file directories can be reduced, and the maintenance cost can be reduced.

In step S102, the disaster recovery cluster receives the data of the service cluster and backs up the data to the local directory.

In this embodiment, the service cluster may send data to the disaster recovery cluster according to a set period, and correspondingly, the disaster recovery cluster may receive the data of the service cluster according to the set period and perform backup. During the backup process, the disaster recovery cluster stores the backup data in the original format (i.e., qcow2 format) to the blank disk 304 mounted on the local directory 305, so that the data format actually used by the service cluster and the disaster recovery cluster is the same, disk format conversion by the disaster recovery cluster is avoided, and quick recovery of the disaster recovery cluster can be realized.

In step S103, when the service cluster fails, the disaster-tolerant backup cluster maps the backup data to at least one virtual machine of the disaster-tolerant backup cluster through the local directory, and the at least one virtual machine of the disaster-tolerant backup cluster takes over the service.

In this embodiment, the local directory in the disaster recovery cluster may correspond to multiple virtual machines. When the service cluster fails, the disaster-tolerant backup cluster maps the backup data to one or more of the virtual machine 301, the virtual machine 302 and the virtual machine 303 of the disaster-tolerant backup cluster through the local directory 305, and accordingly takes over the service by one or more of the virtual machine 301, the virtual machine 302 and the virtual machine 303 of the disaster-tolerant backup cluster. Because the data formats actually used by the service cluster and the disaster recovery cluster are the same, the data format conversion when the virtual machine of the disaster recovery cluster uses data is avoided, the backup data can be directly mapped to the selected virtual machine in the disaster recovery cluster, the selected virtual machine takes over the service, and all services provided by the data center are ensured not to be influenced by disasters to the greatest extent.

Fig. 4 illustrates a hardware block diagram of a computing device 40 for cross-cluster disaster recovery fast recovery according to an embodiment of the present description. As shown in fig. 4, the computing device 40 may include at least one processor 401, a storage 402 (e.g., a non-volatile storage), a memory 403, and a communication interface 404, and the at least one processor 401, the storage 402, the memory 403, and the communication interface 404 are connected together via a bus 404. The at least one processor 401 executes at least one computer readable instruction stored or encoded in the memory 402.

It should be appreciated that the computer-executable instructions stored in the memory 402, when executed, cause the at least one processor 401 to perform the various operations and functions described above in connection with fig. 1-4 in the various embodiments of the present description.

In embodiments of the present description, computing device 40 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, Personal Digital Assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronics, and so forth.

According to one embodiment, a program product, such as a machine-readable medium, is provided. A machine-readable medium may have instructions (i.e., elements described above as being implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in connection with fig. 1-4 in the various embodiments of the present specification. Specifically, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functions of any of the above embodiments is stored, and causes a computer or processor of the system or apparatus to read out and execute instructions stored in the readable storage medium.

According to the method for rapidly recovering the cross-cluster disaster recovery, when the service cluster has a disaster and cannot provide services continuously, the disaster recovery cluster can take over various services of the service cluster rapidly, so that various services provided by the data center are not affected by the disaster to the greatest extent, and the services cannot be terminated; and backup and recovery among clusters can be rapidly realized under the condition that storage is not supported or the storage types are different.

As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

The foregoing descriptions of specific exemplary embodiments of the present invention have been presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:电能表数据管理方法、电能表及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!