Cluster management method, apparatus and system

By switching between initialization and working modes in the MariaDB Galera cluster, combined with Helm Charts and automation scripts, the split-brain problem under single and multi-point failures of the cluster was solved, achieving rapid recovery and data consistency, and reducing maintenance costs and complexity.

CN123138024APending Publication Date: 2026-11-20HILLSTONE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611302648.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies cannot effectively handle single and multi-point failures in MariaDB Galera clusters, leading to split-brain phenomena and difficulties in automatic cluster startup. Furthermore, relying on external tools increases system complexity and maintenance costs.

Method used

By specifying the bootstrap node using the initialization mode during cluster initialization and switching to working mode after the node starts successfully, combined with Helm Chart and automated scripts, the cluster state can be dynamically managed, avoiding split-brain and simplifying the operation and maintenance process.

Benefits of technology

It enables rapid recovery and data consistency in single-point and multi-point failure scenarios, reduces maintenance costs and the risk of human error, and improves system stability and availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138024A_ABST
    Figure CN123138024A_ABST
Patent Text Reader

Abstract

The application provides a cluster management method, device and system, and relates to the technical field of data storage. The cluster management method comprises the following steps: when a target cluster is initialized, using an initialization mode to start a node; after all the nodes are successfully started, switching the initialization mode to a working mode, and maintaining the node running in the working mode. Through timely switching of the working mode of the cluster, the cluster is enabled to work in a suitable mode at a suitable time, so as to achieve the purpose of dynamically managing the cluster state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a cluster management method, apparatus and system. Background Technology

[0002] In modern distributed database systems, high availability is a key factor in ensuring service continuity and data consistency. MariaDB Galera Cluster, as a popular solution, supports multi-master mode and enables real-time data synchronization. However, single point of failure (SPOF) and multiple point of failure (MPOF) remain significant challenges in practical applications.

[0003] When the bootstrap node in a cluster fails, the remaining nodes will re-elect a bootstrap node. Once the original bootstrap node recovers, this can easily lead to a split-brain scenario. Furthermore, when multiple points of failure occur in the cluster, leaving no surviving nodes, even if the cluster nodes subsequently recover, the lack of a bootstrap node makes automatic startup extremely difficult. Therefore, developing an effective cluster management system to handle cluster initialization and fault recovery is crucial. Summary of the Invention

[0004] The purpose of this application is to provide a cluster management method, device and system that dynamically manages the cluster status by switching the cluster's working mode in a timely manner so that the cluster can work in the appropriate mode at the appropriate time.

[0005] In a first aspect, this application provides a cluster management method, which includes: using an initialization mode to start nodes when the target cluster is initialized; and switching the initialization mode to a working mode after all nodes have started successfully, and maintaining node operation in the working mode.

[0006] Furthermore, the steps for starting a node using the initialization mode described above include: designating one of the multiple nodes as the first boot node; and controlling the other nodes to synchronize the data of the first boot node.

[0007] Furthermore, the steps described above for maintaining node operation in working mode include: maintaining data synchronization from the first boot node.

[0008] Furthermore, after the steps described above, which involve switching the initialization mode to the working mode after all nodes have started successfully, the method further includes: if a failure is detected in the first boot node, a second boot node is reassigned from the remaining nodes.

[0009] Furthermore, after the above step of redesignating a second boot node from the remaining nodes, the method further includes: if the first boot node is detected to have returned to normal, continuing to keep the second boot node as the boot node.

[0010] Furthermore, after the steps described above, which involve switching the initialization mode to the working mode after all nodes have started successfully, the process also includes: if all nodes are detected to have failed, uninstalling and reinstalling the target cluster, and starting the target cluster in the initialization mode to re-designate the third boot node.

[0011] Furthermore, the target cluster mentioned above includes: MariaDB Galera cluster.

[0012] Secondly, this application also provides a cluster management device, which includes: a startup module for starting nodes using an initialization mode when the target cluster is initialized; and a mode switching module for switching the initialization mode to a working mode after all nodes have started successfully, so as to maintain node operation in the working mode.

