Storage pool creation method and device, equipment, medium and product

By performing grouped recursive computation and creating hierarchical storage pools in a distributed storage cluster, the problem of resource waste caused by heterogeneous capacity deployment is solved, and efficient utilization of storage resources and data reliability are achieved.

CN121387205AActive Publication Date: 2026-01-23JINAN INSPUR DATA TECH CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202511983487.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-01-23
Estimated Expiration
2045-12-26

AI Technical Summary

Technical Problem

In distributed storage clusters, heterogeneous capacity deployment leads to serious resource waste, and existing technologies cannot effectively utilize storage resources.

Method used

By obtaining the number of fault domain units and replicas, it is determined whether the preset capacity balancing conditions are met. If not, group recursive calculation is performed to determine the target fault domain unit group and create the primary pool and secondary pool. Group recursive calculation is used to more accurately determine the effective capacity of the storage pool and maximize the utilization of storage resources.

Benefits of technology

It improves the utilization rate of storage resources, avoids resource waste, enhances capacity utilization, and ensures data reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387205A_ABST
    Figure CN121387205A_ABST
Patent Text Reader

Abstract

The invention discloses a storage pool creation method and device, equipment, a medium and a product, which are applied to the technical field of storage, and comprise the following steps: obtaining the number of fault domain units and the number of copies; when the number of the fault domain units is greater than the number of the copies, judging whether each fault domain unit meets a first preset capacity balance condition or not based on the minimum effective capacity and the expected effective capacity corresponding to each fault domain unit; if the first preset capacity balance condition is not met, grouping recursive calculation is carried out on each fault domain unit to obtain a target effective capacity, and whether a second preset capacity balance condition is met is judged based on the target effective capacity and the expected effective capacity; and under the condition that a second preset capacity balance condition is not met, creating a main pool based on the target effective capacity and creating an auxiliary pool based on the residual capacity. Therefore, the utilization rate of storage resources can be 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 storage, in particular to a storage pool creation method, device, equipment, medium and product. BACKGROUND

[0002] At present, in a distributed storage cluster, capacity heterogeneous deployment is a common form. In this form of mixed deployment of different capacity units, there is a large capacity deviation of different fault domain units, but data replicas are usually stored according to the smallest capacity unit. In this way, storage is limited by the smallest capacity unit, resulting in serious waste of resources.

[0003] It can be seen that how to improve the utilization rate of storage resources and avoid serious waste of resources is a problem to be solved by those skilled in the art. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a storage pool creation method, device, equipment, medium and product, which can improve the utilization rate of storage resources and avoid serious waste of resources.

[0005] In a first aspect, a storage pool creation method is disclosed, comprising: obtaining the number of fault domain units and the number of replicas; when the number of fault domain units is greater than the number of replicas, determining whether each fault domain unit meets a first preset capacity balance condition based on the minimum effective capacity corresponding to each fault domain unit and an expected effective capacity; if the first preset capacity balance condition is not met, performing grouping recursive calculation on each fault domain unit to obtain a target effective capacity, in the grouping recursive calculation process, grouping and determining a target fault domain unit group for the fault domain units of the current round each round, removing the target fault domain unit group and removing an equivalent capacity of the target fault domain unit group from other fault domain unit groups, and entering the next round, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round; determining whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity; and in the case where the second preset capacity balance condition is not met, creating a primary pool based on the target effective capacity and creating a secondary pool based on the remaining capacity.

[0006] In a second aspect, the present application discloses a storage pool creating device, comprising: a pool information obtaining module, configured to obtain a number of fault domain units and a number of replicas; a first judging module, configured to, when the number of fault domain units is greater than the number of replicas, judge whether each fault domain unit meets a first preset capacity balance condition based on a minimum effective capacity corresponding to each fault domain unit and an expected effective capacity; a grouping recursion module, configured to, if the first preset capacity balance condition is not met, perform grouping recursion calculation on the fault domain units to obtain a target effective capacity, wherein in the grouping recursion calculation process, in each round, the fault domain units in the current round are grouped and a target fault domain unit group is determined, the target fault domain unit group and an equivalent capacity of the target fault domain unit group from other fault domain unit groups are removed, and the next round is entered, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round; a second judging module, configured to judge whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity; and a pool creating module, configured to, in the case that the second preset capacity balance condition is not met, create a primary pool based on the target effective capacity and create a secondary pool based on a remaining capacity.

[0007] In a third aspect, the present application discloses an electronic device, comprising: a memory, configured to store a computer program; and a processor, configured to execute the computer program to implement the steps of the foregoing storage pool creating method.

[0008] In a fourth aspect, the present application discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the foregoing storage pool creating method.

[0009] In a fifth aspect, the present application discloses a computer program product, comprising computer programs / instructions, which are executed by a processor to implement the steps of the foregoing storage pool creating method.

[0010] The application has the beneficial effect that in the case that the number of fault domain units is greater than the number of replicas, whether each fault domain unit is balanced is first judged based on the minimum effective capacity and the expected effective capacity, and if not balanced, grouping recursive calculation is performed, in the grouping recursive calculation process, the fault domain units of the current round are grouped and the target fault domain unit group is determined every round, the target fault domain unit group and the equivalent capacity of the target fault domain unit group from other fault domain unit groups are removed, the next round is entered, the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round, and whether balanced is further judged based on the target effective capacity and the expected effective capacity, and in the case that not balanced, the primary pool can be created based on the target effective capacity and the secondary pool can be created based on the remaining capacity. The application can more accurately calculate the effective capacity through grouping recursive calculation, and then more accurately judge whether each fault domain unit is balanced, and then create the primary pool based on the target effective capacity and the secondary pool based on the remaining capacity, so that the core data of each fault domain unit can be maximally utilized, and the remaining capacity can also be utilized through the secondary pool, so that the utilization rate of storage resources can be improved and serious waste of resources can be avoided. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0012] Figure 1 A storage pool creation method flow chart is provided for the embodiments of the present application. Figure 2 A storage pool creation flow chart is provided for the embodiments of the present application. Figure 3 A data writing schematic diagram is provided for the embodiments of the present application. Figure 4 A storage pool expansion schematic diagram is provided for the embodiments of the present application. Figure 5 A storage pool capacity reduction schematic diagram is provided for the embodiments of the present application. Figure 6 A storage pool creation device schematic diagram is provided for the embodiments of the present application. Figure 7 A structural diagram of an electronic device is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0013] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be described clearly and completely in the description of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0014] The terms "comprising" and "having" and any variations thereof in the specification and the above drawings are intended to cover not exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can include steps or units not listed.

