A distributed storage system scaling method, device, equipment and medium
By dividing the distributed storage system into logical partitions and dynamic groups, and constructing a partition node group mapping table, the migration storm and business jitter problems during the scaling up and down process are solved, and efficient scaling up and down operations are achieved.
Patent Information
- Application Number
- CN202511350786.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Existing distributed storage systems suffer from severe business jitter during scaling up and down, especially when the cluster is being expanded, the scale and time of data migration increase exponentially, and the hardware failure rate is high, leading to migration storms and business jitter.
By dividing the global data space into logical partitions and dynamically grouping physical nodes, a partition node group mapping table is constructed to manage the mapping relationship between logical partitions and node groups. Data rebalancing is performed using the node allocation rules within the group, avoiding global data migration and requiring only adjustments to some partition mappings.
It significantly reduced the amount of data migration, avoided migration storms and business fluctuations, improved system reliability and availability, and supported expansion to tens of thousands of nodes.
Smart Images

Figure CN120848812B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed storage technology, and in particular to a method, apparatus, device, and medium for scaling up and down a distributed storage system. Background Technology
[0002] With the explosive growth of data volume, data rebalancing has become a key threat to business stability when dealing with the challenges of massive data storage. On the one hand, under traditional architectures, the scale and time of data migration increase exponentially when expanding a cluster. On the other hand, large-scale clusters have high hardware failure rates, and frequent disk replacements or node outages trigger "migration storms," with multiple nodes competing for resources during concurrent migrations, exacerbating business fluctuations.
[0003] Current distributed storage systems have a single-layer architecture. Under this architecture, changes in nodes require global data redistribution, which leads to serious business jitter. Therefore, how to avoid business jitter during scaling up and down has become a technical problem that needs to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for scaling up and down a distributed storage system. This method manages the mapping relationship between logical partitions and node groups by dividing the data space and physical nodes and constructing a partition node group mapping table, thus avoiding migration storms and business jitter issues. The specific solution is as follows:
[0005] Firstly, this application provides a method for scaling up and down a distributed storage system, including:
[0006] Based on the configuration parameters corresponding to the target distributed storage system, the global data space of the target distributed storage system is divided into several logical partitions, and a corresponding partition identifier is assigned to each logical partition, and the logical partition corresponding to each data object in the target distributed storage system is determined.
[0007] The physical nodes in the target distributed storage system are dynamically divided into several node groups, and each node group is assigned a corresponding group identifier; wherein each node group includes at least two physical nodes.
[0008] A partition node group mapping table is constructed based on the partition identifier and the group identifier, a node allocation rule within the group is constructed, and a target scaling up / down event in the target distributed storage system is responded to. If the target scaling up event is a node change event, the data objects in the target node group where the node change has occurred are rebalanced using the node allocation rule within the group. The partition node group mapping table includes the mapping relationship between each logical partition and each node group.
[0009] If the target expansion event is a node group change event, then based on the partition node group mapping table, partition rebalancing is performed among the affected node groups to expand or shrink the target distributed storage system.
[0010] Optionally, the step of dividing the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system includes:
[0011] Obtain the configuration parameters corresponding to the target distributed storage system; wherein, the configuration parameters include the system resource throughput, system latency requirements, and hardware resource status of the target distributed storage system;
[0012] The number of target partitions corresponding to the global data space is determined based on the configuration parameters, and the global data space is divided into the number of logical partitions corresponding to the target number of partitions.
[0013] Optionally, determining the logical partition corresponding to each data object in the target distributed storage system includes:
[0014] Obtain the target key corresponding to each of the data objects, process each target key using a consistent hash function to obtain the corresponding processing result, and perform a modulo operation between each processing result and the number of target partitions to obtain the logical partition corresponding to each of the data objects.
[0015] Optionally, the method for scaling up and down the distributed storage system further includes:
[0016] Construct a node group member table; wherein, the node group member table includes the physical nodes corresponding to each node group;
[0017] If the number of nodes in any node group changes, the node groups are reorganized based on the number of nodes corresponding to each node group, and the node group member table is updated based on the reorganized node groups.
[0018] Optionally, the method for scaling up and down the distributed storage system further includes:
[0019] Obtain the data read / write request sent by the target client; wherein, the data read / write request includes the target partition identifier of the target logical partition corresponding to the data to be read / written;
[0020] The partition node group mapping table is queried to determine the target group identifier of the target node group corresponding to the target logical partition, and the target group identifier is used to query the node group member table to obtain the corresponding query results;
[0021] Based on the query results and the node allocation rules within the group, the target physical node corresponding to the data to be read and written is determined, so as to perform data read and write operations on the data to be read and written.
[0022] Optionally, the step of rebalancing the data objects in the target node group where node changes have occurred using the intra-group node allocation rules includes:
[0023] Determine the current number of nodes in the target node group, and determine the current data replica distribution in the target node group based on the node allocation rules within the group;
[0024] Based on the current data replica distribution, the current number of nodes, and the target data processing technology, the data objects in the target node group are rebalanced; wherein, the target data processing technology includes incremental migration technology and asynchronous replication technology.
[0025] Optionally, the partition rebalancing among affected node groups based on the partition node group mapping table includes:
[0026] The number of current node groups and the amount of data stored in each node group in the target distributed storage system are determined, and partition rebalancing is performed among the affected node groups based on the number of current node groups, the amount of data stored in each node group, and the partition node group mapping table.
[0027] Secondly, this application provides a distributed storage system scaling device, comprising:
[0028] The data space partitioning module is used to divide the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system, assign corresponding partition identifiers to each logical partition, and determine the logical partitions corresponding to each data object in the target distributed storage system.
[0029] The node partitioning module is used to dynamically divide each physical node in the target distributed storage system into several node groups, and assign a corresponding group identifier to each node group; wherein, any node group includes at least two physical nodes.
[0030] The data rebalancing module is used to construct a partition node group mapping table based on the partition identifier and the group identifier, construct node allocation rules within the group, and respond to target scaling events in the target distributed storage system. If the target scaling event is a node change event, the module uses the node allocation rules within the group to rebalance the data objects in the target node group where the node change has occurred. The partition node group mapping table includes the mapping relationship between each logical partition and each node group.
[0031] The partition rebalancing module is used to perform partition rebalancing among the affected node groups based on the partition node group mapping table if the target expansion event is a node group change event, so as to expand or shrink the target distributed storage system.
[0032] Thirdly, this application provides an electronic device, comprising:
[0033] Memory, used to store computer programs;
[0034] A processor is used to execute the computer program to implement the aforementioned method for scaling up and down a distributed storage system.
[0035] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned method for scaling up and down a distributed storage system.
[0036] This application first divides the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system. A corresponding partition identifier is assigned to each logical partition, and the logical partition corresponding to each data object in the target distributed storage system is determined. Then, each physical node in the target distributed storage system is dynamically divided into several node groups, and a corresponding group identifier is assigned to each node group. Each node group includes at least two physical nodes. Next, a partition node group mapping table is constructed based on the partition identifiers and group identifiers. Intra-group node allocation rules are established, and a target scaling-up / scaling event in the target distributed storage system is responded to. If the target scaling-up event is a node change event, the intra-group node allocation rules are used to rebalance the data objects in the target node group where the node change occurred. The partition node group mapping table includes the mapping relationship between each logical partition and each node group. If the target scaling-up event is a node group change event, partition rebalancing is performed among the affected node groups based on the partition node group mapping table to scale up / down the target distributed storage system. As can be seen, this application decouples data management from physical topology by dividing the global data space into logical partitions and dynamically grouping physical nodes; by constructing a partition node group mapping table to manage the mapping relationship between logical partitions and node groups, it enables scaling operations to only require adjusting some partition mappings without triggering global data migration, greatly reducing the amount of data migration and thus fundamentally avoiding the problems of migration storms and business jitter. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1 This is a flowchart of a method for scaling up or down a distributed storage system disclosed in this application;
[0039] Figure 2 This is a schematic diagram of a distributed storage system architecture disclosed in this application;
[0040] Figure 3 This application discloses a flowchart for expanding capacity; wherein, (a) is a flowchart for changing nodes, and (b) is a flowchart for changing node groups;
[0041] Figure 4 This application discloses a data access flowchart;
[0042] Figure 5 This is a schematic diagram of the structure of a distributed storage system expansion and contraction device disclosed in this application;
[0043] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] In current distributed storage system architectures, node changes require global data redistribution, leading to severe business instability. To address this, this application provides a method for scaling up and down distributed storage systems. This method manages the mapping relationship between logical partitions and node groups by dividing the data space and physical nodes and constructing a partition node group mapping table, thus avoiding migration storms and business instability.
[0046] See Figure 1 As shown in the figure, an embodiment of the present invention discloses a method for scaling up and down a distributed storage system, including:
[0047] Step S11: Based on the configuration parameters corresponding to the target distributed storage system, divide the global data space of the target distributed storage system into several logical partitions, assign corresponding partition identifiers to each logical partition, and determine the logical partitions corresponding to each data object in the target distributed storage system.
[0048] The system structure in this embodiment is as follows: Figure 2 As shown, the system comprises a logical partitioning layer, a node group layer, and a physical node layer. During system initialization, a storage cluster consisting of multiple physical nodes is constructed. Each node possesses independent computing, storage, and network resources and can communicate with other nodes. The entire system's global data space is uniformly managed and divided into several fixed-size logical partitions based on configuration parameters. Each partition is assigned a unique identifier (PID). This logical partitioning design not only helps reduce metadata overhead but also provides finer-grained control in operations such as data migration and replica scheduling.
[0049] In this embodiment, the process of dividing the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system may specifically include: obtaining the configuration parameters corresponding to the target distributed storage system; wherein, the configuration parameters include the system resource throughput, system latency requirements, and hardware resource status of the target distributed storage system; determining the number of target partitions corresponding to the global data space according to the configuration parameters, and dividing the global data space into the number of logical partitions of the target partitions.
[0050] In addition, the process of determining the logical partitions corresponding to each data object in the target distributed storage system may specifically include: obtaining the target key corresponding to each data object, processing each target key using a consistent hash function to obtain the corresponding processing result, and performing a modulo operation between each processing result and the number of target partitions to obtain the logical partitions corresponding to each data object.
[0051] Specifically, the entire data space is divided into P logical partitions, where P is a configurable parameter. The size of each partition determines the amount of data it carries, thus affecting the overall system performance and management complexity. Larger partitions may lead to higher migration costs and uneven load distribution, while smaller partitions will increase the burden of metadata maintenance. Therefore, the choice of the value of P needs to comprehensively consider the system's throughput, latency requirements, and hardware resources (i.e., configuration parameters).
[0052] Correspondingly, the key of the data object, i.e., the target key, is processed by a hash function, and its logical partition is determined by modulo operation:
[0053] ;
[0054] Hash() is a consistent hash function used to ensure a uniform distribution of data objects across partitions, employing a 32-bit right shift operation to reduce the probability of hash collisions. This design guarantees that even with changes in the number of partitions, the scope of data redistribution is minimized.
[0055] Step S12: Dynamically divide each physical node in the target distributed storage system into several node groups, and assign a corresponding group identifier to each node group; wherein, any node group includes at least two physical nodes.
[0056] To enhance the system's fault tolerance and flexibility, this invention further dynamically divides the N physical nodes into M logical node groups, each containing G nodes (G is not less than 2). Each node group is assigned a unique group identifier GID (Group ID) and serves as the basic unit for fault domains and migration domains.
[0057] The distributed storage system scaling method in this embodiment further includes: constructing a node group member table; wherein the node group member table includes the physical nodes corresponding to each node group; if the number of nodes in any node group changes, the node groups are reorganized based on the number of nodes corresponding to each node group, and the node group member table is updated based on the reorganized node groups.
[0058] In other words, the node group construction process supports dynamic adjustment. When a node joins or leaves the cluster, the system can automatically reorganize the node groups to maintain a reasonable number of nodes within each group. Node group member information is maintained through a centralized Group Membership Table (GMT), recorded in the following format:
[0059] ;
[0060] The GMT table is maintained uniformly by the coordination service (metadata management module) and can be dynamically updated at runtime. This design allows node groups to adapt to different deployment environments and topologies, thereby improving system reliability and availability.
[0061] Step S3: Construct a partition node group mapping table based on the partition identifier and the group identifier, construct node allocation rules within the group, and respond to the target scaling up / down event in the target distributed storage system. If the target scaling up event is a node change event, then use the node allocation rules within the group to rebalance the data objects in the target node group where the node change has occurred. The partition node group mapping table includes the mapping relationship between each logical partition and each node group.
[0062] The core of this embodiment lies in constructing a two-layer mapping structure, including a global partition mapping table, namely the partition node group mapping table (Global Partition Table, GPT), and an intra-group mapping rule (IGMR), namely the intra-group node allocation rule, which are used to determine the mapping relationship between logical partitions and node groups, as well as the specific storage location of each replica within a node group.
[0063] The global partition mapping table records the mapping relationship between each logical partition and its current belonging node group, in the following form:
[0064] ;
[0065] This mapping relationship can be achieved through various strategies, including but not limited to the following three methods:
[0066] Group-based Consistent Hashing: Each node group is treated as a virtual node and inserted into a consistent hash ring. Data partitions are located to the nearest node group through the hash ring.
[0067] Dynamic Modular Assignment: Uses a simple modulo operation to determine the group corresponding to the partition.
[0068] GID = PID mod M;
[0069] This method is suitable for scenarios with high performance requirements and relatively balanced loads;
[0070] Load-Aware Placement: Dynamically adjusts the mapping relationship between partitions and groups based on the current load status of each node group (such as CPU utilization, memory usage, disk I / O, etc.) to achieve better load balancing.
[0071] The above strategies can be flexibly switched or even used in combination according to the actual application scenario to meet the performance and stability goals under different business needs.
[0072] After determining the node group to which the partition belongs, it is necessary to further select specific physical nodes within the group to store data replicas. To this end, this invention defines a set of Intra-Group Mapping Rules (IGMR), whose inputs are the partition identifier (PID) and the group identifier (GID), and whose output is a set of R physical nodes:
[0073] ;
[0074] Here, R stands for Replication Factor, typically set to 3 to ensure high data availability. IGMR can be implemented based on existing mature algorithms, such as CRUSH (Controlled Replication Under Scalable Hashing, a distributed data distribution algorithm) or intra-group consistent hashing mechanisms. These algorithms can intelligently determine the distribution location of replicas based on factors such as the state and topology of nodes within the group, thereby avoiding single points of failure, improving data reliability, and optimizing read and write performance.
[0075] Furthermore, since IGMR only operates within the range of G nodes in the node group, its computational complexity is low, which is beneficial for improving the system's response speed and scalability.
[0076] In this embodiment, if the target scaling event is a node change event, the data objects in the target node group where the node change occurred are rebalanced using the intra-group node allocation rules. Specifically, the process of rebalancing the data objects in the target node group using the intra-group node allocation rules may include: determining the current number of nodes in the target node group and determining the current data replica distribution in the target node group based on the intra-group node allocation rules; and rebalancing the data objects in the target node group according to the current data replica distribution, the current number of nodes, and the target data processing technology. The target data processing technology includes incremental migration technology and asynchronous replication technology.
[0077] Specifically, such as Figure 3 As shown in (a), when a new physical node N joins the cluster and is assigned to an existing node group, the system performs the following operations:
[0078] (1) Node registration and group member update:
[0079] After a new node is successfully registered, the system adds it to the member list of the target group and updates the GMT table.
[0080] (2) Trigger intra-group rebalancing operation:
[0081] When the system detects a change in group members, it automatically triggers an Intra-Group Rebalancing process. This process re-executes the IGMR mapping algorithm to calculate the replica distribution after the new node is added.
[0082] (3) Data migration and load balancing:
[0083] The data migration engine migrates some data copies originally belonging to other nodes to the new node, with the migration amount being approximately 1 / (G+1) of the total data volume within the group. This process employs incremental migration and asynchronous replication mechanisms to ensure minimal impact on online services.
[0084] (4) Eventual consistency maintenance:
[0085] After the migration is complete, the system updates the IGMR mapping results and notifies the coordination service to refresh the relevant metadata to ensure that subsequent requests can correctly hit the new node.
[0086] In addition, the distributed storage system scaling method in this embodiment further includes: obtaining a data read / write request sent by a target client; wherein the data read / write request includes a target partition identifier of the target logical partition corresponding to the data to be read / written; querying a partition node group mapping table to determine the target group identifier of the target node group corresponding to the target logical partition, and using the target group identifier to query the node group member table to obtain the corresponding query result; determining the target physical node corresponding to the data to be read / written according to the query result and the node allocation rules within the group, so as to perform data read / write operations on the data to be read / written.
[0087] Specifically, such as Figure 4 As shown, when a client initiates a write request, the execution flow is as follows:
[0088] (1) Key-value hash calculation and partition location:
[0089] The client first performs a consistent hash operation on the unique key of the data object, and then determines the logical partition identifier (PID) to which the data belongs through a modulo operation:
[0090] ;
[0091] (2) Global partition mapping table lookup:
[0092] The system then queries the Global Partition Map (GPT) to obtain the Group Identifier (GID) to which the partition currently belongs. This process is typically supported by the Coordination Service module to ensure that the mapping between partitions and group nodes is up-to-date.
[0093] (3) Obtaining node group member information:
[0094] After obtaining the GID of the target group, the client further queries the Node Group Membership Table (GMT) to obtain a list of all active physical nodes in that group. ;
[0095] (4) Calculation of replica nodes within the group:
[0096] Based on the above information and the Intragroup Mapping Rule (IGMR), the system calculates the set of R physical nodes that should be written to the partition replica:
[0097] ;
[0098] (5) Concurrent writes to replica nodes:
[0099] The client writes data concurrently to these R replica nodes. The system can adopt a synchronous write strategy (such as strong consistency mode) or an asynchronous write strategy (such as eventual consistency mode), and the specific method can be flexibly configured according to application requirements.
[0100] The same process is used to locate the group and node to which the PID belongs, and read from the primary replica.
[0101] By using node groups as migration domains, the data migration scope of scaling operations is compressed from the entire network to the inter-group level, completely avoiding network-wide data redistribution; Intra-group Mapping Rules (IGMR) strictly isolate node failure recovery within its own group, avoiding cross-group bandwidth contention, and making the impact of the data balancing process on business traffic almost transparent.
[0102] Dynamic Node Groups (GIDs) support automatic reorganization of fault domains. Combined with IGMR's topology awareness capabilities (such as cross-rack / data center distributed replicas), it ensures optimal traffic distribution during reconstruction in the event of a single point of failure. The replica reconstruction process only involves local data within the group, significantly reducing recovery time and the risk of service jitter.
[0103] Logical partitioning (PID) aggregates fine-grained data objects, decoupling metadata scale from cluster scale and supporting expansion to tens of thousands of nodes; the layered computing architecture of GPT and IGMR (global scheduling + local execution) eliminates the bottleneck of a single coordinating node and ensures mapping query efficiency.
[0104] Step S14: If the target expansion event is a node group change event, then based on the partition node group mapping table, perform partition rebalancing among the affected node groups to expand or shrink the target distributed storage system.
[0105] In this embodiment, the process of partition rebalancing among affected node groups based on the partition node group mapping table may specifically include:
[0106] Determine the current number of node groups and the amount of data stored in each node group in the target distributed storage system, and perform partition rebalancing among the affected node groups based on the current number of node groups, the amount of data stored in each node group, and the partition node group mapping table.
[0107] Specifically, such as Figure 3 As shown in (b), when the overall cluster load increases and a new set of nodes needs to be introduced to build a new node group, the system executes the following process:
[0108] (1) New group initialization:
[0109] Initialize a new group of nodes as an independent node group and assign it a unique GID.
[0110] (2) Global member table update:
[0111] Update the GMT table and add a new record:
[0112] ;
[0113] (3) Global partition reallocation:
[0114] The system triggers a global rebalancing process, redistributing the original partitions according to the number of new groups M+1. For example, each existing group releases approximately M+1 partitions (the total cluster data size) to the new groups proportionally.
[0115] (4) GPT mapping update and data migration:
[0116] Modify the GID of the corresponding partition in GPT to point to the new node group, and use the data migration engine to migrate the data of these partitions from the original group to the new group.
[0117] (5) Migration completion and consistency verification:
[0118] After the migration is complete, the system performs data integrity verification and updates the GPT and IGMR mapping rules to ensure that the new group participates in the subsequent data distribution and access process.
[0119] The hierarchical rebalancing mechanism (inter-group migration + intra-group reconstruction) reduces unnecessary data flow by more than 90%, lowering network and storage load; dynamic fault domain management eliminates the need for manual intervention in topology configuration, enhancing system autonomy.
[0120] Additionally, when certain nodes need to be removed from the cluster due to hardware failure, maintenance, or resource reclamation, the system initiates a scaling-down process to ensure data security and service continuity. The specific process is as follows:
[0121] (1) Mark the node to be removed and its group: The system marks the node that is about to be removed. and its node group .
[0122] (2) Update the node group member table: from Remove from member list And update the GMT table.
[0123] (3) Triggering the data takeover process within the group: The system re-executes the IGMR mapping algorithm and calculates... The new owner node for each partition copy.
[0124] (4) Data migration and copy reconstruction: The data migration engine will All partition replicas on the site were migrated to other nodes within the group.
[0125] (5) Node offline and metadata cleanup: After the data migration is completed, the system confirms No valid data remains. It is safely removed from the cluster, and the relevant metadata is cleaned up.
[0126] As can be seen, this application decouples data management from physical topology by dividing the global data space into logical partitions and dynamically grouping physical nodes; by constructing a partition node group mapping table to manage the mapping relationship between logical partitions and node groups, it enables scaling operations to only require adjusting some partition mappings without triggering global data migration, greatly reducing the amount of data migration and thus fundamentally avoiding the problems of migration storms and business jitter.
[0127] See Figure 5 As shown, an embodiment of the present invention discloses a distributed storage system scaling device, comprising:
[0128] The data space partitioning module 11 is used to divide the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system, assign corresponding partition identifiers to each logical partition, and determine the logical partitions corresponding to each data object in the target distributed storage system.
[0129] The node partitioning module 12 is used to dynamically divide each physical node in the target distributed storage system into several node groups, and assign a corresponding group identifier to each node group; wherein, any node group includes at least two physical nodes.
[0130] The data rebalancing module 13 is used to construct a partition node group mapping table based on the partition identifier and the group identifier, construct intra-group node allocation rules, and respond to target scaling events in the target distributed storage system. If the target scaling event is a node change event, the data objects in the target node group where the node change has occurred are rebalanced using the intra-group node allocation rules. The partition node group mapping table includes the mapping relationship between each logical partition and each node group.
[0131] The partition rebalancing module 14 is used to perform partition rebalancing among the affected node groups based on the partition node group mapping table if the target expansion event is a node group change event, so as to expand or shrink the target distributed storage system.
[0132] In some specific embodiments, the data space partitioning module 11 may specifically include:
[0133] A configuration parameter acquisition unit is used to acquire the configuration parameters corresponding to the target distributed storage system; wherein, the configuration parameters include the system resource throughput, system latency requirements, and hardware resource status of the target distributed storage system;
[0134] The partition number determination unit is used to determine the target number of partitions corresponding to the global data space according to the configuration parameters, and to divide the global data space into the target number of logical partitions.
[0135] In some specific embodiments, the data space partitioning module 11 may specifically include:
[0136] The target key acquisition unit is used to acquire the target key corresponding to each of the data objects, process each of the target keys using a consistent hash function to obtain the corresponding processing results, and perform a modulo operation between each of the processing results and the number of target partitions to obtain the logical partitions corresponding to each of the data objects.
[0137] In some specific embodiments, the distributed storage system scaling device further includes:
[0138] A node group member table construction module is used to construct a node group member table; wherein, the node group member table includes the physical nodes corresponding to each node group;
[0139] The node group reorganization unit is used to reorganize each node group based on the number of nodes corresponding to each node group if the number of nodes in any node group changes, and to update the node group member table based on the reorganized node group.
[0140] In some specific embodiments, the distributed storage system scaling device further includes:
[0141] The request acquisition module is used to acquire data read / write requests sent by the target client; wherein, the data read / write request includes the target partition identifier of the target logical partition corresponding to the data to be read / written;
[0142] The mapping table query module is used to query the partition node group mapping table to determine the target group identifier of the target node group corresponding to the target logical partition, and use the target group identifier to query the node group member table to obtain the corresponding query results.
[0143] The node determination module is used to determine the target physical node corresponding to the data to be read and written based on the query results and the node allocation rules within the group, so as to perform data read and write operations on the data to be read and written.
[0144] In some specific embodiments, the data rebalancing module 13 may specifically include:
[0145] The node quantity determination unit is used to determine the current number of nodes in the target node group and to determine the current data replica distribution in the target node group based on the node allocation rules within the group.
[0146] The data rebalancing unit is used to rebalance the data objects in the target node group according to the current data replica distribution, the current number of nodes, and the target data processing technology; wherein, the target data processing technology includes incremental migration technology and asynchronous replication technology.
[0147] In some specific embodiments, the partition rebalancing module 14 may specifically include:
[0148] The partition rebalancing unit is used to determine the current number of node groups and the amount of data stored in each node group in the target distributed storage system, and to perform partition rebalancing among the affected node groups according to the current number of node groups, the amount of data stored in each node group and the partition node group mapping table.
[0149] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0150] Figure 6This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the distributed storage system scaling method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0151] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0152] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0153] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the distributed storage system scaling method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0154] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned distributed storage system scaling method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0155] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0156] 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 implementation should not be considered beyond the scope of this application.
[0157] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0158] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for scaling up and down a distributed storage system, characterized in that, include: Based on the configuration parameters corresponding to the target distributed storage system, the global data space of the target distributed storage system is divided into several logical partitions, and a corresponding partition identifier is assigned to each logical partition, and the logical partition corresponding to each data object in the target distributed storage system is determined. The physical nodes in the target distributed storage system are dynamically divided into several node groups, and each node group is assigned a corresponding group identifier; wherein each node group includes at least two physical nodes. A partition node group mapping table is constructed based on the partition identifier and the group identifier, a node allocation rule within the group is constructed, and a target scaling up / down event in the target distributed storage system is responded to. If the target scaling up event is a node change event, the data objects in the target node group where the node change has occurred are rebalanced using the node allocation rule within the group. The partition node group mapping table includes the mapping relationship between each logical partition and each node group. If the target expansion event is a node group change event, then based on the partition node group mapping table, partition rebalancing is performed among the affected node groups to expand or shrink the target distributed storage system. Specifically, the step of dividing the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system includes: Obtain the configuration parameters corresponding to the target distributed storage system; wherein, the configuration parameters include the system resource throughput, system latency requirements, and hardware resource status of the target distributed storage system; The number of target partitions corresponding to the global data space is determined according to the configuration parameters, and the global data space is divided into the number of logical partitions corresponding to the target number of partitions. The step of rebalancing data objects in the target node group where node changes have occurred using the intra-group node allocation rules includes: Determine the current number of nodes in the target node group, and determine the current data replica distribution in the target node group based on the node allocation rules within the group; Based on the current data replica distribution, the current number of nodes, and the target data processing technology, the data objects in the target node group are rebalanced; wherein, the target data processing technology includes incremental migration technology and asynchronous replication technology; The partition rebalancing based on the partition node group mapping table among the affected node groups includes: The number of current node groups and the amount of data stored in each node group in the target distributed storage system are determined, and partition rebalancing is performed among the affected node groups based on the number of current node groups, the amount of data stored in each node group, and the partition node group mapping table.
2. The method for scaling up and down a distributed storage system according to claim 1, characterized in that, Determining the logical partitions corresponding to each data object in the target distributed storage system includes: Obtain the target key corresponding to each of the data objects, process each target key using a consistent hash function to obtain the corresponding processing result, and perform a modulo operation between each processing result and the number of target partitions to obtain the logical partition corresponding to each of the data objects.
3. The method for scaling up and down a distributed storage system according to claim 1, characterized in that, Also includes: Construct a node group member table; wherein, the node group member table includes the physical nodes corresponding to each node group; If the number of nodes in any node group changes, the node groups are reorganized based on the number of nodes corresponding to each node group, and the node group member table is updated based on the reorganized node groups.
4. The method for scaling up and down a distributed storage system according to claim 3, characterized in that, Also includes: Obtain the data read / write request sent by the target client; wherein, the data read / write request includes the target partition identifier of the target logical partition corresponding to the data to be read / written; The partition node group mapping table is queried to determine the target group identifier of the target node group corresponding to the target logical partition, and the target group identifier is used to query the node group member table to obtain the corresponding query results; Based on the query results and the node allocation rules within the group, the target physical node corresponding to the data to be read and written is determined, so as to perform data read and write operations on the data to be read and written.
5. A distributed storage system expansion / shrinkage device, characterized in that, include: The data space partitioning module is used to divide the global data space of the target distributed storage system into several logical partitions based on the configuration parameters corresponding to the target distributed storage system, assign corresponding partition identifiers to each logical partition, and determine the logical partitions corresponding to each data object in the target distributed storage system. The node partitioning module is used to dynamically divide each physical node in the target distributed storage system into several node groups, and assign a corresponding group identifier to each node group; wherein, any node group includes at least two physical nodes. The data rebalancing module is used to construct a partition node group mapping table based on the partition identifier and the group identifier, construct node allocation rules within the group, and respond to target scaling events in the target distributed storage system. If the target scaling event is a node change event, the module uses the node allocation rules within the group to rebalance the data objects in the target node group where the node change has occurred. The partition node group mapping table includes the mapping relationship between each logical partition and each node group. The partition rebalancing module is used to perform partition rebalancing among the affected node groups based on the partition node group mapping table if the target expansion event is a node group change event, so as to expand or shrink the target distributed storage system. The data space partitioning module includes: A configuration parameter acquisition unit is used to acquire the configuration parameters corresponding to the target distributed storage system; wherein, the configuration parameters include the system resource throughput, system latency requirements, and hardware resource status of the target distributed storage system; A partition number determination unit is used to determine the target number of partitions corresponding to the global data space according to the configuration parameters, and to divide the global data space into the target number of logical partitions; The data rebalancing module includes: The node quantity determination unit is used to determine the current number of nodes in the target node group and to determine the current data replica distribution in the target node group based on the node allocation rules within the group. The data rebalancing unit is used to rebalance the data objects in the target node group according to the current data replica distribution, the current number of nodes, and the target data processing technology; wherein, the target data processing technology includes incremental migration technology and asynchronous replication technology; The partition rebalancing module includes: The partition rebalancing unit is used to determine the current number of node groups and the amount of data stored in each node group in the target distributed storage system, and to perform partition rebalancing among the affected node groups according to the current number of node groups, the amount of data stored in each node group and the partition node group mapping table.
6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the distributed storage system scaling method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the distributed storage system scaling method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Database capacity expansion method and device, electronic equipment and storage medium
CN115186032A
Storage pool capacity expansion and contraction recovery method and device in distributed storage system
CN116166196A