CN117667509A - Snapshot data backup method and device, electronic equipment and storage medium - Google Patents

Snapshot data backup method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117667509A
CN117667509A CN202311434712.XA CN202311434712A CN117667509A CN 117667509 A CN117667509 A CN 117667509A CN 202311434712 A CN202311434712 A CN 202311434712A CN 117667509 A CN117667509 A CN 117667509A
Authority
CN
China
Prior art keywords
target
snapshot
volume
snapshot volume
volumes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311434712.XA
Other languages
Chinese (zh)
Inventor
刘远
张云云
王浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311434712.XA priority Critical patent/CN117667509A/en
Publication of CN117667509A publication Critical patent/CN117667509A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a snapshot data backup method, a snapshot data backup device, electronic equipment and a storage medium. The method comprises the following steps: when unified storage is carried out, snapshot volumes in the network attached storage virtual machine are obtained, and target snapshot volumes are determined; acquiring configuration information of a target snapshot volume and a mapping relation between the target snapshot volume and a target source volume, wherein the configuration information comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume, a generation strategy of the target snapshot volume and the like; and when the target source volume is backed up, backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume. When the network attached storage virtual machine fails and needs to be restored, the snapshot volumes in the virtual machine can be restored according to the configuration information of the backed-up target source volumes and the target snapshot volumes and the mapping relation between the target snapshot volumes and the target source volumes.

Description