[0015] In a distributed storage cluster, mixed deployment of different disk positions (such as 12 disk positions, 24 disk positions, 36 disk position nodes) is a common form. When the capacities of nodes are greatly different (such as 5, 5, 12, 36 node capacities), the system capacity is limited by the smallest capacity node, resulting in serious resource waste and extremely low utilization of large capacity nodes (such as 3 node 16T / 32T / 64T+3 replica scenario, 64T node utilization is only 25%); the actual available capacity of the storage pool is limited by the smallest node (such as 12 disk position nodes limiting the effective output of 24 disk position and 36 disk position nodes). The traditional algorithm cannot break through the node-level fault domain constraint and cannot adapt to dynamic resource scheduling in a capacity heterogeneous scenario. Therefore, the present application provides a storage pool creation scheme, which can improve the utilization of storage resources and avoid serious resource waste.

[0016] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0017] Next, a storage pool creation method provided by the embodiments of the present application will be described in detail. Figure 1 A flowchart of a storage pool creation method provided by the embodiments of the present application is shown in the figure, and the storage pool creation method includes the following steps.

[0018] Step S11: Obtain the number of fault domain units and the number of replicas.

[0019] The embodiment can obtain the number of fault domain units and the number of replicas through a user interface, and can obtain the number of fault domain units and the number of replicas in response to a storage pool creation instruction. That is, a user can select or input the number of fault domain units and the number of replicas through a user interface, and click a storage pool creation button. The fault domain unit can be a cabinet, a node, a disk, or a PG (Placement Group), that is, the fault domain can be a cabinet, a node, a disk, or a PG. Consistency of data content needs to be ensured between multiple replicas, and the more the number of replicas, the more the user can set according to requirements. The embodiment of the application can be applied to distributed storage, that is, a technology architecture that integrates storage resources of multiple nodes through a network to form a unified storage resource pool. For heterogeneous distributed storage, resource utilization can be improved. Heterogeneous refers to significant differences in disk capacity and disk position number of nodes in a storage cluster (for example, 12 disk positions, 24 disk positions, and 36 disk positions coexist).

[0020] Step S12: When the number of fault domain units is greater than the number of replicas, it is determined whether each fault domain unit meets a first preset capacity balance condition based on a minimum effective capacity corresponding to each fault domain unit and an expected effective capacity.

[0021] The minimum effective capacity is the product of the minimum capacity in each fault domain unit and the number of fault domain units divided by the number of replicas, and the expected effective capacity is the total capacity of each fault domain unit divided by the number of replicas. The formula is: expected effective capacity = total capacity of each fault domain unit / number of replicas; minimum effective capacity = minimum capacity in each fault domain unit * number of fault domain units / number of replicas. The first preset capacity balance condition can be that the minimum effective capacity multiplied by a first preset coefficient is greater than or equal to the expected effective capacity, then the first preset capacity balance condition is met, otherwise it is not met, or the expected effective capacity multiplied by a second preset coefficient is less than or equal to the minimum effective capacity, then the first preset capacity balance condition is met, otherwise it is not met, wherein the first preset coefficient is greater than 1, such as 1.2, and the second preset coefficient is less than 1, such as 0.8. The ratio of the minimum effective capacity to the expected effective capacity can also be calculated, and if the ratio is greater than a preset ratio, the first preset capacity balance condition is met, for example, the preset ratio is 0.8, otherwise, the first preset capacity balance condition is not met.

[0022] In the embodiment, when the number of fault domain units is greater than the number of replicas, if the first preset capacity balance condition is met, a storage pool is created based on each fault domain unit.

[0023] Step S13: If the first preset capacity balance condition is not met, the grouping recursive calculation is performed on the fault domain units to obtain a target effective capacity, in the grouping recursive calculation process, in each round, the fault domain units in the current round are grouped and a target fault domain unit group is determined, the target fault domain unit group is removed and an equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, and the next round is entered, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round.

[0024] Wherein, the capacity of the fault domain unit group is the sum of the capacities of all fault domain units in the group, and the end condition of the grouping recursive calculation is that the number of fault domain units in any round is less than the number of replicas. In the grouping recursive calculation process, after the target fault domain unit group is removed and the equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, if the number of remaining fault domain units is greater than or equal to the number of replicas, the next round is entered, the step of grouping the fault domain units in the current round and determining the target fault domain unit group is triggered, otherwise the grouping recursive calculation is ended. Or, in each round, it is first judged whether the grouping of the fault domain units in the current round is greater than or equal to the number of replicas, if yes, the step of grouping the fault domain units in the current round and determining the target fault domain unit group is triggered, if no, the recursive calculation is ended. In each round, the fault domain units need to be reordered in the order of small to large capacity.

[0025] The grouping recursive calculation process comprises: dividing the sequence of fault domain units in the current round into a plurality of fault domain unit groups, wherein the first fault domain unit group is assigned with the first N fault domain units, and each subsequent fault domain unit group is assigned with one fault domain unit in sequence, the fault domain units in the sequence of the current round are arranged in the order of small to large capacity, and N is equal to the number of fault domain units in the current round minus the number of replicas plus one; judging whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group; if the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group, the first fault domain unit group is determined as the target fault domain unit group, otherwise one fault domain unit is removed from the first fault domain unit group to a subsequent fault domain unit group, and the step of judging whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group is triggered; when the target fault domain unit group is determined, the target fault domain unit group is removed and an equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, and the next round is entered.

[0026] Wherein, one fault domain unit is removed from the first fault domain unit group to a subsequent fault domain unit group, and the subsequent fault domain unit group can be the second fault domain unit group.

[0027] In an optional embodiment, removing the equivalent capacity of the target fault domain unit group from other fault domain unit groups comprises: if any fault domain unit group of the other fault domain unit groups comprises a plurality of fault domain units, removing the equivalent capacity by averaging among the plurality of fault domain units.

[0028] In an optional embodiment, removing the equivalent capacity by averaging among the plurality of fault domain units comprises: dividing the equivalent capacity by the number of fault domain units in the fault domain unit group to obtain the capacity removed by each fault domain unit, and in case of non-integer division, allocating the remainder to the last fault domain unit of the fault domain unit group for capacity removal.

[0029] Step S14: determining whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity.

[0030] The second preset capacity balance condition can be that the target effective capacity multiplied by a first preset coefficient is greater than or equal to the expected effective capacity, and the second preset capacity balance condition is met, otherwise, the second preset capacity balance condition is not met, or the expected effective capacity multiplied by a second preset coefficient is less than or equal to the target effective capacity, and the second preset capacity balance condition is met, otherwise, the second preset capacity balance condition is not met, wherein the first preset coefficient is greater than 1, such as 1.2, and the second preset coefficient is less than 1, such as 0.8. Alternatively, a ratio of the target effective capacity to the expected effective capacity is calculated, and the ratio is greater than a preset ratio, and the second preset capacity balance condition is met, for example, the preset ratio is 0.8, otherwise, the second preset capacity balance condition is not met.

