Storage cluster splitting method and apparatus, electronic device, and storage medium
By adjusting data paths, implementing network isolation, and restarting target nodes, lossless partitioning of the storage cluster was achieved, solving the problems of data loss and limited applicability in existing technologies, and improving the efficiency and stability of the partitioning process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2024-12-02
- Publication Date
- 2026-06-02
Smart Images

Figure CN122131965A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to artificial intelligence fields such as cloud computing, distributed storage, and big data processing. Specifically, it relates to a storage cluster splitting method, apparatus, electronic device, and storage medium. Background Technology
[0002] Storage clusters can be used to store critical data such as cluster status, configuration information, and service discovery. For example, a distributed storage cluster like etcd can be used to store the cluster status and metadata of a Kubernetes cluster. As business scales up, the need for storage cluster splitting increases due to stability and performance considerations. Summary of the Invention
[0003] This application provides a storage cluster splitting method, apparatus, electronic device, and storage medium.
[0004] According to one aspect of this application, a method for splitting a storage cluster is provided, comprising:
[0005] The data path of the target resource in the original storage cluster is adjusted so that requests to access the target resource are sent to the target node in the original storage cluster.
[0006] Perform network isolation on the target node;
[0007] Restart the target node, and in response to the target startup parameter of the target node being set to the target value, split the target node from the original storage cluster as a new storage cluster; wherein, the target startup parameter is a parameter used to force a node to start as a new single-node cluster.
[0008] Remove the target node from the original storage cluster and remove the network isolation from the target node.
[0009] According to another aspect of this application, a storage cluster splitting apparatus is provided, comprising:
[0010] The data path adjustment module is used to adjust the data path of the target resource in the original storage cluster so that requests to access the target resource are sent to the target node in the original storage cluster.
[0011] A network isolation module is used to isolate the target node from the network.
[0012] The split module is used to restart the target node. In response to the target startup parameter of the target node being a target value, the target node is split from the original storage cluster and used as a new storage cluster. The target startup parameter is a parameter used to force a node to start as a new single-node cluster.
[0013] The node removal module is used to remove the target node from the original storage cluster;
[0014] The network isolation removal module is used to remove network isolation from the target node.
[0015] According to another aspect of this application, an electronic device is provided, comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in the above embodiments.
[0019] According to another aspect of this application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the method described in the above embodiments.
[0020] According to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in the above embodiments.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein:
[0023] Figure 1 A schematic flowchart illustrating a storage cluster splitting method provided in an embodiment of this application;
[0024] Figure 2 A schematic flowchart of a storage cluster splitting method provided in another embodiment of this application;
[0025] Figure 3 A schematic flowchart of a storage cluster splitting method provided in another embodiment of this application;
[0026] Figure 4 This is a schematic diagram illustrating an embodiment of the present application for adjusting the data path for accessing Pods resources;
[0027] Figure 5A schematic diagram illustrating a network isolation of a designated node provided in an embodiment of this application;
[0028] Figure 6 This is a schematic diagram illustrating an embodiment of the present application where an etcd cluster is split into two.
[0029] Figure 7 A schematic diagram illustrating the process of cleaning up the environment and expanding a newly added etcd cluster, as provided in an embodiment of this application;
[0030] Figure 8 This is a schematic diagram of the structure of a storage cluster splitting device provided in an embodiment of this application;
[0031] Figure 9 This is a block diagram of an electronic device used to implement the storage cluster splitting method of the embodiments of this application. Detailed Implementation
[0032] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0033] The storage cluster splitting method, apparatus, electronic device, and storage medium of this application are described below with reference to the accompanying drawings.
[0034] In some embodiments, the storage cluster can be split by creating a new empty storage cluster. However, this method will result in the loss of existing data and is suitable for splitting Events data, but its applicability is limited.
[0035] This application provides a method for splitting a storage cluster. Figure 1 This is a flowchart illustrating a storage cluster splitting method provided in an embodiment of this application.
[0036] The storage cluster splitting method of this application embodiment can be executed by the storage cluster splitting device of this application embodiment, which can be configured in an electronic device.
[0037] Among them, electronic devices can be any device with computing capabilities, such as personal computers, mobile terminals, servers, etc. Mobile terminals can be hardware devices with various operating systems, touch screens and / or displays, such as in-vehicle devices, mobile phones, tablets, personal digital assistants, wearable devices, etc.
[0038] like Figure 1 As shown, the storage cluster splitting method includes:
[0039] Step 101: Adjust the data path of the target resource in the original storage cluster so that requests to access the resource are sent to the target node in the original storage cluster.
[0040] In this application, the data path for accessing the target resource in the original storage cluster can be adjusted to access the target node, thereby sending the request to access the target resource to the target node in the original storage cluster.
[0041] The target node can be a specified node in the original storage cluster, or it can be determined through load balancing or other means; there are no restrictions on this.
[0042] It should be noted that the target resource can be any type of resource in the storage cluster.
[0043] Step 102: Isolate the target node from the network.
[0044] In this application, network isolation rules can be used to prevent the target node from communicating with other nodes in the original cluster, thereby achieving network isolation of the target node.
[0045] For example, through network isolation rules, a target node can deny access to the target node from other nodes in the original storage cluster and refuse to initiate connections to other nodes in the original storage cluster.
[0046] Step 103: Restart the target node. In response to the target node's target startup parameter being set to the target value, the target node is split from the original storage cluster and used as a new storage cluster.
[0047] The target startup parameters can be parameters used to force a node to start as a new single-node cluster.
[0048] In this application, the target node's target startup parameter can be set to a target value and the target node restarted. If the target node's target startup parameter is detected to be the target value, the target node can be split from the original storage cluster and used as a new storage cluster; that is, the target node will start as a completely new cluster. Because the target node is network isolated, starting the target node as a completely new cluster will not affect the original storage cluster.
[0049] Taking the etcd cluster as an example, with the target startup parameter being force-new-cluster, you can set force-new-cluster to true on the target node and restart the target node. At this time, the target node will start as a brand new cluster.
[0050] It should be noted that the target value of true is only an example. For example, the target value can also be 1 or 01, or other values. There are no restrictions on this.
[0051] Step 104: Remove the target node from the original storage cluster and remove the network isolation from the target node.
[0052] Although step 103 above splits the target node from the original storage cluster, the target node's information still exists in the original storage cluster. Therefore, the target node is removed from the original storage cluster.
[0053] To ensure normal communication in the new storage cluster, the network isolation of the target node is removed, allowing the nodes in the new storage cluster to communicate normally with the remaining nodes in the original storage cluster.
[0054] In this application, since the target node is split from the original storage cluster, the data in the newly added storage cluster is completely consistent with the data in the original storage cluster.
[0055] In this embodiment, by adjusting the data path for accessing the target resource in the original storage cluster, requests to access the target resource are sent to the target node in the original storage cluster. The target node is then network isolated and restarted. If the target startup parameter of the target node is the target value, the target node is split from the original storage cluster to form a new storage cluster. Finally, the target node is removed from the original storage cluster, and the network isolation is lifted. Thus, by splitting the target node from the original storage cluster to form a new storage cluster, the data in the new storage cluster is completely consistent with the data in the original storage cluster, ensuring data integrity. This method is applicable to the splitting of various resources and has a wide range of applications. Furthermore, because the target node is network isolated, the startup of the target node as a completely new cluster does not affect the original storage cluster. The splitting process only affects access to the split target resource, and the impact time is relatively short.
[0056] Figure 2 This is a flowchart illustrating a storage cluster splitting method provided in another embodiment of this application.
[0057] like Figure 2 As shown, the storage cluster splitting method includes:
[0058] Step 201: Obtain the IP address of the target node in the original storage cluster.
[0059] Step 202: Adjust the data path for the interface service to access the target resource based on the IP address of the target node to obtain the adjusted data path.
[0060] In this application, the data path for accessing the target resource in the target configuration item of the interface service can be adjusted according to the IP address of the target node to obtain the adjusted configuration item. The adjusted configuration item includes the adjusted data path, and the adjusted data path includes the IP address of the target node.
[0061] Taking the storage cluster as an etcd cluster and the target resource as Pods as an example, the target configuration item is etcd-servers-overrides. The adjusted configuration item is as follows: etcd-servers-overrides= / pods#https: / / {new-etcd-cluster}.svc:2379, and the adjusted data path is "https: / / {new-etcd-cluster}.svc:2379".
[0062] Step 203: Isolate the target node from the network.
[0063] In this application, step 203 can be implemented in any of the embodiments of this application, so it will not be described in detail here.
[0064] For example, pre-configured network isolation rules can be obtained. These rules can include inbound and outbound filtering rules, which can be set using iptables.
[0065] Inbound filtering rules are used by the target node to filter data packets sent by other nodes in the original storage cluster, excluding the target node itself. Outbound filtering rules are used to prevent the target node from sending data packets to other nodes in the original storage cluster.
[0066] Therefore, based on the inbound filtering rules, the target node can discard the first data packet sent by other nodes in the original storage cluster besides the target node, and based on the outbound filtering rules, the target node can discard the second data packet sent to other nodes in the original storage cluster besides the target node.
[0067] Therefore, based on inbound filtering rules, the target node can refuse access to the target node from other nodes in the original storage cluster. Based on outbound filtering rules, the target node can refuse to initiate connections to other nodes in the original storage cluster. Thus, based on inbound and outbound filtering rules, communication between the target node and other nodes in the original storage cluster can be prevented, thereby achieving network isolation of the target node.
[0068] For example, the inbound filtering rule may include the target port of the target node. Based on the inbound filtering rule, the target node can discard the first data packet sent to the target port by other nodes in the original storage cluster. It is clear that the first data packet is a data packet sent to the target port by other nodes in the original storage cluster.
[0069] Therefore, based on the inbound filtering rules, the target node can refuse connections initiated by other nodes in the original storage cluster to the target port of the target node.
[0070] For example, outbound filtering rules can include target ports of other nodes in the original storage cluster. Based on the outbound filtering rules, the target node can discard second data packets sent to the target ports of other nodes in the original storage cluster. Therefore, the second data packet is a data packet sent by the target node to the target ports of other nodes in the original storage cluster.
[0071] Therefore, based on outbound filtering rules, the target node can refuse access to the target port of the target node from other nodes in the original storage cluster.
[0072] Optionally, inbound filtering rules can be set for other nodes in the original storage cluster to discard data packets sent by the target node, and outbound filtering rules can be set for other nodes in the original storage cluster to discard data packets sent to the target node, so as to isolate the target node from the network.
[0073] Step 204: Restart the target node. In response to the target node's target startup parameter being set to the target value, the target node is split from the original storage cluster and used as a new storage cluster.
[0074] In this application, step 204 can be implemented in any of the embodiments of this application, so it will not be described in detail here.
[0075] Step 205: Remove the target node from the original storage cluster and remove the network isolation from the target node.
[0076] In this application, step 205 can be implemented in any of the embodiments of this application, so it will not be described in detail here.
[0077] For example, network isolation rule information can be obtained, which may include the identification information of the inbound filtering rule and the identification information of the outbound filtering rule. Inbound filtering rules can be deleted based on the identification information of the inbound filtering rule, and outbound filtering rules can be deleted based on the identification information of the outbound filtering rule, thereby removing the network isolation of the target node.
[0078] The identification information of the inbound filtering rule can be the number of the inbound filtering rule, or the line number of the inbound filtering rule in the code file, or other information that can be used to identify the uniqueness of the inbound filtering rule. This application does not limit this.
[0079] For example, iptables can be used to obtain network isolation rule information and delete inbound and outbound filtering rules.
[0080] For example, you can get the numbers of network isolation rules by executing "iptables -L --line-numbers".
[0081] For example, executing "iptables -D INPUT {number}" will delete the inbound filtering rule with the specified number, where {number} is a placeholder representing the number of the inbound filtering rule to be deleted. In iptables, each rule has a unique number, which can be assigned based on the order in which the rule was added to the chain.
[0082] Therefore, deleting inbound filtering rules based on the identification information of inbound filtering rules and deleting outbound filtering rules based on the identification information of outbound filtering rules is a simple and convenient method.
[0083] For example, based on the target node's identification information, a member removal command can be executed to remove the target node from the cluster member list of the original storage cluster and update the configuration file in the original storage cluster so that the updated configuration file does not contain the target node's node information, thereby completely removing the target node from the original storage cluster.
[0084] The member removal command can include the node identifier of the target node to be removed, such as the ID of the target node, so as to achieve accurate removal of the target node.
[0085] Therefore, by executing the member removal command to remove the target node from the original storage cluster's cluster member list, the original storage cluster's configuration file is updated, and the target node's node information is deleted from the configuration file, ensuring the complete removal of the target node and thus improving the success rate of storage cluster splitting.
[0086] For example, after removing the target node from the original storage cluster, the number of remaining nodes in the original storage cluster is greater than or equal to 3. These remaining nodes have a voting timeout period. If the voting timeout period for the third remaining node expires, each of the remaining nodes can send a voting request to the other remaining nodes. If the number of votes for the fourth remaining node exceeds a second threshold, the fourth node can be designated as the master node in the original storage cluster. Afterward, the master node in the original storage cluster synchronizes data with all other nodes in the original storage cluster to ensure data consistency within the cluster.
[0087] The second threshold can be greater than half the number of remaining nodes in the original storage cluster.
[0088] It should be noted that the third node can be any of the remaining nodes in the original storage cluster, and the fourth node can be any of the remaining nodes in the original storage cluster. The third node and the fourth node can be the same node or different nodes, and there is no limitation on this.
[0089] Therefore, if the number of remaining nodes in the original storage cluster is greater than or equal to 3, the master node in the original storage cluster can be selected by voting when any of the remaining nodes reaches the voting time. This ensures that the original storage cluster operates normally after the target node is removed, thereby ensuring high availability, compatibility and data consistency of the original storage cluster after the target node is removed.
[0090] In this embodiment, by adjusting the data path of the interface service to access the target resource according to the IP address of the target node, it can be ensured that the interface service accurately sends the request for the target resource to the target node, while the request for the remaining resources is sent to other nodes in the original storage cluster, thus providing a basis for the splitting of the target resource.
[0091] Figure 3 This is a flowchart illustrating a storage cluster splitting method provided in another embodiment of this application.
[0092] like Figure 3 As shown, the storage cluster splitting method includes:
[0093] Step 301: Adjust the data path of the target resource in the original storage cluster so that requests to access the resource are sent to the target node in the original storage cluster.
[0094] Step 302: Isolate the target node from the network.
[0095] Step 303: Restart the target node. In response to the target node's target startup parameter being set to the target value, the target node is split from the original storage cluster and used as a new storage cluster.
[0096] Step 304: Remove the target node from the original storage cluster and remove the network isolation from the target node.
[0097] In this application, steps 301-304 can be implemented in any of the embodiments of this application, so they will not be described in detail here.
[0098] Step 305: Expand the newly added storage cluster to obtain the expanded storage cluster.
[0099] To ensure high availability of the newly added storage cluster, its capacity can be expanded.
[0100] For example, the number of nodes in the expanded storage cluster can meet the quantity requirements. Exemplary data requirements may include at least one of the following: the number of nodes is greater than or equal to 3, or the number of nodes is an odd number.
[0101] Therefore, by expanding the capacity of the new storage cluster, its high availability can be guaranteed. Furthermore, the number of nodes in the expanded storage cluster meets the requirements, ensuring the successful selection of a master node and thus guaranteeing high availability and fault tolerance.
[0102] For example, if the voting timeout period for the first node in the expanded storage cluster expires, each node in the expanded storage cluster can send a voting request to the other nodes in the expanded storage cluster. If the number of votes for the second node in the expanded storage cluster exceeds a first threshold, the second node can be determined as the master node in the expanded storage cluster. Afterwards, the master node in the expanded storage cluster synchronizes data with the other nodes in the expanded storage cluster to ensure data consistency within the cluster.
[0103] The first threshold can be greater than half the number of nodes in the expanded storage cluster.
[0104] It should be noted that the first node can be any node in the expanded storage cluster, and the second node can be any node in the expanded storage cluster. The first node and the second node can be the same node or different nodes, and there is no restriction on this.
[0105] Therefore, when any node in the expanded storage cluster reaches the voting time, the master node in the expanded storage cluster can be selected through voting, thereby ensuring the high availability, compatibility and data consistency of the new storage cluster.
[0106] To facilitate understanding of the storage cluster partitioning method in this application, the following example uses an etcd cluster as the storage cluster and Pods resources as the target resource. Figures 4-7This application describes a method for splitting a storage cluster. Figure 4 This is a schematic diagram illustrating an embodiment of the present application for adjusting the data path for accessing Pods resources. Figure 5 This is a schematic diagram illustrating a network isolation of a designated node provided in an embodiment of this application. Figure 6 This is a schematic diagram illustrating an embodiment of the present application where an etcd cluster is split into two. Figure 7 This is a schematic diagram illustrating an environment cleanup and expansion of a newly added etcd cluster, as provided in an embodiment of this application.
[0107] The splitting process of the etcd cluster in this embodiment is as follows:
[0108] The first step is to adjust the data path that the API service accesses from etcd. The relevant API service configuration items are as follows:
[0109] etcd-servers-overrides= / pods#https: / / {new-etcd-cluster}.svc:2379
[0110] For example, the API service could be kube-apiserver.
[0111] like Figure 4 As shown, an etcd cluster has four nodes: etcd1, etcd2, etcd3, and etcd4. The designated node is etcd4. By adjusting the path for the API service to access Pods resources, requests for Pods resources from the API service are sent only to the designated node etcd4, while requests for other resources are sent to the remaining nodes etcd1, etcd2, and etcd3. In other words, nodes etcd1, etcd2, and etcd3 belong to one service, and node etcd4 belongs to another service.
[0112] The second step is to isolate the specified node. You can use iptables to isolate a specific node, preventing it from communicating with other nodes. For example... Figure 5 As shown, network isolation is performed on the specified node etcd4, preventing it from communicating with other nodes etcd1, etcd2, and etcd3.
[0113] The third step is to split the etcd cluster in two. For example, you can set `force-new-cluster` to `true` on a specified node and restart that node. The specified node will then start as a completely new cluster. Due to the network isolation measures described earlier, this operation will not affect the original etcd cluster.
[0114] For example, Figure 5If you set `force-new-cluster` to `true` on the specified node `etcd4` and restart the specified node `etcd4`, then the specified node `etcd4` will start as a completely new cluster. Figure 6 As shown, the etcd cluster is split into two: one cluster is a newly added cluster with the specified node etcd4 as the new cluster, and the other cluster is the original etcd cluster after the specified node etcd4 is split off.
[0115] The fourth step is to clean up the environment and expand the newly added etcd cluster to ensure its high availability. Cleaning up the environment requires removing the specified nodes that have been split off from the original etcd cluster, and then removing the network isolation from the specified nodes.
[0116] For example, Figure 6 The specified node etcd4 is removed from the original etcd cluster, and the network isolation of the specified node etcd4 is removed. Then, the newly added etcd cluster is expanded as follows. Figure 7 As shown.
[0117] It should be noted that the number of nodes added to the etcd cluster can be determined according to actual needs, and there is no limit to this.
[0118] The storage cluster splitting process in this application is efficient, ensures data integrity, maintains basic cluster availability, and has a short impact on the cluster. It can be applied to the splitting of various etcd resources in production-grade Kubernetes clusters, thereby improving the stability and performance of Kubernetes clusters.
[0119] To implement the above embodiments, this application also proposes a storage cluster splitting device. Figure 8 This is a schematic diagram of the structure of a storage cluster splitting device provided in an embodiment of this application.
[0120] like Figure 8 As shown, the storage cluster splitting device 800 includes:
[0121] The data path adjustment module 810 is used to adjust the data path of the target resource in the original storage cluster so that the request to access the target resource is sent to the target node in the original storage cluster.
[0122] The network isolation module 820 is used to isolate the target node from the network.
[0123] The split module 830 is used to restart the target node. In response to the target startup parameter of the target node being a target value, the target node is split from the original storage cluster as a new storage cluster. The target startup parameter is a parameter used to force a node to start as a new single-node cluster.
[0124] Node removal module 840, used to remove the target node from the original storage cluster;
[0125] The network isolation removal module 850 is used to remove the network isolation from the target node.
[0126] Optionally, the data path adjustment module 810 is used for:
[0127] Obtain the IP address of the target node;
[0128] Based on the IP address, the data path for the interface service to access the target resource is adjusted to obtain the adjusted data path; wherein the adjusted data path includes the IP address.
[0129] Optionally, the network isolation module 820 is used for:
[0130] Based on preset inbound filtering rules, the target node discards the first data packets sent by other nodes in the original storage cluster besides the target node;
[0131] Based on preset outbound filtering rules, the target node discards the second data packet sent to the other nodes.
[0132] Optionally, the inbound filtering rule includes the target port of the target node, and the first data packet is a data packet sent by the other node to the target port of the target node.
[0133] Optionally, the outbound filtering rule includes the target port of the other node, and the second data packet is a data packet sent by the target node to the target port of the other node.
[0134] Optionally, the network isolation release module 850 is used for:
[0135] Obtain network isolation rule information: wherein the network isolation rule information includes the identification information of the inbound filtering rule and the identification information of the outbound filtering rule;
[0136] Delete the inbound filtering rule based on its identifier information;
[0137] Delete the outbound filtering rule based on its identifier information.
[0138] Optionally, the node removal module 840 is used for:
[0139] The target node is removed from the cluster member list of the original storage cluster by executing a member removal command;
[0140] The configuration file of the original storage cluster is updated so that the updated configuration file does not contain the node information of the target node.
[0141] Optionally, the device may further include:
[0142] The cluster expansion module is used to expand the newly added storage cluster to obtain an expanded storage cluster; wherein the number of nodes in the expanded storage cluster meets the quantity requirements.
[0143] The quantity requirement includes at least one of the following: the number of nodes is greater than or equal to 3, or the number of nodes is odd.
[0144] Optionally, the device may further include:
[0145] The first sending module is used to respond to the arrival of the voting timeout time of the first node in the expanded storage cluster, and each node in the expanded storage cluster sends a voting request to the other nodes in the expanded storage cluster.
[0146] The first determining module is configured to determine the second node as the master node in the expanded storage cluster in response to the second node having a vote count greater than a first threshold; wherein the first threshold is greater than half the number of nodes in the expanded storage cluster.
[0147] Optionally, if after removing the target node from the original storage cluster, the number of remaining nodes in the original storage cluster is greater than or equal to 3, the device may further include:
[0148] The second sending module is used to send a voting request to the other nodes in the remaining nodes in response to the timeout of the voting timeout of the third node in the remaining nodes.
[0149] The second determining module is used to determine the fourth node as the master node in the original storage cluster in response to the number of votes of the fourth node among the remaining nodes being greater than a second threshold; wherein the second threshold is greater than half of the number of remaining nodes.
[0150] It should be noted that the explanation of the aforementioned storage cluster splitting method embodiment also applies to the storage cluster splitting device of this embodiment, so it will not be repeated here.
[0151] In this embodiment, by adjusting the data path for accessing the target resource in the original storage cluster, requests to access the target resource are sent to the target node in the original storage cluster. The target node is then network isolated and restarted. If the target startup parameter of the target node is the target value, the target node is split from the original storage cluster to form a new storage cluster. Finally, the target node is removed from the original storage cluster, and the network isolation is lifted. Thus, by splitting the target node from the original storage cluster to form a new storage cluster, the data in the new storage cluster is completely consistent with the data in the original storage cluster, ensuring data integrity. This method is applicable to the splitting of various resources and has a wide range of applications. Furthermore, because the target node is network isolated, the startup of the target node as a completely new cluster does not affect the original storage cluster. The splitting process only affects access to the split target resource, and the impact time is relatively short.
[0152] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0153] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0154] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 902 or a computer program loaded from storage unit 908 into RAM (Random Access Memory) 903. RAM 903 can also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. I / O (Input / Output) interface 905 is also connected to bus 904.
[0155] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0156] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the storage cluster partitioning method. For example, in some embodiments, the storage cluster partitioning method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the storage cluster partitioning method described above can be performed. Alternatively, in other embodiments, computing unit 901 may be configured to perform a storage cluster splitting method by any other suitable means (e.g., by means of firmware).
[0157] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0158] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0159] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0160] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0161] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.
[0162] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers integrated with blockchain technology.
[0163] According to an embodiment of this application, this application also provides a computer program product that, when an instruction processor in the computer program product is executed, performs the storage cluster splitting method proposed in the above embodiments of this application.
[0164] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0165] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for splitting a storage cluster, characterized in that, include: The data path of the target resource in the original storage cluster is adjusted so that requests to access the target resource are sent to the target node in the original storage cluster. Perform network isolation on the target node; Restart the target node, and in response to the target startup parameter of the target node being set to the target value, split the target node from the original storage cluster as a new storage cluster; wherein, the target startup parameter is a parameter used to force a node to start as a new single-node cluster. Remove the target node from the original storage cluster and remove the network isolation from the target node.
2. The method as described in claim 1, wherein, The adjustment of the data path of the target resource in the original storage cluster, so that requests to access the target resource are sent to the target node in the original storage cluster, includes: Obtain the IP address of the target node; Based on the IP address, the data path for the interface service to access the target resource is adjusted to obtain the adjusted data path; wherein the adjusted data path includes the IP address.
3. The method as described in claim 1, wherein, The network isolation of the target node includes: Based on preset inbound filtering rules, the target node discards the first data packets sent by other nodes in the original storage cluster besides the target node; Based on preset outbound filtering rules, the target node discards the second data packet sent to the other nodes.
4. The method of claim 3, wherein, The inbound filtering rule includes the target port of the target node, and the first data packet is a data packet sent by the other node to the target port of the target node.
5. The method of claim 3, wherein, The outbound filtering rules include the target ports of the other nodes, and the second data packet is a data packet sent by the target node to the target port of the other nodes.
6. The method of claim 3, wherein, The process of releasing the network isolation from the target node includes: Obtain network isolation rule information: wherein the network isolation rule information includes the identification information of the inbound filtering rule and the identification information of the outbound filtering rule; Delete the inbound filtering rule based on its identifier information; Delete the outbound filtering rule based on its identifier information.
7. The method of claim 1, wherein, The step of removing the target node from the original storage cluster includes: The target node is removed from the cluster member list of the original storage cluster by executing a member removal command; The configuration file of the original storage cluster is updated so that the updated configuration file does not contain the node information of the target node.
8. The method according to any one of claims 1-7, further comprising: The newly added storage cluster is expanded to obtain an expanded storage cluster; wherein the number of nodes in the expanded storage cluster meets the quantity requirements. The quantity requirement includes at least one of the following: the number of nodes is greater than or equal to 3, or the number of nodes is odd.
9. The method of claim 8, further comprising: In response to the expiration of the voting timeout of the first node in the expanded storage cluster, each node in the expanded storage cluster sends a voting request to the other nodes in the expanded storage cluster; In response to the second node in the expanded storage cluster having a vote count greater than a first threshold, the second node is determined as the master node in the expanded storage cluster; wherein the first threshold is greater than half the number of nodes in the expanded storage cluster.
10. The method according to any one of claims 1-7, wherein, After removing the target node from the original storage cluster, the number of remaining nodes in the original storage cluster is greater than or equal to 3. The method further includes: In response to the timeout of the vote of the third node among the remaining nodes, each of the remaining nodes sends a vote request to the other nodes among the remaining nodes. In response to the fact that the number of votes for the fourth node among the remaining nodes is greater than a second threshold, the fourth node is determined as the master node in the original storage cluster; wherein the second threshold is greater than half of the number of remaining nodes.
11. A storage cluster splitting device, characterized in that, include: The data path adjustment module is used to adjust the data path of the target resource in the original storage cluster so that requests to access the target resource are sent to the target node in the original storage cluster. A network isolation module is used to isolate the target node from the network. The split module is used to restart the target node. In response to the target startup parameter of the target node being a target value, the target node is split from the original storage cluster and used as a new storage cluster. The target startup parameter is a parameter used to force a node to start as a new single-node cluster. The node removal module is used to remove the target node from the original storage cluster; The network isolation removal module is used to remove network isolation from the target node.
12. The apparatus of claim 11, wherein, The data path adjustment module is used for: Obtain the IP address of the target node; Based on the IP address, the data path for the interface service to access the target resource is adjusted to obtain the adjusted data path; wherein the adjusted data path includes the IP address.
13. The apparatus of claim 11, wherein, The network isolation module is used for: Based on preset inbound filtering rules, the target node discards the first data packets sent by other nodes in the original storage cluster besides the target node; Based on preset outbound filtering rules, the target node discards the second data packet sent to the other nodes.
14. The apparatus of claim 13, wherein, The inbound filtering rule includes the target port of the target node, and the first data packet is a data packet sent by the other node to the target port of the target node.
15. The apparatus of claim 13, wherein, The outbound filtering rules include the target ports of the other nodes, and the second data packet is a data packet sent by the target node to the target port of the other nodes.
16. The apparatus of claim 13, wherein, The network isolation removal module is used for: Obtain network isolation rule information: wherein the network isolation rule information includes the identification information of the inbound filtering rule and the identification information of the outbound filtering rule; Delete the inbound filtering rule based on its identifier information; Delete the outbound filtering rule based on its identifier information.
17. The apparatus of claim 11, wherein, The node removal module is used for: The target node is removed from the cluster member list of the original storage cluster by executing a member removal command; The configuration file of the original storage cluster is updated so that the updated configuration file does not contain the node information of the target node.
18. The apparatus of any one of claims 11-17, further comprising: The cluster expansion module is used to expand the newly added storage cluster to obtain an expanded storage cluster; wherein the number of nodes in the expanded storage cluster meets the quantity requirements. The quantity requirement includes at least one of the following: the number of nodes is greater than or equal to 3, or the number of nodes is odd.
19. The apparatus of claim 18, further comprising: The first sending module is used to respond to the arrival of the voting timeout time of the first node in the expanded storage cluster, and each node in the expanded storage cluster sends a voting request to the other nodes in the expanded storage cluster. The first determining module is configured to determine the second node as the master node in the expanded storage cluster in response to the second node having a vote count greater than a first threshold; wherein the first threshold is greater than half the number of nodes in the expanded storage cluster.
20. The apparatus according to any one of claims 11-17, wherein, After removing the target node from the original storage cluster, the number of remaining nodes in the original storage cluster is greater than or equal to 3. The device further includes: The second sending module is used to send a voting request to the other nodes in the remaining nodes in response to the timeout of the voting timeout of the third node in the remaining nodes. The second determining module is used to determine the fourth node as the master node in the original storage cluster in response to the number of votes of the fourth node among the remaining nodes being greater than a second threshold; wherein the second threshold is greater than half of the number of remaining nodes.
21. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-10.
23. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-10.