Snapshot data backup method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data backup technologies, and in particular, to a snapshot data backup method, device, electronic device, and storage medium.
Background
Disaster recovery capability is a critical capability for a storage system, and for centralized storage, both software and hardware related failures may result in cluster loss. In order to cope with the scene, the disaster recovery data is backed up at night by the centralized storage, and the cluster and the data are restored by adopting a T3 restoration mode when the disaster recovery data are failed, so that the disaster recovery capacity of the centralized storage for dealing with the disaster recovery scene is greatly improved. However, the backup data is not comprehensive when the disaster recovery data is backed up to the NAS (Network Attached Storage ) cluster at present, so that snapshot data in the cluster cannot be recovered after the NAS cluster is recovered.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention are provided to provide a snapshot data backup method, apparatus, electronic device, and storage medium that overcome or at least partially solve the foregoing problems.
In a first aspect, an embodiment of the present invention discloses a snapshot data backup method, including:
when unified storage is carried out, snapshot volumes in the network attached storage virtual machine are obtained, and target snapshot volumes are determined; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the file system is snapshot;
acquiring configuration information of the target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
obtaining a mapping relation between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume;
and backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
Optionally, the snapshot volumes include timed snapshot volumes, the obtaining a snapshot volume in the network attached storage virtual machine and determining a target snapshot volume includes:
inquiring whether snapshot volumes exist in the network attached storage virtual machine or not;
if the snapshot volume exists in the network attached storage virtual machine, inquiring whether a timing snapshot volume exists in the snapshot volume or not;
if the timed snapshot volume exists in the snapshot volumes, acquiring the generation time of the timed snapshot volume, and taking the timed snapshot volume with the latest generation time as a target snapshot volume according to the generation time;
if the timed snapshot volume does not exist in the snapshot volumes, taking all snapshot volumes obtained by query as target snapshot volumes;
the obtaining the configuration information of the target snapshot volume includes:
when the target snapshot volume is a timing snapshot volume, determining that configuration information of the target snapshot volume comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
when the target snapshot volume is not the timing snapshot volume, determining that the configuration information of the target snapshot volume comprises the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
Optionally, the obtaining the generation time of the timing snapshot volume includes:
acquiring the name of the timing snapshot volume; the name includes a time of generation of the timing snapshot.
Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume further includes a number of the target snapshot volumes.
Optionally, the target source volume is a file in a multi-controller system, and when the target source volume is backed up, backing up configuration information of the target snapshot volume and a mapping relationship between the target snapshot volume and the target source volume includes:
backing up the multi-controller system and the network attached storage virtual machine according to preset time;
when the multi-controller system is backed up, the target source volume and the mapping relation between the target snapshot volume and the target source volume are backed up, and a first backup file is generated;
and when the network attached storage virtual machine is backed up, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
Optionally, the first backup file is an mcsconfig. Crom. Xml file, and the second backup file is a cib. Xml file.
Optionally, the backing up the multi-controller system includes:
backing up the multi-controller system by executing a mcsconfig-backup instruction;
the backing up the network attached storage virtual machine includes:
and backing up the network attached storage virtual machine by executing a backup nascon fig instruction.
In a second aspect, an embodiment of the present invention discloses a snapshot data backup device, including:
the target snapshot volume determining module is used for acquiring snapshot volumes in the network attached storage virtual machine and determining target snapshot volumes when unified storage is carried out; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the file system is snapshot;
the configuration information acquisition module is used for acquiring the configuration information of the target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
the mapping relation acquisition module is used for acquiring the mapping relation between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume;
and the backup module is used for backing up the configuration information of the target snapshot volume and the mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
Optionally, the snapshot volume includes a timed snapshot volume, and the target snapshot volume determining module is specifically configured to: inquiring whether snapshot volumes exist in the network attached storage virtual machine or not; if the snapshot volume exists in the network attached storage virtual machine, inquiring whether a timing snapshot volume exists in the snapshot volume or not; if the timed snapshot volume exists in the snapshot volumes, acquiring the generation time of the timed snapshot volume, and taking the timed snapshot volume with the latest generation time as a target snapshot volume according to the generation time; if the timed snapshot volume does not exist in the snapshot volumes, taking all snapshot volumes obtained by query as target snapshot volumes;
the configuration information acquisition module is specifically configured to: when the target snapshot volume is a timing snapshot volume, determining that configuration information of the target snapshot volume comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume; when the target snapshot volume is not the timing snapshot volume, determining that the configuration information of the target snapshot volume comprises the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
Optionally, the target snapshot volume determining module is specifically configured to: acquiring the name of the timing snapshot volume; the name includes a time of generation of the timing snapshot.
Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume further includes a number of the target snapshot volumes.
Optionally, the target source volume is a file in a multi-controller system, and the backup module is specifically configured to: backing up the multi-controller system and the network attached storage virtual machine according to preset time; when the multi-controller system is backed up, the target source volume and the mapping relation between the target snapshot volume and the target source volume are backed up, and a first backup file is generated; and when the network attached storage virtual machine is backed up, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
Optionally, the first backup file is an mcsconfig. Crom. Xml file, and the second backup file is a cib. Xml file.
Optionally, the backup module is specifically configured to: backing up the multi-controller system by executing a mcsconfig-backup instruction; and backing up the network attached storage virtual machine by executing a backup nascon fig instruction.
In a third aspect, an embodiment of the present invention discloses an electronic device, including: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor, implements the steps of the snapshot data backup method as described above.
In a fourth aspect, embodiments of the present invention disclose a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a snapshot data backup method as described above.
The embodiment of the invention has the following advantages:
firstly, when unified storage is carried out, snapshot volumes in a network attached storage virtual machine are obtained, and target snapshot volumes are determined; then, configuration information of a target snapshot volume and a mapping relation between the target snapshot volume and a target source volume are obtained, wherein the configuration information comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume; and finally, backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume when backing up the target source volume. When the network attached storage virtual machine fails and needs to be recovered, the snapshot volumes in the network attached storage virtual machine can be recovered according to the configuration information of the backed-up target source volumes and the target snapshot volumes and the mapping relation between the target snapshot volumes and the target source volumes.
Drawings
FIG. 1 is a flowchart illustrating steps of a snapshot data backup method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another snapshot data backup method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a snapshot data backup process according to an embodiment of the present invention;
FIG. 4 is a flowchart of a T3 restore backup provided in an embodiment of the present invention;
FIG. 5 is a block diagram of a snapshot data backup device according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 7 is a block diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Noun interpretation:
t3 recovery: if the system state has been lost in all of the control cabinet node containers, the system recovery process will recover the entire storage system. The process recreates the storage system using the saved configuration data. The saved configuration data is located in the active quorum disk and in the latest XML configuration backup file. Restoration may not be able to restore all volume data. This process is also referred to as "layer 3 (T3)" recovery.
XML: extensible Markup Language, extensible markup language.
MCS: multiple Controller System, a multi-controller system, is a storage control system.
NAS: network Attached Storage, network attached storage, is a device connected to a network and having a data storage function.
Snapshot: one fully available copy of the specified data set.
Snapshot volume: is the recorded data for the state of the file system at a certain moment.
Unified storage: the data is stored on a central node, i.e. centralized, consisting of one or more computers.
Because the backup data is not comprehensive when disaster recovery data centralized storage backup is performed on the NAS cluster at present, snapshot data in the cluster cannot be recovered after the NAS cluster is recovered, and the NAS snapshot stores rollback data required by a client at a special time point, and the NAS snapshot data is lost to cause incomplete NAS service data. Therefore, the embodiment of the invention backs up the configuration information of the target snapshot volume, the mapping relation between the target snapshot volume and the target source volume, and further can restore snapshot data in the cluster according to the backup file when restoring the NAS cluster.
Referring to fig. 1, a step flowchart of a snapshot data backup method provided by an embodiment of the present invention is shown, where the method specifically may include the following steps:
step 101, when unified storage is carried out, snapshot volumes in a network attached storage virtual machine are obtained, and target snapshot volumes are determined; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the snapshot of the file system.
The snapshot volume displayed in the virtual machine is a virtual snapshot data file generated after the snapshot of the file system, and the corresponding entity snapshot data file, namely the source volume, is recorded in a certain entity storage device.
When cluster data is uniformly stored, whether snapshot volumes exist in NAS virtual machines in the clusters can be firstly inquired, and if the snapshot volumes exist in the NAS virtual machines, all the snapshot volumes in the NAS virtual machines can be obtained and part or all of the snapshot volumes are used as target snapshot volumes.
102, acquiring configuration information of a target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume.
After the target snapshot volume is determined, a file system corresponding to the target snapshot volume and a shared data file created by the file system can be determined, and a mapping relation is established. For example, if the target snapshot volume a is the record data of the state of the file system a at a certain moment, it is determined that the file system corresponding to the target snapshot volume a is the file system a, and the shared data file created by the file system a can be queried continuously. Thus, a mapping relationship between the target snapshot volume a and the file system a and a mapping relationship between the target snapshot volume a and the shared data file a can be established.
After the target snapshot volume is determined, the name of the target snapshot volume and the generation strategy of the target snapshot volume can be obtained, wherein when the target snapshot volume is a timing snapshot volume, the timing snapshot volume is the snapshot volume generated at regular time according to a preset time interval, and the generation strategy of the target snapshot volume is the timing generation strategy of the snapshot volume. For example, the target snapshot volume generation policy may generate a snapshot volume every other day.
Step 103, obtaining the mapping relation between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume.
After the target snapshot volume is determined, a target source volume corresponding to the target snapshot volume can be determined, and a mapping relation between the target source volume and the target snapshot volume is established.
And 104, backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
When the target source volume is backed up, the configuration information of the target snapshot volume and the mapping relation between the target snapshot volume and the target source volume are backed up, so that the snapshot volume in the NAS virtual machine can be restored according to the configuration information of the target snapshot volume, the target source volume can be positioned according to the mapping relation between the target snapshot volume and the target source volume, and the data in the target source volume can be acquired.
When unified storage is carried out, the embodiment of the invention acquires the snapshot volume in the network attached storage virtual machine and determines the target snapshot volume; acquiring configuration information of a target snapshot volume and a mapping relation between the target snapshot volume and a target source volume, wherein the configuration information comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume, a generation strategy of the target snapshot volume and the like; and when the target source volume is backed up, backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume. When the network attached storage virtual machine fails and needs to be restored, the snapshot volumes in the virtual machine can be restored according to the configuration information of the backed-up target source volumes and the target snapshot volumes and the mapping relation between the target snapshot volumes and the target source volumes, so that the NAS disaster recovery capability of the centralized storage is improved.
Referring to fig. 2, a step flow chart of another snapshot data backup method provided by an embodiment of the present invention is shown, where the method specifically may include the following steps:
step 201, inquiring whether snapshot volumes exist in the network attached storage virtual machine or not when unified storage is performed.
If the snapshot volume exists in the network attached storage virtual machine, then a query is made as to whether a timed snapshot volume exists in the snapshot volume, step 202.
In step 203, if the timed snapshot volume exists in the snapshot volumes, the generation time of the timed snapshot volume is obtained, and the timed snapshot volume with the latest generation time is taken as the target snapshot volume according to the generation time.
The snapshot volumes comprise timed snapshot volumes and non-timed snapshot volumes, and naming rules of the timed snapshot volumes and the non-timed snapshot volumes are different. The naming format of a timed snapshot volume is typically: cycle_policy_file system name_snap timestamp, such as cycle_interval_nod1fs1_snap 20230505062358. Non-timed snapshot, the time point of creating the snapshot, that is, the snapshot generation time, is recorded in the snapshot volume name, and the format is generally that: the palm_nas_vd_fsname_time of year, month, day, and minute, and second, such as node1fs1_snap20230505062358, 20230505062358, are the generation times of the timing snapshot. The name of the snapshot volume can thus be obtained and the timing snapshot in the snapshot volume can be determined from the name of the snapshot volume. And determining the generation time of the timing snapshot volume according to the name of the timing snapshot volume, so that the timing snapshot volume with the latest generation time can be determined according to the generation time and used as the target snapshot volume.
And 204, if the timed snapshot volume does not exist in the snapshot volumes, taking all the snapshot volumes obtained by query as target snapshot volumes.
When the snapshot volumes do not contain the timing snapshot volumes, the fact that all the snapshot volumes are currently the snapshot volumes which are specially stored by a user according to own needs is indicated, and therefore all the snapshot volumes need to be backed up when the snapshot volumes are backed up; when the snapshot volume contains the timing snapshot volume, the user only needs to update the snapshot volume at regular time, so that the latest generated timing snapshot volume is only needed to be backed up during backup.
In step 205, when the target snapshot volume is a timing snapshot volume, the configuration information of the target snapshot volume is determined to include a corresponding relationship between the target snapshot volume and a file system, a corresponding relationship between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume, and a generation policy of the target snapshot volume.
In step 206, when the target snapshot volume is not the timing snapshot volume, the configuration information of the target snapshot volume is determined to include a correspondence between the target snapshot volume and a file system, a correspondence between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, and a name of the target snapshot volume.
When the target snapshot volume is not the timing snapshot volume, the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume and other information can be backed up. And at this time, there may be multiple target snapshot volumes, and the number of target snapshot volumes may also be backed up.
When the target snapshot volume is a timing snapshot volume, the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume and other information are backed up, and the generation strategy of the timing snapshot volume is required to be stored.
Step 207, obtaining a mapping relationship between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume.
And step 208, backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
Steps 207-208 of the embodiment of the present invention are the same as steps 103-104 described above, and will not be repeated here.
According to the embodiment of the invention, by taking all the non-timed snapshot volumes as the target snapshot volumes or taking the timed snapshot volume with the latest generation time in the timed snapshot volumes as the target snapshot volumes, the backup storage resources can be saved, and the backup requirement of users on the snapshot volumes can be met.
The NAS T3 recovery procedure for centralized storage at present is as follows:
1. performing mcsconfig-backup to backup configuration information and service data of the MCS, and generating files such as mcsconfig, cron, xml and the like;
2. executing backup to backup configuration information of the NAS virtual machine to generate files such as cib.xml and the like;
3. when the NAS is recovered, the NAS is recovered according to the following steps: (a) Inquiring whether NAS clusters exist or not, and if so, entering the next flow; (b) According to the mcsconfig. Crom. Xml file in the MCS backup file, completing the recovery of the NAS virtual machine cluster through a recovervdisk vdisk _name instruction, and simultaneously recovering the mapping relation between the virtual machine and the MCS; and (c) recovering the NAS service network card according to the NAS backup file. (d) And recovering the NAS shared data according to the cib.xml file in the NAS backup file.
In this T3 recovery, since the mapping relationship between the source volume not included in the MCS and the snapshot volume in the NAS virtual machine in the mcconfig. Cron. Xml file, and the relevant configuration information of the NAS snapshot volume are not included in the cib. Xml backup file, snapshot data in the NAS virtual machine will not be recovered after T3 recovery.
Therefore, in an alternative embodiment, the target source volume may be a file in the MCS of the multi-controller system, and the step of backing up configuration information of the target snapshot volume and a mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume may specifically include: backing up the multi-controller system and the network attached storage virtual machine according to preset time; when the multi-controller system is backed up, backing up the target source volume and the mapping relation between the target snapshot volume and the target source volume, and generating a first backup file; and when the network attached storage virtual machine is backed up, backing up the configuration information of the target snapshot volume, and generating a second backup file. When the MCS is backed up, the mapping relation of the target source volume, the target snapshot volume and the target source volume is backed up, and a first backup file is generated; and when the NAS is backed up, backing up the configuration information of the target snapshot volume, and generating a second backup file.
In an alternative embodiment, the first backup file may be an mcsconfig. Crom. Xml file, and the second backup file may be a cib. Xml file. That is, the mapping relationship between the target snapshot volume and the target source volume may be stored in the mcconfig. crom. Xml file, and the configuration information of the target snapshot volume may be stored in the cib. Xml file.
In an alternative embodiment, the specific step of backing up the multi-controller system may include: backing up the multi-controller system by executing a mcsconfig-backup instruction; the specific step of backing up the network attached storage virtual machine may include: the network attached storage virtual machine is backed up by executing a backup nascon fig instruction. And maintaining the backup instruction executed in the original backup flow, and backing up the mapping relation between the target snapshot volume and the target source volume and the configuration information of the target snapshot volume only after executing the backup instruction.
Referring to fig. 3, a snapshot data backup flowchart provided by an embodiment of the present invention is shown. Firstly, when the storage system is backed up, inquiring whether NAS snapshot volumes exist, if not, executing the original normal T3 backup flow without backing up NAS snapshot data.
If the NAS snapshot volume exists, executing a NAS snapshot data backup flow, wherein the first step is to inquire whether a timing snapshot volume exists or not by executing an lsfsssnaptimer instruction, if the timing snapshot volume does not exist, inquiring all snapshot volumes, confirming source volumes corresponding to the snapshot volumes, establishing mapping relations between the snapshot volumes and the source volumes, and checking the mapping relations between the snapshot volumes and the source volumes by executing an lclcmap instruction. And then executing a mcsconfig-backup instruction to store the mapping relation between each snapshot volume and the source volume in a mcsconfig. Cron. Xml file, executing a backup on fig at the same time, storing the names of each snapshot volume and the mapping relation between each snapshot volume and a corresponding file system in a cib.xml file, and checking the mapping relation between each snapshot volume and the file system and the mapping relation between each snapshot volume and the shared data file by executing a lssnap instruction.
If the timed snapshot volume exists, executing lsvdisk-backup to inquire all NAS snapshot volumes, confirming the snapshot volume belonging to the timed snapshot according to the name of the snapshot volume, and confirming the timed snapshot volume with the latest generation time according to the name of the timed snapshot volume. And querying a source volume, a corresponding file system, a corresponding shared data file, a timing strategy and a name corresponding to the timing snapshot volume with the latest generation time. Then, executing a mcsconfig-backup instruction to store the mapping relation between the timing snapshot volume and the source volume in an mcsconfig. Cron. Xml file, executing a backup snapshot at the same time, storing the name of the timing snapshot volume, the mapping relation between the timing snapshot volume and a corresponding file system, the mapping relation between the timing snapshot volume and a shared data file, and a generation strategy of the timing snapshot volume in a cib. Xml file.
Referring to fig. 4, a flowchart of a T3 restore backup provided by an embodiment of the present invention is shown. Step 301: and executing a T3 backup flow. Step 302: and searching all snapshot volumes in the NAS virtual machine, wherein the snapshot volumes in the NAS virtual machine are virtual volumes. Step 303: the data in the virtual volume is saved in a mcsconfig. Step 304: and inquiring configuration information of the snapshot volumes in the NAS virtual machine, wherein the configuration information comprises information such as mapping relation between the snapshot volumes and a file system, mapping relation between the snapshot volumes and shared data files, names of the snapshot volumes, the number of the snapshot volumes and the like. Step 305: these configuration information are saved in the cib.xml file. Step 306: and ending the T3 backup flow.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 5, a block diagram of a snapshot data backup device provided by an embodiment of the present invention may specifically include the following modules:
the target snapshot volume determining module 401 is configured to obtain snapshot volumes in the network attached storage virtual machine and determine a target snapshot volume when performing unified storage; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the file system is snapshot;
a configuration information obtaining module 402, configured to obtain configuration information of the target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
a mapping relationship obtaining module 403, configured to obtain a mapping relationship between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume;
and the backup module 404 is configured to backup configuration information of the target snapshot volume and a mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume.
Optionally, the snapshot volume includes a timed snapshot volume, and the target snapshot volume determining module 401 is specifically configured to: inquiring whether snapshot volumes exist in the network attached storage virtual machine or not; if the snapshot volume exists in the network attached storage virtual machine, inquiring whether a timing snapshot volume exists in the snapshot volume or not; if the timed snapshot volume exists in the snapshot volumes, acquiring the generation time of the timed snapshot volume, and taking the timed snapshot volume with the latest generation time as a target snapshot volume according to the generation time; if the timed snapshot volume does not exist in the snapshot volumes, taking all snapshot volumes obtained by query as target snapshot volumes;
the configuration information obtaining module 402 is specifically configured to: when the target snapshot volume is a timing snapshot volume, determining that configuration information of the target snapshot volume comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume; when the target snapshot volume is not the timing snapshot volume, determining that the configuration information of the target snapshot volume comprises the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
Optionally, the target snapshot volume determining module 401 is specifically configured to: acquiring the name of the timing snapshot volume; the name includes a time of generation of the timing snapshot.
Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume further includes a number of the target snapshot volumes.
Optionally, the target source volume is a file in the multi-controller system, and the backup module 404 is specifically configured to: backing up the multi-controller system and the network attached storage virtual machine according to preset time; when the multi-controller system is backed up, the target source volume and the mapping relation between the target snapshot volume and the target source volume are backed up, and a first backup file is generated; and when the network attached storage virtual machine is backed up, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
Optionally, the first backup file is an mcsconfig. Crom. Xml file, and the second backup file is a cib. Xml file.
Optionally, the backup module 404 is specifically configured to: backing up the multi-controller system by executing a mcsconfig-backup instruction; and backing up the network attached storage virtual machine by executing a backup nascon fig instruction.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Referring to fig. 6, a block diagram of an electronic device 50 according to an embodiment of the present invention is shown, where the electronic device 50 includes:
the processor 501, the memory 502, and the computer program 5021 stored in the memory 502 and capable of running on the processor 501, where the computer program 5021 when executed by the processor 501 implements the processes of the above-described data acquisition method embodiment, and the same technical effects can be achieved, so that repetition is avoided and redundant description is omitted.
Referring to fig. 7, a block diagram of a computer readable storage medium 60 according to an embodiment of the present invention is shown, where a computer program 601 is stored on the computer readable storage medium 60, and each process of the above-mentioned data acquisition method embodiment is implemented when the computer program 601 is executed by a processor, and the same technical effects can be achieved, so that repetition is avoided and redundant description is omitted.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of 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, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, 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.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The above detailed description of the snapshot data backup method, the device, the electronic equipment and the storage medium provided by the invention applies specific examples to illustrate the principle and the implementation of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. A snapshot data backup method, comprising:
when unified storage is carried out, snapshot volumes in the network attached storage virtual machine are obtained, and target snapshot volumes are determined; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the file system is snapshot;
acquiring configuration information of the target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
obtaining a mapping relation between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume;
and backing up configuration information of the target snapshot volume and a mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
2. The snapshot data backup method of claim 1, wherein the snapshot volumes comprise timed snapshot volumes, the obtaining a snapshot volume in a network-attached storage virtual machine and determining a target snapshot volume comprises:
inquiring whether snapshot volumes exist in the network attached storage virtual machine or not;
if the snapshot volume exists in the network attached storage virtual machine, inquiring whether a timing snapshot volume exists in the snapshot volume or not;
if the timed snapshot volume exists in the snapshot volumes, acquiring the generation time of the timed snapshot volume, and taking the timed snapshot volume with the latest generation time as a target snapshot volume according to the generation time;
if the timed snapshot volume does not exist in the snapshot volumes, taking all snapshot volumes obtained by query as target snapshot volumes;
the obtaining the configuration information of the target snapshot volume includes:
when the target snapshot volume is a timing snapshot volume, determining that configuration information of the target snapshot volume comprises a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
when the target snapshot volume is not the timing snapshot volume, determining that the configuration information of the target snapshot volume comprises the corresponding relation between the target snapshot volume and the file system, the corresponding relation between the target snapshot volume and the shared data file created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
3. The snapshot data backup method according to claim 2, wherein the obtaining the generation time of the timed snapshot volume includes:
acquiring the name of the timing snapshot volume; the name includes a time of generation of the timing snapshot.
4. The snapshot data backup method of claim 2, wherein when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume further includes a number of the target snapshot volumes.
5. The snapshot data backup method according to claim 1, wherein the target source volume is a file in a multi-controller system, and the backing up configuration information of the target snapshot volume and a mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume includes:
backing up the multi-controller system and the network attached storage virtual machine according to preset time;
when the multi-controller system is backed up, the target source volume and the mapping relation between the target snapshot volume and the target source volume are backed up, and a first backup file is generated;
and when the network attached storage virtual machine is backed up, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
6. The snapshot data backup method according to claim 4, wherein the first backup file is a mcsconfig. Crom. Xml file and the second backup file is a cib. Xml file.
7. The snapshot data backup method of claim 4, wherein,
the backing up the multi-controller system includes:
backing up the multi-controller system by executing a mcsconfig-backup instruction;
the backing up the network attached storage virtual machine includes:
and backing up the network attached storage virtual machine by executing a backup nascon fig instruction.
8. A snapshot data backup device, comprising:
the target snapshot volume determining module is used for acquiring snapshot volumes in the network attached storage virtual machine and determining target snapshot volumes when unified storage is carried out; the snapshot volume in the virtual machine is a virtual snapshot data file generated after the file system is snapshot;
the configuration information acquisition module is used for acquiring the configuration information of the target snapshot volume; the configuration information of the target snapshot volume comprises at least one of a corresponding relation between the target snapshot volume and a file system, a corresponding relation between the target snapshot volume and a shared data file created by the file system corresponding to the target snapshot volume, a name of the target snapshot volume and a generation strategy of the target snapshot volume;
the mapping relation acquisition module is used for acquiring the mapping relation between the target snapshot volume and the target source volume; the target source volume is a physical snapshot data file corresponding to the target snapshot volume;
and the backup module is used for backing up the configuration information of the target snapshot volume and the mapping relation between the target snapshot volume and the target source volume when backing up the target source volume.
9. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor performs the steps of the snapshot data backup method as claimed in any one of claims 1 to 7.
10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, which when executed by a processor, implements the steps of the snapshot data backup method according to any one of claims 1-7.
CN202311434712.XA 2023-10-31 2023-10-31 Snapshot data backup method and device, electronic equipment and storage medium Pending CN117667509A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311434712.XA CN117667509A (en) 2023-10-31 2023-10-31 Snapshot data backup method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311434712.XA CN117667509A (en) 2023-10-31 2023-10-31 Snapshot data backup method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117667509A true CN117667509A (en) 2024-03-08

