Metadata backup method and device, computer readable medium and electronic equipment
By exporting and storing metadata in the object storage system, the problems of high metadata backup cost and difficulty in deployment in the existing technology are solved, self-contained backup of metadata is realized, cost is reduced and reliability is improved.
Patent Information
- Application Number
- CN202310375838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2024-10-15
AI Technical Summary
Backing up metadata in existing storage systems requires an additional reliable system, which results in high costs and difficulty for customers to implement and deploy in private deployments.
Metadata is implemented by exporting the metadata as a cold backup file in the object storage system and storing it in a dedicated bucket, while storing the metadata of the cold backup file in a target file system independent of the object storage system self-contained backup.
It reduces the cost of metadata storage, reduces dependence on external systems, simplifies the privatization deployment and deployment process, and improves the reliability of metadata.
Smart Images

Figure CN118779148A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information storage technology, and in particular to a method, device, computer-readable medium and electronic device for backing up metadata in an object storage system. Background Art
[0002] In existing storage systems, in order to ensure the reliability of metadata storage, it is generally necessary to set up an additional system to back up and store the metadata.
[0003] However, this method requires setting up an additional reliable system, which is costly. In a private deployment scenario, customers may not have purchased or find it difficult to purchase additional systems, making the storage system difficult to implement and deploy. Summary of the invention
[0004] The embodiments of the present application provide a method, device, computer-readable medium, and electronic device for backing up metadata in an object storage system, thereby ensuring the reliability of metadata storage at a relatively low cost, at least to a certain extent.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of an embodiment of the present application, a method for backing up metadata in an object storage system is provided, the object storage system comprising an object data storage system and a metadata storage system, wherein objects in the object storage system are stored in storage buckets, the method comprising: exporting metadata of a target object stored in the metadata storage system as a cold backup file, wherein the object data of the target object is stored in the object data storage system; storing the cold backup file as an object in a dedicated storage bucket, wherein the object storage system stores the object data of the cold backup file in the object data storage system, and storing the metadata of the cold backup file in the metadata storage system, wherein the dedicated storage bucket is different from the storage bucket to which the target object belongs; exporting the metadata of the cold backup file in the metadata storage system as a first backup file, and storing the first backup file in a target file system independent of the object storage system.
[0007] According to one aspect of an embodiment of the present application, a metadata backup device for an object storage system is provided, wherein the object storage system includes an object data storage system and a metadata storage system, wherein objects in the object storage system are stored in storage buckets, and the device includes: an export unit, configured to export metadata of a target object stored in the metadata storage system as a cold backup file, wherein the object data of the target object is stored in the object data storage system; a preservation unit, configured to store the cold backup file as an object in a dedicated storage bucket, wherein the object storage system stores the object data of the cold backup file in the object data storage system, and stores metadata of the cold backup file in the metadata storage system, wherein the dedicated storage bucket is different from the storage bucket to which the target object belongs; and an export and storage unit, configured to export metadata of the cold backup file in the metadata storage system as a first backup file, and store the first backup file in a target file system independent of the object storage system.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the device also includes an acquisition and backup unit; after storing the first backup file in a target file system independent of the object storage system, the acquisition and backup unit is used to: if the metadata storage system fails, obtain the first backup file from the target file system, and restore the metadata of the target object in the object storage system based on the first backup file.
[0009] In some embodiments of the present application, based on the aforementioned scheme, before restoring the metadata of the target object in the object storage system according to the first backup file, the preservation unit is also used to: obtain the metadata operation log, and back up the metadata operation log as an object to the dedicated storage bucket, so as to store the object data of the metadata operation log in the object data storage system, and store the metadata of the metadata operation log in the metadata storage system; back up the metadata of the metadata operation log to obtain a log metadata backup result; the acquisition and backup unit is configured to: restore the metadata of the target object in the object storage system according to the first backup file, the object data of the metadata operation log and the log metadata backup result.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the preservation unit is configured to: regularly perform a backup step, and the backup step includes: storing the cold backup files corresponding to the metadata of all objects in the metadata storage system as objects in a dedicated storage bucket; the export and storage unit is configured to: whenever the backup step is completed and / or whenever a predetermined time is reached, export the metadata of the cold backup files in the metadata storage system as a first backup file, and store the first backup file in a target file system independent of the object storage system.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the saving unit is configured as follows: when the time for executing the backup step is reached, if the dedicated storage bucket has stored cold backup files previously stored in a predetermined number of backup steps, the cold backup files stored in the first backup step in the dedicated storage bucket are deleted.
[0012] In some embodiments of the present application, based on the aforementioned solution, the storage unit is configured to: export the metadata of the metadata operation log in the metadata storage system as a second backup file, and store the second backup file as a log metadata backup result in a target file system independent of the object storage system; and / or
[0013] The metadata of the metadata operation log is encoded, and the encoding result is printed as the log metadata backup result into the object data of the metadata operation log in the object data storage system.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the storage unit is configured as follows: at predetermined time intervals, based on the generation of a new metadata operation log file, the metadata operation log is obtained from the generated metadata operation log file that has not been backed up, and the metadata operation log is backed up as an object to the dedicated storage bucket.
[0015] In some embodiments of the present application, based on the aforementioned scheme, the acquisition and backup unit is configured to: build a new metadata storage system in the object storage system; obtain the metadata of the cold backup file based on the first backup file, and restore the object data of the cold backup file from the object data storage system based on the metadata of the cold backup file; obtain the metadata of the corresponding target object based on the object data and metadata of the cold backup file, and write the metadata of the target object into the new metadata storage system; generate metadata of the metadata operation log based on the log metadata backup result; obtain the metadata operation log based on the object data of the metadata operation log and the metadata of the metadata operation log, and update the metadata of the target object based on the metadata operation log.
[0016] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a file synchronization unit; after storing the first backup file in a target file system independent of the object storage system, the file synchronization unit is used to: synchronize the first backup file from the target file system to at least one other file system.
[0017] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for backing up metadata in an object storage system as described in the above embodiment is implemented.
[0018] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the metadata backup method in the object storage system as described in the above embodiments.
[0019] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes computer instructions, the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for backing up metadata in an object storage system as described in the above embodiments.
[0020] In the technical solutions provided in some embodiments of the present application, for an object storage system including an object data storage system and a metadata storage system, by first exporting the metadata of the target object stored in the metadata storage system as a cold backup file, and storing the cold backup file as an object in a dedicated storage bucket, the object storage system stores the object data of the cold backup file in the object data storage system, and stores the metadata of the cold backup file in the metadata storage system. Finally, the metadata of the cold backup file in the metadata storage system is exported as a first backup file, and the first backup file is stored in a target file system independent of the object storage system. Therefore, the solution of the embodiment of the present application can restore the metadata of the object according to the first backup file stored in the target file system independent of the object storage system when data loss or failure occurs in the metadata storage system, thereby ensuring the reliability of the metadata; more importantly, since the solution of the embodiment of the present application is a metadata backup performed in the object storage system itself that stores the object, the target file system can be a local file system of a computer or an intelligent terminal, therefore, there is no need to set up an additional storage system, reducing the dependence on external systems and reducing costs, thereby ensuring the reliability of metadata storage at a lower cost; in addition, in a privatized deployment or a proprietary cloud scenario, users do not need to purchase additional systems, which greatly reduces the difficulty of implementing and deploying the object storage system.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0024] Figure 2 A flowchart of a method for backing up metadata in an object storage system according to an embodiment of the present application is shown;
[0025] Figure 3 An embodiment according to the present application is shown. Figure 2 A flowchart of the steps after step 250 in the embodiment;
[0026] Figure 4An embodiment according to the present application is shown. Figure 3 A flowchart of the steps before step 260 and details of step 260 in the embodiment;
[0027] Figure 5 An embodiment according to the present application is shown. Figure 4 A flowchart of the details of step 230 in an embodiment;
[0028] Figure 6 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 220 and step 250 in the embodiment;
[0029] Figure 7 A flowchart is shown of restoring metadata of a target object in an object storage system according to a first backup file, object data of a metadata operation log, and a log metadata backup result according to an embodiment of the present application;
[0030] Figure 8 Another embodiment according to the present application is shown. Figure 2 A flowchart of the steps after step 250 in the embodiment;
[0031] Fig. 9 A block diagram of a metadata backup device in an object storage system according to an embodiment of the present application is shown;
[0032] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0037] A distributed storage system is a system that stores and manages data by distributing it across multiple physical nodes. Unlike traditional centralized storage systems, distributed storage systems can provide higher reliability, scalability, and performance.
[0038] In a distributed storage system, data is divided into multiple parts and stored on different nodes. Each node has its own storage devices and computing resources, and can process and manage data independently. In this way, a distributed storage system can provide higher fault tolerance because even if one of the nodes fails, the entire system can still continue to operate.
[0039] Distributed storage systems can also provide better scalability because when storage capacity needs to be increased, only more nodes need to be added without the need to restructure or change the entire system. In addition, distributed storage systems can also provide higher performance because multiple nodes can be accessed simultaneously, and each node can process a portion of the data and perform tasks in parallel.
[0040] In a distributed storage system, the data stored in the system is usually divided into metadata and real data. Metadata is the dictionary and index of the real data. The metadata can be used to explain, index, download, and manage the real data. If the metadata is lost, the real data will lose its meaning because the dictionary and index information of the data are lost. Therefore, in a distributed storage system, the reliability of metadata is of paramount importance. However, considering unexpected bugs in the system, daily operation and maintenance errors, etc., the metadata may be destroyed.
[0041] In the common metadata backup scheme of distributed storage systems, the metadata of system A is usually backed up to another system B, so that when the part storing metadata in system A fails, it can be restored from system B. However, these distributed storage system metadata backup methods require two systems, but in some private deployment scenarios, it is possible that the cluster scale is relatively small and there is no condition for such backup. If the metadata is only backed up to the current system, then if the part storing metadata in this system fails, the metadata backed up in this system cannot be restored.
[0042] To this end, the present application first provides a method for backing up metadata in an object storage system. The method for backing up metadata in an object storage system provided by the embodiment of the present application can overcome the above-mentioned defects, and can support backing up metadata in the storage system in the storage system itself, so that the backup of metadata no longer depends on an external system, which reduces costs. When a storage cluster is deployed, especially in a privatized deployment or a proprietary cloud scenario, the size of the minimum cluster can be reduced, and the difficulty and threshold of implementing and deploying the storage system are reduced.
[0043] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture 100 may include an object upload terminal 110, an object storage system 120, and a user terminal 130. The object storage system 120 includes an object data storage server 121 and a metadata storage server 122 that can communicate with each other. The object data storage server 121 is deployed with an object data storage system, and the metadata storage server 122 is deployed with a metadata storage system. Communication links are set between the object upload terminal 110 and the object storage system 120, and between the metadata storage server 122 and the user terminal 130. When a method for backing up metadata in an object storage system provided in the present application is applied to Figure 1In the system architecture shown, a process may be as follows: first, the object upload terminal 110 obtains the target object, and the user of the object upload terminal 110 requests to upload the target object to the storage bucket of the object storage system 120; then, the object storage system 120 will store the object data of the target object in the object data storage system on the object data storage server 121 according to the received request, and store the metadata of the target object in the metadata storage system on the metadata storage server 122; next, a dedicated storage bucket is newly created in the object storage system 120, and the metadata of the target object is exported as a cold backup file, and the cold backup file is stored as an object in the dedicated storage bucket, so that the object data of the cold backup file is stored in the object data storage system, and the metadata of the cold backup file is stored in the metadata storage system; finally, the metadata of the cold backup file in the metadata storage system is exported as a backup file, and the backup file is stored in the user terminal 130 independent of the object storage system 120 through a communication link, thereby realizing the backup of the metadata of the target object.
[0044] In some embodiments of the present application, after a failure of the metadata storage server 122, the dedicated storage bucket is restored based on the backup files stored in the user terminal 130 and the object data stored in the object data storage system, thereby restoring the metadata of the target object.
[0045] In some embodiments of the present application, the user of the object upload terminal 110 may also modify the objects and their metadata stored in the object storage system 120 through the object upload terminal 110 , or delete the objects and their metadata stored in the object storage system 120 .
[0046] In some embodiments of the present application, whenever the metadata of an object in the object storage system 120 changes, the contents in the dedicated storage bucket and the user terminal 130 can be synchronously updated in real time.
[0047] In some embodiments of the present application, the object storage system 120 is a proprietary object storage service deployed for users in a privatized deployment manner.
[0048] It should be understood that Figure 1 The number of object upload terminals, object data storage servers, metadata storage servers, and user terminals in the embodiment is only illustrative. According to the implementation requirements, there may be any number of object upload terminals, object data storage servers, metadata storage servers, and user terminals, that is, there may be multiple object upload terminals and user terminals. In addition, the object data storage server and the metadata storage server may be a server cluster composed of multiple servers.
[0049] It should be noted that Figure 1The embodiment shown is only one embodiment of the present application. Figure 1 In the embodiment, the user terminal is a laptop computer, and the object upload terminal is a desktop computer. However, in other embodiments of the present application, the user terminal and the object upload terminal may also be various types of terminal devices such as desktop computers, workstations, tablet computers, vehicle-mounted terminals, portable wearable devices, and even other servers. Figure 1 In the solution of the embodiment, only one user terminal is used to store the backup file, but in other embodiments of the present application, multiple user terminals can also be used to store the backup file at the same time. For example, the backup file can be synchronized from the user terminal 130 to other user terminals to further improve the storage reliability. Figure 1 In the solution of the embodiment, the contents in the dedicated storage bucket and the user terminal 130 are updated synchronously in real time, but in other embodiments of the present application, the two can also be updated asynchronously, for example, after a certain period of time. The embodiment of the present application does not make any limitation on this, and the protection scope of the present application should not be limited in any way.
[0050] It is easy to understand that the metadata backup method in the object storage system provided in the embodiment of the present application is generally executed by the server, and accordingly, the metadata backup device in the object storage system is generally set in the server. However, in other embodiments of the present application, the terminal device may also have similar functions as the server, so as to execute the metadata backup solution in the object storage system provided in the embodiment of the present application.
[0051] Therefore, the embodiments of the present application can be applied to a terminal or a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0052] The solution of the embodiment of the present application can be applied to cloud storage scenarios. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0053] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0054] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0055] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0056] Figure 2 A flowchart of a method for backing up metadata in an object storage system according to an embodiment of the present application is shown. The method for backing up metadata in the object storage system can be executed by various devices capable of computing and processing, such as user terminals or cloud servers. User terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Please refer to Figure 2 As shown, the object storage system may include an object data storage system and a metadata storage system. In the object storage system, objects are stored in buckets. The method for backing up metadata in the object storage system includes at least the following steps:
[0057] In step 210, metadata of the target object stored in the metadata storage system is exported as a cold backup file, and object data of the target object is stored in the object data storage system.
[0058] The target object may be one or more objects, and the target object is part or all of the objects that have been stored in the object storage system.
[0059] In one embodiment of the present application, before exporting the metadata of the target object stored in the metadata storage system as a cold backup file, the metadata backup method in the object storage system may also include the following steps: establishing a target storage bucket in the object storage system; storing the target object in the target storage bucket of the object storage system to store the object data of the target object in the object data storage system of the object storage system, and storing the metadata of the target object in the metadata storage system of the object storage system.
[0060] The solution of the embodiment of the present application can be applied to the Cloud Object Storage (COS) scenario. Cloud Object Storage (COS) is a distributed storage service with no directory hierarchy, no data format restrictions, can accommodate massive data, and supports HTTP / HTTPS protocol access. Users can store and view data at any time through the network. Object is the basic unit of object storage, which can be understood as data of any format type, such as pictures, documents, audio and video files, etc. Bucket is the carrier of the object, which can also be called storage space. It is a container for users to store objects, and each bucket can accommodate any number of objects.
[0061] The object storage system can provide object storage services to the outside world. When a terminal device requests to store an object in a storage bucket of the object storage system, the object storage system automatically stores the object data of the object in the object data storage system of the object storage system, and automatically stores the metadata of the object in the metadata storage system of the object storage system.
[0062] The object storage system can be a distributed storage system, and both the object data storage system and the metadata storage system in the object storage system can be distributed storage systems. The object data corresponding to an object in a storage bucket can be stored in multiple machines in the object data storage system, which is a distributed storage system.
[0063] An object can include an object identifier (filekey), object data (Value), and metadata (Metadata). Tenants can create buckets, upload objects, download objects, delete objects, and other operations in the object storage system.
[0064] The object data of an object can also be called the object value, which is the real data of the object, that is, the object itself, which can also be understood as the file content. The metadata of an object is a set of key-value pairs, which can be understood as the attributes of the file.
[0065] The metadata storage system is a key-value distributed storage system that is responsible for storing all metadata, including multiple tables such as the bucket index table (Table 3), directory index table (Table 1), file information table (Table 2), and block information table (Table 6). The bucket index table is a bucket list. The key in this table is the name of the bucket, and the value is the metadata such as the creation time of the bucket, whether the bucket has cross-campus replication enabled, and the bucket's permissions. For example, for the testbucket bucket, the records in Table 3 are as follows: testbucket->(createtime, whether the auth permission has public read and write enabled, life cycle rules, etc.); the directory index table is an object list for each bucket. This table records all object lists. For example, for the 10 objects in the testbucket bucket, the records in Table 1 are as follows: / testbucket / file1.txt->(object creation time, object size, whether the object is uploaded simply or in blocks, object md5, object filekey, etc.)... / testbucket / file10.txt->(object creation time, object size, whether the object is uploaded simply or in blocks, object md5, object filekey, etc.) ilekey, etc.); the file information table records information related to filekey. The filekey in this table and the filekey in the value of Table 1 can be associated for query. The records in the file information table are as follows: filekey->(basic information of filekey, including the reference count, creation time, size and other information of this filekey). The file information table also records the fragmentation information of each filekey. For example, if the size of the object data of an object is 10MB, the object data will be divided into 10 fragments of 1MB in size. The records in the file information table are as follows: filekey_00001->(the id of the data corresponding to the storage of this fragment in the object data storage system)...filekey_00010->(the id of the data corresponding to the storage of this fragment in the object data storage system); the fragmentation information is recorded in the block information table. Only objects uploaded to the storage system in block upload mode will have corresponding block information in the block information table.
[0066] Taking the object data storage system as a and the metadata storage system as b as an example, the b_dump_file method can be used to export the metadata of all objects stored in the metadata storage system. The metadata can be exported as a cold backup file in the dump format, and finally one or more cold backup files can be exported.
[0067] In step 220, the cold backup file is stored as an object in a dedicated storage bucket, and the object storage system stores the object data of the cold backup file in the object data storage system, and stores the metadata of the cold backup file in the metadata storage system. The dedicated storage bucket is different from the storage bucket to which the target object belongs.
[0068] Like other objects such as target objects, when a cold backup file is uploaded as an object to a dedicated bucket, the object storage system automatically stores the object data of the cold backup file in the object data storage system and stores the metadata of the cold backup file in the metadata storage system.
[0069] Before storing the cold backup file as an object in a dedicated bucket, you can first create a dedicated bucket b-backup specifically for backup. You can use a reserved developer account to create a dedicated bucket in the object storage system, that is, only the developers of the object storage system are allowed to have the creation and operation permissions for the dedicated bucket to avoid tenant misoperation.
[0070] In one embodiment of the present application, a cold backup file is stored as an object in a dedicated storage bucket, including: creating a business directory corresponding to each business under the current date directory in the dedicated storage bucket; for each cold backup file, storing the cold backup file in the corresponding business directory according to the business corresponding to the cold backup file; whenever all cold backup files corresponding to a business are uploaded, uploading a first list file under the business directory corresponding to the business, wherein the first list file records the time when each cold backup file corresponding to the business starts to export, the time when the export is completed, and the minimum and maximum values of the keys in the cold backup file; when the cold backup files corresponding to all businesses are uploaded, uploading a second list file under the current date directory, wherein the second list file records the time when the upload of the cold backup files corresponding to each business starts, the time when the upload is completed, and other information.
[0071] Each business is equivalent to a table, and different businesses are different tables in the metadata storage system; each business can correspond to several cold backup files, and the minimum value key_min and the maximum value key_max of the key in the cold backup file are the starting ID and the maximum ID of the record of the table corresponding to the cold backup file.
[0072] In a dedicated bucket, the storage directory for cold backup files can be as follows:
[0073] 2022-11-07 / manifest.txt
[0074] 2022-11-07 / 720051_1 /
[0075] 2022-11-07 / 720051_1 / manifest.txt
[0076] 2022-11-07 / 720051_1 / 10.29.0.144_720051_1_1_0_303030303030_303032323533.dump
[0077] 2022-11-07 / 720051_1 / 10.29.0.144_720051_1_1_1_303435303630_303437333133.dump
[0078] 2022-11-07 / 720051_1 / 10.29.0.144_720051_1_1_2_303930313230_303932333733.dump
[0079] Among them, the current date directory 2022-11-07 represents a backup upload of a cold backup file starting on November 7, 2022. 720051_1 represents a business directory. The .dump file in the business directory is the cold backup file. The manifest.txt in the business directory is the first manifest file. The manifest.txt in the directory 2022-11-07 is the second manifest file.
[0080] In the embodiment of the present application, by storing the cold backup files and the corresponding list files in the current date directory and the business directory, a reasonable directory structure is set, which is convenient for searching and archiving, and can improve the readability of the files and make the contents of the files clearer. For a system containing a large number of files, a clear directory structure can enable users to find the required files more quickly.
[0081] In step 250, the metadata of the cold backup file in the metadata storage system is exported as a first backup file, and the first backup file is stored in a target file system independent of the object storage system.
[0082] Similar to the cold backup file, the first backup file may also be a file in a dump format, and the first backup file may be exported in the same manner as the cold backup file.
[0083] If the cold backup file is backed up using a simple upload method, you only need to back up Table 1 of the b-backup bucket and Table 2 corresponding to all filekeys in Table 1. If the cold backup file is uploaded using a block upload method, you also need to back up Table 6.
[0084] The target file system can be any entity that can store data. The entity can be a local file system, such as a device or terminal, a USB flash drive or a mobile hard disk, or even a network disk or a cloud disk. For example, the first backup file can be stored in a local computer or a local server. The first backup file can be transferred to a target file system independent of the object storage system through the network for storage. The target file system is independent of the object storage system, which means that the target file system and the object storage system are different systems. In order to ensure the reliability of storage, the target file system can be located far away from the object storage system.
[0085] Figure 3 An embodiment according to the present application is shown. Figure 2 Flow chart of the steps after step 250 in the embodiment. Figure 3 As shown, after storing the first backup file in a target file system independent of the object storage system, the method for backing up metadata in the object storage system may further include the following steps:
[0086] In step 260, if the metadata storage system fails, the first backup file is obtained from the target file system, and the metadata of the target object is restored in the object storage system according to the first backup file.
[0087] Although the embodiment of the present application performs metadata recovery when a metadata storage system fails, in other embodiments of the present application, metadata recovery can also be performed when metadata loss occurs in the metadata storage system; that is, in scenarios where metadata loss occurs due to unexpected bugs in the system or due to misoperation by maintenance personnel, metadata recovery operations for target objects can be performed. The metadata of the cold backup file can be obtained based on the first backup file, so that the metadata of the cold backup file and the object data of the cold backup file in the object data storage system can be used to restore the dedicated storage bucket, and finally the metadata of the target object can be restored.
[0088] If a full cold backup file is backed up every time the metadata of the target object changes or a full cold backup file is backed up every minute, a large amount of storage resources and computing resources will be consumed; however, if the time interval between two full cold backup files is very long, then within the interval time period, if the metadata of the target object changes and a failure occurs after the change, this part of the metadata cannot be restored. For this reason, the embodiment of the present application also proposes a backup solution for the metadata operation log to further improve the storage reliability of the metadata of the target object.
[0089] Figure 4 An embodiment according to the present application is shown. Figure 3 Flowchart of the steps before step 260 and details of step 260 in the embodiment. Figure 4 As shown, before restoring the metadata of the target object in the object storage system according to the first backup file, the method for backing up metadata in the object storage system may further include the following steps:
[0090] In step 230, the metadata operation log is obtained and backed up as an object in a dedicated storage bucket to store the object data of the metadata operation log in the object data storage system and the metadata of the metadata operation log in the metadata storage system.
[0091] The metadata operation trail (MOT) is a log that records changes in the metadata of the target object, which may include logs of metadata write (set) and delete (delete) operations. The metadata operation trail can be generated on the access side machine of the metadata storage system, so the metadata operation trail can be obtained from the access side machine of the metadata storage system. The metadata operation trail can be backed up as an object under the binlog directory, and then divided into subdirectories according to the IP address of the access side machine.
[0092] Although this step also backs up the metadata operation log as an object to a dedicated storage bucket, in other embodiments of the present application, a corresponding dedicated storage bucket can be created separately for the metadata operation log, and the metadata operation log can be backed up as an object to a dedicated storage bucket dedicated to the metadata operation log.
[0093] Similar to regular objects and cold backup files, backing up the metadata operation log as an object to a dedicated storage bucket will also cause the object storage system to store the object data of the metadata operation log into the object data storage system, and store the metadata of the metadata operation log into the metadata storage system.
[0094] Figure 5 An embodiment according to the present application is shown. Figure 4 Flow chart of details of step 230 in the embodiment. Figure 5 As shown, obtaining the metadata operation log and backing up the metadata operation log as an object to a dedicated storage bucket may include the following steps:
[0095] In step 230', at predetermined intervals, based on the generation of new metadata operation log files, metadata operation log files are obtained from the generated metadata operation log files that have not been backed up, and the metadata operation log files are backed up as objects in a dedicated storage bucket.
[0096] The scheduled duration can be set as needed, for example, it can be set to 1 minute. Assume that the access side machine switches the generated metadata operation log in units of 1GB, that is, whenever a metadata operation log file of 1GB size is generated, a new file is created to store the metadata operation log until it reaches 1GB size again. Assuming that two metadata operation log files A and B are generated, and A and B are both generated at 6:00:30, then the metadata operation log will not be backed up at 6:00. At 6:01, since two new metadata operation log files A and B are generated, and the two new metadata operation log files A and B have not been backed up, A and B will be backed up. By backing up the metadata operation log every minute, the reliability of the backup is greatly improved.
[0097] Please continue to see Figure 4 In step 240, the metadata of the metadata operation log is backed up to obtain a log metadata backup result.
[0098] The metadata of the metadata operation log can be backed up in multiple ways.
[0099] In one embodiment of the present application, metadata of the metadata operation log is backed up to obtain a log metadata backup result, including:
[0100] Exporting metadata of the metadata operation log in the metadata storage system as a second backup file, and storing the second backup file as a log metadata backup result in a target file system independent of the object storage system; and / or
[0101] The metadata of the metadata operation log is encoded, and the encoding result is printed as the log metadata backup result into the object data of the metadata operation log in the object data storage system.
[0102] The metadata of the metadata operation log can be backed up in at least one of the above two ways.
[0103] When the metadata of the metadata operation log is backed up in the form of the second backup file, the backup method adopted is similar to the backup method of the metadata of the cold backup file.
[0104] Although in the embodiment of the present application, the second backup file and the first backup file are both stored in the target file system, in other embodiments of the present application, the two can also be stored in different file systems respectively.
[0105] The metadata of the metadata operation log can be encoded in Hex encoding, and the object data of the metadata operation log is the log file itself, so the metadata of the metadata operation log can be directly restored from the log file. Of course, it can also be encoded in other ways.
[0106] Hex encoding, also known as hexadecimal encoding, is a way of converting binary data into an encoding that is easy to read and transmit. In Hex encoding, each byte of binary data is represented as two hexadecimal digits ranging from 00 to FF (decimal 0 to 255). Therefore, Hex encoding can represent any binary data as a series of hexadecimal digits, which is convenient for transmission and storage. Hex encoding is often used in fields such as network communication, file transfer, and programming, such as converting binary data into ASCII characters in network transmission for transmission in text protocols, or storing binary data in text files. Hex encoding can also be used when debugging and analyzing binary data to make it easier to view and compare data.
[0107] Figure 6 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 220 and step 250 in the embodiment. Figure 6 As shown, storing the cold backup file as an object in a dedicated storage bucket may include the following steps:
[0108] In step 220 ′, a backup step is performed regularly, and the backup step includes: storing the cold backup files corresponding to the metadata of all objects in the metadata storage system as objects in a dedicated storage bucket.
[0109] The periodicity can be performed at fixed time intervals, for example, the backup step can be performed every 7 days, or it can be performed on a preset date, for example, on a certain day or several days of each week or month; of course, it can also be performed at a time specified by the user.
[0110] In one embodiment of the present application, a backup step is performed periodically, including: when the time to perform the backup step is reached, if the dedicated storage bucket has stored cold backup files previously stored in a predetermined number of backup steps, the cold backup files stored in the first backup step in the dedicated storage bucket are deleted.
[0111] Each time a backup step is executed, a corresponding cold backup file will be stored. By executing a predetermined number of backup steps, a predetermined number of cold backup files can be obtained. The first backup step is the earliest step corresponding to the cold backup file of the dedicated storage bucket.
[0112] The value of the predetermined number can be set as needed, for example, it can be set to 2. If the fixed time period between the backup steps is 7 days, then if there are cold backup files stored in two backup steps, and the start backup time of the latest backup record is greater than 7 days from the current time, the earliest backed-up cold backup file in the dedicated storage bucket will be deleted, and a new round of backup will be performed.
[0113] In the embodiment of the present application, by periodically executing the backup step and deleting the earliest generated backup, it is possible to reduce the occupancy of storage resources while ensuring the reliability of the backup.
[0114] Step 250 specifically includes the following steps:
[0115] In step 250', whenever the backup step is completed and / or whenever a predetermined time is reached, the metadata of the cold backup file in the metadata storage system is exported as a first backup file, and the first backup file is stored in a target file system independent of the object storage system.
[0116] The scheduled time can be a fixed time every day, a fixed time every week, or a fixed time every month. In order to ensure the reliability of the backup, the metadata of the cold backup file in the metadata storage system is exported every time the backup step is completed and at a fixed time every day.
[0117] Please continue to see Figure 4 Restoring the metadata of the target object in the object storage system according to the first backup file may include the following steps:
[0118] In step 260', the metadata of the target object is restored in the object storage system according to the first backup file, the object data of the metadata operation log, and the log metadata backup result.
[0119] The metadata of the target object can be restored more reliably and completely by using the first backup file, the object data of the metadata operation log, and the log metadata backup result.
[0120] Figure 7A flowchart of restoring the metadata of a target object in an object storage system according to an embodiment of the present application is shown, based on the first backup file, the object data of the metadata operation log, and the log metadata backup result. Figure 7 As shown, restoring the metadata of the target object in the object storage system according to the first backup file, the object data of the metadata operation log, and the log metadata backup result may include the following steps:
[0121] In step 710, a new metadata storage system is built in the object storage system.
[0122] You can build a new metadata storage system in the object storage system by rebuilding the storage cluster.
[0123] In step 720, metadata of the cold backup file is obtained according to the first backup file, and object data of the cold backup file is restored from the object data storage system according to the metadata of the cold backup file.
[0124] The first backup file is obtained by exporting the metadata of the cold backup file. Therefore, the metadata of the cold backup file can be obtained based on the first backup file; the metadata of the cold backup file describes the properties of the cold backup file. Therefore, the object data of the cold backup file can be found from the object data storage system based on the metadata of the cold backup file.
[0125] In step 730, metadata of the corresponding target object is obtained according to the object data and metadata of the cold backup file, and the metadata of the target object is written into a new metadata storage system.
[0126] The cold backup file can be obtained according to the object data and metadata of the cold backup file, and then the metadata of the target object can be obtained.
[0127] In step 740, metadata of the metadata operation log is generated according to the log metadata backup result.
[0128] The metadata of the metadata operation log can be obtained by using the log file and / or the second backup file as the log metadata backup results.
[0129] In step 750, a metadata operation log is obtained according to the object data of the metadata operation log and the metadata of the metadata operation log, and the metadata of the target object is updated according to the metadata operation log.
[0130] The metadata operation log object can be obtained according to the object data of the metadata operation log and the metadata of the metadata operation log, and then the metadata of the target object can be further restored according to the metadata operation log.
[0131] Figure 8 Another embodiment according to the present application is shown. Figure 2 Flow chart of the steps after step 250 in the embodiment. Figure 8 As shown, after storing the first backup file in a target file system independent of the object storage system, the method may further include the following steps:
[0132] In step 270, the first backup file is synchronized from the target file system to at least one other file system.
[0133] The first backup file can be synchronized to at least two additional machines through the rsync tool. The three machines storing the first backup file can be located on different racks; therefore, at least three copies of the first backup file can be obtained, so that the metadata of the dedicated storage bucket has the reliability of 3 copies.
[0134] In other embodiments of the present application, the second backup file may also be synchronized in this manner.
[0135] In summary, according to the metadata backup method in the object storage system provided by the embodiment of the present application, the problem of metadata backup is solved through in-situ backup, which is easy to implement and deploy in the proprietary cloud scenario, thereby ensuring the reliability of the entire system, reducing the size of the minimum cluster and the dependence on the cluster size, and improving the reliability of the metadata of the privatized cos storage system. It can calmly deal with the scenario where unexpected system bugs lead to metadata loss and maintenance personnel's misoperation leads to metadata loss.
[0136] For example, if the cluster of the object storage system stores 100PB of data, the metadata of the entire cluster is about 100TB. If it is compressed and stored and backed up to the cluster, it is about 10TB. The metadata of this 10TB backup file is only about 10GB, which can be stored locally and synchronized to an additional machine by rsync to ensure the reliability of three copies. The solution of the embodiment of the present application transforms the original 100TB metadata backup problem into metadata of metadata. Only 10GB needs to be backed up to finally restore 100PB of metadata.
[0137] The following describes an apparatus embodiment of the present application, which can be used to execute the method for backing up metadata in an object storage system in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the embodiment of the method for backing up metadata in an object storage system in the above-mentioned embodiment of the present application.
[0138] Fig. 9 A block diagram of a metadata backup device in an object storage system according to an embodiment of the present application is shown.
[0139] Reference Fig. 9 As shown, the object storage system includes an object data storage system and a metadata storage system. In the object storage system, objects are stored in a storage bucket as a carrier. According to an embodiment of the present application, a metadata backup device 900 in the object storage system includes: an export unit 910, a preservation unit 920, and an export and storage unit 930. The export unit 910 is used to export the metadata of the target object stored in the metadata storage system as a cold backup file, and the object data of the target object is stored in the object data storage system; the preservation unit 920 is used to store the cold backup file as an object in a dedicated storage bucket, and the object storage system stores the object data of the cold backup file in the object data storage system, and stores the metadata of the cold backup file in the metadata storage system, and the dedicated storage bucket is a different storage bucket from the storage bucket to which the target object belongs; the export and storage unit 930 is used to export the metadata of the cold backup file in the metadata storage system as a first backup file, and store the first backup file in a target file system independent of the object storage system.
[0140] In some embodiments of the present application, based on the aforementioned scheme, the device also includes an acquisition and backup unit; after storing the first backup file in a target file system independent of the object storage system, the acquisition and backup unit is used to: if the metadata storage system fails, obtain the first backup file from the target file system, and restore the metadata of the target object in the object storage system based on the first backup file.
[0141] In some embodiments of the present application, based on the aforementioned scheme, before restoring the metadata of the target object in the object storage system according to the first backup file, the saving unit 920 is also used to: obtain the metadata operation log, and back up the metadata operation log as an object to the dedicated storage bucket, so as to store the object data of the metadata operation log in the object data storage system, and store the metadata of the metadata operation log in the metadata storage system; back up the metadata of the metadata operation log to obtain a log metadata backup result; the acquisition and backup unit is configured to: restore the metadata of the target object in the object storage system according to the first backup file, the object data of the metadata operation log and the log metadata backup result.
[0142] In some embodiments of the present application, based on the aforementioned scheme, the saving unit 920 is configured to: regularly perform a backup step, the backup step including: storing the cold backup files corresponding to the metadata of all objects in the metadata storage system as objects in a dedicated storage bucket; the export and storage unit 930 is configured to: whenever the backup step is completed and / or whenever a predetermined time is reached, export the metadata of the cold backup files in the metadata storage system as a first backup file, and store the first backup file in a target file system independent of the object storage system.
[0143] In some embodiments of the present application, based on the aforementioned scheme, the saving unit 920 is configured as follows: when the time for executing the backup step is reached, if the dedicated storage bucket has stored cold backup files previously stored in a predetermined number of backup steps, the cold backup files stored in the first backup step in the dedicated storage bucket are deleted.
[0144] In some embodiments of the present application, based on the aforementioned solution, the storage unit 920 is configured to: export the metadata of the metadata operation log in the metadata storage system as a second backup file, and store the second backup file as a log metadata backup result in a target file system independent of the object storage system; and / or
[0145] The metadata of the metadata operation log is encoded, and the encoding result is printed as the log metadata backup result into the object data of the metadata operation log in the object data storage system.
[0146] In some embodiments of the present application, based on the aforementioned scheme, the saving unit 920 is configured as follows: at predetermined intervals, based on the generation of a new metadata operation log file, obtain the metadata operation log from the generated metadata operation log file that has not been backed up, and back up the metadata operation log as an object to the dedicated storage bucket.
[0147] In some embodiments of the present application, based on the aforementioned scheme, the acquisition and backup unit is configured to: build a new metadata storage system in the object storage system; obtain the metadata of the cold backup file based on the first backup file, and restore the object data of the cold backup file from the object data storage system based on the metadata of the cold backup file; obtain the metadata of the corresponding target object based on the object data and metadata of the cold backup file, and write the metadata of the target object into the new metadata storage system; generate metadata of the metadata operation log based on the log metadata backup result; obtain the metadata operation log based on the object data of the metadata operation log and the metadata of the metadata operation log, and update the metadata of the target object based on the metadata operation log.
[0148] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a file synchronization unit; after storing the first backup file in a target file system independent of the object storage system, the file synchronization unit is used to: synchronize the first backup file from the target file system to at least one other file system.
[0149] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0150] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0151] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method described in the above embodiment. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through the bus 1004. The input / output (I / O) interface 1005 is also connected to the bus 1004.
[0152] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0153] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0154] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0155] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0156] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0157] As one aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0158] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0159] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0160] It can be understood that in the specific implementation of the present application, the storage of object data is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0161] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0162] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for backing up metadata in an object storage system. It is characterized in that The object storage system includes an object data storage system and a metadata storage system. In the object storage system, objects are stored in buckets as carriers. The method includes: Exporting metadata of a target object stored in the metadata storage system as a cold backup file, wherein the object data of the target object is stored in the object data storage system; The cold backup file is stored as an object in a dedicated storage bucket, the object storage system stores the object data of the cold backup file in the object data storage system, and the metadata of the cold backup file is stored in the metadata storage system, wherein the dedicated storage bucket is different from the storage bucket to which the target object belongs; The metadata of the cold backup file in the metadata storage system is exported as a first backup file, and the first backup file is stored in a target file system independent of the object storage system.
2. The method for backing up metadata in an object storage system according to claim 1, It is characterized in that After storing the first backup file in a target file system independent of the object storage system, the method further includes: If the metadata storage system fails, the first backup file is obtained from the target file system, and the metadata of the target object is restored in the object storage system according to the first backup file.
3. The method for backing up metadata in an object storage system according to claim 2, It is characterized in that Before restoring the metadata of the target object in the object storage system according to the first backup file, the method further includes: Obtaining a metadata operation log, and backing up the metadata operation log as an object to the dedicated storage bucket, so as to store object data of the metadata operation log in the object data storage system, and storing metadata of the metadata operation log in the metadata storage system; Backing up the metadata of the metadata operation log to obtain a log metadata backup result; Restoring the metadata of the target object in the object storage system according to the first backup file includes: The metadata of the target object is restored in the object storage system according to the first backup file, the object data of the metadata operation log, and the log metadata backup result.
4. The method for backing up metadata in an object storage system according to claim 1, It is characterized in that The storing the cold backup file as an object in a dedicated storage bucket includes: Performing a backup step regularly, the backup step comprising: storing cold backup files corresponding to metadata of all objects in the metadata storage system as objects in a dedicated storage bucket; The step of exporting the metadata of the cold backup file in the metadata storage system as a first backup file, and storing the first backup file in a target file system independent of the object storage system, comprises: Whenever the backup step is completed and / or whenever a predetermined time is reached, the metadata of the cold backup file in the metadata storage system is exported as a first backup file, and the first backup file is stored in a target file system independent of the object storage system.
5. The method for backing up metadata in an object storage system according to claim 4, It is characterized in that The step of regularly performing backup comprises: When the time to perform the backup step is reached, if the dedicated storage bucket has stored cold backup files previously stored in a predetermined number of backup steps, the cold backup files stored in the first backup step in the dedicated storage bucket are deleted.
6. The method for backing up metadata in an object storage system according to claim 3, It is characterized in that The step of backing up the metadata of the metadata operation log to obtain a log metadata backup result includes: Exporting the metadata of the metadata operation log in the metadata storage system as a second backup file, and storing the second backup file as a log metadata backup result in a target file system independent of the object storage system; and / or The metadata of the metadata operation log is encoded, and the encoding result is printed as the log metadata backup result into the object data of the metadata operation log in the object data storage system.
7. The method for backing up metadata in an object storage system according to claim 3, It is characterized in that The step of obtaining the metadata operation log and backing up the metadata operation log as an object to the dedicated storage bucket includes: At predetermined intervals, based on the generation of a new metadata operation log file, the metadata operation log is obtained from the generated metadata operation log file that has not been backed up, and the metadata operation log is backed up as an object in the dedicated storage bucket.
8. The method for backing up metadata in an object storage system according to claim 3, It is characterized in that The restoring the metadata of the target object in the object storage system according to the first backup file, the object data of the metadata operation log, and the log metadata backup result includes: Building a new metadata storage system in the object storage system; Obtaining metadata of a cold backup file according to the first backup file, and restoring object data of the cold backup file from the object data storage system according to the metadata of the cold backup file; Obtaining metadata of a corresponding target object according to the object data and metadata of the cold backup file, and writing the metadata of the target object into the new metadata storage system; Generate metadata of the metadata operation log according to the log metadata backup result; A metadata operation log is obtained according to the object data of the metadata operation log and the metadata of the metadata operation log, and the metadata of the target object is updated according to the metadata operation log.
9. The method for backing up metadata in an object storage system according to any one of claims 1 to 8, It is characterized in that After storing the first backup file in a target file system independent of the object storage system, the method further includes: The first backup file is synchronized from the target file system to at least one other file system.
10. A metadata backup device in an object storage system, It is characterized in that The object storage system includes an object data storage system and a metadata storage system. In the object storage system, objects are stored in buckets as carriers. The device includes: An export unit, configured to export metadata of a target object stored in the metadata storage system as a cold backup file, wherein the object data of the target object is stored in the object data storage system; a storage unit, configured to store the cold backup file as an object in a dedicated storage bucket, wherein the object storage system stores the object data of the cold backup file in the object data storage system, and stores the metadata of the cold backup file in the metadata storage system, wherein the dedicated storage bucket is different from the storage bucket to which the target object belongs; The export and storage unit is used to export the metadata of the cold backup file in the metadata storage system as a first backup file, and store the first backup file in a target file system independent of the object storage system.
11. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for backing up metadata in an object storage system according to any one of claims 1 to 9 is implemented.
12. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the metadata backup method in the object storage system as described in any one of claims 1 to 9.
13. A computer program product, It is characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for backing up metadata in an object storage system as described in any one of claims 1 to 9.