[0031] Step S15: creating a primary pool based on the target effective capacity and a secondary pool based on the remaining capacity in a case where the second preset capacity balance condition is not met.

[0032] The primary pool can be created according to the target effective capacity and the number of replicas, and the product of the target effective capacity and the number of replicas is the capacity of the primary pool, each replica corresponds to a target effective capacity, and the remaining capacity is the secondary pool. In this embodiment, the remaining capacity after the recursive calculation of the grouping is ended can be used to create the secondary pool, and the other capacity can be used to create the primary pool. Alternatively, the capacity of the primary pool and the secondary pool can be allocated according to user settings to create the primary pool and the secondary pool. That is, the storage pool layering of the embodiment of the application can divide the storage resources into a primary storage pool (primary pool) and a secondary storage pool (secondary pool) to carry different types or life cycle data. The primary storage pool can be used to store core business data, and needs to meet the requirements of high reliability and low latency, and strict fault domain constraints and redundancy strategies are adopted. The secondary storage pool is used to store non-core data (such as logs and archived data), and a lower redundancy strategy can be adopted to improve the capacity utilization rate. Data life cycle management is performed, that is, a management mechanism is adopted to automatically migrate data between the primary pool and the secondary pool according to the data creation time, access frequency and other characteristics.

[0033] In the optional embodiment, if the second preset capacity balance condition is not met, the storage pool creation suggestion information is displayed on the user interface, and if the user selects to create according to the storage pool suggestion information, a primary pool is created based on the target effective capacity and a secondary pool is created based on the remaining capacity. One storage pool can also be created based on each failure domain unit in response to a user instruction. If the user selects to create according to the storage pool suggestion information by default when creating the storage pool, a primary pool is directly created based on the target effective capacity and a secondary pool is directly created based on the remaining capacity if the second preset capacity balance condition is not met. No further operation is required from the user.

[0034] In the optional embodiment, if the second preset capacity balance condition is met, one storage pool is created based on each failure domain unit.

[0035] In the embodiment, if the second preset capacity balance condition is not met, a primary pool is created based on the target effective capacity and a secondary pool is created based on the remaining capacity, which can include the following: if the second preset capacity balance condition is not met, a primary pool is created based on the target effective capacity and a secondary pool is created based on the remaining capacity according to the configuration information.

[0036] The configuration information includes secondary pool strategy information, and the secondary pool strategy information is to reduce the failure domain or reduce the number of replicas. That is, the secondary pool reduces the failure domain or the number of replicas relative to the primary pool.

[0037] In the embodiment, when the number of failure domain units is equal to the number of replicas, whether the first preset capacity balance condition is met is determined based on the minimum effective capacity and the expected effective capacity corresponding to each failure domain unit; if the first preset capacity balance condition is met, one storage pool is created based on each failure domain unit.

[0038] In the embodiment, when the number of failure domain units is equal to the number of replicas, the minimum effective capacity is calculated according to the foregoing formula, the minimum effective capacity is the minimum capacity in each failure domain unit, and the expected effective capacity is the total capacity of each failure domain unit divided by the number of replicas.

[0039] In the embodiment, when the number of failure domain units is equal to the number of replicas, if the first preset capacity balance condition is not met, a primary pool is created based on the minimum effective capacity and a secondary pool is created based on the remaining capacity. That is, the capacity of the primary pool is the product of the minimum effective capacity and the number of replicas, the minimum effective capacity in each failure domain unit is divided into the primary pool, and the others are divided into the secondary pool.

[0040] In the embodiment, when the number of failure domain units is less than the number of replicas, an abnormal prompt is output.

[0041] Further, the embodiment of the present application can further include: determining a write pool from the primary pool and the secondary pool based on a data type of write data; and storing the write data to the write pool.

[0042] That is, core input can be written to the primary pool based on the data type, and non-core data can be written to the secondary pool.

[0043] In an optional implementation, the embodiment of the present application can further include: when a water level of the primary pool is higher than a preset water level threshold, migrating first target data in the primary pool to the secondary pool, wherein the first target data is data that has not been accessed for a first preset time length.

[0044] For example, when the water level of the primary pool is greater than or equal to 80%, data that has not been accessed for 30 days is automatically migrated to the secondary pool.

[0045] In an optional implementation, the embodiment of the present application can further include: determining data with a time interval between a creation time and a current time greater than a preset time interval from the primary pool to obtain second target data; and migrating the second target data to the secondary pool.

[0046] That is, the embodiment of the present application can trigger data migration according to a life cycle, for example, data created more than 90 days (such as historical orders) is automatically migrated from the primary pool to the secondary pool.

[0047] In an optional implementation, the embodiment of the present application can further include: determining data accessed more than a preset number threshold within a second preset time length from the secondary pool to obtain third target data; and migrating the third target data to the primary pool.

[0048] That is, the embodiment can also be reversed to migrate, data in the secondary pool accessed more than or equal to 5 times within 3 days is automatically migrated back to the primary pool.

[0049] Further, the embodiment of the present application can further include: in the case where a target pool for expansion is not specified, if expansion is performed to the primary pool and the primary pool satisfies a target capacity balance condition, then expansion is performed to the primary pool, otherwise expansion is performed to the secondary pool.

[0050] The target capacity balance condition is the second preset capacity balance condition, that is, if expansion is performed to the primary pool, each fault domain unit in the primary pool is grouped and recursively calculated to obtain a target effective capacity, and whether the second preset capacity balance condition is satisfied is determined based on the target effective capacity and an expected effective capacity. In other embodiments, the target capacity balance condition can also be the first preset capacity balance condition. That is, the capacity corresponding to each replica is balanced, then expansion is performed to the primary pool, otherwise expansion is performed to the secondary pool.

[0051] Further, the embodiment of the present application can further include: in the case that the target pool for capacity expansion is designated, directly expanding the capacity to the target pool, the target pool being the primary pool or the secondary pool.

[0052] Further, the embodiment of the present application can further include: if the rebalancing strategy is selected when the capacity is shrunk, in the case that the target pool for capacity shrinkage is the primary pool, if the secondary pool satisfies the first capacity shrinkage condition, shrinking the capacity of the secondary pool and the primary pool, and expanding the capacity of the secondary pool to the primary pool.

[0053] The first capacity shrinkage condition is that the capacity shrinkage object in the secondary pool and the capacity shrinkage object in the primary pool are in the same failure domain unit, and the remaining capacity (free capacity of the un-written data) of the capacity shrinkage object in the secondary pool is greater than the capacity shrinkage capacity * a preset proportion coefficient, and the preset proportion coefficient is greater than 1, such as 2. For example, the failure domain is a node, and the capacity is shrunk for a node in the primary pool, and the capacity is shrunk from the disk of the node in the secondary pool to the primary pool. If the first capacity shrinkage condition is not satisfied, the capacity shrinkage fails.

