A storage pool creation method, apparatus, device, medium and product
By performing grouped recursive computation and pool creation in a distributed storage cluster, the problem of resource waste caused by heterogeneous capacity deployment is solved, and efficient utilization of storage resources is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-20
AI Technical Summary
In distributed storage clusters, heterogeneous capacity deployment leads to serious resource waste, and existing technologies cannot effectively utilize storage resources.
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 remove the equivalent capacity, and create a primary pool and a secondary pool to optimize storage resource utilization.
It improves the utilization rate of storage resources, avoids resource waste, and enhances capacity utilization.
Smart Images

Figure CN121387205B_ABST
Abstract
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 beneficial effect of the present application is that in the case that the number of fault domain units is greater than the number of replicas, firstly, whether each fault domain unit is balanced is 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 unit of the current round is 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 it is balanced is further judged based on the target effective capacity and the expected effective capacity, and in the case that it is 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 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 also 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.
[0013] Figure 2 A storage pool creation flow chart is provided for the embodiments of the present application.
[0014] Figure 3 A data writing schematic diagram is provided for the embodiments of the present application.
[0015] Figure 4 A storage pool expansion schematic diagram is provided for the embodiments of the present application.
[0016] Figure 5 A storage pool capacity reduction schematic diagram is provided for the embodiments of the present application.
[0017] Figure 6 A storage pool creation device schematic diagram is provided for the embodiments of the present application.
[0018] Figure 7 A structural diagram of an electronic device is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be apparently and completely described below with reference to the drawings in 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. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0020] The terms of “include” and “have” and any variations in the specification and above drawings of the present application, as well as any variations related to “include” and “have”, are intended to cover the inclusions without the exclusions. 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 the steps or units not listed.
[0021] 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 minimum capacity node, resulting in serious resource waste and extremely low utilization rate of large capacity nodes (such as 3 node 16T / 32T / 64T+3 replica scenario, and the utilization rate of 64T node is only 25%); the actual available capacity of the storage pool is limited by the minimum node (such as 12 disk position nodes limiting the effective output of 24 disk position nodes and 36 disk position nodes). The traditional algorithm cannot break through the node-level fault domain constraint and cannot adapt to the dynamic resource scheduling of the capacity heterogeneous scene. Therefore, the present application provides a storage pool creation scheme, which can improve the utilization rate of storage resources and avoid serious resource waste.
[0022] 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 drawings and specific embodiments.
[0023] Next, a storage pool creation method provided by the embodiments of the present application will be described in detail. Figure 1 A storage pool creation method flowchart is provided for the embodiments of the present application, and the storage pool creation method includes the following steps.
[0024] Step S11: Obtain the number of fault domain units and the number of replicas.
[0025] 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).
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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.
[0035] Step S14: determining whether a second preset capacity balance condition is met based on the target effective capacity and the expected effective capacity.
[0036] 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 then 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 then 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 if the ratio is greater than a preset ratio, 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.
[0037] 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.
[0038] 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 can be stored in this embodiment, and the storage resources can be divided 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 delay, 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 used to improve the capacity utilization rate. Data life cycle management is performed, that is, a management mechanism is automatically used to migrate data between the primary pool and the secondary pool according to the data creation time, access frequency and other characteristics.
[0039] 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 the storage pool 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 the storage pool 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.
[0040] In the optional embodiment, if the second preset capacity balance condition is met, one storage pool is created based on each failure domain unit.
[0041] 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 configuration information.
[0042] 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. That is, the secondary pool reduces the number of failure domains or the number of replicas relative to the primary pool.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] In the embodiment, when the number of failure domain units is less than the number of replicas, an abnormal prompt is output.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] In an optional implementation, the embodiment of the present application can further include: determining, from the primary 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 migrating the second target data to the secondary pool.
[0052] That is, the embodiment of the present application can trigger data migration according to a life cycle, for example, data that has been created for more than 90 days (such as historical orders) is automatically migrated from the primary pool to the secondary pool.
[0053] In an optional implementation, the embodiment of the present application can further include: determining, from the secondary pool, data that has been accessed for a second preset time length more than a preset number of times threshold, to obtain third target data; and migrating the third target data to the primary pool.
[0054] That is, the embodiment can also be reversely migrated, data in the secondary pool that has been accessed for more than or equal to 5 times in 3 days is automatically migrated back to the primary pool.
[0055] Further, the embodiment of the present application can further include: in a 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] wherein 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, the preset proportion coefficient being 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.
[0060] 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.
[0061] 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.
[0062] wherein 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.
[0063] 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.
[0064] Further, referring to Figure 2 shown, Figure 2This invention provides a flowchart for creating a storage pool. Users create a storage pool through an interface, setting fault domains, the number of fault domain units, and the number of replicas. Taking fault domains as nodes as an example, fault domain units are nodes, and the number of fault domain units is the number of nodes. There are three main scenarios: number of nodes < number of replicas, number of nodes = number of replicas + number of nodes > number of replicas. In the first scenario (number of nodes < number of replicas), deployment is not possible, and the interface will directly display a prompt or report an error, without needing to determine whether the pool is balanced. In the second scenario (number of nodes = number of replicas), the capacity of the node with the smallest capacity is determined as the minimum effective capacity. If the pool is unbalanced, a tiered system can be created, i.e., a primary pool and a secondary pool. Each node in the primary pool is allocated a minimum effective capacity, and the rest enters the secondary pool (e.g., in scenarios with 12T, 24T, and 36T, each node in the primary pool receives 12T, 12T, 12T, and the remaining capacity in the secondary pool is 12T, 24T, and 36T). The strategy for the secondary pool is then configured according to the interface settings. For example, it can be configured to reduce fault domains or reduce replicas. Whether to perform tiering, tiering by reduction strategy or tiering by fault domain, can be reconfigured by the user. Tiering by reduction strategy is equivalent to tiering by reducing replicas. If the system is balanced, no tiering is performed, and a storage pool is created. The minimum capacity (minimum effective capacity * 1.2) is greater than or equal to the expected capacity (expected effective capacity), indicating a balanced system. The third scenario is where the number of nodes > the number of replicas: In this scenario, it first checks if the system is balanced, i.e., whether the minimum effective capacity and the expected effective capacity meet the first preset balance condition. If not, it further performs grouping and recursively calculates the effective capacity to obtain the recursive capacity (the aforementioned target effective capacity), and then checks if the system is balanced again. If it is unbalanced, tiered storage pools can be created. If the recursive capacity * 1.2 is greater than or equal to the expected capacity (expected effective capacity), the system is balanced; otherwise, it is unbalanced. The strategy can be configured through the interface: no tiering, tiering by reduction strategy, or tiering by fault domain. If tiering is performed, two storage pools are created: a primary pool and a secondary pool. If no tiering is performed, one storage pool is created. Expected effective capacity = total capacity / number of replicas; minimum effective capacity = minimum capacity * number of nodes / number of replicas. The first preset equilibrium condition can be that the minimum capacity (i.e., minimum effective capacity * 1.2) is greater than or equal to the expected capacity (i.e., expected effective capacity). If the condition is met, the equilibrium is achieved. Alternatively, the first preset equilibrium condition can be that the difference between the minimum effective capacity and the expected effective capacity is greater than the ratio of the minimum effective capacity to the expected effective capacity. If the ratio is greater than the preset coefficient ratio, the condition is not met, i.e., the equilibrium is achieved. For example, the preset coefficient ratio is 0.2.
[0065] 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 waste of 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.
[0066] 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).
[0067] 2. Group recursive calculation (number of nodes, number of copies, list table).
[0068] 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- copy number + 1)); the second group capacity: list (len- copy number + 2); the third group capacity: list (len- copy number + 3), wherein 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, 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. If the number of nodes is less than the number of copies: exit and return (effective capacity (i.e., the sum of the effective capacities of each round), list table).
[0069] 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.
[0070] Table 1
[0071]
[0072] 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.
[0073] 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 capacity of the second group and whether the capacity of the first group is less than or equal to the capacity of the third group. If the above judgment condition is not met, the second grouping is performed: 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 capacity of the second group and whether the capacity of the first group is less than or equal to the capacity of the third group. If the above judgment condition is not met, the grouping is continued until the fifth grouping: the first group is the first 4, and the sum is obtained to obtain the capacity of the group. The second group is the 5th to the 8th, and the sum is obtained to obtain 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 capacity of the second group and whether the capacity of the first group is less than or equal to the capacity of the third group. If the above judgment condition is met, the effective capacity of this round is 31T, the first 4 nodes can be divided into the main pool, the two groups can be divided into the main pool, and the capacities of the two groups are 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, the first group is removed, that is, the 9th and 5th nodes, and the 8th and 6th nodes share 26T. The 7th node is removed by 26T. Grouping recursive calculation third round (7-3, 8-13, 6-16), the effective capacity of this round is 3T, the first node is removed, and the remaining 2 nodes are recursive. The target effective capacity is the grouping recursive capacity, which is 31T+26T+3T=60T.
[0074] 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.
[0075] Table 2
[0076]
[0077] 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.
[0078] 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. 5 times, automatically migrate back to the main pool. For example, seeFigure 3 As shown in the figure, 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.
[0079] Further, referring to Figure 4 As shown in the figure, 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 the specified pool, directly expanding to the pool; if it is automatic calculation, selecting to judge the resource waste condition after expanding into the main pool, the calculation algorithm is the same as the recursive calculation effective capacity algorithm of the created storage pool grouping, and then judging whether it is balanced or not. 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 it is greater than or equal to, it indicates that it is balanced, and then the expansion is performed to the main pool, otherwise it is not balanced, and then the expansion is performed to the auxiliary pool. The capacity difference coefficient is 1.2.
[0080] Further, referring to Figure 5 As shown in the figure, 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. 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, performing step 3; 3, judging whether the selected disk is in the main pool or the auxiliary pool (the contraction is in the storage pool dimension, and the disks of the main pool and the auxiliary pool cannot be selected together for contraction, and in order to ensure the reliability of the 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, performing step 4; 4, the main pool contraction rebalancing strategy is that the disks of the auxiliary pool in the same failure domain (such as the same node) are contracted to join the main pool, so as to achieve the capacity balance of the main pool. If there is no disk in the auxiliary pool in the same failure domain, no operation is performed. At the same time, considering that the auxiliary pool has written data and has no extra space for contraction, the remaining capacity is first judged, and 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.
[0081] This invention provides a dynamic capacity detection mechanism: identifying heterogeneous scenarios and being compatible with capacity fluctuations caused by disk failures; and a multi-strategy decision-making model: dynamically selecting balancing / replica reduction / fault domain reduction strategies based on business priorities and resource status; a grouped recursive calculation algorithm for effective capacity: recursively calculating the maximum available space of the main pool, resulting in more accurate effective capacity calculation; and adaptive scaling: automatically calculating scenarios and adding disks to the corresponding pools to improve disk utilization. Capacity detection methods include: the calculation logic for the ratio of node capacity to the average value, the setting of the 80%-120% threshold, and the triggering mechanism; a multi-strategy deployment scheme: providing applicable scenarios, decision logic, and methods for creating tiered storage pools for four strategies; a grouped recursive calculation algorithm: calculating effective capacity in groups and recursively calculating effective capacity, and generating a partitioning method for the main pool and auxiliary pools; and migration and scaling strategies.
[0082] This invention addresses the issue of heterogeneous capacity, such as significant capacity discrepancies between single-node disks and those on other nodes, leading to capacity imbalance. Through a comprehensive mechanism encompassing capacity detection, multi-strategy deployment, tiered storage, and dynamic scaling, it achieves a balance between efficient storage resource utilization and reliability. Intelligent tiering and migration overcome traditional fault domain constraints. The solution provided by this invention improves capacity utilization: in a 3-node, 12 / 24 / 36T+3 replica scenario, capacity utilization increases from 25% (traditional solution) to over 65%, ensuring reliability; enhances business adaptability, supporting diverse needs across multiple scenarios. Core data maintains high redundancy through the primary pool, while non-core data balances cost and reliability through a secondary pool, enhancing flexibility; optimizes operational efficiency, reducing manual intervention costs, improving scaling efficiency by 50%, and supporting dynamic adjustment of tiering strategies to adapt to business changes; reduces costs: minimizes idle large-capacity nodes, reducing hardware investment per cluster by 30%-40%; and ensures controllable data risk: migration does not affect business continuity. Future scalability is extendable to multi-cloud scenarios, further improving resource utilization through unified tiering strategies for cross-cloud storage pool management.
[0083] See Figure 6 As shown in the figure, an embodiment of the present invention provides a storage pool creation device, including the following modules.
[0084] Pool information acquisition module 11 is used to acquire the number of fault domain units and the number of replicas.
[0085] The first judgment module 12 is used to determine whether each fault domain unit meets the first preset capacity balancing condition based on the minimum effective capacity and the expected effective capacity corresponding to each fault domain unit when the number of fault domain units is greater than the number of replicas.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] Further, the apparatus can further include a capacity reduction processing module configured to: if a re-balance 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 re-balance strategy is not selected when reducing the capacity, in a case where the target pool for capacity reduction satisfies the first capacity reduction condition, reduce the capacity of the target pool.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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 and the equivalent capacity of the target fault domain unit groups from other fault domain unit groups are removed, 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, the main pool can be created based on the target effective capacity and the auxiliary pool can be created based on the remaining capacity. Through grouping recursive calculation, the embodiments of the present application can more accurately calculate the effective capacity, and further more accurately determine whether the fault domain units are balanced. Further, the main pool can be created based on the target effective capacity and the 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 by the auxiliary pool. In this way, the utilization rate of storage resources can be improved, and serious waste of resources can be avoided.
[0103] Figure 6 The description of the features in the corresponding embodiments can be referred to Figure 6 the related description of the corresponding embodiments, which will not be repeated here.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] Those skilled in the art can understand that, Figure 7 The structures shown in the figures do not constitute a limitation on the electronic device, and can include more or fewer components than those shown.
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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 embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the related parts can be referred to the method part.
[0114] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0115] The foregoing has provided a detailed description of a storage pool creation method, apparatus, device, medium, and product provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. A method for creating a storage pool, characterized in that, include: Obtain the number of fault domain units and replicas; When the number of fault domain units is greater than the number of replicas, it is determined whether each fault domain unit meets the first preset capacity balancing condition based on the minimum effective capacity and the expected effective capacity corresponding to each fault domain unit. If the first preset capacity balancing condition is not met, the fault domain units are recursively grouped to obtain the target effective capacity. In the grouping recursive calculation process, each round groups the fault domain units of the current round and determines the target fault domain unit group. 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 before entering the next round. 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. Based on the target effective capacity and the expected effective capacity, determine whether the second preset capacity balance condition is met; If the second preset capacity balancing condition is not met, a main pool is created based on the target effective capacity and an auxiliary pool is created based on the remaining capacity. The grouping recursive calculation process includes: The fault domain unit sequence of the current round is divided into a number of replica fault domain unit groups. The first fault domain unit group is allocated the first N fault domain units, and the non-first fault domain unit groups are allocated one fault domain unit in sequence. The fault domain units in the current round in the fault domain unit 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 replicas plus one. Determine 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, then the first fault domain unit group is determined as the target fault domain unit group; otherwise, a fault domain unit is removed from the first fault domain unit group and moved to its subsequent fault domain unit group, and the step of determining 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. Once a target fault domain unit group is identified, the target fault domain unit group is removed, and its equivalent capacity is removed from other fault domain unit groups, before proceeding to the next round.
2. The storage pool creation method according to claim 1, characterized in that, Removing the equivalent capacity of the target fault domain unit group from other fault domain unit groups includes: If any fault domain unit group in other fault domain unit groups includes multiple fault domain units, then the equivalent capacity is removed by distributing it equally among the multiple fault domain units.
3. The storage pool creation method according to claim 2, characterized in that, The removal of the equal capacity is carried out by distributing it equally among the multiple fault domain units, including: Divide the equal capacity by the number of fault domain units in the fault domain unit group to obtain the capacity to be removed from each fault domain unit. If the capacity is not divisible, allocate the remainder to the last fault domain unit in the fault domain unit group for capacity removal.
4. The storage pool creation method according to claim 1, characterized in that, Also includes: When the number of fault domain units is equal to the number of replicas, it is determined whether each fault domain unit meets the first preset capacity balancing condition based on the minimum effective capacity and the expected effective capacity corresponding to each fault domain unit. If the first preset capacity balancing condition is met, a storage pool is created based on each fault domain unit.
5. The storage pool creation method according to claim 4, characterized in that, Also includes: When the number of fault domain units equals the number of replicas, if the first preset capacity balancing condition is not met, a primary pool is created based on the minimum effective capacity and an auxiliary pool is created based on the remaining capacity.
6. The storage pool creation method according to claim 1, characterized in that, Also includes: If the number of fault domain units is less than the number of replicas, an error message will be output.
7. The storage pool creation method according to claim 1, characterized in that, Also includes: If no target pool is specified for expansion, and the expansion is to the main pool, and the main pool meets the target capacity balancing condition, then the expansion is to the main pool; otherwise, the expansion is to the auxiliary pool.
8. The storage pool creation method according to claim 1, characterized in that, Also includes: If a rebalancing strategy is selected during scaling down, and the target pool for scaling down is the main pool, if the auxiliary pool meets the first scaling down condition, then the auxiliary pool and the main pool are scaled down, and the scaled-down capacity of the auxiliary pool is expanded to the main pool.
9. The storage pool creation method according to claim 8, characterized in that, Also includes: If a rebalancing strategy is not selected during scaling down, the target pool will be scaled down if the target pool meets the first scaling down condition.
10. The storage pool creation method according to claim 1, characterized in that, If the second preset capacity balancing 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, including: If the second preset capacity balancing condition is not met, a primary pool is created based on the configuration information and the target effective capacity, and an auxiliary pool is created based on the remaining capacity.
11. The storage pool creation method according to claim 10, characterized in that, The configuration information includes auxiliary pool policy information, which is either reducing the number of fault domains or reducing the number of replicas.
12. The storage pool creation method according to claim 1, characterized in that, Also includes: The write pool is determined from the main pool and the auxiliary pool based on the data type of the data being written. The write data is stored in the write pool.
13. The storage pool creation method according to claim 1, characterized in that, Also includes: When the water level in the main pool is higher than a preset water level threshold, the first target data in the main pool is migrated to the auxiliary pool, wherein the first target data is data that has not been accessed within a first preset time period.
14. The storage pool creation method according to claim 1, characterized in that, Also includes: The second target data is obtained by determining data from the main pool whose time interval between creation time and current time is greater than a preset time interval. The second target data is migrated to the auxiliary pool.
15. The storage pool creation method according to claim 1, characterized in that, Also includes: From the auxiliary pool, data whose access frequency exceeds a preset threshold within a second recent preset time period is determined to obtain the third target data; The third target data is migrated to the main pool.
16. A storage pool creation apparatus, characterized in that, include: The pool information acquisition module is used to obtain the number of fault domain units and the number of replicas; The first judgment module is used to determine whether each fault domain unit meets the first preset capacity balancing condition based on the minimum effective capacity and the expected effective capacity corresponding to each fault domain unit when the number of fault domain units is greater than the number of replicas. The grouping recursive module is used to perform grouping recursive calculation on each fault domain unit if the first preset capacity balancing condition is not met, to obtain the target effective capacity. In the grouping recursive calculation process, each round groups the fault domain units of the current round and determines the target fault domain unit group, removes the target fault domain unit group and removes the equivalent capacity of the target fault domain unit group from other fault domain unit groups, and enters the next round. 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. The second judgment module is used to determine whether the second preset capacity balancing condition is met based on the target effective capacity and the expected effective capacity. The pool creation module is used to create a main pool based on the target effective capacity and an auxiliary pool based on the remaining capacity when the second preset capacity balancing condition is not met. The grouping recursive calculation process includes: The fault domain unit sequence of the current round is divided into a number of replica fault domain unit groups. The first fault domain unit group is allocated the first N fault domain units, and the non-first fault domain unit groups are allocated one fault domain unit in sequence. The fault domain units in the current round in the fault domain unit 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 replicas plus one. Determine 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, then the first fault domain unit group is determined as the target fault domain unit group; otherwise, a fault domain unit is removed from the first fault domain unit group and moved to its subsequent fault domain unit group, and the step of determining 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. Once a target fault domain unit group is identified, the target fault domain unit group is removed, and its equivalent capacity is removed from other fault domain unit groups, before proceeding to the next round.
17. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the storage pool creation method as described in any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the storage pool creation method as described in any one of claims 1 to 15.
19. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the storage pool creation method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Data processing method and apparatus
CN107704212A
Method and device for storing copy data in ceph
CN108846009A