[0013] Thirdly, this application also provides a cluster management system, including multiple server nodes; the cluster management system is used to execute the method described in the first aspect.

[0014] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in the first aspect above.

[0015] The cluster management method, apparatus, and system provided in this application use an initialization mode to start nodes during target cluster initialization; after all nodes have started successfully, the initialization mode is switched to a working mode to maintain node operation. This application achieves dynamic cluster state management by switching the cluster's working mode in a timely manner, allowing the cluster to operate in the appropriate mode at the appropriate time. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 A flowchart illustrating a cluster management method provided in an embodiment of this application; Figure 2 A flowchart illustrating a cluster management method provided in an embodiment of this application; Figure 3 A flowchart illustrating a single-point fault recovery process provided in an embodiment of this application; Figure 4 A flowchart illustrating a multi-point fault recovery process provided in this application embodiment; Figure 5 A structural block diagram of a cluster management device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a cluster management system provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] For cluster startup, a common solution in existing technologies is to forcibly designate a node as the bootstrap node each time the cluster starts. In this approach, when the cluster needs to recover, a node is designated as the fixed bootstrap node through manual intervention or pre-configuration. This method works correctly in the event of a single node failure, ensuring the cluster can recover to an available state. However, this approach carries significant risks when multiple nodes recover simultaneously. After multiple nodes recover, all nodes may attempt to start as the bootstrap node, inevitably leading to split-brain problems. Furthermore, it requires manual configuration intervention, resulting in high operational complexity and increasing maintenance costs and the risk of human error.

[0020] Another solution is to use external cluster management tools or monitoring systems to monitor the cluster status and automatically perform cluster recovery operations when necessary. This method uses external tools to monitor the cluster's health in real time, automatically triggering recovery mechanisms upon detecting faults to ensure rapid cluster recovery. However, it has the following problems: 1. It relies on the stability and correct configuration of external tools, increasing system complexity. 2. External tools have complex management strategies, high maintenance costs, and unpredictable errors may occur during recovery, leading to cluster instability.

[0021] Based on this, embodiments of this application provide a cluster management method, apparatus and system, which achieves the purpose of dynamically managing the cluster status by switching the cluster's working mode in a timely manner so that the cluster can work in the appropriate mode at the appropriate time.

[0022] To facilitate understanding of this embodiment, a cluster management method disclosed in this application embodiment will first be described in detail. Figure 1This application provides a cluster management method that can be applied to a control node in a cluster management system. The method specifically includes the following steps: Step S102: When the target cluster is initialized, the node is started using the initialization mode; The target cluster mentioned above may include: MariaDB Galera cluster.

[0023] The initialization mode described above is called the init mode. The init mode has its own unique configuration parameters that ensure a specific node is designated as the bootstrap node each time the cluster starts, and all other nodes must synchronize data from that node. Even if a bootstrap node already exists in the original cluster, the init mode will still specify the bootstrap node according to the configured parameters. Therefore, when using the init mode, care must be taken to prevent split-brain issues.

[0024] The init mode is suitable for cluster initialization or when all nodes in the cluster have crashed and there are no surviving nodes. In this case, there is no bootstrap node in the cluster, so a bootstrap node must be explicitly specified when starting the cluster for it to start successfully.

[0025] In this embodiment, when the target cluster is initialized, the initialization mode is used to start the nodes. Specifically, one of the multiple nodes is designated as the first boot node, and the other nodes are controlled to synchronize the data of the first boot node.

[0026] Step S104: After all nodes have started successfully, switch the initialization mode to the working mode to maintain node operation.

[0027] The above-described working mode is called work mode. Work mode also has its own unique configuration parameters. In this mode, when the cluster starts, it synchronizes data from the existing bootstrap node among the surviving nodes. If there is no bootstrap node in the original cluster, the startup will fail. This mode does not force the designation of a specific node as the bootstrap node.

