Method for realizing data balance in distributed storage system

By implementing automatic migration and balancing of the PG layer in a distributed storage system using intelligent algorithms, the problem of uneven data distribution is solved, and the system's resource utilization and reliability are improved.

CN121143718APending Publication Date: 2025-12-16SHANDONG CHAOYUE DATA CONTROL ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511204391.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

In distributed storage systems, uneven data distribution leads to uneven disk load, affecting IO speed and system reliability. Furthermore, scaling up or down may cause imbalances in the PG layer, resulting in wasted space and stability issues.

Method used

The system uses intelligent algorithms to automatically migrate and balance the PG layer on the disk, including manual and automatic balancing strategies. It calculates the target PG layer number by combining disk capacity weight and system total weight, dynamically adjusts the amount of data to be migrated, and supports custom time periods and busy monitoring.

Benefits of technology

It achieves optimal data balance in the storage system, improves resource utilization, avoids uneven disk pressure and capacity usage, and enhances system performance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121143718A_ABST
    Figure CN121143718A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a method for realizing data balance in a distributed storage system. According to the method for realizing the data balance in the distributed storage system, the maximum tolerance variance of the data balance is customized and set according to the actual condition of an application scene; a manual equalization strategy / automatic equalization strategy is set based on an intelligent PG layer equalization algorithm, the automatic equalization strategy supports control of time for implementing automatic equalization by taking a month, a week or a day as a unit and supports custom setting of a time period for executing automatic equalization, and a system executes equalization actions according to the manual equalization strategy / automatic equalization strategy. According to the method for realizing data balance in the distributed storage system, manual balance or automatic balance strategy execution is performed on the storage system through an intelligent balance algorithm, so that the data reaches an optimal balance state in the storage system, and non-uniform disk pressure and non-uniform capacity occupation in the system can be effectively avoided; and the resource utilization rate of the storage system is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data balancing, in particular to a method for realizing data balancing in a distributed storage system. BACKGROUND

[0002] In a distributed storage system, storage capacity, system reliability and system performance are three insurmountable mountains. In the case of safe and reliable storage system and limited cost, it is extremely important to use limited resources to obtain the maximum storage capacity and fully exert the performance of the system hardware.

[0003] The storage resources in the storage system are composed of a large number of disks, and the balancing degree of data on the disks has a great influence on the performance, reliability and capacity use of the distributed storage. When the data is not balanced, it will cause the load of some disks or all disks of a node to be too high, affecting the IO speed and causing performance bottlenecks; the load of a single disk being too high will also cause the disk life to be reduced, affecting the system reliability; and the overload of some disks will also cause the entire storage system to be unable to write data. Therefore, it is particularly important to balance the data in the distributed storage system.

[0004] The data management method in the storage system is generally to slice the data by striping, and the sliced data is mapped to the logical layer (i.e. PG layer) by hash algorithm. The PG layer is a logical carrier for data storage, and fully manages the storage space of the disk. If the PG layer is not evenly distributed on the disk, it will inevitably lead to unbalanced data storage on the disk, causing a lot of space waste and other stability problems. Even if the PG layer is balanced at the initial stage of system deployment, the subsequent expansion and contraction of the disk or node will also lead to unbalanced PG layer.

[0005] To solve the above problems, the present application provides a method for realizing data balancing in a distributed storage system, which aims to realize data balancing and reduce the operation and maintenance complexity of the storage system through intelligent algorithm. SUMMARY

[0006] The present application provides a simple and efficient method for realizing data balancing in a distributed storage system to overcome the defects of the prior art.

[0007] The present application is realized by the following technical solutions:

[0008] A method for realizing data balancing in a distributed storage system, which realizes automatic migration and balancing of the PG layer on the disk through intelligent algorithm, and realizes system data balancing; comprising the following steps:

[0009] Step S1, deploying a distributed storage cluster;

[0010] Step S2, in the cluster initial state (i.e. just completed deployment, no data has been written), manual PG layer balancing is performed to make the PG layer of the storage pool reach the optimal distribution state;

[0011] Step S3, according to the actual situation of the application scene, the maximum tolerance variance of data balancing is customized and set; the manual balancing strategy / automatic balancing strategy is set based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the time of implementing automatic balancing in units of month, week or day, and supports customizing and setting the time period of executing automatic balancing, and the system executes balancing actions according to the manual balancing strategy / automatic balancing strategy.

[0012] In step S3, when balancing data, the target number of PG layers that a single disk needs to carry is calculated by calculating the capacity weight of the disk and the total weight of the system, and then the current number of PG layers carried is calculated, and the PG layers that need to be migrated are obtained through the maximum tolerance variance customized by the user, so as to complete data balancing.

