Cluster management method and device, storage medium and electronic equipment
By setting up the main and standby management nodes in the cluster and switching to the standby node when the main node is abnormal, the service interruption problem caused by management node exceptions is solved, and the reliability and continuity of the cluster is improved.
Patent Information
- Application Number
- CN202411870229.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-12-18
AI Technical Summary
When an exception occurs in the management node of the cluster, it is difficult to provide normal services during the re-election of the management node, resulting in business interruption and unstable service.
The primary management node and a standby management node are set up in the first working group. The primary management node is responsible for coordinating the nodes of the target cluster to provide services. If there is an exception in the primary management node, the secondary management node will take over its responsibilities and coordinate the nodes in the target cluster. to provide services and ensure service continuity through periodic communications and status reporting.
It simplifies the management node switching process, reduces the time and complexity of resource reacquisition, improves the reliability and continuity of cluster services, avoids service interruptions and network splits, and ensures the stable operation of the cluster.
Smart Images

Figure CN119322706A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the computer field, and in particular to a cluster management method and device, a storage medium and an electronic device. Background Art
[0002] In existing cluster services, when an abnormality occurs in the management node responsible for scheduling and controlling management services, the entire cluster service will be interrupted. At this time, even if a new election is performed, business interruption will occur and it will be impossible to provide users with continuous business services. Specifically, in the process of cluster re-negotiation of a new management node, the service becomes unstable due to the need to reorganize each node and obtain the corresponding business resources of the node.
[0003] In summary, there is a technical problem in the related technology that when an abnormality occurs in the management node of the cluster and it is difficult to provide normal services during the process of re-electing the management node.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a cluster management method and device, a storage medium and an electronic device to at least solve the technical problem that it is difficult to provide normal services during the process of re-election of the management node when an abnormality occurs in the management node of the cluster.
[0006] According to one aspect of an embodiment of the present application, a cluster management method is provided, comprising: setting a primary management node in a first workgroup, wherein the primary management node is set to coordinate nodes in a target cluster to provide services, the target cluster includes the first workgroup and a second workgroup, and the nodes in the first workgroup are set as backup nodes for the nodes in the second workgroup; setting a backup management node in the first workgroup, wherein the backup management node represents a backup management node of the primary management node; in the event of an abnormality in the primary management node, controlling the backup management node to take over the primary management node and coordinate the nodes in the target cluster to provide services.
[0007] According to another aspect of an embodiment of the present application, a cluster management device is also provided, including: a master setting module, used to set a master management node in a first workgroup, wherein the master management node is set to coordinate the nodes in a target cluster to provide services, the target cluster includes the first workgroup and the second workgroup, and the nodes in the first workgroup are set as backup nodes of the nodes in the second workgroup; a backup setting module, used to set a backup management node in the first workgroup, wherein the backup management node represents a backup management node of the master management node; a control module, used to control the backup management node to take over the master management node and coordinate the nodes in the target cluster to provide services when an abnormality occurs in the master management node.
[0008] Optionally, the device is also used to: establish communication between the active management node and the nodes in the target cluster, wherein the active management node is used to periodically obtain node service information sent by the nodes in the target cluster, the node service information includes the service status and service configuration of the node, and the node service information corresponds to the service provided by the node; control the active management node to periodically send the node service information to the backup management node; in the event of an abnormality in the active management node, control the backup management node to establish communication with the nodes in the target cluster to take over the active management node to periodically obtain the node service information, and coordinate the nodes in the target cluster based on the node service information to provide services.
[0009] Optionally, the device is also used to: control the active management node to periodically send its own working status to the backup management node; in the case where the working status fails to be sent, detect the connection status between the active management node and the backup management node; when the connection status indicates that the active management node is normal and the backup management node is abnormal, re-determine the backup management node, and when the connection status indicates that both the active management node and the backup management node are normal, control the active management node to resend the working status to the backup management node; obtain the report time corresponding to the working status received by the backup management node; when the report time exceeds a preset time threshold, detect the connection status and the business resource information stored by the backup management node; when the connection status indicates that the backup management node is normal and the active management node is abnormal, and the business resource information includes the node service information corresponding to each node in the target cluster, send a node notification message to each node and update the working status of the target cluster, wherein the node notification message indicates that the backup management node will establish communication with the nodes in the target cluster.
[0010] Optionally, the device is used to set the main management node in the first working group in the following manner, including: initiating a cluster configuration request to divide the nodes in the target cluster into the first working group and the second working group; determining the main management node that meets the target node conditions from the first working group, wherein the target node conditions include being able to communicate normally with any node in the target cluster and being recognized by the nodes in the first working group; and configuring the main management node to manage the nodes in the target cluster.
[0011] Optionally, the device is used to configure the main management node to manage the nodes in the target cluster in the following manner: establish communication between the main management node and the nodes in the target cluster, and the main management node is used to periodically obtain the service status and service configuration sent by the nodes in the target cluster; when the main management node receives a first service status sent by a first service node, the first service status is sent to the backup management node, and the working status of the target cluster is updated, wherein the first service node represents the node whose service status has changed; when the main management node receives a second service configuration sent by a second service node, the second service configuration is sent to the backup management node, and the working status of the target cluster is updated, wherein the second service node represents the node whose service configuration has changed.
[0012] Optionally, the device is also used to: when the first working group includes multiple nodes, obtain other nodes in the first working group except the main management node; and determine the node with the smallest load among the other nodes in the idle state as the backup management node.
[0013] Optionally, the device is further used to: when the first working group only includes the active management node, obtain other nodes in the second working group; and determine the node with the smallest load among the other nodes in an idle state as the backup management node.
[0014] Optionally, the device is also used to: control the active management node to periodically send its own working status to the backup management node; in case the working status fails to be sent, detect the connection status between the active management node and the backup management node; in case the connection status indicates that the active management node is normal and the backup management node is abnormal, re-determine the backup management node from the first working group based on the active management node.
[0015] Optionally, the device is used to set a backup management node in the first working group in the following manner: obtaining the report time corresponding to the working status sent by the active management node when the backup management node receives it; when the report time exceeds a preset time threshold, detecting the connection status between the backup management node and the active management node and the business resource information stored by the backup management node; when the connection status indicates that the backup management node is normal and the active management node is abnormal, and the business resource information includes the service status and service configuration of each node in the target cluster, sending a node notification message to each node and updating the working status of the target cluster, wherein the node notification message indicates that the backup management node will establish communication with the nodes in the target cluster.
[0016] Optionally, the device is also used to: after setting a backup management node in the first work group, when the active management node determines that an abnormality has occurred in the active service node, control the active management node to initiate an active-standby switching operation to instruct the backup service node to replace the active service node, and send the service configuration of the active service node to the backup service node, wherein the active service node is a node in the second work group and the backup service node is a node in the first work group; when the active service node repairs the abnormality, control the active management node to initiate an active-standby recovery operation to instruct the active service node to replace the backup service node, and send the service configuration of the backup service node to the active service node.
[0017] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned cluster management method when running.
[0018] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above cluster management method.
[0019] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the cluster management method through the computer program.
[0020] In an embodiment of the present application, a main management node is set in the first working group, wherein the main management node is set to coordinate the nodes in the target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set to be backup nodes of the nodes in the second working group; a backup management node is set in the first working group, wherein the backup management node represents a backup management node of the main management node; in the event of an abnormality in the main management node, the backup management node is controlled to take over the main management node, and the nodes in the target cluster are coordinated to provide services, thereby simplifying the management node switching process, reducing the time and complexity of resource re-acquisition, and achieving the purpose of effectively improving the reliability and continuity of cluster services, avoiding service interruptions, network splits and other problems in the process of re-electing management nodes, thereby enabling the cluster to provide stable services. Therefore, the technical problem of difficulty in providing normal services during the process of re-electing management nodes when an abnormality occurs in the management nodes of the cluster is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 is a schematic diagram of an application environment of an optional cluster management method according to an embodiment of the present application;
[0023] Figure 2 is a flow chart of an optional cluster management method according to an embodiment of the present application;
[0024] Figure 3 is a cluster schematic diagram of an optional cluster management method according to an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of an optional cluster management method according to an embodiment of the present application;
[0026] Figure 5 is a schematic diagram of another optional cluster management method according to an embodiment of the present application;
[0027] Figure 6 This is a schematic diagram of an application scenario of an optional cluster management method according to an embodiment of the present application;
[0028] Figure 7 is a schematic structural diagram of an optional cluster management device according to an embodiment of the present application;
[0029] Figure 8is a schematic diagram of the structure of an optional cluster management product according to an embodiment of the present application;
[0030] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] The present application is described below in conjunction with embodiments:
[0034] According to one aspect of an embodiment of the present application, a cluster management method is provided. Optionally, in this embodiment, the cluster management method can be applied to Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal 103 via a network, and can be used to provide services for the terminal device or an application 107 installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 may be set up on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above-mentioned network may include, but is not limited to, a wired network and a wireless network, wherein the wired network includes, a local area network, a metropolitan area network and a wide area network; the wireless network includes, Bluetooth, WIFI and other networks that implement wireless communication; the terminal device 103 may be a terminal configured with an application, and may include, but is not limited to, at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a mixed reality (MR) terminal and other computer devices; the above-mentioned server may be a single server, a server cluster consisting of multiple servers, or a cloud server.
[0035] Combination Figure 1 As shown, the cluster management method can be executed by an electronic device, which can be a terminal device or a server. The cluster management method can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.
[0036] The above is only an example and is not specifically limited in this embodiment.
[0037] Optionally, as an optional implementation, as Figure 2 As shown, the management method of the above cluster includes:
[0038] S202, setting a primary management node in the first working group, wherein the primary management node is set to coordinate nodes in a target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set as backup nodes for the nodes in the second working group;
[0039] Optionally, in an embodiment of the present application, the above-mentioned main management node refers to the equipment responsible for daily management and business control in the first working group in the target cluster, including but not limited to video storage servers, network equipment, computing nodes, etc., used to monitor and maintain the overall operating status of the cluster; the above-mentioned target cluster refers to a system composed of multiple nodes, including but not limited to video storage server clusters, cloud computing platforms, distributed database systems, etc.
[0040] Optionally, in an embodiment of the present application, the first working group and the second working group may be understood as different sets of nodes in the target cluster divided according to work roles, including but not limited to primary management nodes, backup management nodes, and ordinary working nodes.
[0041] It should be noted that the setting of the primary management node can be adjusted according to different needs and environments, and this application does not limit this. For example, the primary management node can be a physical device or a virtual machine; the nodes in the target cluster can be devices of the same type or devices of different types or configurations; the service can be a computing service, a storage service, or any other type of service.
[0042] Exemplarily, the target cluster is first configured, including a first working group and a second working group, to ensure that the nodes of the first working group can serve as a backup for the nodes of the second working group. The above-mentioned main management node is set from the first working group, and the node will be responsible for coordinating the services in the target cluster. A coordination mechanism is implemented on the main management node to ensure the continuity and high availability of the services. Specifically, the main management node can be used to monitor the node status of the nodes in the target cluster. Once a node failure or unavailability is detected in the second working group, it will automatically switch to the backup node corresponding to the first working group.
[0043] It should also be noted that the above-mentioned target cluster can include multiple working groups, and the nodes in each working group can be dynamically adjusted and allocated as needed; the nodes in the above-mentioned first working group can also serve as backup nodes for other working groups to maximize the utilization of resources.
[0044] S204, setting a standby management node in the first working group, wherein the standby management node refers to a standby management node of the active management node;
[0045] Optionally, in an embodiment of the present application, the above-mentioned backup management node refers to a device that is in standby status in the first working group and can quickly take over its functions when the above-mentioned main management node fails, including but not limited to video storage servers, network devices, computing nodes, etc.
[0046] It should be noted that the settings of the above-mentioned standby management nodes may vary according to the needs and configurations of different workgroups, and this application does not limit this. For example, the standby management nodes may be other nodes in the same workgroup, or nodes across workgroups, or virtual nodes in the cloud. In addition, the activation conditions of the standby management nodes may also be customized according to actual needs, such as automatic activation, manual activation, or triggering based on specific events.
[0047] Exemplarily, the process of setting the above standby management node can be summarized into the following steps:
[0048] First, determine the primary management node and select one or more backup management nodes based on the needs and policies of the workgroup.
[0049] Next, the backup management node is configured to ensure that the backup management node can quickly take over the function when the primary node is unavailable, which may include but is not limited to synchronizing the status information, configuration information and any necessary security credentials of the primary management node; for example, the service status, service configuration and working status of each node obtained by the primary management node are periodically synchronized to the backup management node.
[0050] Furthermore, when an abnormality occurs in the above-mentioned active management node, the backup management node is triggered in time, and the backup management node implements the function of the above-mentioned active management node.
[0051] S206, when an abnormality occurs in the active management node, control the standby management node to take over the active management node and coordinate the nodes in the target cluster to provide services.
[0052] It should be noted that the present application does not limit the causes of abnormalities in the above-mentioned primary management node, such as hardware failure, software crash or network problem.
[0053] Exemplarily, when the active management node detects an abnormality, the standby management node will be activated; first, the standby management node will perform fault detection to confirm the status of the active management node; once it is confirmed that the active management node is unavailable, the standby management node will begin to take over its work, including but not limited to establishing communication with other nodes in the target cluster, synchronizing status information, and starting to coordinate nodes in the cluster to ensure service continuity, and the standby management node can also reallocate tasks to each node, update configurations, and maintain the stability of the cluster until the active node returns to normal or is permanently replaced.
[0054] In an exemplary embodiment, Figure 3 is a cluster diagram of an optional cluster management method according to an embodiment of the present application, such as Figure 3As shown, the target cluster may be an N+M cluster (N represents N active devices in the cluster working group, and M represents M standby devices in the cluster working group). There are four types of status nodes, namely: active devices (nodes in the second working group), standby devices (nodes in the first working group), DCS working machines (the active management nodes), and DCS backup machines (the standby management nodes). Specifically:
[0055] The main equipment provides business services to the outside world, and the DCS working machine manages all DCS services. After the DCS working machines have negotiated and determined, the DCS working machine initiates a request to designate a DCS backup machine. The DCS working machine monitors the business configurations of all main services, sends changes to the DCS working machine in a timely manner, and the DCS working machine promptly sets the business configurations to the DCS backup machine, so that the DCS backup machine and the DCS working machine have the same working capabilities.
[0056] In addition, the DCS working machine monitors the working status of all main services provided by the main equipment. If an abnormality occurs in the main service, the DCS working machine will initiate a master-slave switch and synchronize the corresponding host configuration to the selected destination backup equipment; and, when the DCS working machine monitors the recovery of the abnormal main equipment, it will actively initiate master-slave repair and business migration; and the DCS backup machine can be used to monitor the status of the DCS working machine and take over immediately if the DCS working machine is abnormal.
[0057] In another exemplary embodiment, taking the application scenario of a data center as an example, the main management node in the backup device is responsible for monitoring the operating status and service configuration of each server in the data center (the nodes in the above-mentioned target cluster), and some servers are main devices, and some servers are backup devices. Each server regularly sends its corresponding service information to the main management node, and the above-mentioned main management node stores the service information separately and periodically sends it to the backup management node in the backup device. When the main management node fails to work due to a fault, the backup management node immediately takes over, establishes communication with the servers in the data center, coordinates their services according to the service information of the servers, and ensures the continuous operation of the data center.
[0058] Through the embodiments of the present application, a main management node is set in the first working group, wherein the main management node is set to coordinate the nodes in the target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set to be backup nodes of the nodes in the second working group; a backup management node is set in the first working group, wherein the backup management node represents the backup management node of the main management node; in the event of an abnormality in the main management node, the backup management node is controlled to take over the main management node, and the nodes in the target cluster are coordinated to provide services, thereby simplifying the management node switching process, reducing the time and complexity of resource re-acquisition, and achieving the purpose of effectively improving the reliability and continuity of cluster services, avoiding service interruptions, network splits and other problems in the process of re-electing management nodes, thereby enabling the cluster to provide stable services. Therefore, the technical problem of difficulty in providing normal services during the process of re-electing management nodes when an abnormality occurs in the management nodes of the cluster is effectively solved.
[0059] As an optional scheme, the above method also includes: establishing communication between the above-mentioned main management node and the nodes in the above-mentioned target cluster, wherein the above-mentioned main management node is used to periodically obtain node service information sent by the nodes in the above-mentioned target cluster, the above-mentioned node service information includes the service status and service configuration of the node, and the above-mentioned node service information corresponds to the service provided by the node; controlling the above-mentioned main management node to periodically send the above-mentioned node service information to the above-mentioned backup management node; in the event that the above-mentioned main management node has an abnormality, controlling the above-mentioned backup management node to establish communication with the nodes in the above-mentioned target cluster to take over the above-mentioned main management node to periodically obtain the above-mentioned node service information, and coordinate the nodes in the above-mentioned target cluster based on the above-mentioned node service information to provide services.
[0060] Optionally, in an embodiment of the present application, the above-mentioned node service information refers to information corresponding to the service provided by the node, including but not limited to service status and service configuration. The above-mentioned service status may include but is not limited to whether the node is currently online, whether it is providing services, whether the service is running normally, etc. The above-mentioned service configuration refers to the configuration parameters of the node, such as resource allocation, service parameters, security settings, etc.
[0061] It should be noted that the above-mentioned active management node and standby management node can be different types of devices or the same type of devices. Node service information can include multiple types of data, such as performance indicators, resource usage, service logs, etc. The nodes in the target cluster can be physical devices or virtual devices, which is not limited in this application.
[0062] Exemplarily, the above-mentioned active management node periodically obtains node service information from the nodes in the target cluster, and then periodically sends the node service information to the backup management node. When an abnormality occurs in the active management node, the backup management node will take over its function, establish communication with the nodes in the target cluster, and coordinate the nodes based on the node service information to provide services.
[0063] It should also be noted that the frequency with which different nodes in the above-mentioned target cluster send their own service information can be the same or different, and the nodes in the above-mentioned target cluster can choose to send their own service information, or choose not to send their own service information, and this application also does not limit this.
[0064] Through the embodiment of the present application, a collaborative working mechanism of the main management node and the backup management node is adopted to achieve the technical effects of high availability and failover, thereby achieving the purpose of improving service stability and reliability.
[0065] As an optional solution, the method further includes: controlling the active management node to periodically send its own working status to the standby management node; in the case where the working status fails to be sent, detecting the connection status between the active management node and the standby management node; in the case where the connection status indicates that the active management node is normal and the standby management node is abnormal, re-determining the standby management node, and in the case where the connection status indicates that both the active management node and the standby management node are normal, controlling the active management node to resend the working status to the standby management node; obtaining the report time corresponding to the working status received by the standby management node; in the case where the report time exceeds a preset time threshold, detecting the connection status and the business resource information stored by the standby management node; in the case where the connection status indicates that the standby management node is normal and the active management node is abnormal, and the business resource information includes the node service information corresponding to each node in the target cluster, sending a node notification message to each node, and updating the working status of the target cluster, wherein the node notification message indicates that the standby management node will establish communication with the nodes in the target cluster.
[0066] Optionally, in an embodiment of the present application, the above-mentioned business resource information may include but is not limited to configuration parameters of each node in the cluster, resource usage, business load, network status, etc. The above-mentioned working status refers to the real-time operating status of the main management node, including but not limited to equipment health status, system operating parameters, business processing status, errors and warning information, etc. The above-mentioned preset time threshold can be flexibly set manually, and the above-mentioned node notification message may include but is not limited to text, images, voice, video and other forms, which are used to convey to each node in the cluster that the standby management node will take over the cluster management service. Information, ensure that all nodes can respond in time and make corresponding status adjustments, to ensure a smooth transition of cluster services.
[0067] It should be noted that the communication protocol between the above-mentioned main management node and each node, the content of the status report, the specific setting of the preset time threshold, etc. can be adjusted according to different cluster types and business requirements, and this application does not limit this.
[0068] Exemplarily, first, the above-mentioned main management node periodically sends the working status to the backup management node, including its own operating status, fault information, etc.; when it is detected that the working status sending fails, the connection status between the main management node and the backup management node is further detected to determine whether it is caused by a network failure; if the network connection is normal, the main management node attempts to resend the working status to the backup management node.
[0069] It should be noted that the above standby management node detects the connection status and the main management node is abnormal, including but not limited to the following two situations:
[0070] S1, the standby management node determines through the connection status that the data transmission channel between itself and the active management node is abnormal, while the active management node itself is not abnormal, for example, the data interaction between the active management node and other service nodes is normal, and the data interaction between the standby management node and other service nodes is also normal, only the data interaction between the active management node and the standby management node cannot be performed;
[0071] S2, the standby management node detects that the active management node is abnormal, for example, it cannot normally obtain the working status of the active management node, but the data transmission channel between the two is normal.
[0072] It can be understood that the above two situations can trigger the standby management node to manage the state switching of the entire cluster and the nodes corresponding to the cluster.
[0073] Furthermore, the standby management node records the time of each work status report received and sets a preset time threshold. Once the work status is not received after the threshold is exceeded, the standby management node will detect its own connection status and stored business resource information.
[0074] Then, when the standby management node confirms that the active management node is abnormal and it has complete business resource information, the standby management node immediately starts the takeover mechanism and sends a notification message to each node in the cluster, indicating that it will take over the function of the active management node and update the working status of the cluster to ensure the normal operation of the cluster.
[0075] In an exemplary embodiment, Figure 4 is a schematic diagram of an optional cluster management method according to an embodiment of the present application, such as Figure 4 As shown, the application scenarios of the video storage server cluster are taken as an example, including but not limited to:
[0076] The above-mentioned main management node ( Figure 4 After detecting that the communication between itself and the standby management node is interrupted, the DCS working machine (as shown) will automatically try to re-establish the connection and send the latest working status information to the standby management node to ensure that the standby management node can update its own information base in time.
[0077] The above standby management node ( Figure 4 After receiving the working status information of the active management node, the DCS backup machine shown in the figure will continuously monitor the health status of the active management node. Once it is found that the active management node has not sent working status information for a long time, the backup management node will immediately start the takeover process, take over the management and control of the cluster, send notifications to each node in the cluster, update the cluster status, and ensure the continuity of the video storage service.
[0078] Through the embodiments of the present application, a mechanism of collaborative work between the primary and standby management nodes and automatic status detection and switching is adopted to achieve the technical effect of quickly responding to failures of the primary management node, thereby achieving the purpose of improving cluster service stability and reducing business interruption time. Especially in fields that require high availability such as video storage servers, the application of this technical solution will greatly improve system reliability and user experience.
[0079] As an optional scheme, the above-mentioned setting of the main management node in the first working group includes: initiating a cluster configuration request to divide the nodes in the above-mentioned target cluster into the above-mentioned first working group and the above-mentioned second working group; determining the above-mentioned main management node that meets the target node conditions from the above-mentioned first working group, wherein the above-mentioned target node conditions include being able to communicate normally with any node in the above-mentioned target cluster and being recognized by the nodes in the above-mentioned first working group; configuring the above-mentioned main management node to manage the nodes in the above-mentioned target cluster.
[0080] Optionally, in an embodiment of the present application, the above-mentioned cluster configuration request refers to an instruction or signal initiated by a system administrator or an automatic configuration mechanism for initializing or reconfiguring the cluster management architecture, which may include but is not limited to defining the roles of the primary and backup management nodes, dividing the first working group and the second working group, setting the inter-node communication protocol, defining the node status detection frequency and threshold, etc.
[0081] It should be noted that in an embodiment of the present application, if the current active management node is unable to perform cluster configuration, the entire cluster can be configured by any node other than the non-active management node, and the node-related configuration information can be sent to the active management node.
[0082] Exemplarily, the client first initiates the above-mentioned cluster configuration request to reasonably divide the nodes in the target cluster into a first working group and a second working group; then, a node that meets the target node conditions is found in the above-mentioned first working group as the main management node, and the above-mentioned target node conditions mainly include the normal communication capability with any node in the cluster, and the recognition of other nodes; finally, the selected main management node is configured so that the main management node can manage other nodes.
[0083] In an exemplary embodiment, taking the application scenario of a video storage server cluster as an example, in the initial configuration stage of the cluster nodes, the cluster management system will initiate a cluster configuration request and divide the nodes in the cluster into two working groups: the first working group includes service nodes that are currently in standby state and do not provide business services, while the second working group includes service nodes that are currently in operation and provide business services. Then, the nodes that meet the target node conditions are selected from the first working group as the main management nodes. The node must have the ability to communicate normally with all other nodes in the cluster and obtain the recognition of all nodes in the first working group by initiating negotiation.
[0084] Through the embodiments of the present application, dynamic role allocation and configuration are performed for cluster nodes, achieving the goal of quickly determining and configuring the main management node, and achieving the purpose of optimizing cluster management efficiency and enhancing system stability and service continuity.
[0085] As an optional scheme, the above-mentioned configuration of the above-mentioned main management node to manage the nodes in the above-mentioned target cluster includes: establishing communication between the above-mentioned main management node and the nodes in the above-mentioned target cluster, and the above-mentioned main management node is used to periodically obtain the service status and service configuration sent by the nodes in the above-mentioned target cluster; when the above-mentioned main management node receives a first service status sent by a first service node, the above-mentioned first service status is sent to the above-mentioned backup management node, and the working status of the above-mentioned target cluster is updated, wherein the above-mentioned first service node represents the node whose service status has changed; when the above-mentioned main management node receives a second service configuration sent by a second service node, the above-mentioned second service configuration is sent to the above-mentioned backup management node, and the working status of the above-mentioned target cluster is updated, wherein the above-mentioned second service node represents the node whose service configuration has changed.
[0086] It should be noted that the method of establishing communication between the above-mentioned main management node and the nodes in the above-mentioned target cluster, the frequency of obtaining service status and service configuration, and the working status update mechanism, etc. can all be flexibly adjusted according to actual business needs and network conditions. For example, communication can be based on TCP / IP protocol, UDP, HTTP or other custom protocols.
[0087] It should also be noted that the above-mentioned service status may include but is not limited to the health status of the node, performance indicators, error logs, etc.; the above-mentioned service configuration may include but is not limited to network settings, resource allocation strategies, security configurations, etc.; and the update of the above-mentioned working status can be completed through real-time broadcasting, periodic polling or event-driven methods, which is not limited in this application.
[0088] In an exemplary embodiment, taking the application scenario of a video storage server cluster as an example, the above-mentioned main management node first establishes stable network communication with all server nodes.
[0089] During the normal service provision of the target cluster, when the health status of a server (the first service node) changes, such as detecting a disk read or write error, the server will immediately notify the active management node of the status change.
[0090] Then, after receiving this information, the active management node will not only update its own status information, but also synchronize the first service status to the standby management node, update the working status of the entire cluster, and notify other nodes to adjust the service load to avoid data being written to the faulty node.
[0091] Similarly, during the normal service provision of the target cluster, if the configuration of a server (second service node) changes, such as increasing the read / write rate or adjusting the storage strategy, the server will also notify the active management node.
[0092] Next, the active management node synchronizes the updated second service configuration to the standby management node and updates the working status of the target cluster to ensure that all nodes follow the latest configuration and optimize cluster performance.
[0093] Through the embodiments of the present application, a real-time communication and status synchronization mechanism is adopted between the main management node and the nodes in the target cluster, which achieves the technical effect of quickly responding to changes in service status and service configuration, and achieves the purpose of improving cluster management efficiency.
[0094] As an optional scheme, the above method also includes: when the above first working group includes multiple nodes, obtaining other nodes in the above first working group except the above main management node; and determining the node with the smallest load among the above other nodes in idle state as the above backup management node.
[0095] As an optional solution, the method further includes: when the first working group only includes the main management node, obtaining other nodes in the second working group; and determining the node with the smallest load among the other idle nodes as the backup management node.
[0096] Optionally, in an embodiment of the present application, the above-mentioned idle state refers to a situation where the node does not perform critical tasks or services within a certain period of time, which may include but is not limited to underutilized processing power, no ongoing high-priority tasks, resource consumption below a preset threshold, etc.
[0097] It should be noted that the load evaluation criteria of the above nodes, the definition of idle state, the election algorithm of the standby management node, etc. can all be flexibly set according to factors such as the scale of the cluster, business characteristics, resource allocation strategy, etc. For example, the minimum load can be evaluated based on indicators such as CPU usage, memory usage, network bandwidth consumption, disk I / O, etc.; and the determination of the idle state can include but is not limited to the determination through the real-time monitoring data of the target cluster, historical statistical information or preset service level agreement; furthermore, the election of the above standby management node may adopt a simple minimum load principle, or a more complex multi-factor comprehensive consideration algorithm, which is not limited in this application.
[0098] In an exemplary embodiment, taking the application scenario of a video surveillance system as an example, when the first working group includes multiple servers, the main management node will first obtain the real-time load information of these servers, including but not limited to CPU usage, memory occupancy, network traffic, etc.
[0099] Next, the active management node will select servers that are in an idle state, that is, servers with low current load and not performing critical tasks. Finally, based on the load evaluation results, the active management node selects the server with the smallest load as the standby management node for configuration and status synchronization.
[0100] In an exemplary embodiment, Figure 5 is a schematic diagram of another optional cluster management method according to an embodiment of the present application, wherein the process of creating a standby management node through a primary management node is as follows: Figure 5 shown.
[0101] In another exemplary embodiment, it is assumed that the current first working group is composed only of the main management node, indicating that the first working group has only one node, and the node has been determined as the above-mentioned main management node. In this case, the main management node in the embodiment of the present application will actively detect all nodes in the second working group, and determine the current load and idleness of the nodes in the second working group based on indicators such as CPU utilization, memory usage, network traffic, and disk I / O load.
[0102] Furthermore, when the active management node needs to determine a standby management node, the active management node may select nodes in an idle state from the second working group.
[0103] It should be noted that the determination of the idle state may include but is not limited to determining based on the resource usage of the node being lower than a preset threshold, or not executing a high priority task for a period of time. Further, after determining the nodes in the idle state, the active management node may further analyze their load conditions and select the node with the smallest load as the standby management node.
[0104] In another exemplary embodiment, if the first working group includes multiple backup nodes in addition to the target main node, and these multiple backup nodes are all in a state of providing services, or these multiple backup nodes are all in a high-load state, an ordinary service node with relatively low load and high stability can also be selected from the second working group as a backup management node.
[0105] That is to say, in an embodiment of the present application, priority is given to determining a backup management node in the first working group. When there is only one node in the first working group that has been set as the target master node, or when nodes other than the target master node in the first working group cannot be set as the target master node, the present application may also consider determining a backup management node from ordinary service nodes that normally provide services in the second working group. By intelligently selecting a backup management node, it is possible to effectively reduce fault recovery time and improve the overall stability and availability of the cluster. At the same time, it optimizes resource utilization and avoids unnecessary performance waste, thereby achieving the technical effect of enhancing system management capabilities and high availability.
[0106] As an optional scheme, the above method also includes: controlling the above-mentioned main management node to periodically send its own working status to the above-mentioned backup management node; in the case that the above-mentioned working status fails to be sent, detecting the connection status between the above-mentioned main management node and the above-mentioned backup management node; in the case that the above-mentioned connection status indicates that the above-mentioned main management node is normal and the above-mentioned backup management node is abnormal, re-determining the above-mentioned backup management node from the above-mentioned first working group based on the above-mentioned main management node.
[0107] Optionally, in an embodiment of the present application, the working status of the above-mentioned main management node refers to the operating status and management capabilities of the main management node, including but not limited to its health status, resource occupancy, tasks being executed, communication status with other nodes in the cluster, etc.; the above-mentioned connection status refers to the real-time status of the communication link between the main management node and the backup management node, including but not limited to network connectivity, data transmission delay, packet loss rate and other indicators.
[0108] It should be noted that the main management node and the backup management node can not only coordinate and manage each node in the target cluster, but also serve as backup nodes corresponding to the nodes in the second working group. In the event of an abnormality in the nodes in the second working group, they will take over the nodes in the second working group and provide services to the outside world.
[0109] In an exemplary embodiment, taking the application scenario of a video surveillance server cluster as an example, the main management node (DCS working machine) sends its own working status to the backup management node (DCS backup machine) at a predetermined period, such as every 10 seconds, including health check results, resource usage, and service task list. If the backup management node fails to successfully receive the working status information when sending it several times in a row, the main management node will automatically trigger a connection status detection to check the communication link between the two. If the detection result shows that the main management node is normal and the backup management node cannot respond, the main management node will immediately reselect a node with good working status and moderate load from the first working group (i.e., the N main devices in N+M) as a new backup management node, and start synchronizing the necessary status information and configuration to it to ensure that when the main management node fails, the new backup management node can quickly take over the cluster management task to avoid business interruption.
[0110] Through the embodiments of the present application, a periodic status report and a dynamic connection status detection mechanism are adopted to realize the monitoring and management of real-time communication between the active management node and the backup management node, so as to achieve the purpose of timely detecting communication anomalies and quickly switching the backup node to ensure the high availability of the cluster.
[0111] As an optional scheme, the above-mentioned setting of a backup management node in the above-mentioned first working group includes: obtaining the report time corresponding to the working status sent by the above-mentioned main management node and received by the above-mentioned backup management node; when the above-mentioned report time exceeds the preset time threshold, detecting the connection status between the above-mentioned backup management node and the above-mentioned main management node, and the business resource information stored by the above-mentioned backup management node; when the above-mentioned connection status indicates that the above-mentioned backup management node is normal, the above-mentioned main management node is abnormal, and the above-mentioned business resource information includes the service status and service configuration of each node in the above-mentioned target cluster, sending a node notification message to each of the above-mentioned nodes, and updating the working status of the above-mentioned target cluster, wherein the above-mentioned node notification message indicates that the above-mentioned backup management node will establish communication with the nodes in the above-mentioned target cluster.
[0112] Optionally, in an embodiment of the present application, the above-mentioned preset time threshold refers to a set value used to evaluate the communication delay or interruption between the primary management node and the backup management node, including but not limited to a few seconds to a few minutes, and its specific value should be reasonably set according to the network environment, business requirements and fault tolerance.
[0113] In an exemplary embodiment, taking the application scenario of a video surveillance server cluster as an example, the standby management node (DCS backup machine) will continuously record the time of receiving the report on the working status of the active management node (DCS working machine);
[0114] When it is detected that the reporting time exceeds the preset time threshold, such as 30 seconds, the standby management node will actively detect the network connection status between it and the active management node, and check whether the business resource information stored in the standby management node itself is complete, including the latest service status and service configuration of all nodes in the cluster.
[0115] If the detection result shows that the connection between the standby management node and the active management node has been disconnected, and the standby management node itself is in normal status and has stored all necessary business resource information, the standby management node will send a "node notification message" to each node in the target cluster, indicating that it will take over the cluster management task.
[0116] At the same time, the standby management node can also update the working status of the target cluster to reflect the current management node changes and ensure the business continuity and stability of the cluster.
[0117] Through the embodiments of the present application, dynamic communication delay detection and business resource information integrity verification are adopted to achieve that when an abnormality occurs in the main management node, the backup management node can quickly and accurately determine whether it has the conditions for takeover, and if the conditions are met, it can quickly switch to the management state, thereby realizing the automation of business takeover and achieving the purpose of reducing fault recovery time, improving system high availability and user experience.
[0118] As an optional scheme, after setting the backup management node in the above-mentioned first working group, it includes: when the above-mentioned main management node determines that the main service node has an abnormality, controlling the above-mentioned main management node to initiate a main-backup switching operation to instruct the backup service node to replace the above-mentioned main service node, and sending the service configuration of the above-mentioned main service node to the above-mentioned backup service node, wherein the above-mentioned main service node is a node in the above-mentioned second working group, and the above-mentioned backup service node is a node in the above-mentioned first working group; when the above-mentioned main service node repairs the abnormality, controlling the above-mentioned main management node to initiate a main-backup recovery operation to instruct the above-mentioned main service node to replace the above-mentioned backup service node, and sending the service configuration of the above-mentioned backup service node to the above-mentioned main service node.
[0119] Optionally, in an embodiment of the present application, the above-mentioned master-slave switching operation refers to a process initiated by the above-mentioned master management node when an abnormality occurs in the above-mentioned master service node, with the purpose of promoting the backup service node to the master state to take over the responsibilities of the failed node, including but not limited to updating the role status of each node in the cluster, synchronizing service configuration parameters to the backup service node, adjusting network routing and load balancing strategies, etc.
[0120] Optionally, in an embodiment of the present application, the above-mentioned master-slave recovery operation refers to a process initiated by the master management node after the master service node repairs the exception, with the purpose of restoring the service status before the failure, repositioning the master service node as the master, and downgrading the previous backup service node to the backup, including but not limited to resynchronizing the service configuration to the master service node, adjusting the node role and cluster status, updating load balancing rules, etc.
[0121] In an exemplary embodiment, taking the application scenario of a data storage server cluster as an example, assuming that the main service node (the node in the second working group) in the target cluster has an abnormality due to CPU overload, the main management node (DCS working machine) will detect this situation and automatically initiate a master-slave switching operation, instructing the backup service node in the backup working group (the node in the first working group) to take over the responsibilities of the failed node.
[0122] Specifically, during the switching process, the active management node will send the service configuration of the failed node, including storage policies, access permissions, load balancing settings, etc., to the standby service node to ensure that it can seamlessly take over and provide the same service.
[0123] When the active service node repairs the anomaly and the CPU load returns to normal, the active management node will initiate the active-standby recovery operation again, migrate the service configuration from the standby service node back to the active service node, and adjust its status to active, while the standby service node returns to the standby status to restore the original working mode of the cluster.
[0124] Through the embodiments of the present application, when an abnormality occurs in the primary service node, the primary-backup switching can be performed quickly and accurately, and after the abnormality is repaired, it can be restored to the primary state smoothly and efficiently, thereby achieving high service continuity and self-healing capabilities of the cluster, and achieving the purpose of improving the overall stability of the system and user experience.
[0125] In an exemplary embodiment, the cluster management method proposed in this application can implement a cluster scheduling management service hot standby management system.
[0126] First, the nouns appearing in the embodiments of the present application are explained:
[0127] N+M cluster: N+M service nodes of the system form a cluster to provide external services. N represents the N active devices in the cluster workgroup, and M represents the M standby devices in the cluster workgroup. If any number of devices (not more than M) in the workgroup N fails, the devices in the standby group M will be seamlessly replaced to take over the work of the active devices, ensuring that external services are not interrupted during abnormal periods.
[0128] For example, Figure 6is a schematic diagram of an application scenario of an optional cluster management method according to an embodiment of the present application, such as Figure 6 As shown: The dispatching console service is provided through the DCS working machine (the above-mentioned main management node). It is the center of the entire cluster control and is responsible for the entire cluster management. The roles assumed by the DCS working machine in the cluster include but are not limited to: initiating negotiation and forming a cluster; status detection and status set management of each service node; node anomaly detection, initiating active-standby switching, and migrating services; repairing the main equipment and migrating cluster services, etc.
[0129] In the related art, when a DCS working machine fails, business interruption will occur. Even if the negotiation management node is re-elected, the cluster will be unreadable and writable for a certain period of time. In addition, the renegotiated DCS working machine needs to reorganize the cluster and obtain cluster resources. Specifically, there is a possibility of brain split during the renegotiation process, requiring external intervention in the cluster work.
[0130] Based on the above technical problems, the embodiment of the present application can use the DCS working machine to create a DCS backup machine (the above-mentioned backup management node). The two work together to reduce the pressure on the service node. If the DCS working machine is abnormal, the DCS backup machine can take over the management cluster in time. During the switching between the two, the cluster's external business is not interrupted. There is no need to re-initiate the election, and the relevant resource information and configuration of the DCS working machine cluster can be synchronized to the DCS backup machine in time. In other words, the DCS working machine and the DCS backup machine are both selected from the M backup work group devices. The DCS working machine and the DCS backup machine can both take over the work of the main equipment. All nodes in the above-mentioned N+M cluster (the above-mentioned target cluster) have the ability to provide the same service, and the DCS working machine can be negotiated to give different nodes different states. Among them, there are four types of state nodes in the N+M cluster: main equipment, backup equipment, backup machine + DCS working machine, and backup machine + DCS backup machine. Specifically:
[0131] The main equipment provides business services to the outside world, and the DCS working machine manages all DCS services. After the DCS working machines have negotiated and determined, the DCS working machine initiates a request to designate a DCS backup machine. The DCS working machine monitors the business configurations of all main services, sends changes to the DCS working machine in a timely manner, and the DCS working machine promptly sets the business configurations to the DCS backup machine, so that the DCS backup machine and the DCS working machine have the same working capabilities.
[0132] In addition, the DCS working machine monitors the working status of all main services provided by the main equipment. If an abnormality occurs in the main service, the DCS working machine will initiate a master-slave switch and synchronize the corresponding host configuration to the selected destination backup equipment; and, when the DCS working machine monitors the recovery of the abnormal main equipment, it will actively initiate master-slave repair and business migration; and the DCS backup machine can be used to monitor the status of the DCS working machine and take over immediately if the DCS working machine is abnormal.
[0133] In an exemplary embodiment, the steps of negotiating a DCS working machine and creating a DCS backup machine may include but are not limited to:
[0134] S1, the client initiates the request and specifies the primary and backup devices;
[0135] S2, negotiate the DCS working machine from the backup equipment. Negotiation rules and requirements:
[0136] S2-1, select the standby machine;
[0137] S2-2, the standby machine initiates negotiation;
[0138] S3, start the required functions of the DCS working machine. Specifically including:
[0139] S3-1, keep-alive detection with the main service;
[0140] S3-2, and other DCS keep-alive detection;
[0141] It can be understood as the keep-alive detection between the DCS working machine and the backup equipment, and the keep-alive detection between the DCS working machine and the main equipment.
[0142] S4, the DCS working machine connects, obtains, and subscribes to the business configuration of the devices in the cluster;
[0143] S5, the DCS working machine sets the working status of each main and backup equipment;
[0144] S6, the DCS working machine creates a DCS backup machine.
[0145] In another exemplary embodiment, the DCS working machine may include but is not limited to implementing:
[0146] S1, the DCS working machine regularly reports the working status to the DCS backup machine;
[0147] S2, DCS will modify the monitored business configuration to DCS backup machine;
[0148] S3, report failure, need to check its own connection status. If normal, reselect DCS backup machine;
[0149] S4, update the cluster status.
[0150] In another exemplary embodiment, the DCS backup machine may include but is not limited to implementing:
[0151] S1, regularly check the reporting time of DCS working machine;
[0152] S2: When the reporting time of the DCS working machine exceeds the threshold time, the working machine checks its own connectivity status and whether it has the business resources (i.e., service configuration information) of all cluster nodes.
[0153] S3, notify each node in the cluster: the DCS backup machine will take over the DCS working machine to implement node management;
[0154] S4, update the cluster status.
[0155] Through the embodiment of the present application, a DCS working machine is set in the cluster, and the DCS working machine selects a DCS backup machine, and the DCS working machine and the DCS backup machine can work together. The DCS backup machine can monitor the status of the DCS working machine in time and can switch in time, ensuring that even if the central management node fails, there will be no cluster service failure, and no additional re-negotiation and re-acquisition of cluster service resources are required. The working mode of the DCS working machine being synchronized to the DCS backup machine in time can ensure that the two have the same working ability and can immediately take over and manage the cluster. Ensure the rapid takeover of services.
[0156] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0157] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0158] According to another aspect of the embodiment of the present application, a cluster management device for implementing the above cluster management method is also provided. Figure 7 As shown, the device comprises:
[0159] A master setting module 702 is used to set a master management node in the first working group, wherein the master management node is set to coordinate nodes in a target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set as backup nodes for the nodes in the second working group;
[0160] A standby setting module 704 is used to set a standby management node in the first working group, wherein the standby management node refers to a standby management node of the active management node;
[0161] The control module 706 is used to control the backup management node to take over the active management node and coordinate the nodes in the target cluster to provide services when an abnormality occurs in the active management node.
[0162] As an optional scheme, the above-mentioned device is also used to: establish communication between the main management node and the nodes in the target cluster, wherein the main management node is used to periodically obtain node service information sent by the nodes in the target cluster, the node service information includes the service status and service configuration of the node, and the node service information corresponds to the service provided by the node; control the main management node to periodically send node service information to the backup management node; in the event of an abnormality in the main management node, control the backup management node to establish communication with the nodes in the target cluster to take over the main management node to periodically obtain node service information, and coordinate the nodes in the target cluster based on the node service information to provide services.
[0163] As an optional scheme, the above-mentioned device is also used to: control the main management node to periodically send its own working status to the backup management node; in the case of failure to send the working status, detect the connection status between the main management node and the backup management node; in the case that the connection status indicates that the main management node is normal and the backup management node is abnormal, re-determine the backup management node, and in the case that the connection status indicates that both the main management node and the backup management node are normal, control the main management node to resend the working status to the backup management node; obtain the report time corresponding to the backup management node receiving the working status; in the case that the report time exceeds a preset time threshold, detect the connection status and the business resource information stored in the backup management node; in the case that the connection status indicates that the backup management node is normal and the main management node is abnormal, and the business resource information includes the node service information corresponding to each node in the target cluster, send a node notification message to each node, and update the working status of the target cluster, wherein the node notification message indicates that the backup management node will establish communication with the nodes in the target cluster.
[0164] As an optional solution, the above-mentioned device is used to set the main management node in the first working group in the following manner, including: initiating a cluster configuration request to divide the nodes in the target cluster into a first working group and a second working group; determining a main management node that meets the target node conditions from the first working group, wherein the target node conditions include being able to communicate normally with any node in the target cluster and being recognized by the nodes in the first working group; and configuring the main management node to manage the nodes in the target cluster.
[0165] As an optional scheme, the above-mentioned device is used to configure the main management node in the following manner to manage the nodes in the target cluster: establish communication between the main management node and the nodes in the target cluster, and the main management node is used to periodically obtain the service status and service configuration sent by the nodes in the target cluster; when the main management node receives a first service status sent by a first service node, the first service status is sent to the backup management node, and the working status of the target cluster is updated, wherein the first service node represents the node whose service status has changed; when the main management node receives a second service configuration sent by a second service node, the second service configuration is sent to the backup management node, and the working status of the target cluster is updated, wherein the second service node represents the node whose service configuration has changed.
[0166] As an optional solution, the above-mentioned device is also used to: when the first working group includes multiple nodes, obtain other nodes in the first working group except the main management node; determine the node with the smallest load among other idle nodes as the backup management node.
[0167] As an optional solution, the above device is also used to: when the first working group only includes the active management node, obtain other nodes in the second working group; and determine the node with the smallest load among the other idle nodes as the backup management node.
[0168] As an optional solution, the above-mentioned device is also used to: control the main management node to periodically send its own working status to the backup management node; in the case of failure to send the working status, detect the connection status between the main management node and the backup management node; in the case that the connection status indicates that the main management node is normal and the backup management node is abnormal, re-determine the backup management node from the first working group based on the main management node.
[0169] As an optional scheme, the above-mentioned device is used to set a standby management node in the first working group in the following manner: obtaining the reporting time corresponding to the working status sent by the main management node when the standby management node receives it; when the reporting time exceeds a preset time threshold, detecting the connection status between the standby management node and the main management node and the business resource information stored in the standby management node; when the connection status indicates that the standby management node is normal and the main management node is abnormal, and the business resource information includes the service status and service configuration of each node in the target cluster, sending a node notification message to each node and updating the working status of the target cluster, wherein the node notification message indicates that the standby management node will establish communication with the nodes in the target cluster.
[0170] As an optional scheme, the above-mentioned device is also used to: after setting a backup management node in the first working group, when the main management node determines that the main service node has an abnormality, control the main management node to initiate a master-standby switching operation to instruct the backup service node to replace the main service node, and send the service configuration of the main service node to the backup service node, wherein the main service node is a node in the second working group and the backup service node is a node in the first working group; when the main service node repairs the abnormality, control the main management node to initiate a master-standby recovery operation to instruct the main service node to replace the backup service node, and send the service configuration of the backup service node to the main service node.
[0171] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0172] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0173] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program.
[0174] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0175] Figure 8 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0176] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0177] like Figure 8 As shown, the computer system 800 includes a central processing unit 801 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 802 (ROM) or the program loaded from the storage part 808 to the random access memory 803 (RAM). Various programs and data required for system operation are also stored in the random access memory 803. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output interface 805 (Input / Output interface, i.e., I / O interface) is also connected to the bus 804.
[0178] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0179] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions defined in the system of the present application are executed.
[0180] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions provided by the embodiment of the present application are performed.
[0181] According to another aspect of the embodiment of the present application, an electronic device for implementing the above cluster management method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.
[0182] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0183] Optionally, in this embodiment, the above-mentioned processor can be configured to execute the methods in each embodiment of the present application through a computer program.
[0184] Alternatively, a person skilled in the art may understand that: Fig. 9 The structure shown is for illustration only. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig. 9 Different configurations shown.
[0185] Among them, the memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the cluster management method and device in the embodiment of the present application. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, realizing the above-mentioned cluster management method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely located relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 can be specifically, but not limited to, used to store information such as the above-mentioned node service information. As an example, such as Fig. 9As shown, the memory 902 may include, but is not limited to, the active setting module 702, the standby setting module 704, and the control module 706 in the cluster management device. In addition, it may also include, but is not limited to, other module units in the cluster management device, which will not be described in detail in this example.
[0186] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0187] In addition, the electronic device further includes: a display 908 for displaying the node service information; and a connection bus 910 for connecting various module components in the electronic device.
[0188] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0189] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the cluster management method provided in various optional implementations of the above-mentioned cluster management aspects.
[0190] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store data for executing the methods in various embodiments of the present application.
[0191] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0192] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0193] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for one or more electronic devices to execute all or part of the steps of the methods described in each embodiment of the present application.
[0194] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0195] In the several embodiments provided in the present application, it should be understood that the disclosed application can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0198] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A cluster management method, characterized in that: include: Setting a primary management node in the first working group, wherein the primary management node is set to coordinate nodes in a target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set as standby nodes for the nodes in the second working group; Setting a standby management node in the first working group, wherein the standby management node represents a standby management node of the active management node; When an abnormality occurs in the active management node, the backup management node is controlled to take over from the active management node and coordinate the nodes in the target cluster to provide services.
2. The method according to claim 1, characterized in that The method further comprises: Establishing communication between the active management node and the nodes in the target cluster, wherein the active management node is used to periodically obtain node service information sent by the nodes in the target cluster, the node service information including the service status and service configuration of the node, and the node service information corresponds to the service provided by the node; Controlling the active management node to periodically send the node service information to the standby management node; In the event that an abnormality occurs in the active management node, the standby management node is controlled to establish communication with the nodes in the target cluster to take over the active management node to periodically obtain the node service information, and coordinate the nodes in the target cluster to provide services based on the node service information.
3. The method according to claim 2, characterized in that The method further comprises: Controlling the active management node to periodically send its own working status to the standby management node; In case that the working status fails to be sent, detecting the connection status between the active management node and the standby management node; When the connection status indicates that the active management node is normal and the standby management node is abnormal, re-determine the standby management node; when the connection status indicates that both the active management node and the standby management node are normal, control the active management node to resend the working status to the standby management node; Obtaining the time at which the standby management node receives a report corresponding to the working status; In the case where the reporting time exceeds a preset time threshold, detecting the connection state and the service resource information stored by the standby management node; When the connection status indicates that the backup management node is normal, the active management node is abnormal, and the business resource information includes the node service information corresponding to each node in the target cluster, a node notification message is sent to each node and the working status of the target cluster is updated, wherein the node notification message indicates that the backup management node will establish communication with the nodes in the target cluster.
4. The method according to claim 1, characterized in that: The step of setting a primary management node in the first working group includes: Initiating a cluster configuration request to divide the nodes in the target cluster into the first working group and the second working group; Determine the primary management node that meets the target node condition from the first working group, wherein the target node condition includes being able to communicate normally with any node in the target cluster and being recognized by the nodes in the first working group; The primary management node is configured to manage the nodes in the target cluster.
5. The method according to claim 4, characterized in that The configuring the primary management node to manage the nodes in the target cluster includes: Establishing communication between the active management node and the nodes in the target cluster, the active management node being used to periodically obtain service status and service configuration sent by the nodes in the target cluster; When the active management node receives the first service state sent by the first service node, the active management node sends the first service state to the standby management node and updates the working state of the target cluster, wherein the first service node represents the node whose service state changes; When the active management node receives the second service configuration sent by the second service node, the active management node sends the second service configuration to the standby management node and updates the working state of the target cluster, wherein the second service node represents the node where the service configuration changes.
6. The method according to claim 1, characterized in that The method further comprises: In the case where the first working group includes a plurality of nodes, obtaining other nodes in the first working group except the primary management node; A node with the smallest load among the other nodes in the idle state is determined as the standby management node.
7. The method according to claim 1, characterized in that The method further comprises: When the first working group includes only the primary management node, acquiring other nodes in the second working group; A node with the smallest load among the other nodes in the idle state is determined as the standby management node.
8. The method according to claim 1, characterized in that The method further comprises: Controlling the active management node to periodically send its own working status to the standby management node; In case that the working status fails to be sent, detecting the connection status between the active management node and the standby management node; When the connection status indicates that the active management node is normal and the standby management node is abnormal, the standby management node is re-determined from the first working group based on the active management node.
9. The method according to claim 1, characterized in that: The step of setting a standby management node in the first working group includes: Obtaining a report time corresponding to the working status sent by the active management node when the standby management node receives the report time; In the case where the reporting time exceeds a preset time threshold, detecting a connection state between the standby management node and the active management node and service resource information stored in the standby management node; When the connection status indicates that the backup management node is normal and the active management node is abnormal, and the business resource information includes the service status and service configuration of each node in the target cluster, a node notification message is sent to each node and the working status of the target cluster is updated, wherein the node notification message indicates that the backup management node will establish communication with the nodes in the target cluster.
10. The method according to claim 1, characterized in that After the standby management node is set in the first working group, the method further comprises: When the active management node determines that an abnormality occurs in the active service node, control the active management node to initiate an active-standby switching operation to instruct the standby service node to take over the active service node, and send the service configuration of the active service node to the standby service node, wherein the active service node is a node in the second working group, and the standby service node is a node in the first working group; When the active service node repairs the abnormality, the active management node is controlled to initiate an active-standby recovery operation to instruct the active service node to take over the standby service node and send the service configuration of the standby service node to the active service node.
11. A cluster management device, characterized in that: include: A master setting module, used for setting a master management node in a first working group, wherein the master management node is set to coordinate nodes in a target cluster to provide services, the target cluster includes the first working group and the second working group, and the nodes in the first working group are set as standby nodes for the nodes in the second working group; A standby setting module, used to set a standby management node in the first working group, wherein the standby management node represents a standby management node of the active management node; The control module is used to control the backup management node to take over the active management node and coordinate the nodes in the target cluster to provide services when an abnormality occurs in the active management node.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method described in any one of claims 1 to 10.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.
14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.
Citation Information
Patent Citations
Fault processing method of computer cluster system
CN103607297A
Server cluster system and load balancing implementation method thereof
CN104283948A
Data processing node management method and device, equipment and storage medium
CN111818159A
Backup method and device and server cluster system
CN113472556A
Chproxy cluster fault repair method and device, equipment and storage medium
CN114816820A