[0054] If the rebalancing strategy is selected when the capacity is shrunk, in the case that the target pool for capacity shrinkage is the secondary pool, if the secondary pool satisfies the capacity sufficient condition, the capacity of the secondary pool is shrunk. For example, the capacity sufficient condition can be that the water level is lower than a preset water level threshold, or the free capacity is greater than a preset capacity threshold. The free capacity is the capacity that is not occupied by data.

[0055] Further, if the rebalancing strategy is not selected when the capacity is shrunk, in the case that the target pool for capacity shrinkage satisfies the first capacity shrinkage condition, the capacity of the target pool is shrunk.

[0056] The target pool can be the primary pool or the secondary pool, and the first capacity shrinkage condition represents that the capacity is sufficient, which is that the water level is lower than a preset water level threshold, or the free capacity is greater than a preset capacity threshold.

[0057] It can be seen that in the case that the number of the fault domain units is greater than the number of the replicas, the embodiments of the present application first judge whether the fault domain units are balanced based on the minimum effective capacity and the expected effective capacity, and if not, the grouping recursive calculation is performed. In the grouping recursive calculation process, the fault domain units in the current round are grouped and the target fault domain unit group is determined in each round, the target fault domain unit group is removed and the equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, the next round is entered, the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round, and whether the fault domain units are balanced is further judged based on the target effective capacity and the expected effective capacity. In the case that the fault domain units are not balanced, the primary pool can be created based on the target effective capacity and the secondary pool can be created based on the remaining capacity. Through the grouping recursive calculation, the present application can more accurately calculate the effective capacity, and further more accurately judge whether the fault domain units are balanced, and further create the primary pool based on the target effective capacity and the secondary pool based on the remaining capacity, so that the core data can be maximally stored in the fault domain units, and the remaining capacity can also be utilized through the secondary pool. In this way, the utilization rate of the storage resources can be improved, and the serious waste of resources can be avoided.

[0058] Further, referring to Figure 2 as shown, Figure 2A storage pool creation flowchart is provided for an embodiment of the present application. A user creates a storage pool through an interface, sets a failure domain, a failure domain unit quantity, a copy quantity, and the like in the interface, and takes a node as an example of the failure domain. The failure domain unit is a node, and the failure domain unit quantity is a node quantity. There are mainly three cases, which are a node quantity < a copy quantity, a node quantity = a copy quantity, and a node quantity > a copy quantity. The first case of the node quantity < the copy quantity: this scenario cannot be deployed, and a direct interface prompt or an exception exit is required, and a judgment of whether to be balanced is not required. The second case of the node quantity = the copy quantity: a capacity of a node with the smallest capacity is determined as a smallest effective capacity. If it is unbalanced, a hierarchy can be created, that is, a main pool and an auxiliary pool are created. The main pool is divided by the smallest effective capacity per node, and the others enter the auxiliary pool (for example, a scenario of 12T, 24T, and 36T, a main pool of 12T, 12T, and 12T per node, and a remaining 12T and 24T in an auxiliary pool). A strategy of the auxiliary pool is further set according to an interface configuration. For example, a failure domain or a copy can be reduced. Whether to be layered, layered according to a reduction strategy or layered according to a reduction failure domain can be further configured by a user. If it is balanced, a storage pool is not layered, and a smallest capacity is a smallest effective capacity * 1.2, which is greater than or equal to an expected capacity, that is, an expected effective capacity. It is balanced. The third case of the node quantity > the copy quantity: whether it is balanced is first judged, that is, whether the smallest effective capacity and the expected effective capacity satisfy a first preset balanced condition. If it does not satisfy, a recursive calculation of an effective capacity is further performed to obtain a recursive capacity, that is, a target effective capacity. Whether it is balanced is further judged. If it is unbalanced, a hierarchy can be created to create a storage pool. The recursive capacity * 1.2 is greater than or equal to the expected capacity, that is, the expected effective capacity, and it is balanced. Otherwise, it is unbalanced. A strategy can be configured through an interface, and the strategy is not layered, layered according to a reduction strategy, or layered according to a reduction failure domain. If it is layered, two storage pools, that is, a main pool and an auxiliary pool, are created. If it is not layered, a storage pool is created. The expected effective capacity = a total capacity / a copy quantity; and the smallest effective capacity = a smallest capacity * a node quantity / a copy quantity. The first preset balanced condition can be that the smallest capacity, that is, the smallest effective capacity * 1.2, is greater than or equal to the expected capacity, that is, the expected effective capacity, and the condition is satisfied, and it is balanced. The first preset balanced condition can also be that a difference between the smallest effective capacity and the expected effective capacity is greater than a preset coefficient ratio, that is, the expected effective capacity, and the condition is not satisfied, that is, it is unbalanced. Otherwise, it is balanced. For example, the preset coefficient ratio is 0.2.

[0059] That is, in the storage pool creation stage, capacity detection is performed to detect node capacity balance. Capacity statistics are performed first: total capacity of each unit is counted according to fault domain types (nodes / cabinets, etc.) (for example, the total capacity of the disks of each node is counted for node fault domains). Balance calculation: expected effective capacity = total capacity / number of copies, minimum effective capacity is calculated, and whether it is balanced is judged based on the capacity, for example, a capacity difference coefficient is used: not all scenarios need to be layered, in fewer cases, such as only one node missing one disk, it can be added later, there is no need to establish two pools, and only in the case of large wasted space, layering is performed, so a capacity difference coefficient is set, such as 1.2, that is, the minimum effective capacity * 1.2 is greater than or equal to the expected effective capacity, then it is balanced, otherwise it is not balanced. The embodiment of the application also provides a more accurate effective capacity judgment method, namely, group recursive calculation, the trigger condition: compare the expected effective capacity and the minimum effective capacity, if the minimum node effective capacity * the capacity difference coefficient < the expected effective capacity, start the group recursive calculation of the effective capacity, and finally decide whether to layer. The group recursive effective capacity is inaccurate due to large node capacity difference, and the application provides group recursive calculation to provide a suggestion of whether to layer. The group recursive calculation can specifically include the following steps, taking the node as an example, and the same applies to other fault domain units.

[0060] 1. Sort each node according to capacity from small to large to get a fault domain unit sequence, that is, a node capacity list (list table).

[0061] 2. Group recursive calculation (number of nodes, number of copies, list table).

[0062] If the number of nodes is greater than or equal to the number of copies, group calculation is performed: according to the list table, it is divided into a number of copies; the first group capacity: sum(list(1)+...+list(len- number of copies+1)); the second group capacity: list(len-number of copies+2); the third group capacity: list(len-number of copies+3)..., where len is the length of the list table, that is, the number of nodes. If the first group capacity is less than or equal to the capacity of each group, then the effective capacity = the first group capacity, the remaining list table = the nodes of the first group are removed, the second group is evenly distributed with the effective capacity, and when the division is not exact, the last node is reduced by (integer + remainder), and the following groups are reduced by the effective capacity; the target effective capacity = the effective capacity + the target effective capacity of the historical round, the list table = the remaining list table, and the number of nodes is assigned to the number of nodes after removing the nodes of the first group, and step 2 is entered again.