[0013] In step S3, the intelligent PG layer balancing algorithm implementation process is as follows:

[0014] Step S3.1, the user customizes and sets the maximum variance of the offset of the PG layer on each object storage daemon OSD and the number of PG layer migration each time;

[0015] Step S3.2, the total number of PG layers of the distributed storage system is obtained, and the weight of all object storage daemons OSDs under the crush applied by the distributed storage system is calculated

[0016] Step S3.3, the number of PG layers that should be carried by the unit weight is calculated, and the load balancing formula is: PG layer s_per_weight = total_PG layers / osd_weight_total;

[0017] Step S3.4, the number of PG layers that each object storage daemon OSD should carry target_PG layers is calculated;

[0018] Step S3.5, the standard deviation is calculated by the number of PG layers currently carried by the object storage daemon OSD and the target_PG layers, and the maximum variance of each object storage daemon OSD is recorded;

[0019] It is judged whether the maximum variance is greater than the set variance, if it is greater, it is considered that there is an object storage daemon OSD that needs to be adjusted in PG layer;

[0020] Step S3.6, the number of PG layer migration each time is obtained according to the user's setting, and the PG layer adjustment is performed;

[0021] The PG layer migration position of the object storage daemon (OSD) exceeding the variance is calculated, and data migration is completed.

[0022] In the step S3, during automatic balancing, the busy degree of the current service is monitored in real time, and the data amount of each migration is dynamically adjusted.

[0023] The busy degree of the current service is divided into three situations, i.e., high, medium and low, according to the self-defined setting.

[0024] When the system busy degree is at a high level, the system does not make balancing adjustment.

[0025] When the system busy degree is at a medium level, the PG layer number of each adjustment does not exceed 5.

[0026] When the system busy degree is at a low level, the PG layer number of each adjustment does not exceed 15.

[0027] The method for realizing data balancing in the distributed storage system, the automatic balancing strategy and the manual balancing strategy cannot be executed synchronously; when the manual balancing strategy is executed, if the system judges that the automatic balancing strategy is being executed at present, the manual balancing strategy is refused to be executed, and a prompt information is sent to the user.

[0028] The method for realizing data balancing in the distributed storage system supports closing the automatic balancing strategy, and the fast balancing of the system is completed through the mode of manual balancing.

[0029] A system for realizing data balancing in the distributed storage system, which is used for realizing the above method, comprises a system configuration module, a manual balancing module and an automatic balancing module.

[0030] The system configuration module is responsible for helping the user to set the maximum variance of the PG layer offset on each object storage daemon (OSD) and the number of PG layer migration each time.

[0031] The manual balancing module is responsible for helping the user to complete the data balancing of the system through the mode of manual balancing, so that the PG layer of the storage pool reaches the best distribution state.

[0032] The automatic balancing module is responsible for setting the balancing strategy of automatic balancing based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the time of implementing automatic balancing in units of month, week or day, and supports setting the time period of executing automatic balancing, and the system executes the automatic balancing action according to the automatic balancing strategy.

[0033] A device for realizing data balancing in the distributed storage system, characterized by comprising a memory and a processor; the memory is used for storing a computer program, and the processor is used for executing the computer program to realize the method steps.

[0034] A readable storage medium, characterized in that: the readable storage medium has a computer program stored thereon, the computer program is executed by a processor to realize the method steps.

[0035] The method for realizing data balancing in the distributed storage system has the advantages that: the intelligent balancing algorithm is used to manually balance the storage system or execute an automatic balancing strategy, so that the data in the storage system reaches an optimal balancing state, the uneven disk pressure and uneven capacity occupation in the system can be effectively avoided, and the resource utilization rate of the storage system is effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0037] ATTACHMENT Figure 1 The figure shows the method for realizing data balancing in the distributed storage system of the present application. DETAILED DESCRIPTION

[0038] In order to make the person skilled in the art better understand the technical solutions in the present application, the following will combine the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0039] The method for realizing data balancing in the distributed storage system realizes automatic migration and balancing of the PG layer on the disk through an intelligent algorithm, and realizes system data balancing; including the following steps:

[0040] Step S1, deploying a distributed storage cluster;

[0041] Step S2, in the initial state of the cluster (i.e. just after deployment, no data has been written), manually balancing the PG layer to make the PG layer of the storage pool reach an optimal distribution state;