Family

ID=90065237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311434712.XA Pending CN117667509A (en) 2023-10-31 2023-10-31 Snapshot data backup method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117667509A (en)

Similar Documents

Publication Publication Date Title
CN108241555B (en) Backup and recovery method and device of distributed database and server
WO2019154394A1 (en) Distributed database cluster system, data synchronization method and storage medium
US7249281B2 (en) Method and system for backing up and restoring data of a node in a distributed system
US9235606B1 (en) Simplified database/log backup and restore
US10726042B2 (en) Replication control using eventually consistent meta-data
CN109298978B (en) Recovery method and system for database cluster of specified position
WO2019020081A1 (en) Distributed system and fault recovery method and apparatus thereof, product, and storage medium
CN112286728A (en) Data backup method, device, equipment and computer storage medium
CN114466027B (en) Cloud primary database service providing method, system, equipment and medium
US11436110B2 (en) Distributed database remote backup
WO2017014814A1 (en) Replicating memory volumes
US8612799B2 (en) Method and apparatus of backing up subversion repository
US11966297B2 (en) Identifying database archive log dependency and backup copy recoverability
CN113986450A (en) Virtual machine backup method and device
US11042454B1 (en) Restoration of a data source
CN117667509A (en) Snapshot data backup method and device, electronic equipment and storage medium
CN111125060A (en) Database management method, system, device and storage medium
CN112286730A (en) Method for performing remote full backup and recovery on HDFS file
CN111737043A (en) Database disaster tolerance method, device, server and storage medium
WO2022228417A1 (en) User data disaster tolerance method and apparatus, network element device, and storage medium
CN117271206A (en) Database recovery method and device based on time point and distributed database system
CN116107803A (en) Database backup method, system, electronic equipment and storage medium
CN112181719A (en) Data processing method, device, equipment and computer readable storage medium
CN115495282A (en) Method, server and storage medium for remotely copying source volume to multi-target volume
CN116185705A (en) Method for synchronizing data of main server and standby server, standby server and main server

Legal Events

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