A metadata backup method, device, equipment and medium
By using a RAID10 disk array in the data storage system for metadata backup, the problems of large data reconstruction volume and long cluster failure time caused by SSD disk failure are solved, thus maintaining data security, reliability and high performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-08-26
- Publication Date
- 2026-07-24
AI Technical Summary
In data storage systems, SSD disk failures result in large amounts of data reconstruction and prolonged cluster downtime, impacting data security, reliability, and normal business operations.
Metadata backup is performed using a disk array built with RAID10. By utilizing the backup redundancy mechanism of RAID10, the target data and metadata are stored in the hard disk and the disk array built with RAID10, and the metadata partition is backed up in RAID1 to achieve data redundancy and fast recovery.
It reduces data reconstruction time in the event of SSD failure, improves data write speed, ensures data security and reliability and system performance, and reduces the impact of failure on cluster status.
Smart Images

Figure CN115309588B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage, and in particular to a method, apparatus, device, and medium for metadata backup. Background Technology
[0002] With the introduction of the next-generation storage engine Bluestore, object data index information is stored in the RocksDB KV database. To improve storage performance, the database is stored on an SSD (Solid State Disk or Solid State Drive) partition. Furthermore, some cluster metadata (OSDmap, pglog, pginfo, superblock) is also stored in the RocksDB database in KV format to improve access performance.
[0003] Typically, an SSD is partitioned into 6 to 12 partitions as the database (db) partitions for an OSD (Object-based Storage Device). When an SSD fails, all database information for the corresponding OSDs is lost, rendering them unable to function properly. Replacing the SSD requires formatting the corresponding HDD (Hard Disk Drive), deleting and re-adding the relevant OSDs, and then recovering the data from the HDDs through data reconstruction. This mechanism presents a problem: when the cluster is at a high water level (50% or higher), if an SSD fails and needs replacement, the entire replacement process until the cluster returns to normal can take an exceptionally long time.
[0004] As can be seen from the above, how to avoid situations where SSD disk failure leads to large amounts of data reconstruction and long cluster failure periods is a problem that needs to be solved in this field. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a metadata backup method, apparatus, device, and medium that can reduce the amount of data reconstruction and the time required for data degradation when a disk fails, maximize data security and reliability, and reduce the impact of failures on normal business operations. The specific solution is as follows:
[0006] In a first aspect, this application discloses a metadata backup method, including:
[0007] After storing the target data to the mechanical hard drive in the preset operating system using the first device in the preset object storage engine, the target metadata corresponding to the target data stored in the preset database is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine.
[0008] The target metadata is backed up to the target backup partition in the target disk array, which is constructed based on RAID1 and corresponds to the preset metadata storage partition.
[0009] Optionally, the step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system includes:
[0010] The second device of the preset object storage engine stores the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the first target disk of the target disk array built based on RAID10 in the preset operating system;
[0011] Accordingly, after backing up the target metadata to the target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition, the method further includes:
[0012] The target metadata is backed up to the target backup partition in the second target disk of the target disk array, which is based on RAID1 and corresponds to the first target disk, and corresponds to the preset metadata storage partition.
[0013] Optionally, after storing the target data to a mechanical hard drive in a preset operating system using a first device in the preset object storage engine, the second device in the preset object storage engine stores the target metadata corresponding to the target data in a preset database to a preset metadata storage partition in a target disk array built based on RAID10 in the preset operating system, including:
[0014] After storing the target data to the mechanical hard drive in the preset kernel using the first device in bluestore, the target metadata corresponding to the target data stored in RocksDB is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel using the second device in bluestore.
[0015] Optionally, the step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system includes:
[0016] The target metadata corresponding to the target data is obtained from the interface provided by the preset file system in the preset object storage engine;
[0017] The target metadata is stored in the preset metadata storage partition in the target disk array built on RAID10 in the preset operating system using the second device of the preset object storage engine.
[0018] Optionally, the step of using the second device of the bluestore to store the target metadata corresponding to the target data stored in RocksDB to the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel includes:
[0019] Retrieve the target metadata corresponding to the target data stored in RocksDB using the interface provided by BluesFS in bluestore;
[0020] The target metadata is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel using the second device of the bluestore.
[0021] Optionally, before storing the target data to the hard disk in the preset operating system using the first device in the preset object storage engine, the method further includes:
[0022] A target disk array is constructed based on RAID10, with RAID0 as the execution array and RAID1 as the protection array.
[0023] Optionally, after backing up the target metadata to a target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition, the method further includes:
[0024] When a disk failure is detected in the target disk array, the target reconstruction data is read from the target backup partition;
[0025] Based on the target reconstruction data, a preset data reconstruction method is used to reconstruct the data of the new disks newly inserted into the target disk array.
[0026] Secondly, this application discloses a metadata backup device, comprising:
[0027] The metadata storage module is used to store the target data to the mechanical hard disk in the preset operating system using the first device in the preset object storage engine, and then to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine.
[0028] The metadata backup module is used to back up the target metadata to a target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition.
[0029] Thirdly, this application discloses an electronic device, including:
[0030] Memory, used to store computer programs;
[0031] A processor is used to execute the computer program to implement the aforementioned metadata backup method.
[0032] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed metadata backup method.
[0033] This application proposes an OSD metadata backup technology based on RAID10. After storing the target data to a mechanical hard drive in a preset operating system using a first device in a preset object storage engine, the second device in the same preset object storage engine stores the target metadata corresponding to the target data in a preset database to a preset metadata storage partition in a target disk array built on RAID10 within the preset operating system. The target metadata is then backed up to a target backup partition in the target disk array built on RAID1, corresponding to the preset metadata storage partition. In this way, the invention utilizes the backup redundancy mechanism of RAID10 to achieve OSD metadata backup. RAID10 achieves data redundancy through data mirroring of four SSDs, using RAID0 as the execution array and RAID1 as the data protection array. Compared to a single SSD without any protection, this can double the data write speed, which is crucial for high-performance storage systems requiring extremely fast data write speeds. This solves the problem of system reliability under disk failure without sacrificing overall system performance. Furthermore, when the original data is busy or abnormal, data can be directly read from the backup mirror. This improves write speed while maintaining security. Reduce data reconstruction time in the event of SSD disk failure, minimize the impact of failure on cluster status, and improve system reliability. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0035] Figure 1 A flowchart of a metadata backup method provided in this application;
[0036] Figure 2 This application provides a schematic diagram of a target disk array structure based on RAID10;
[0037] Figure 3 A flowchart illustrating a specific metadata backup method provided in this application;
[0038] Figure 4 A data backup storage architecture diagram provided in this application;
[0039] Figure 5 A schematic diagram of a metadata backup device provided in this application;
[0040] Figure 6 This application provides a structural diagram of an electronic device. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] In existing technologies, when an SSD fails, all database information for the corresponding OSDs is lost, rendering these OSDs unable to function properly. Furthermore, when the cluster is at a high watermark (50% or higher), if an SSD fails and needs replacement, the entire replacement process, from initial setup to cluster recovery, takes an exceptionally long time. This application addresses this issue by reducing the amount of data reconstruction and the time required for data degradation when a disk fails, maximizing data security and reliability, and minimizing the impact of the failure on normal business operations.
[0043] This invention discloses a metadata backup method, see [link to relevant documentation]. Figure 1 The method includes:
[0044] Step S11: After storing the target data to the mechanical hard drive in the preset operating system using the first device in the preset object storage engine, the target metadata corresponding to the target data stored in the preset database is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine.
[0045] In this embodiment, before storing the target data to the mechanical hard drive in the preset operating system using the first device in the preset object storage engine, the method further includes: constructing a target disk array based on RAID10 with RAID0 as the execution array and RAID1 as the protection array.
[0046] like Figure 2 This application provides a schematic diagram of a target disk array structure based on RAID 10. In this target disk array, every two disks form a RAID 1 array, two RAID 1 arrays form a RAID 0 array, and this structure constitutes RAID 10. Specifically, disks 1 and 2 form a RAID 1 array, disks 3 and 4 form another RAID 1 array, and two RAID 1 arrays form a new RAID 0 array. In a specific implementation, data A1, A3, A5, and A7 are written on disk 1. Disk 2 serves as a backup disk for the data on disk 1, meaning disk 2 also stores data A1, A3, A5, and A7. Data A0, A2, A4, and A6 are written on disk 3, and disk 4 also serves as a backup disk for the data on disk 3, meaning disk 4 also stores data A0, A2, A4, and A6. All data is combined across these four disks to form a RAID 10 array, possessing the characteristics of both RAID 0 and RAID 1. In this embodiment, RAID 10 uses RAID 0 as the execution array and RAID 1 as the data protection array. It has the same fault tolerance capability as RAID 1, with minimal system overhead for fault tolerance processing. Similar to standalone mirroring, it offers higher read and write performance due to the use of RAID0 as the execution level, making it suitable for applications requiring high performance and high fault tolerance but with limited capacity requirements.
[0047] In this embodiment, the step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built on RAID10 in the preset operating system may include: using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the first target disk of the target disk array built on RAID10 in the preset operating system.
[0048] In this embodiment, during the deployment phase, such as Figure 2The diagram shows four SSDs forming a RAID10 array. A series of partitions are then created on the RAID10 array as metadata partitions for the HDD disk OSD. The data read and written to the metadata in the OSD is stored in the partitions of this array.
[0049] In this embodiment, after the target data is written to the hard disk drive (HDD), metadata is written. Specifically, the metadata is written to a pre-defined metadata storage partition pre-allocated within the target disk array built based on RAID 10. In a specific implementation, this pre-defined metadata storage partition can be referred to as the SSD1 partition.
[0050] In this embodiment, the step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built on RAID10 in the preset operating system may include: obtaining the target metadata corresponding to the target data stored in the preset database according to the interface provided by the preset file system in the preset object storage engine; and using the second device of the preset object storage engine to store the target metadata to the preset metadata storage partition in the target disk array built on RAID10 in the preset operating system.
[0051] In some specific implementations, when writing the target metadata corresponding to the target data into the target disk array, the target metadata is first obtained from a preset database. At this time, the target metadata can be obtained through the interface provided by the preset file system in the preset object storage engine.
[0052] Step S12: Back up the target metadata to the target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition.
[0053] In this embodiment, backing up the target metadata to a target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition may include: backing up the target metadata to a target backup partition in the second target disk in the target disk array that is constructed based on RAID1 and corresponds to the first target disk and corresponds to the preset metadata storage partition.
[0054] In this embodiment, the backup partition mentioned in this step and the metadata storage partition in step S11 are partitions built based on RAID1, and the target backup partition is the backup partition corresponding to the preset metadata storage partition. In a specific implementation, the preset metadata storage partition shown can be referred to as the SSD2 partition.
[0055] It should be noted that in this application, when a disk is removed from the RAID 10 array, it will be automatically removed from the RAID 10 array, and when a disk is inserted, it will be automatically added back to the RAID 10 array for data recovery. In this embodiment, backing up the target metadata to a target backup partition in the target disk array that is constructed based on RAID 1 and corresponds to the preset metadata storage partition may include: when a disk in the target disk array is detected to have failed, reading target reconstruction data from the target backup partition; and based on the target reconstruction data, using a preset data reconstruction method to reconstruct the data of the newly inserted disk in the target disk array.
[0056] In this embodiment, metadata is written to a disk array consisting of four SSDs configured in RAID 10. This ensures that if one SSD fails, the metadata required for OSD operation can be read from the backup disk, guaranteeing the validity of existing data on the HDD after an SSD failure. This significantly reduces the amount of data to be reconstructed and the reconstruction time caused by an SSD failure. Furthermore, data recovery only requires replacing the hard drive with a new one and following the RAID 10 operating principle. The system continues to function normally during the data recovery process. The original data is synchronously restored to the replaced hard drive.
[0057] This embodiment utilizes the RAID 10 backup redundancy mechanism to achieve OSD metadata backup. Although the RAID 10 scheme results in 50% disk wastage, it provides 200% speed and data security in the event of a single disk failure. Since metadata read / write speeds are critical, RAID 10 can offer a 200% data write speed advantage while ensuring data security. This is essential for high-performance storage systems with extreme data write speed requirements, addressing the need for system reliability under disk failure without sacrificing overall system performance.
[0058] This embodiment proposes an OSD metadata backup technology based on RAID10. After storing the target data to a mechanical hard drive in a preset operating system using a first device in a preset object storage engine, the second device in the same engine stores the target metadata corresponding to the target data in a preset database to a preset metadata storage partition in a target disk array built on RAID10 within the preset operating system. The target metadata is then backed up to a target backup partition in the target disk array, built on RAID1, corresponding to the preset metadata storage partition. Thus, this invention utilizes the backup redundancy mechanism of RAID10 to achieve OSD metadata backup. RAID10 achieves data redundancy through data mirroring of four SSDs, using RAID0 as the execution array and RAID1 as the data protection array. Compared to a single SSD without any protection, this can double the data write speed, which is crucial for high-performance storage systems requiring extremely fast data write speeds. This solves the problem of system reliability under disk failure without sacrificing overall system performance. Furthermore, when the original data is busy or abnormal, data can be directly read from the backup mirror. This improves write speed while maintaining security. Reduce data reconstruction time in the event of SSD disk failure, minimize the impact of failure on cluster status, and improve system reliability.
[0059] Figure 3 A flowchart illustrating a specific metadata backup method provided in this application embodiment. See also... Figure 3 As shown, the method includes:
[0060] Step S21: After storing the target data to the mechanical hard drive in the preset kernel using the first device in bluestore, store the target metadata corresponding to the target data stored in RocksDB to the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel using the second device in bluestore.
[0061] In this embodiment, the preset object storage engine is preferably bluestore, the preset operating system is preferably kernel, and the preset database is preferably RocksDB.
[0062] Step S22: Obtain the target metadata corresponding to the target data stored in RocksDB according to the interface provided by BluesFS in bluestore.
[0063] In this embodiment, when the preset object storage engine is bluestore, the preset file system is BluesFS.
[0064] Step S23: Use the second device of the bluestore to store the target metadata in the preset metadata storage partition of the target disk array built based on RAID10 in the preset kernel.
[0065] like Figure 4 This application provides a data backup storage architecture diagram. In the diagram, Bluestore serves as the preset object storage engine, and the kernel serves as the preset operating system to complete data and metadata storage operations. Specifically, a first device writes data to the HDD disk within the kernel, and a second device writes metadata to a target disk array constructed using RAID 10 within the kernel. SSD1 and SSD2 perform disk metadata backup. When using the second device to write metadata to the RAID 10 array, the metadata corresponding to the data is first determined from RocksDB, then transmitted to the second device via an interface provided by BlueFS, and finally written to the target disk array by the second device.
[0066] In this embodiment, the target data is first stored in a mechanical hard drive within a preset kernel using the first device in Bluestore. Then, the target metadata corresponding to the target data, stored in RocksDB, is stored in a preset metadata storage partition within the target disk array built on RAID10 within the preset kernel using the second device in Bluestore. The target metadata corresponding to the target data, stored in RocksDB, is retrieved using the interface provided by BluesFS in Bluestore. Finally, the target metadata is stored in the preset metadata storage partition within the target disk array built on RAID10 within the preset kernel using the second device in Bluestore. In this way, the present invention can achieve OSD metadata backup functionality through the RAID10 backup redundancy mechanism. When using Bluestore as the preset object storage engine to complete data storage, the target metadata corresponding to the target data, stored in RocksDB, is retrieved using the interface provided by the preset file system BluesFS in Bluestore, and then the target metadata is stored in the target disk array built on RAID10 using the second device. Compared to a single SSD without any measures, this invention can double the data write speed, and when the original data is busy or abnormal, data can be read directly from the backup image. It improves write speed while maintaining security. It also reduces data reconstruction time in the event of SSD failure, minimizing the impact of failures on the cluster state.
[0067] See Figure 5As shown in the figure, this application discloses a metadata backup device, which may specifically include:
[0068] Metadata storage module 11 is used to store target data in a preset operating system by using the first device in the preset object storage engine to the mechanical hard disk in the preset operating system, and then use the second device in the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system.
[0069] Metadata backup module 12 is used to back up the target metadata to a target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition.
[0070] This invention proposes an OSD metadata backup technology based on RAID 10. First, the target data is stored on a mechanical hard drive within a preset operating system using a first device in a preset object storage engine. Then, the target metadata corresponding to the target data, stored in a preset database, is stored in a preset metadata storage partition within a target disk array built on RAID 10 within the preset operating system using a second device in the same preset object storage engine. Finally, the target metadata is backed up to a target backup partition in the target disk array, built on RAID 1, corresponding to the preset metadata storage partition. This invention utilizes the backup redundancy mechanism of RAID 10 to achieve OSD metadata backup. RAID 10 achieves data redundancy through data mirroring of four SSDs, using RAID 0 as the execution array and RAID 1 as the data protection array. Compared to a single SSD without any protection, this can double the data write speed, which is crucial for high-performance storage systems requiring extremely fast data write speeds. This solves the problem of system reliability under disk failure without sacrificing overall system performance. Furthermore, when the original data is busy or abnormal, data can be read directly from the backup mirror. This improves write speed while maintaining security. Reduce data reconstruction time in the event of SSD disk failure, minimize the impact of failure on cluster status, and improve system reliability.
[0071] In some specific embodiments, the metadata storage module 11 specifically includes:
[0072] The first metadata storage unit is used to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the first target disk of the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine;
[0073] Accordingly, the metadata backup module 12 specifically includes:
[0074] The first metadata backup unit is used to back up the target metadata to the target backup partition corresponding to the preset metadata storage partition in the second target disk of the target disk array based on RAID1 and corresponding to the first target disk.
[0075] In some specific embodiments, the metadata storage module 11 specifically includes:
[0076] The second metadata storage unit is used to store the target data in the preset kernel's mechanical hard drive using the first device in bluestore, and then use the second device in bluestore to store the target metadata corresponding to the target data stored in RocksDB into the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel.
[0077] In some specific embodiments, the metadata storage module 11 specifically includes:
[0078] The first target metadata acquisition unit is used to acquire target metadata corresponding to the target data stored in the preset database according to the interface provided by the preset file system in the preset object storage engine;
[0079] The first target metadata storage unit is used to store the target metadata in a preset metadata storage partition in the target disk array built on RAID10 in the preset operating system using the second device of the preset object storage engine.
[0080] In some specific embodiments, the second metadata storage unit includes:
[0081] The second target metadata acquisition unit is used to acquire the target metadata corresponding to the target data stored in RocksDB according to the interface provided by BluesFS in bluestore;
[0082] The second target metadata storage unit is used to store the target metadata in the preset metadata storage partition of the target disk array built based on RAID10 in the preset kernel using the second device of the bluestore.
[0083] In some specific embodiments, the metadata backup device further includes:
[0084] The target disk array building unit is used to build a target disk array based on RAID10, with RAID0 as the execution array and RAID1 as the protection array.
[0085] In some specific embodiments, the metadata backup device further includes:
[0086] The target reconstruction data reading unit is used to read target reconstruction data from the target backup partition when a failure is detected in a disk in the target disk array.
[0087] The data reconstruction unit is used to reconstruct the data of a new disk newly inserted into the target disk array based on the target reconstruction data and using a preset data reconstruction method.
[0088] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of use of this application.
[0089] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a display screen 24, an input / output interface 25, a communication interface 26, and a communication bus 27. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the metadata backup method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0090] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 26 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0091] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it can include an operating system 221, computer programs 222, and virtual machine data 223, etc. The virtual machine data 223 can include various types of data. The storage method can be temporary storage or permanent storage.
[0092] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the metadata backup method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0093] Furthermore, this application also discloses a computer-readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the art. The computer program, when executed by a processor, implements the aforementioned disclosed metadata backup method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0094] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section. Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0095] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0096] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0097] The metadata backup method, apparatus, device, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A metadata backup method, characterized in that, include: After storing the target data to the mechanical hard drive in the preset operating system using the first device in the preset object storage engine, the target metadata corresponding to the target data stored in the preset database is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine. In the target disk array, every two disks form RAID1, two RAID1 groups form RAID0, and this structure forms RAID10. The data written on hard disk 1 are A1, A3, A5, and A7. Hard disk 2 is a backup disk for the data on hard disk 1. The data on hard disk 3 are A0, A2, A4, and A6. Hard disk 4 is a backup disk for the data on hard disk 3. The target metadata is backed up to the target backup partition in the target disk array, which is constructed based on RAID1 and corresponds to the preset metadata storage partition; After storing the target data to a mechanical hard drive in a preset operating system using the first device in the preset object storage engine, the second device in the preset object storage engine stores the target metadata corresponding to the target data in a preset database to a preset metadata storage partition in a target disk array built based on RAID10 in the preset operating system, including: After storing the target data to the mechanical hard drive in the preset kernel using the first device in bluestore, the target metadata corresponding to the target data stored in RocksDB is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel using the second device in bluestore; Before storing the target data to the mechanical hard drive in the preset operating system using the first device in the preset object storage engine, the process also includes: A target disk array is constructed based on RAID10, with RAID0 as the execution array and RAID1 as the protection array.
2. The metadata backup method according to claim 1, characterized in that, The step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system includes: The second device of the preset object storage engine stores the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the first target disk of the target disk array built based on RAID10 in the preset operating system; Accordingly, after backing up the target metadata to the target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition, the method further includes: The target metadata is backed up to the target backup partition in the second target disk of the target disk array, which is based on RAID1 and corresponds to the first target disk, and corresponds to the preset metadata storage partition.
3. The metadata backup method according to claim 1, characterized in that, The step of using the second device of the preset object storage engine to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system includes: The target metadata corresponding to the target data is obtained from the interface provided by the preset file system in the preset object storage engine; The target metadata is stored in the preset metadata storage partition in the target disk array built on RAID10 in the preset operating system using the second device of the preset object storage engine.
4. The metadata backup method according to claim 3, characterized in that, The step of using the second device of the bluestore to store the target metadata corresponding to the target data stored in RocksDB to the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel includes: Retrieve the target metadata corresponding to the target data stored in RocksDB using the interface provided by BluesFS in bluestore; The target metadata is stored in the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel using the second device of the bluestore.
5. The metadata backup method according to any one of claims 1 to 4, characterized in that, After backing up the target metadata to the target backup partition in the target disk array, which is constructed based on RAID1 and corresponds to the preset metadata storage partition, the method further includes: When a disk failure is detected in the target disk array, the target reconstruction data is read from the target backup partition; Based on the target reconstruction data, a preset data reconstruction method is used to reconstruct the data of the new disks newly inserted into the target disk array.
6. A metadata backup device, characterized in that, include: The metadata storage module is used to store the target data to the mechanical hard disk in the preset operating system using the first device in the preset object storage engine, and then to store the target metadata corresponding to the target data stored in the preset database to the preset metadata storage partition in the target disk array built based on RAID10 in the preset operating system using the second device of the preset object storage engine. In the target disk array, every two disks form RAID1, two RAID1 groups form RAID0, and this structure forms RAID10. The data written on hard disk 1 are A1, A3, A5, and A7. Hard disk 2 is a backup disk for the data on hard disk 1. The data on hard disk 3 are A0, A2, A4, and A6. Hard disk 4 is a backup disk for the data on hard disk 3. The metadata backup module is used to back up the target metadata to a target backup partition in the target disk array that is constructed based on RAID1 and corresponds to the preset metadata storage partition; The metadata storage module includes: The second metadata storage unit is used to store the target data in the preset kernel after the first device in bluestore stores the target data to the mechanical hard disk in the preset kernel, and then use the second device in bluestore to store the target metadata corresponding to the target data stored in RocksDB to the preset metadata storage partition in the target disk array built based on RAID10 in the preset kernel; Also includes: The target disk array building unit is used to build a target disk array based on RAID10, with RAID0 as the execution array and RAID1 as the protection array.
7. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the metadata backup method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Used for storing computer programs; wherein, when the computer programs are executed by a processor, they implement the metadata backup method as described in any one of claims 1 to 5.