[0063] 3. Main pool and auxiliary pool division: the remaining list returned finally creates an auxiliary pool, and the others enter the main pool. As shown in Table 1, Table 1 is a storage pool creation decision schematic table provided by the embodiment of the application.

[0064] Table 1

[0065]

[0066] The above capacity unit is T, and the 9 nodes (1, 2, 3, 25, 28, 36, 36, 36, 36) and 3 copies are taken as an example to further illustrate the grouping recursive algorithm of the application.

[0067] Grouping recursive calculation, first round (9, 3 copies, list (node name, node capacity)). First grouping: the first 7 nodes are the first group, the 8th node is the second group, and the 9th node is the third group. The first group is summed up, and it is judged whether the capacity of the first group is less than or equal to the second group and whether the first group is less than or equal to the third group. If the above judgment condition is not met, the second grouping: the first 6 nodes are the first group, the 7th node and the 8th node are the second group, and the 9th node is the third group. The first group and the second group are summed up respectively, and it is judged whether the capacity of the first group is less than or equal to the second group and whether the first group is less than or equal to the third group. If the above judgment condition is not met, continue grouping until the fifth grouping: the first group is the first 4, and the sum is obtained to get the capacity of the group. The second group is the 5th to the 8th, and the sum is obtained to get the capacity of the group. The third group is the 9th, and it is judged whether the capacity of the first group is less than or equal to the second group and whether the first group is less than or equal to the third group. If the above judgment condition is met, the effective capacity of this round is 31T, and the first 4 nodes can be divided into the main pool. The two groups share 31T, which can be divided into the main pool, and the shared capacity is 7, 7, 7 and 10 respectively. The third group 31T can be divided into the main pool. Grouping recursive calculation second round (5, 3 copies, 9-5, 5-21, 8-26, 6-29, 7-29), the front number represents the node number, and the rear number represents the node capacity. The effective capacity of this round is 26T, and the first group is removed, that is, the 9th and 5th nodes. The 8th and 6th nodes share 26T, and the 7th node is reduced by 26T. Grouping recursive calculation third round (7-3, 8-13, 6-16), the effective capacity of this round is 3T, and the first node is removed. The remaining 2 nodes are recursive, and the target effective capacity is the grouping recursive capacity, which is 31T+26T+3T=60T.

[0068] Regarding the hierarchical strategy selection, the embodiment of the present application can provide corresponding suggestions to the user, which are displayed on the interface. When there is no minimum effective capacity and the expected effective capacity does not satisfy the balance condition or the target effective capacity and the expected effective capacity are judged to be unbalanced, hierarchical selection is needed. In this case, the number of nodes, the set failure domain and the redundancy strategy (the number of data blocks) can be calculated, and various schemes can be selected according to the capacity utilization rate, reliability and adaptive scenario, as shown in Table 2, which is a strategy selection table. In an optional implementation, the embodiment of the present application can automatically select a strategy in combination with user demand information (including storage data types) and the like.

[0069] Table 2

[0070]

[0071] The first kind: capable of reweight balance, requiring that the number of nodes, the number of data blocks and the failure domain type can be balanced through the reweight value. For example, when the number of failure domains (nodes or cabinets) is greater than the number of data replicas, and the PG allocation can be adjusted through the disk reweight weighted value to achieve capacity balance (for example, a 4-node cluster composed of 1 12-disk node, 2 24-disk nodes and 1 36-disk node, the load of the 12-disk node is balanced through reweight), and hierarchical selection can be avoided. The second kind: incapable of reweight balance and without hierarchical selection. This scheme has low capacity utilization rate but high reliability. The third kind: incapable of reweight balance and adopting the way of reducing the number of data blocks (such as the number of replicas). The fourth kind: incapable of reweight balance and adopting the way of reducing the failure domain type. Hierarchical strategy setting (for strategies 3 and 4): if there is a clear priority for business data (such as core transactions vs. archiving), an associated hierarchical storage pool (main pool + auxiliary pool, the main pool carries core data, and the auxiliary pool carries non-core data, sharing the underlying node resources) is created. If the business data is not associated (such as a multi-tenant scenario), an independent hierarchical storage pool (the main pool and the auxiliary pool are physically isolated, and each is configured with a failure domain and a redundancy strategy) is created.

[0072] Further, the embodiment of the present application can implement hierarchical writing or migration of the storage pool. Hierarchical writing: the business layer automatically routes according to the data type, the main pool: core data (such as financial transaction records), configured with a node-level failure domain + 3 replicas (tolerable to 1 node failure); the auxiliary pool: non-core data (such as logs / archiving), configured with a disk-level failure domain + EC (Erasure Coding, error correction code) 6+2 (tolerable to 2 disk failures). Migration strategy: 1) water level trigger: when the water level of the main pool is 80%, automatically migrate the data not accessed within 30 days to the auxiliary pool; 2) life cycle trigger: when the data is created for more than 90 days (such as historical orders), automatically migrate from the main pool to the auxiliary pool; reverse migration: when the data in the auxiliary pool is accessed 5 times within 3 days, automatically migrate back to the main pool. For example, see​Figure 3 As shown, Figure 3 A data writing schematic diagram is provided for the embodiment of the application. The client writes, and according to the data type judgment, if it is core data, the main pool is stored, and if it is non-core data, the auxiliary pool is stored. The main pool node level fault tolerance is adopted, 3 copies cross nodes, and 1 node failure can be tolerated. The auxiliary pool disk level fault tolerance is adopted, EC 6+2 cross disks, and 2 disk failures can be tolerated.

[0073] Further, referring to Figure 4 As shown, Figure 4 A storage pool expansion schematic diagram is provided for the embodiment of the application. In the expansion and contraction scene, the operation is performed according to the interface selection disk and the set strategy. The detailed process is as follows: entering the expansion interface, selecting the disk, setting the expansion to the specified pool, or automatic calculation; if it is a specified pool, it is directly expanded to the pool; if automatic calculation, the resource waste condition after expansion into the main pool is selected, the calculation algorithm is the same as the recursive calculation of the effective capacity algorithm of the created storage pool grouping, and whether it is balanced is judged. The product of the effective capacity (i.e. recursive capacity) and the capacity difference coefficient is greater than or equal to the expected effective capacity (i.e. expected capacity), if greater than or equal to, it means balanced, then expand to the main pool, otherwise, it is unbalanced, and expand to the auxiliary pool. The capacity difference coefficient is 1.2.