[0042] Step S3, according to the actual situation of the application scene, the maximum tolerance variance of data balancing is customized and set; a manual balancing strategy / automatic balancing strategy is set based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the time of implementing automatic balancing in units of month, week or day, and supports customizing and setting the time period of executing automatic balancing, such as 00:00-02:00 in the early morning of Saturday to Sunday every week; the system executes balancing actions according to the manual balancing strategy / automatic balancing strategy.

[0043] In the step S3, when balancing data, the target PG layer number that a single disk needs to carry is calculated by calculating the capacity weight of the disk and the total weight of the system, and then the current carried PG layer number is calculated, and the PG layer that needs to be migrated is obtained through the user-defined maximum tolerance variance, so as to complete data balancing.

[0044] In the step S3, the intelligent PG layer balancing algorithm implementation process is as follows:

[0045] Step S3.1, the user customizes and sets the maximum variance of the offset of the PG layer on each object storage daemon OSD and the number of PG layer migration each time;

[0046] Step S3.2, the total PG layer number of the distributed storage system is obtained, and the weight of all object storage daemons OSDs under the crush applied by the distributed storage system is calculated

[0047] Step S3.3, the number of PG layers that should be carried by the unit weight is calculated, and the load balancing formula is: PG layer s_per_weight = total_PG layers / osd_weight_total;

[0048] Step S3.4, the number of PG layers that each object storage daemon OSD should carry target_PG_layer is calculated;

[0049] Step S3.5, the standard deviation is calculated by the current carried PG layer number of the object storage daemon OSD and the target_PG_layer, and the maximum variance of each object storage daemon OSD is recorded;

[0050] It is judged whether the maximum variance is greater than the set variance, if it is greater, it is considered that there is an object storage daemon OSD that needs to be adjusted in PG layer;

[0051] Step S3.6, the number of PG layer migration each time set by the user is obtained, and the PG layer adjustment is performed;

[0052] The PG layer migration position of the object storage daemon OSD that exceeds the variance is calculated, and data migration is completed.

[0053] In the step S3, during automatic balancing, the busy degree of the current service is monitored in real time, and the amount of data migrated each time is dynamically adjusted;

[0054] The busy degree of the current service is self-defined into three cases of high, medium and low;

[0055] When the system busy degree is at a high level, the system does not make balancing adjustment;

[0056] When the system busy degree is at a medium level, the number of PG layers adjusted each time does not exceed 5;

[0057] When the system busy degree is at a low level, the number of PG layers adjusted each time does not exceed 15.

[0058] The method for realizing data balancing in the distributed storage system, the automatic balancing strategy and the manual balancing strategy cannot be executed synchronously; when the manual balancing strategy is executed, if the system judges that the automatic balancing strategy is currently being executed, the manual balancing strategy is refused to be executed, and a prompt information is sent to the user.

[0059] The method for realizing data balancing in the distributed storage system supports closing the automatic balancing strategy, and completes the fast balancing of the system through the mode of manual balancing.

[0060] Through the manual and automatic balancing strategies, data balancing can be completed after the initial deployment of the system, after the failure of a disk or a node, and after the expansion or contraction of the system.

[0061] The system for realizing data balancing in the distributed storage system is used to realize the above method, and includes a system configuration module, a manual balancing module and an automatic balancing module.

[0062] The system configuration module is responsible for helping the user to self-define and set the maximum variance of the offset of the PG layer on each object storage daemon (OSD) and the number of PG layers migrated each time;

[0063] The manual balancing module is responsible for helping the user to complete the data balancing of the system through the mode of manual balancing, so that the PG layer of the storage pool reaches the best distribution state.

[0064] The automatic balancing module is responsible for setting the balancing strategy of automatic balancing based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the time of implementing automatic balancing in units of month, week or day, and supports self-defining and setting the time period of executing automatic balancing, and the system executes automatic balancing action according to the automatic balancing strategy.

[0065] The device for realizing data balancing in the distributed storage system includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to realize the method steps.

[0066] The computer program is stored on the readable storage medium and is executed by the processor to implement the method steps.

[0067] The above describes in detail the method for realizing data balancing in a distributed storage system in an embodiment of the present application. This section uses specific examples to describe the principles and implementation modes of the present application. The above examples are only used to help understand the core idea of the present application, and all other embodiments obtained by those skilled in the art without making creative efforts under the condition of not departing from the principles of the present application shall belong to the protection scope of the present application.

Claims