[0028] Work mode is suitable after the cluster has successfully initialized and is running stably. At this point, a bootstrap node already exists in the cluster, and it is not necessary to forcibly designate a specific node as the bootstrap node. If a node crashes and then recovers, the cluster will add that node back to the original cluster as a new ordinary node, without forcibly designating it as the bootstrap node, thus preventing split-brain scenarios.

[0029] In this embodiment, after all nodes have started successfully, that is, after node initialization is completed, the initialization mode is switched to the working mode to maintain node operation, that is, to maintain data synchronization from the first boot node.

[0030] The cluster management method provided in this application embodiment achieves the purpose of dynamically managing the cluster status by switching the cluster's working mode in a timely manner, allowing the cluster to work in the appropriate mode at the appropriate time.

[0031] This application also provides another cluster management method, which is implemented based on the previous embodiment. This embodiment focuses on describing the single-point fault handling process and the multi-point fault handling process.

[0032] Furthermore, after the above steps of switching the initialization mode to the working mode after all nodes have started successfully, the following steps are also included: (1) If a failure is detected in the first boot node, a second boot node is reassigned from the remaining nodes.

[0033] (2) If the first boot node is detected to have returned to normal, the second boot node shall continue to be the boot node.

[0034] (3) If all nodes are detected to be faulty, uninstall and reinstall the target cluster, and start the target cluster in initialization mode to re-specify the third boot node.

[0035] The above steps actually involve single-point fault handling and multi-point fault handling processes, which will be detailed below with examples.

[0036] See Figure 2 As shown, the working process of this cluster management system is illustrated using a three-node cluster as an example: 1. Initially, there is no surviving bootstrap node in the cluster, so it needs to be started in init mode. In this mode, the cluster will forcibly designate a bootstrap node, and the other two nodes will synchronize data from that bootstrap node.

[0037] 2. When all nodes in the cluster start up successfully, our cluster management system will detect this change and switch the cluster's working mode from init mode to work mode.

[0038] 3. Under normal circumstances, the cluster operates in work mode.

[0039] 4. If the boot node of the cluster fails, one of the other two nodes in the cluster will be re-elected as the boot node, and the cluster will continue to provide services normally.

[0040] 5. When the failed boot node recovers, it will join the cluster as a regular node because it is in work mode and will not be forced to be designated as the boot node. It will synchronize data from the original boot node in the cluster and will not cause a split-brain phenomenon.

[0041] 6. All clusters in the cluster crash, at which point there are no boot nodes in the cluster.

[0042] 7. The cluster management system will switch the cluster mode to init mode, forcibly designate a node as the boot node, and start the cluster.

[0043] 8. Once the cluster is running stably, the management system will detect this and switch the cluster's working mode to work mode, allowing the cluster to provide services to the outside world normally.

[0044] (1) The following are the ways to deal with single point of failure scenarios: In a single point of failure scenario, assuming the bootstrap node (e.g., node 0) fails, the other two nodes (node ​​1 and node 2) will elect a new bootstrap node through Galera Cluster's automatic election mechanism. To prevent the original bootstrap node from recovering and becoming the bootstrap node again, leading to a split-brain situation, this cluster management system provides the following solution: 1) Initialization deployment: Install the MariaDB Galera cluster using Helm Chart, using init mode to ensure that a specified node is used as the bootstrap node during initialization.

[0045] 2) Mode switching: Once the cluster has completed initialization, the cluster management system will detect this change and switch to work mode, which means that the forced boot strategy will no longer be used during the subsequent node recovery process.

[0046] 3) Fault detection and handling: When node 0 fails, node 1 and node 2 elect a new bootstrap node. When node 0 recovers, it will not actively attempt to start as a bootstrap node in work mode, thus avoiding a split-brain scenario.

[0047] Single point of failure recovery process as follows Figure 3 As shown.

[0048] (2) The following are the ways to deal with multi-point failure scenarios: In the event of a multi-point failure, such as when all nodes in the cluster (node ​​0, node 1, and node 2) fail, the cluster will become completely unavailable. At this point, since there are no surviving nodes, the Galera Cluster cannot perform election or recovery. Even after all nodes recover, as mentioned earlier, since it is running in work mode, the automatically recovered cluster lacks a bootstrap node and therefore cannot start successfully. To address this issue, this cluster management system provides the following solution: 1) Fault monitoring: Run a cluster management system on the cluster's management node to periodically check the cluster's status. If the entire cluster is found to be unavailable (i.e., all nodes are down or unavailable), trigger the recovery process.