[0074] Further, referring to Figure 5 As shown, Figure 5 A storage pool contraction schematic diagram is provided for the embodiment of the application. According to the strategy configured by the interface, the main pool and the auxiliary pool are contracted, and the detailed process is as follows: 1, entering the contraction interface, selecting the node and the disk, and configuring whether to rebalance the strategy; 2, whether to rebalance: no, directly judging the water level and the pool state, and contracting; yes, then executing step 3; 3, judging whether the selected disk is in the main pool or the auxiliary pool (contraction is in the storage pool dimension, and the disks of the main pool and the auxiliary pool cannot be selected at the same time to contract, and in order to ensure the reliability of data, it is generally not recommended to contract multiple disks at one time), if it is the auxiliary pool, directly judging the water level and the pool state, and contracting, if it is the main pool, then performing step 4; 4, the main pool contraction rebalancing strategy is that the disks of the auxiliary pool are contracted to join the main pool under the same fault domain (such as the same node), and the capacity balance of the main pool is achieved, if there is no disk in the auxiliary pool under the same fault domain, no operation is performed. At the same time, considering that the auxiliary pool has written data and has no extra space for contraction, so the remaining capacity is first judged, and at the same time, the contraction reconstruction needs a process, so the remaining capacity needs to be greater than the proportion of the contraction capacity, so a coefficient (such as 2 times) needs to be multiplied.

[0075] The embodiment of the present application provides a dynamic capacity detection mechanism: identifying a heterogeneous scene, being compatible with capacity fluctuation caused by a bad disk; and providing a multi-strategy decision model: combining a service priority and a resource state, dynamically selecting a balance / duplicate reduction / failure domain reduction strategy; a grouping recursive effective capacity calculation algorithm: recursively calculating the maximum available space of a main pool, and the effective capacity calculation is more accurate; adaptive capacity expansion and contraction: automatically calculating a scene, adding a disk to a corresponding pool, and improving disk utilization. The capacity detection method: the calculation logic of the node capacity and the average value ratio, the setting of the 80%-120% threshold value and the triggering mechanism; the multi-strategy deployment scheme: providing the applicable scene, the decision logic and the creation method of the hierarchical storage pool of four strategies. The grouping recursive calculation algorithm is provided: grouping and recursively calculating the effective capacity, and generating the division mode of the main pool and the auxiliary pool; and the migration and capacity expansion and contraction strategy are provided.

[0076] The present application aims at the capacity heterogeneity problem, such as the capacity imbalance problem of large capacity deviation between a single node disk and other node disks, and realizes efficient utilization of storage resources and balance of reliability through a whole-process mechanism of capacity detection-multi-strategy deployment-hierarchical storage-dynamic capacity expansion and contraction, breaks through the traditional failure domain constraint through intelligent hierarchical migration. Through the scheme provided by the present application, the capacity utilization rate is improved: in a 3-node 12 / 24 / 36T+3 copy scene, the capacity utilization rate is improved from 25% (traditional scheme) to more than 65%, the reliability is guaranteed: the service adaptability is improved, the differentiated needs of multiple scenes are supported, the core data is maintained in high redundancy through the main pool, the non-core data balances the cost and reliability through the auxiliary pool, the flexibility is enhanced: the operation and maintenance efficiency is optimized, the manual intervention cost is reduced, the capacity expansion and contraction efficiency is improved by 50%, the hierarchical strategy is dynamically adjusted to adapt to service changes; the cost is reduced: the large-capacity node is idle, the hardware investment of a single cluster can be reduced by 30%-40%. The data risk is controllable: the migration process does not affect the service continuity. The future can be extended to a multi-cloud scene, and the cross-cloud storage pool is managed through unified hierarchical strategy, and the resource utilization rate is further improved.

[0077] Referring to Figure 6 The embodiment of the present application provides a storage pool creation device, which comprises the following modules.

[0078] The pool information acquisition module 11 is used for acquiring the number of failure domain units and the number of copies.

[0079] The first judgment module 12 is used for judging whether each failure domain unit meets a first preset capacity balance condition based on the minimum effective capacity corresponding to each failure domain unit and the expected effective capacity when the number of failure domain units is greater than the number of copies.

[0080] The grouping recursive module 13 is configured to perform grouping recursive calculation on the fault domain units to obtain a target effective capacity if the first preset capacity balance condition is not met, in the grouping recursive calculation process, in each round, a target fault domain unit group is determined by grouping the fault domain units in the current round and removing the target fault domain unit group and an equivalent capacity of the target fault domain unit group from other fault domain unit groups, and the next round is entered, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round.

[0081] The second judgment module 14 is configured to judge whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity.

[0082] The pool creation module 15 is configured to create a main pool based on the target effective capacity and a secondary pool based on a remaining capacity if the second preset capacity balance condition is not met.

[0083] In the grouping recursive calculation process, the sequence of fault domain units in the current round can be divided into N fault domain unit groups, wherein the first fault domain unit group is assigned with the first N fault domain units, and each subsequent fault domain unit group is assigned with one fault domain unit in sequence, the fault domain units in the sequence are arranged in ascending order of capacity, and N is equal to the number of fault domain units in the current round minus the number of copies plus one; it is judged whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group; if the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group, the first fault domain unit group is determined as the target fault domain unit group, otherwise, one fault domain unit is removed from the first fault domain unit group to a subsequent fault domain unit group, and the step of judging whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group is triggered; when the target fault domain unit group is determined, the target fault domain unit group is removed and an equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, and the next round is entered.

[0084] In the process of removing the equivalent capacity of the target fault domain unit group from other fault domain unit groups, if any fault domain unit group in the other fault domain unit groups includes multiple fault domain units, the equivalent capacity can be removed by being equally distributed among the multiple fault domain units.

[0085] The equal capacity is averagely allocated to the plurality of failure domain units for removal, which can include: dividing the equal capacity by the number of failure domain units in the failure domain unit group to obtain the capacity removed by each failure domain unit, and in case of a remainder, the remainder is allocated to the last failure domain unit in the failure domain unit group for capacity removal.

[0086] Further, the first judging module 12 can be further configured to: when the number of failure domain units is equal to the number of replicas, judge whether each failure domain unit satisfies a first preset capacity balance condition based on the minimum effective capacity and the expected effective capacity corresponding to each failure domain unit; and correspondingly, the pool creating module 15 can be further configured to: if the first preset capacity balance condition is satisfied, create a storage pool based on the plurality of failure domain units.

[0087] Further, the pool creating module 15 can be further configured to: when the number of failure domain units is equal to the number of replicas, if the first preset capacity balance condition is not satisfied, create a primary pool based on the minimum effective capacity and create a secondary pool based on the remaining capacity.

[0088] Further, the apparatus can further include an exception prompting module configured to: when the number of failure domain units is less than the number of replicas, output an exception prompt.

