System and method for implementing minio real-time disaster recovery
By designing a real-time disaster recovery system in MinIO to monitor and synchronize events on the source and disaster recovery sides in real time, the problem of data loss and data inconsistency in the MinIO service when the storage node is damaged is solved, and high availability and robustness are achieved.
Patent Information
- Application Number
- PCT/CN2023/142697
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-13
- Filing Date
- 2023-12-28
- Publication Date
- 2024-10-17
AI Technical Summary
When more than half of the storage nodes of the MinIO service suffered physical damage, the instance became unavailable, causing a catastrophic production accident. In addition, when the MinIO Client was writing in parallel, the source and disaster recovery side data were inconsistent due to network reasons.
A system is designed to implement MinIO real-time disaster recovery, including a connection processing module, a full data comparison module, an event monitoring module and an object event processing module. It maintains the disaster recovery service connection through the SDK, monitors and synchronizes the buckets on the source side and the disaster recovery side in real time. and object events, using full and incremental data synchronization to ensure data consistency.
Real-time backup of the MinIO service is realized, avoiding data loss, solving data inconsistency problems caused by parallel uploads, ensuring high availability and robustness of the service, and allowing quick switching to the disaster recovery side.
Smart Images

Figure CN2023142697_17102024_PF_FP_ABST
Abstract
Description
A system and method for implementing MinIO real-time disaster recovery Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to a system and method for implementing MinIO real-time disaster recovery. Background Art
[0002] MinIO is a high-performance, distributed object storage system. Unlike traditional storage and other object storage, its software architecture was designed from the beginning for private cloud standards with higher performance requirements. It is designed in a more user-friendly way and can realize all the functions required for object storage. It is also more powerful in performance and will not compromise on ease of use and efficiency for more business functions. It can more easily implement native object storage services with elastic scalability.
[0003] To ensure the high availability of MinIO, you can deploy MinIO in distributed deployment mode, in which MinIO uses a distributed algorithm to ensure high availability and data redundancy. Minio uses Reed-Solomon code to split objects into N / 2 data and N / 2 parity blocks. This means that if there are 12 disks, an object will be divided into 6 data blocks and 6 parity blocks. If any 6 disks are lost (regardless of whether they store data blocks or parity blocks), the data can still be recovered from the remaining disks. When a node goes down, other nodes can automatically take over the data blocks of the node and continue to provide services, and the data will be automatically restored after the node comes back online, thus ensuring the high availability of the service.
[0004] However, if more than half of the MinIO storage nodes suffer physical damage, the entire MinIO instance will become unavailable, resulting in all data loss and a catastrophic production accident. When real-time synchronization of MinIO services is required for disaster recovery, MinIO provides the MinIO Client to synchronize data to the disaster recovery MinIO in real time. However, when the MinIO Client writes files in parallel, network problems may cause inconsistencies between the source and disaster recovery data. For example, if the source MinIO writes file A.pdf twice simultaneously, the MinIO Client will synchronize both changes to the disaster recovery MinIO. However, there is no guarantee that the final file version on the disaster recovery MinIO will be the second uploaded file A.pdf. Instead, it depends on the MinIO Client. The file uploaded later during the two synchronizations will be the file on the disaster recovery side. If the second upload is completed later than the first upload, data inconsistency will occur.
[0005] Summary of the Invention
[0006] The purpose of the present invention is to provide a system and method for implementing MinIO real-time disaster recovery, aiming to solve the problem in the prior art that more than half of the MinIO service nodes suffer physical damage, making the instance unavailable, leading to catastrophic production accidents.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A system for implementing MinIO real-time disaster recovery includes: a connection processing module, a full data comparison module, an event monitoring module, a bucket event processing module, and an object event processing module. The connection processing module is used to maintain the connection between the disaster recovery service and the source MinIO service and the disaster recovery MinIO service, ensuring that the connection between the disaster recovery service and the services at both ends is normal and available for other modules to obtain connections. The full data comparison module is used to perform a full comparison of the bucket data and object data already existing in the MinIO services at both the source and disaster recovery ends when disaster recovery is initiated. The event monitoring module is responsible for real-time monitoring of bucket events and object events of the source MinIO service. The object event processing module is responsible for parallel processing of object event synchronization tasks submitted by the event monitoring module and the full data comparison module.
[0009] As a preferred solution of the present invention, when the full data comparison module performs a full comparison between bucket data and object data, the bucket data has a higher priority than the object data.
[0010] As a preferred solution of the present invention, the event monitoring module is also used to submit the task of converting bucket event content into bucket event processing module to the bucket event processing module, and submit the task of converting object event content into object event processing module to the object event processing module.
[0011] A method for implementing MinIO real-time disaster recovery, the method including: a data synchronization process, a data comparison execution process, an object synchronization event processing process, and a thread execution task processing process.
[0012] As a preferred solution of the present invention, the data synchronization process specifically includes the following steps:
[0013] Step S11: The user applies to initiate a MinIO synchronization task and submits the source MinIO service information and the disaster recovery MinIO service information;
[0014] Step S12: The synchronization service obtains the source MinIO Client object with event monitoring based on the source MinIO service information through the SDK;
[0015] Step S13: The synchronization service obtains the MinIO Client object on the disaster recovery side according to the MinIO service information on the disaster recovery side through the SDK.
[0016] Step S14: Use the listBuckets method of the SDK to obtain all bucket information of the source MinIO service and the disaster recovery MinIO service respectively.
[0017] Step S15: Loop through the bucket information of the source MinIO service and compare it with the bucket information of the disaster recovery MinIO to find the bucket data that exists in the source MinIO but not in the disaster recovery MinIO.
[0018] Step S16: Use the SDK's makeBucket method to create a bucket on the disaster recovery MinIO that exists on the source MinIO but does not exist on the disaster recovery MinIO.
[0019] Step S17: Enable event monitoring for the source MinIO service (bucket event monitoring + object event monitoring).
[0020] Step S18: Synchronize the existing object difference comparison and synchronization tasks between the source MinIO service and the disaster recovery MinIO service, and monitor the event object synchronization tasks. At this time, the synchronization service simultaneously performs full data synchronization and incremental data synchronization to ensure data consistency between the source MinIO and the disaster recovery MinIO.
[0021] Step S19: The synchronization queue continuously consumes messages in the queue, obtains object data from the source MinIO service based on the object information, and synchronizes the data to the disaster recovery MinIO service.
[0022] As a preferred solution of the present invention, in step S18, the object differences between the source MinIO service and the disaster recovery MinIO service are compared and synchronized, and all object data of the source and disaster recovery sides are obtained respectively through the listObjects() method of the SDK; all objects on the source side are looped, and the object data of the disaster recovery side MinIO is compared with the information of the source side objects; when the object does not exist on the disaster recovery side or the object data is inconsistent, the object information is pushed into the task queue to be synchronized of the synchronization service.
[0023] As a preferred solution of the present invention, the data comparison execution process specifically includes the following steps:
[0024] Step S21: When traversing the source MinIO object data, obtain the source object metadata;
[0025] Step S22: traverse the MinIO objects on the disaster recovery side and obtain object metadata;
[0026] Step S23: Taking the source object as a reference, obtain the object data of the disaster recovery end with the same name:
[0027] Step S231: If there are objects with the same name, continue comparing;
[0028] Step S232: If there is no object with the same name, it means that the disaster recovery end does not have the information of the current object on the source end, and the object data of the current source end is pushed into the object synchronization queue;
[0029] Step S24: Determine whether the source object does not have version numbers enabled and there is an object with the same name on the disaster recovery side whose modification time is later than the modification time of the source object. If so, the object currently processed by the source is considered to be a previous version of the object on the disaster recovery side, that is, the currently processed object does not need to be synchronized to the disaster recovery side. If this is not the case, continue determining.
[0030] Step S25: Determine whether the disaster recovery object meets the conditions. If so, the objects are considered to be the same object and there is no need to synchronize the current source object.
[0031] Step S26: If the condition is not met in step S25, it is determined that if the source end opens the version number and it is determined that it is not the same object, the disaster recovery end has object data with the version number, and the exception handling strategy is triggered.
[0032] As a preferred solution of the present invention, in the step S25 of judging whether the disaster recovery end object meets the conditions, the conditions include equal size, equal user metadata and equal object modification time.
[0033] As a preferred solution of the present invention, the object synchronization event processing process specifically includes the following steps:
[0034] Step S31: Queue data is derived from object events received from the full synchronization and incremental event steps.
[0035] Step S32: Determine whether a thread pool for object event processing has been created. If not, create a thread pool for object event processing first. Select ArrayBlockingQueue as the thread pool queue and CallerRunsPolicy as the rejection policy. When the thread pool is full, the event listening thread is used to execute the object event to improve processing efficiency.
[0036] Step S33: Determine whether the current object has no version number:
[0037] Step S331: If there is a version number, directly submit the task to the thread pool and end the process;
[0038] Step S332: If there is no version number: determine whether the same type of task has been submitted: if the same type of task has been submitted, add the current event information to the waiting queue in the ConcurrentHashMap and end the process; if it has not been submitted, submit the task to the thread pool, and submit the current event information to the ConcurrentHashMap, and end the process.
[0039] As a preferred solution of the present invention, the following:
[0040] Step S41: The thread pool starts to continuously process the line synchronization task;
[0041] Step S42: After consuming an object synchronization task, determine whether the current object has no version number:
[0042] Step S421: If there is a version number, the current task processing is completed and the process ends;
[0043] Step S422: If there is no version number, check whether there is a waiting queue with the same name in ConcurrentHashMap:
[0044] Step S4221: If there is no waiting queue, the current task processing is completed and the process ends;
[0045] Step S4222: If there is a waiting queue, the object synchronization task with the latest time is taken to enter this process recursively until all tasks in the waiting queue are executed and the process ends.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] This invention implements real-time backup of MinIO services, avoiding the loss of all data and catastrophic production accidents when more than half of the MinIO storage nodes suffer physical damage; it also solves the problem of data inconsistency caused by parallel uploads of MinIO clients; it can choose peer-to-peer deployment or apeer deployment to rationally utilize resources, and when a fault occurs on the source side, it can quickly switch to the disaster recovery side MinIO for use, ensuring the robustness and high availability of the service. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0049] FIG1 is a flowchart of a system and method for implementing MinIO real-time disaster recovery according to the present invention for monitoring real-time disaster recovery MinIO services;
[0050] FIG2 is a schematic diagram of a data synchronization process in a system and method for implementing MinIO real-time disaster recovery according to the present invention;
[0051] FIG3 is a schematic diagram of a data comparison execution process in a system and method for implementing MinIO real-time disaster recovery according to the present invention;
[0052] FIG4 is a schematic diagram of an object synchronization event processing flow in a system and method for implementing MinIO real-time disaster recovery according to the present invention;
[0053] FIG5 is a schematic diagram of a thread execution task processing flow in a system and method for implementing MinIO real-time disaster recovery according to the present invention. DETAILED DESCRIPTION
[0054] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0055] Example 1
[0056] Please refer to Figures 1 to 5. The present invention provides the following technical solutions:
[0057] A system for implementing MinIO real-time disaster recovery includes: a connection processing module, a full data comparison module, an event monitoring module, a bucket event processing module, and an object event processing module. The connection processing module is used to maintain the connection between the disaster recovery service and the source MinIO service and the disaster recovery MinIO service, ensuring that the connection between the disaster recovery service and the services at both ends is normal and available for other modules to obtain connections. The full data comparison module is used to perform a full comparison of the existing bucket data and object data of the MinIO services on both the source and disaster recovery ends when disaster recovery is initiated. The event monitoring module is responsible for real-time monitoring of bucket events and object events of the source MinIO service. The object event processing module is responsible for parallel processing of object event synchronization tasks submitted by the event monitoring module and the full data comparison module.
[0058] Specifically, when the full data comparison module performs a full comparison of bucket data and object data, the bucket data has a higher priority than the object data.
[0059] Specifically, the event monitoring module is further used to submit the task of converting bucket event content into bucket event processing module to the bucket event processing module, and submit the task of converting object event content into object event processing module to the object event processing module.
[0060] In a specific embodiment of the present invention, the present invention uses the SDK to monitor bucket events and object events of the source MinIO service in real time, and reproduces the content of the event on the MinIO service of the disaster recovery end through the query, download, upload, and delete methods of the SDK, so as to achieve real-time disaster recovery of the MinIO service.
[0061] This system mainly includes five modules: connection processing module, full data comparison module, event monitoring module, bucket event processing module and object event processing module.
[0062] The connection processing module is responsible for maintaining the connection between the disaster recovery service and the source MinIO service and the disaster recovery MinIO service, ensuring that the connection between the disaster recovery service and the services at both ends is normal and available, so that other modules can obtain the connection and call the SDK method to process the data of the MinIO service.
[0063] The full data comparison module is responsible for performing a full comparison of the existing bucket and object data on both the source and disaster recovery MinIO servers when a disaster recovery is initiated. The full comparison of the bucket data is performed first, and if any inconsistencies are found, the bucket data is synchronized to the disaster recovery server. After the full comparison of the bucket data is completed, the incremental synchronization event listener module is enabled before performing a full comparison of the object data to ensure that no changes to the source MinIO data are lost during the full comparison of the object data (both full and incremental synchronization are performed simultaneously). When the full comparison of the object data is performed, the object name, version number, last modified time, size, and userMetadata are checked for consistency. If all are the same, the object data does not need to be synchronized. If any of them are inconsistent, the object data synchronization task is submitted to the object synchronization event processing module.
[0064] The event monitoring module is responsible for real-time monitoring of bucket events (additions, deletions, and modifications) and object events (additions, deletions, and modifications) of the source MinIO service, and submitting the task of converting bucket event content into bucket event processing module to the bucket event processing module, and submitting the task of converting object event content into object event processing module to the object event processing module.
[0065] The bucket event processing module is responsible for parallel processing of bucket event synchronization tasks submitted by the event listening module. To improve data synchronization efficiency, a bucket event processing thread pool is used to synchronize data in parallel across multiple threads. The thread pool queue is ArrayBlockingQueue (multi-thread safe and bounded), and the rejection policy is CallerRunsPolicy (when the thread pool is full, the submitting thread is used to execute the task).
[0066] The object event processing module is responsible for parallel processing of object event synchronization tasks submitted by the event listening module and the full data comparison module. To improve data synchronization efficiency, the object event processing thread pool is used, with multiple threads synchronizing data in parallel. The thread pool queue is ArrayBlockingQueue (multi-thread safe and bounded), and the rejection policy is CallerRunsPolicy (when the thread pool is full, the submitting thread is used to execute the task).
[0067] Specifically, a method for implementing MinIO real-time disaster recovery includes: a data synchronization process, a data comparison execution process, an object synchronization event processing process, and a thread execution task processing process.
[0068] In this embodiment, since multi-threaded object data synchronization is used, in order to avoid the problem of data inconsistency caused by parallel modification as described in the background, the object processing thread of this solution is designed as follows: when the source MinIO service has enabled the object version number, there is no data inconsistency problem (synchronization version number) because the version number is used as an identifier; when the source MinIO service has not enabled the object version number, a ConcurrentHashMap (key is the synchronization data id + source bucket name + source object name) is used to save the key of the unenabled version number being executed and its corresponding task list. The program cannot operate on this ConcurrentHashMap in parallel, and reading, modifying, and deleting can only be executed serially. When a thread obtains a synchronization task without a version number, it obtains the key value of the current object data and first determines whether ConcurrentHashMap already has data for that key. If so, the current task is added to the task list corresponding to the key. If no data exists, data for that key is added to ConcurrentHashMap. When the thread pool executes a task, if it is a synchronization task without a version number, after the current task is completed, it will try to obtain data from ConcurrentHashMap using the key corresponding to the current task. If data is obtained, the value of that key in ConcurrentHashMap is cleared, and the current thread continues to execute the obtained task list. After executing the currently obtained list, it will try to obtain data from ConcurrentHashMap using the key corresponding to the current task again. This process is repeated until no data for that key is obtained and the current synchronization task of the object is completed. This solves the problem of data inconsistency caused by concurrent uploads.
[0069] For details, please refer to Figure 2. When initiating a synchronization task, the synchronization process (including bucket data synchronization processing) is as follows:
[0070] Step S11: The user applies to initiate a MinIO synchronization task and submits the source MinIO service information (login URL, account number, password) and the disaster recovery MinIO service information (login URL, account number, password).
[0071] Step S12: The synchronization service obtains the source MinIO Client object with event monitoring through the SDK according to the source MinIO service information (login URL, account number, password);
[0072] Step S13: The synchronization service obtains the MinIO Client object on the disaster recovery side through the SDK according to the MinIO service information (login URL, account number, password) on the disaster recovery side.
[0073] Step S14: Use the listBuckets() method of the SDK to obtain all bucket information of the source MinIO service and the disaster recovery MinIO service respectively.
[0074] Step S15: Loop through the bucket information of the source MinIO service and compare it with the bucket information of the disaster recovery MinIO to find the bucket data that exists in the source MinIO but not in the disaster recovery MinIO.
[0075] Step S16: Use the SDK's makeBucket() method to create a bucket on the disaster recovery side that exists on the source side's MinIO but does not exist on the disaster recovery side's MinIO.
[0076] Step S17: Enable event monitoring for the source MinIO service (bucket event monitoring + object event monitoring).
[0077] Step S18: Synchronize the existing object difference comparison and synchronization between the source MinIO service and the disaster recovery MinIO service, and monitor the event object synchronization task. At this time, the synchronization service performs full data synchronization and incremental data synchronization at the same time to ensure data consistency between the source MinIO and the disaster recovery MinIO:
[0078] Step S181: Compare and synchronize the object differences between the source MinIO service and the disaster recovery MinIO service: Use the SDK's listObjects() method to obtain all object data on the source and disaster recovery sides respectively; loop through all objects on the source side and compare the MinIO object data on the disaster recovery side with the source object information; if the object does not exist on the disaster recovery side or the object data is inconsistent, push the object information into the task queue to be synchronized in the synchronization service;
[0079] Step S182: Continuously monitor the object change events of the source MinIO service. When a change event is received, push the object information into the task queue to be synchronized in the synchronization service.
[0080] Step S19: The synchronization queue continuously consumes messages in the queue, obtains object data from the source MinIO service based on the object information, and synchronizes the data to the disaster recovery MinIO service.
[0081] Please refer to Figure 3 for details. After initiating synchronization, the comparison process of the existing source MinIO object data with the existing disaster recovery MinIO object data is as follows:
[0082] Step S21: When traversing the source MinIO object data, obtain the source object metadata;
[0083] Step S22: traverse the MinIO objects on the disaster recovery side and obtain object metadata;
[0084] Step S23: Taking the source object as a reference, obtain the object data of the disaster recovery end with the same name:
[0085] Step S231: If there are objects with the same name, continue comparing;
[0086] Step S232: If there is no object with the same name, it means that the disaster recovery end does not have the information of the current object on the source end, and the object data of the current source end is pushed into the object synchronization queue;
[0087] Step S24: Determine whether the source object does not have version numbers enabled and there is an object with the same name on the disaster recovery side whose modification time is later than the modification time of the source object. If so, the object currently processed by the source is considered to be a previous version of the object on the disaster recovery side, that is, the currently processed object does not need to be synchronized to the disaster recovery side. If this is not the case, continue determining.
[0088] Step S25: Determine whether the objects on the disaster recovery side meet the following conditions: 1. Equal size, 2. Equal user metadata, and 3. Equal object modification time. If so, the objects are considered to be the same object and there is no need to synchronize the current source object.
[0089] Step S26: If step S25 is not satisfied, it is determined that if the source end opens the version number and it is determined that it is not the same object, the disaster recovery end has object data with the version number, and the exception handling strategy is triggered.
[0090] Please refer to Figure 4 for details. The object synchronization event processing flow is as follows:
[0091] Step S31: Queue data is derived from object events received from the full synchronization and incremental event steps.
[0092] Step S32: Determine whether a thread pool for object event processing has been created. If not, create a thread pool for object event processing first (lazy loading). Select ArrayBlockingQueue (multi-threaded safety, bounded) as the thread pool queue, and select CallerRunsPolicy (when the thread pool is full, use the submitted thread to execute the task) as the rejection policy. When the thread pool is full, the event listening thread is also used to execute the object event to improve processing efficiency.
[0093] Step S33: Determine whether the current object has no version number (to handle the scenario where one-way synchronization of objects with the same name leads to data inconsistency):
[0094] Step S331: If there is a version number, directly submit the task to the thread pool and end the process;
[0095] Step S332: If there is no version number:
[0096] Step S3321, determine whether the same type of task has been submitted (use ConcurrentHashMap with key as the unique value of the object file to store the task record that has been submitted to the thread pool): If the same type of task has been submitted, just add the current event information to the waiting queue in the ConcurrentHashMap and end the process; if it has not been submitted, submit the task to the thread pool, and submit the current event information to the ConcurrentHashMap, and end the process.
[0097] Please refer to Figure 5 for details. The thread execution task processing flow when the object synchronization task is not enabled is as follows:
[0098] Step S41: The thread pool starts to continuously process the line synchronization task;
[0099] Step S42: After consuming an object synchronization task, determine whether the current object has no version number:
[0100] Step S421: If there is a version number, the current task processing is completed and the process ends;
[0101] Step S422: If there is no version number, check whether there is a waiting queue with the same name in ConcurrentHashMap:
[0102] Step S4221: If there is no waiting queue, the current task processing is completed and the process ends;
[0103] Step S4222: If there is a waiting queue, the object synchronization task with the latest time is taken to enter this process recursively until all tasks in the waiting queue are executed and the process ends.
[0104] Example 2
[0105] The present invention also provides a specific implementation step, which is as follows:
[0106] S1: Deploy the source MinIO service in the source environment. Taking Linux as an example, execute
[0107] S2: Deploy the disaster recovery MinIO service in the disaster recovery environment. Taking Linux as an example, execute
[0108] S3: Deploy the MinIO synchronization service system and ensure smooth network connectivity between the MinIO synchronization service and the source and disaster recovery ends.
[0109] S4: Initiate a MinIO disaster recovery request to the MinIO synchronization service system, submitting the source MinIO service information (login URL, account, password) and the disaster recovery MinIO service information (login URL, account, password);
[0110] S5: After the MinIO synchronization service system establishes a connection with the source MinIO and the disaster recovery MinIO, it starts full and incremental data synchronization;
[0111] S6: MinIO synchronization service is running, and the real-time disaster recovery source MinIO service is running.
[0112] This invention implements real-time backup of MinIO services, avoiding the loss of all data and catastrophic production accidents when more than half of the MinIO storage nodes suffer physical damage; it also solves the problem of data inconsistency caused by parallel uploads of MinIO clients; it can choose peer-to-peer deployment or apeer deployment to rationally utilize resources, and when a fault occurs on the source side, it can quickly switch to the disaster recovery side MinIO for use, ensuring the robustness and high availability of the service.
[0113] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A system for implementing MinIO real-time disaster recovery, characterized in that: include: Connection processing module, full data comparison module, event monitoring module, bucket event processing module and object event processing module. The connection processing module is used to maintain the connection between the disaster recovery service and the source MinIO service and the disaster recovery MinIO service, ensuring that the connection between the disaster recovery service and the services at both ends is normal and available for other modules to obtain connections. The full data comparison module is used to perform a full comparison of the existing bucket data and object data of the MinIO services at both the source and disaster recovery ends when initiating disaster recovery. The event monitoring module is responsible for real-time monitoring of the bucket events and object events of the source MinIO service. The object event processing module is responsible for parallel processing of object event synchronization tasks submitted by the event monitoring module and the full data comparison module.
2. A system for implementing MinIO real-time disaster recovery according to claim 1, characterized in that: When the full data comparison module performs a full comparison between bucket data and object data, the bucket data has a higher priority than the object data.
3. A system for implementing MinIO real-time disaster recovery according to claim 2, characterized in that: The event monitoring module is also used to submit the task of converting the bucket event content into the bucket event processing module to the bucket event processing module, and submit the task of converting the object event content into the object event processing module to the object event processing module.
4. A method for implementing MinIO real-time disaster recovery, applied to a system for implementing MinIO real-time disaster recovery as described in any one of claims 1 to 3, characterized in that: The method includes: a data synchronization process, a data comparison execution process, an object synchronization event processing process and a thread execution task processing process.
5. A method for implementing MinIO real-time disaster recovery according to claim 4, characterized in that: The data synchronization process specifically includes the following steps: Step S11: The user applies to initiate a MinIO synchronization task and submits the source MinIO service information and the disaster recovery end MinIO service information; Step S12: The synchronization service obtains the source MinIO Client object with event monitoring according to the source MinIO service information through the SDK; Step S13: The synchronization service obtains the disaster recovery end MinIO service information through the SDK. MinIO Client object; Step S14: Obtain all bucket information of the source MinIO service and the disaster recovery MinIO service through the listBuckets method of the SDK. Step S15: loop through the bucket information of the source MinIO service, compare it with the bucket information of the disaster recovery MinIO, and find out the bucket data that exists in the source MinIO but does not exist in the disaster recovery MinIO; Step S16: Use the makeBucket method of the SDK to create bucket data on the disaster recovery MinIO that exists on the source MinIO but does not exist on the disaster recovery MinIO. Step S17: Enable event monitoring for the source MinIO service (bucket event monitoring + object event monitoring); Step S18: Synchronize the existing object difference comparison synchronization and event object synchronization tasks between the source MinIO service and the disaster recovery MinIO service. At this time, the synchronization service performs full data synchronization and incremental data synchronization at the same time to ensure data consistency between the source MinIO and the disaster recovery MinIO. Step S19: The synchronization queue continuously consumes messages in the queue, obtains object data from the source MinIO service according to the object information, and synchronizes the data to the disaster recovery end MinIO service.
6. A method for implementing MinIO real-time disaster recovery according to claim 5, characterized in that: In step S18, the object differences between the source MinIO service and the disaster recovery MinIO service are compared and synchronized, and all object data of the source and disaster recovery ends are obtained respectively through the listObjects() method of the SDK; all objects of the source end are looped, and the object data of the disaster recovery MinIO is looped and compared according to the information of the source end objects; when the object does not exist on the disaster recovery end or the object data is inconsistent, the information of the object is pushed into the task queue to be synchronized of the synchronization service.
7. A method for implementing MinIO real-time disaster recovery according to claim 6, characterized in that: The data comparison execution process specifically includes the following steps: Step S21, when traversing the source MinIO object data, obtain the object meta information of the source; Step S22, traverse the objects of MinIO on the disaster recovery end and obtain object metadata; Step S23: Taking the source object as a reference, obtain the object data of the disaster recovery end with the same name: Step S231: If there are objects with the same name, continue to compare; Step S232: If there is no object with the same name, it means that the disaster recovery end does not have the information of the current object on the source end, and the object data of the current source end is pushed into the object synchronization queue; Step S24: determine whether the source object has no version number enabled and there is an object with the same name on the disaster recovery end whose modification time is greater than the modification time of the source object, then the object currently processed by the source end is deemed to be a version before the disaster recovery end object, that is, the currently processed object does not need to be synchronized to the disaster recovery end; if this is not the case, continue to determine; Step S25: determine whether the disaster recovery end object meets the conditions. If so, they are considered to be the same object and there is no need to synchronize the current source end object. Step S26: If the condition is not met in step S25, it is determined that if the source end opens the version number and it is determined that it is not the same object, the disaster recovery end has object data of the version number, and the exception handling strategy is triggered.
8. A method for implementing MinIO real-time disaster recovery according to claim 7, characterized in that: In the step S25 of determining whether the disaster recovery end object satisfies the conditions, the conditions include equal size, equal user metadata, and equal object modification time.
9. A method for implementing MinIO real-time disaster recovery according to claim 8, characterized in that: The object synchronization event processing process specifically includes the following steps: Step S31, the queue data comes from receiving the object events submitted from the full synchronization and incremental event steps; Step S32, determine whether the thread pool for object event processing has been created. If not, create a thread pool for object event processing first. The thread pool queue selects ArrayBlockingQueue, and the rejection policy selects CallerRunsPolicy. When the thread pool is full, the event listening thread is used to execute the object event to improve processing efficiency. Step S33: Determine whether the current object has no version number: Step S331: If there is a version number, directly submit the task to the thread pool and end the process; Step S332, if there is no version number: determine whether a similar task has been submitted: if a similar task has been submitted, add the current event information to the waiting queue in the ConcurrentHashMap, and end the process; If it has not been submitted, the task will be submitted to the thread pool, and the information of the current event will be submitted to ConcurrentHashMap, and then the process will end.
10. A method for implementing MinIO real-time disaster recovery according to claim 9, characterized in that: Said: Step S41, the thread pool starts to continuously process the line synchronization task; Step S42: After consuming an object synchronization task, determine whether the current object has no version number: Step S421, if there is a version number, the current task processing is completed and the process ends; Step S422: If there is no version number, check whether there is a waiting queue with the same name in ConcurrentHashMap: Step S4221: If there is no waiting queue, the current task processing is completed and the process ends; Step S4222: If there is a waiting queue, the object synchronization task with the latest time is taken to enter this process recursively until all tasks in the waiting queue are executed and the process ends.
Citation Information
Patent Citations
MinIO-based industrial quality inspection file distributed storage system and method
CN112579567A
Object storage incremental backup method, system, equipment and medium
CN116467118A
Object storage data backup method and device and storage medium
CN117009143A
Computational storage in a function-as-a-service architecture
EP4180958A1