[0049] 2) Uninstall the original MariaDB Galera cluster: Once a cluster failure is detected, the cluster management system will completely uninstall the current MariaDB Galera cluster.

[0050] 3) Redeployment and Upgrade: Subsequently, the cluster management system will automatically re-execute `helm install` according to the previous initialization deployment process, re-initializing the cluster in init mode, and making the specified node (such as node 0) the bootstrap node. After the cluster starts successfully and runs stably, it will be switched back to work mode to restore the cluster to its normal operating state.

[0051] 4) Ensure data consistency: This automated recovery and redeployment strategy ensures the uniqueness of the cluster state after recovery from multiple failures, prevents split-brain scenarios, and guarantees the consistency of cluster data and the high availability of the system.

[0052] Multi-point fault recovery flowchart as follows Figure 4 As shown.

[0053] The cluster management method provided in this application is applicable to various business scenarios requiring high availability and high consistency data storage solutions, such as financial services, telecommunications operations, large e-commerce platforms, and real-time analytics systems. Especially in scenarios requiring multi-point disaster recovery and rapid restoration, the application of this solution can significantly improve system stability and availability, and reduce system maintenance costs and the risk of human error.

[0054] The advantages and beneficial effects of the cluster management method provided in this application are as follows: 1) Avoiding split-brain issues: By employing different recovery strategies in single-point and multi-point failure scenarios, especially automated script management in multi-point failure scenarios, the split-brain problem caused by multiple boot nodes is avoided.

[0055] 2) Simplify the operation and maintenance process: By combining Helm Chart and automated scripts, a cluster management system has been developed. Operation and maintenance personnel do not need to manually intervene in the complex recovery process, which reduces the complexity of operation and the risk of human error.

[0056] 3) Improve system availability: In the event of single or multiple points of failure, the system can respond quickly and restore cluster services, minimizing the time the system is unavailable and improving the overall availability of the system.

[0057] 4) High flexibility: This solution implements highly flexible cluster management strategies through parameter configuration and automated scripts, which can adapt to various complex business needs and environmental changes.

[0058] 5) Low maintenance cost: The automated recovery mechanism reduces reliance on external tools and manual monitoring, thereby lowering cluster maintenance costs and management difficulty.

[0059] The key technologies in this embodiment are as follows: 1) Helm Chart dynamic parameter configuration strategy: Use different parameter configuration files during initial deployment and fault recovery to control the cluster boot strategy.

[0060] 2) Automated fault detection and recovery scripts: Monitor cluster status and automatically execute recovery and redeployment processes in the event of an overall failure, ensuring the uniqueness of cluster status and the consistency of data.

[0061] 3) Security recovery mechanism: During the multi-point fault recovery process, the cluster is redeployed to ensure that only one node is used as the bootstrap node to start the process, thus avoiding the occurrence of split-brain problems.

[0062] 4) Comprehensive solution combining single-point and multi-point fault handling: Optimized handling strategies for different fault scenarios ensure high system availability and data consistency.

[0063] Based on the above method embodiments, this application also provides a cluster management device, see [link to relevant documentation]. Figure 5 As shown, the device includes: a startup module 52, used to start nodes in initialization mode when the target cluster is initialized; and a mode switching module 54, used to switch the initialization mode to working mode after all nodes have started successfully, and to maintain node operation in working mode.

[0064] Furthermore, the aforementioned startup module 52 is used to designate one of the multiple nodes as the first boot node and control the other nodes to synchronize the data of the first boot node.

[0065] Furthermore, the aforementioned mode switching module 54 is used to maintain data synchronization from the first boot node.

[0066] Furthermore, the above-mentioned device also includes: a fault monitoring module, which, after the initialization mode is switched to the working mode following the successful startup of all nodes, if a fault is detected in the first boot node, a second boot node is reassigned from the remaining nodes.