[0089] Further, the apparatus can further include a capacity expansion processing module configured to: in a case where a target pool for capacity expansion is not specified, if capacity expansion is to the primary pool and the primary pool satisfies a target capacity balance condition, expand the capacity to the primary pool, otherwise, expand the capacity to the secondary pool.

[0090] Further, the apparatus can further include a capacity reduction processing module configured to: if a rebalancing strategy is selected when reducing the capacity, in a case where a target pool for capacity reduction is the primary pool, if the secondary pool satisfies a first capacity reduction condition, reduce the capacity of the secondary pool and the primary pool, and expand the capacity of the secondary pool to the primary pool. If the rebalancing strategy is not selected when reducing the capacity, in a case where a target pool for capacity reduction satisfies the first capacity reduction condition, reduce the capacity of the target pool.

[0091] Further, the pool creating module 15 can be specifically configured to: in a case where the second preset capacity balance condition is not satisfied, create a primary pool based on the target effective capacity and create a secondary pool based on the remaining capacity according to configuration information. The configuration information includes secondary pool strategy information, and the secondary pool strategy information is to reduce the number of failure domains or reduce the number of replicas.

[0092] In an optional implementation, the apparatus further includes a write processing module configured to: determine a write pool from the primary pool and the secondary pool based on a data type of write data; and store the write data to the write pool.

[0093] In an optional implementation, the apparatus further comprises a first migration module configured to, when the water level of the main pool is higher than a preset water level threshold, migrate first target data in the main pool to the auxiliary pool, wherein the first target data is data that has not been accessed for a first preset time length.

[0094] In an optional implementation, the apparatus further comprises a second migration module configured to: determine, from the main pool, data whose time interval between a creation time and a current time is greater than a preset time interval, to obtain second target data; and migrate the second target data to the auxiliary pool.

[0095] In an optional implementation, the apparatus further comprises a third migration module configured to: determine, from the auxiliary pool, data whose access frequency in a second preset time length exceeds a preset frequency threshold, to obtain third target data; and migrate the third target data to the main pool.

[0096] It can be seen that, in the case where the number of fault domain units is greater than the number of replicas, the embodiments of the present application first determine whether the fault domain units are balanced based on the minimum effective capacity and the expected effective capacity, and if not, perform grouping recursive calculation. In the grouping recursive calculation process, the fault domain units in the current round are grouped and target fault domain unit groups are determined in each round, the target fault domain unit groups are removed and an equivalent capacity of the target fault domain unit groups is removed from other fault domain unit groups, and the next round is entered. The capacity of the target fault domain unit groups is less than or equal to the capacity of each other fault domain unit group. The target effective capacity is the sum of the capacities of the target fault domain unit groups in each round. Further, whether the fault domain units are balanced is determined based on the target effective capacity and the expected effective capacity. In the case where the fault domain units are not balanced, a main pool can be created based on the target effective capacity and an auxiliary pool can be created based on the remaining capacity. The present application can more accurately calculate the effective capacity through grouping recursive calculation, and further more accurately determine whether the fault domain units are balanced. Further, a main pool can be created based on the target effective capacity and an auxiliary pool can be created based on the remaining capacity, which can maximize the use of the fault domain units to store core data. The remaining capacity can also be used through the auxiliary pool. In this way, the utilization rate of storage resources can be improved, and serious waste of resources can be avoided.

[0097] Figure 6 The description of the features in the corresponding embodiments can be referred to Figure 6 The related description of the corresponding embodiments will not be repeated here.

[0098] Figure 7 A structural diagram of an electronic device provided by the embodiments of the present application is as follows Figure 7As shown, the electronic device includes a memory 70 for storing a computer program, and a processor 71 for implementing the steps of the storage pool creation method of the above embodiments when executing the computer program. The processor 71 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 71 can be implemented in at least one of a hardware form of a Digital Signal Processing (DSP), a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA). The processor 71 can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a Central Processing Unit (CPU). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 71 can be integrated with a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 71 can also include an Artificial Intelligence (AI) processor, which is used to process machine learning-related computing operations.

[0099] The memory 70 can include one or more computer-readable storage media that can be non-transitory. The memory 70 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In this embodiment, the memory 70 is at least used to store the following computer program 701, wherein the computer program is loaded and executed by the processor 71, and can implement the related steps of the storage pool creation method disclosed in any of the preceding embodiments. In addition, the resources stored in the memory 70 can also include an operating system 702 and data 703, etc., and the storage mode can be temporary storage or permanent storage. The operating system 702 can include Windows, Unix, Linux, etc. The data 703 can include but is not limited to configuration data, etc.

[0100] In some embodiments, the electronic device can also include a display screen 72, an input / output interface 73, a communication interface 74, a power supply 75, and a communication bus 76.

[0101] Those skilled in the art can understand that, Figure 7 The structure shown in the figure does not constitute a limitation on the electronic device, and can include more or fewer components than those shown.

[0102] It can be understood that if the storage pool creation method in the above embodiments is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), an electrically erasable programmable ROM, a register, a hard disk, a removable magnetic disk, a CD-ROM, a magnetic disk or an optical disk, and various media that can store program codes.

[0103] Based on this, the embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned storage pool creation method are implemented.

[0104] For the specific process of the above-mentioned storage pool creation method, reference can be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0105] Further, the embodiment of the present application further provides a computer program product, which includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above-mentioned storage pool creation method are implemented.

[0106] For the specific process of the above-mentioned storage pool creation method, reference can be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0107] The above describes in detail the storage pool creation method, device, equipment, medium and product provided by the embodiment of the present application. The embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the difference from other embodiments. The same or similar parts of each embodiment can be referred to. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0108] Those skilled in the art will further realize that the mere concepts, teachings, and embodiments described herein are merely meant to provide an enabling description of the claimed invention and are not intended to limit the scope of the claimed invention to these embodiments. Therefore, embodiments described herein are not meant to be limiting, but merely representative. Further, the routines executed to implement the embodiments of the invention, individually or collectively, need not be limited to any specific combination of hardware and software. Various embodiments can also be implemented using more conventional components, such as microprocessors, digital signal processors, microcomputers or microcontrollers, or using one or more analog or digital logic circuits, or using one or more ASICs or FPGAs. Current or future implementations can also take advantage of virtualization, cloud computing, or other similar technologies. Consequently, the application is not limited to the above-described embodiments, but instead has wide applicability and scope.

[0109] The above provides a storage pool creation method, device, equipment, medium and product. The principle and implementation of the application are described by applying specific examples. The above description of the embodiments is only used to help understand the method and core idea of the application. It should be pointed out that, for those skilled in the art, without departing from the principle of the application, the application can be improved and modified in many ways. These improvements and modifications also fall within the protection scope of the application.

Claims