1. A method for implementing data balancing in a distributed storage system, characterized in that: The automatic migration and balancing of the PG layer on the disk is realized through an intelligent algorithm, and system data balancing is realized, including the following steps: Step S1, deploying a distributed storage cluster; Step S2, in the initial state of the cluster, manual PG layer balancing is performed to make the PG layer of the storage pool reach the best distribution state; Step S3, according to the actual situation of the application scenario, the maximum tolerance variance of data balancing is customized and set; a manual balancing strategy / automatic balancing strategy is set based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the time of implementing automatic balancing in units of months, weeks or days, and supports customizing and setting the time period of executing automatic balancing, and the system executes balancing actions according to the manual balancing strategy / automatic balancing strategy.

2. The method for data balancing in distributed storage system according to claim 1, characterized in that: In the step S3, when balancing data, the target number of PG layers that a single disk needs to carry is calculated by calculating the capacity weight of the disk and the total weight of the system, and then the current number of PG layers carried is calculated, and the PG layers that need to be migrated are obtained through the maximum tolerance variance customized by the user to complete data balancing.

3. The method for data balancing in distributed storage system according to claim 2, characterized in that: In the step S3, the intelligent PG layer balancing algorithm implementation process is as follows: Step S3.1, the user customizes and sets the maximum variance of the offset of the PG layer on each object storage daemon OSD and the number of PG layer migrations each time; Step S3.2, the total number of PG layers of the distributed storage system is obtained, and the weight of all object storage daemons OSDs under the crush applied by the distributed storage system is calculated Step S3.3, the number of PG layers per weight is calculated, and the load balancing formula is: PG layer s_per_weight = total_PG layers / osd_weight_total; Step S3.4, the number of PG layers that each object storage daemon OSD should carry target_PG layers is calculated; Step S3.5, the standard deviation is calculated through the current number of PG layers carried by the object storage daemon OSD and the target_PG layers, and the maximum variance of each object storage daemon OSD is recorded; Determine whether the maximum variance is greater than the set variance. If it is greater, it is considered that the object storage daemon OSD needs to be adjusted for the PG layer; Step S3.6, the number of PG layer migrations each time is obtained, and the PG layer adjustment is performed; The migration position of the PG layer of the object storage daemon OSD that exceeds the variance is calculated, and data migration is completed.

4. The method for data balancing in distributed storage system according to claim 3, characterized in that: During automatic balancing, the current business busy degree is monitored in real time, and the amount of data migrated each time is dynamically adjusted; The current business busy degree is customized into three situations: high, medium and low; When the system busy degree is at a high level, the system does not make balancing adjustment; When the system busy degree is at a medium level, the number of PG layers adjusted each time does not exceed 5; When the system busy degree is at a low level, the number of PG layers adjusted each time does not exceed 15.

5. The method for realizing data balancing in a distributed storage system according to claim 1, characterized in that: The automatic balancing strategy and the manual balancing strategy cannot be executed synchronously; when the manual balancing strategy is executed, if the system judges that the automatic balancing strategy is being executed, the manual balancing strategy is refused to be executed, and a prompt information is sent to the user.

6. The method for data balancing in distributed storage system according to claim 5, characterized in that: The automatic balancing strategy is supported to be closed, and the balancing of the system is completed through the manual balancing mode.

7. A system for implementing data balancing in a distributed storage system, the system comprising: The method of any one of claims 1-6, comprising a system configuration module, a manual balancing module and an automatic balancing module; The system configuration module is responsible for helping the user to customize and set the maximum variance of the offset of the PG layer on each object storage daemon OSD and the number of PG layer migration each time; The manual balancing module is responsible for helping the user to complete the data balancing of the system through the manual balancing mode, so that the PG layer of the storage pool reaches the optimal distribution state; The automatic balancing module is responsible for setting the balancing strategy of the automatic balancing based on the intelligent PG layer balancing algorithm, the automatic balancing strategy supports controlling the implementation of the automatic balancing in units of month, week or day, and supports customizing and setting the time period of executing the automatic balancing, and the system executes the automatic balancing action according to the automatic balancing strategy.

8. An apparatus for implementing data balancing in a distributed storage system, the apparatus comprising: The readable storage medium stores a computer program, and the processor executes the computer program to realize the method steps of any one of claims 1-6.

9. A readable storage medium characterized by: The readable storage medium stores a computer program, and the processor executes the computer program to realize the method steps of any one of claims 1-6.

Citation Information

Patent Citations

  • Distributed file capacity balancing method and device

    CN106991170A

  • Cluster data processing method, device and equipment and storage medium

    CN112015326A

  • Homing group balancing method and device of distributed storage system

    CN112306692A

  • Distributed storage collocation group PG balancing method and device, equipment and medium

    CN117389465A

  • Hierarchical mapping-based automatic balancing storage method for ceph storage system

    WO2022028033A1