[0067] Furthermore, after the aforementioned fault monitoring module completes the step of redesignating a second boot node from the remaining nodes, if the first boot node is detected to have recovered, the second boot node will continue to be the boot node.

[0068] Furthermore, the aforementioned fault monitoring module is used to, after the step of switching the initialization mode to the working mode following the successful startup of all nodes, if all nodes are detected to have failed, uninstall and reinstall the target cluster, and start the target cluster in the initialization mode to re-designate the third boot node.

[0069] Furthermore, the target cluster mentioned above includes: MariaDB Galera cluster.

[0070] The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts of the device embodiment not mentioned can be referred to the corresponding content in the aforementioned method embodiment.

[0071] This application also provides a cluster management system, see [link to relevant documentation]. Figure 6 As shown, the cluster management system includes multiple server nodes, such as node0, node1, node2, etc. One node in this system is used to execute the cluster management method described in the above method embodiments.

[0072] The system provided in this application embodiment has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0073] The cluster management system provided in this application can automatically monitor the status of the MariaDB-Galera cluster and switch the cluster mode as needed. During cluster initialization, the init mode is used. Once all nodes in the cluster have started, the system switches the cluster mode to work mode. As long as there are surviving nodes and a bootstrap node running stably, the cluster will continue to run stably in work mode. When all nodes in the cluster fail and there are no surviving nodes, the cluster will switch back to init mode to ensure that the cluster can be restarted.

[0074] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-described method. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.

[0075] The computer program products of the methods, apparatus and systems provided in the embodiments of this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0076] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application.

[0077] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] The embodiments or examples disclosed herein are not exhaustive, but merely illustrative of some embodiments or examples, and are not intended to limit the scope of protection of this disclosure. Unless otherwise specified, each step in a particular embodiment or example can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a particular embodiment or example can also be implemented as an independent embodiment, and the order of the steps in a particular embodiment or example can be arbitrarily interchanged. Furthermore, optional methods or examples in a particular embodiment or example can be arbitrarily combined; moreover, embodiments or examples can be arbitrarily combined. For example, some or all steps of different embodiments or examples can be arbitrarily combined, and a particular embodiment or example can be arbitrarily combined with optional methods or examples of other embodiments or examples.

[0079] Furthermore, the terms “first,” “second,” and “third” are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0080] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A cluster management method, characterized in that, The method includes: When initializing the target cluster, use the initialization mode to start the nodes; After all nodes have started successfully, the initialization mode is switched to the working mode to maintain node operation.

2. The method according to claim 1, characterized in that, The steps for starting a node using initialization mode include: Designate one of multiple nodes as the first boot node; Control other nodes to synchronize the data of the first boot node.

3. The method according to claim 2, characterized in that, The steps for maintaining node operation in the described working mode include: Maintain data synchronization from the first boot node.

4. The method according to claim 2, characterized in that, After all nodes have started successfully, the step of switching the initialization mode to the working mode also includes: If a failure is detected in the first boot node, a second boot node is reassigned from the remaining nodes.

5. The method according to claim 4, characterized in that, After the step of reassigning a second bootstrap node from the remaining nodes, the following is also included: If the first boot node is detected to have returned to normal, the second boot node will continue to be the boot node.

6. The method according to claim 1, characterized in that, After all nodes have started successfully, the step of switching the initialization mode to the working mode also includes: If all nodes are detected to be faulty, uninstall and reinstall the target cluster, and start the target cluster using the initialization mode to re-designate the third boot node.

7. The method according to claim 1, characterized in that, The target cluster includes: MariaDB Galera cluster.

8. A cluster management device, characterized in that, The device includes: The startup module is used to start nodes using the initialization mode when the target cluster is initialized. The mode switching module is used to switch the initialization mode to the working mode after all nodes have started successfully, and to maintain the operation of the nodes in the working mode.

9. A cluster management system, characterized in that, It includes multiple server nodes; the cluster management system is used to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.