1. A storage pool creation method characterized by, The method comprises the following steps: acquiring the number of fault domain units and the number of replicas; when the number of fault domain units is greater than the number of replicas, judging whether each fault domain unit meets a first preset capacity balance condition based on the minimum effective capacity corresponding to each fault domain unit and the expected effective capacity; if the first preset capacity balance condition is not met, performing grouping recursive calculation on the fault domain units to obtain a target effective capacity, in the grouping recursive calculation process, in each round, the fault domain units in the current round are grouped and a target fault domain unit group is determined, the target fault domain unit group and an equivalent capacity of the target fault domain unit group from other fault domain unit groups are removed, and the next round is entered, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each other fault domain unit group, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round; judging whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity; in the case that the second preset capacity balance condition is not met, creating a primary pool based on the target effective capacity and creating a secondary pool based on the remaining capacity.

2. The storage pool creating method according to claim 1, wherein The grouping recursive calculation process comprises the following steps: dividing a sequence of fault domain units in the current round into replica-number fault domain unit groups, wherein the first fault domain unit group is assigned with the first N fault domain units, and each non-first fault domain unit group is assigned with one fault domain unit in sequence, the fault domain units in the sequence are arranged in descending order of capacity, and N is equal to the number of fault domain units in the current round minus the number of replicas plus one; judging whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group; if the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group, the first fault domain unit group is determined as the target fault domain unit group, otherwise, one fault domain unit is removed from the first fault domain unit group to the subsequent fault domain unit group, and the step of judging whether the capacity of the first fault domain unit group is less than or equal to the capacity of each other fault domain unit group is triggered; when the target fault domain unit group is determined, the target fault domain unit group and an equivalent capacity of the target fault domain unit group from other fault domain unit groups are removed, and the next round is entered.

3. The storage pool creation method of claim 2, wherein, The equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, which comprises the following steps: if any fault domain unit group in the other fault domain unit groups comprises multiple fault domain units, the equivalent capacity is removed by being averagely distributed in the multiple fault domain units.

4. The storage pool creating method according to claim 3, wherein The equivalent capacity is removed by being averagely distributed in the multiple fault domain units, which comprises the following steps: the equivalent capacity is divided by the number of fault domain units in the fault domain unit group to obtain the capacity removed by each fault domain unit, and in the case that the division is not exact, the remainder is assigned to the last fault domain unit in the fault domain unit group for capacity removal.

5. The storage pool creation method of claim 1, wherein, The method further comprises the following steps: when the number of fault domain units is equal to the number of replicas, judging whether each fault domain unit meets a first preset capacity balance condition based on the minimum effective capacity corresponding to each fault domain unit and the expected effective capacity; If the first preset capacity balance condition is met, a storage pool is created based on the failure domain units.

6. The storage pool creation method of claim 5, wherein, Further comprising: If the number of failure domain units is equal to the number of replicas, and the first preset capacity balance condition is not met, a primary pool is created based on the minimum effective capacity, and a secondary pool is created based on the remaining capacity.

7. The storage pool creation method of claim 1, wherein, Further comprising: If the number of failure domain units is less than the number of replicas, an abnormal prompt is output.

8. The storage pool creation method of claim 1, wherein, Further comprising: If the target pool for expansion is not specified, if the expansion is to the primary pool, and the target capacity balance condition is met, the expansion is to the primary pool, otherwise the expansion is to the secondary pool.

9. The storage pool creating method of claim 1, wherein, Further comprising: If the rebalancing strategy is selected when shrinking, if the target pool for shrinking is the primary pool, and the first shrinking condition is met for the secondary pool, the secondary pool and the primary pool are shrunk, and the shrinking capacity of the secondary pool is expanded to the primary pool.

10. The storage pool creation method of claim 9, wherein, Further comprising: If the rebalancing strategy is not selected when shrinking, if the target pool for shrinking meets the first shrinking condition, the target pool is shrunk.

11. The storage pool creating method of claim 1, wherein, If the second preset capacity balance condition is not met, a primary pool is created based on the target effective capacity, and a secondary pool is created based on the remaining capacity, comprising: If the second preset capacity balance condition is not met, a primary pool is created based on the target effective capacity, and a secondary pool is created based on the remaining capacity according to configuration information.

12. The storage pool creation method of claim 11, wherein, The configuration information includes secondary pool strategy information, and the secondary pool strategy information is to reduce the number of failure domains or reduce the number of replicas.

13. The storage pool creation method of claim 1, wherein, Further comprising: Determining a write pool from the primary pool and the secondary pool based on the data type of the write data; Storing the write data to the write pool.

14. The storage pool creation method of claim 1, wherein, Further comprising: When the water level of the primary pool is higher than a preset water level threshold, migrating first target data in the primary pool to the secondary pool, wherein the first target data is data that has not been accessed for a first recent preset time period.

15. The storage pool creation method of claim 1, wherein, Further comprising: Determining data from the primary pool that has a time interval between the creation time and the current time greater than a preset time interval to obtain second target data; Migrating the second target data to the secondary pool.

16. The storage pool creation method of claim 1, wherein, Further comprising: Determining data from the secondary pool that has been accessed more than a preset number of times threshold in a second recent preset time period to obtain third target data; Migrating the third target data to the primary pool.

17. A storage pool creating apparatus characterized by comprising: Comprising: A pool information acquisition module for acquiring the number of failure domain units and the number of replicas; A first judgment module for determining whether the first preset capacity balance condition is met based on the minimum effective capacity and the expected effective capacity corresponding to each failure domain unit when the number of failure domain units is greater than the number of replicas. a grouping recursion module, configured to perform grouping recursion calculation on the fault domain units to obtain a target effective capacity if the first preset capacity balance condition is not met, wherein in the grouping recursion calculation, in each round, the fault domain units in the current round are grouped and a target fault domain unit group is determined, the target fault domain unit group is removed and an equivalent capacity of the target fault domain unit group is removed from other fault domain unit groups, and the next round is entered, wherein the capacity of the target fault domain unit group is less than or equal to the capacity of each of the other fault domain unit groups, and the target effective capacity is the sum of the capacities of the target fault domain unit groups in each round; a second judgment module, configured to judge whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity; a pool creation module, configured to create a main pool based on the target effective capacity and a secondary pool based on a remaining capacity if the second preset capacity balance condition is not met.

18. An electronic device, comprising: comprise: a memory, configured to store a computer program; a processor, configured to execute the computer program to implement the steps of the storage pool creation method according to any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium and is executed by the processor to implement the steps of the storage pool creation method according to any one of claims 1 to 16.

20. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the steps of the storage pool creation method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Data processing method and apparatus

    CN107704212A

  • Method and device for storing copy data in ceph

    CN108846009A

  • balanced allocation method of OSD capacity of a distributed storage system

    CN109343795A

  • Storage pool creation method and system, equipment and medium

    CN111414136A

  • Distributed storage capacity balancing optimization method, system, equipment and medium

    CN114647381A