Computer cluster management method and computer equipment

By automatically detecting the status of computer cluster nodes and performing master-slave replication, the problem of delayed recovery from computer cluster failures is solved, achieving rapid failure recovery and operational continuity.

CN121396753APending Publication Date: 2026-01-23HENAN KUNLUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511326699.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

The recovery of computer clusters when nodes fail is delayed and cannot be restored in a timely manner, affecting the continuity of operation of the computer cluster.

Method used

By acquiring the status information of computer cluster nodes, faulty nodes are automatically detected, and normal nodes are promoted to master nodes for master-slave replication, thereby achieving automatic inspection and fault recovery of the computer cluster.

Benefits of technology

It improves the timeliness of computer cluster fault recovery, reduces reliance on maintenance personnel, and ensures the continuity of computer cluster operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121396753A_ABST
    Figure CN121396753A_ABST
Patent Text Reader

Abstract

The invention discloses a management method of a computer cluster and computer equipment. The computer cluster comprises a plurality of nodes. The method comprises the steps of obtaining state information of a plurality of nodes when receiving a routing inspection instruction of a computer cluster, and if it is determined that a target node in a fault state and a plurality of non-target nodes in a normal state exist in the plurality of nodes based on the state information of the plurality of nodes, when the target node comprises an initial main node, sending the initial main node to the computer cluster; and obtaining a to-be-upgraded slave node and a target slave node from the plurality of non-target nodes based on the state information of the non-target nodes, upgrading the to-be-upgraded slave node into a target master node, and controlling the target master node and the target slave node to perform master-slave replication. According to the technical scheme, the computer node with the fault can be recovered in time, and the recovery hysteresis of the computer node with the fault is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of distributed computing, and particularly relates to a computer cluster management method and computer equipment. BACKGROUND

[0002] A computer cluster refers to a system in which multiple independent computers are connected through a network to work cooperatively to complete specific tasks, and can collectively process user requests, store data or run application programs.

[0003] When a computer node in a computer cluster is unavailable, the computer node can be recovered. However, the recovery method has a lag and cannot recover the computer node in time. SUMMARY

[0004] Embodiments of the present application aim to provide a computer cluster management method and computer equipment, and to recover a computer node in failure in time and reduce the recovery lag of the computer node in failure.

[0005] In a first aspect, the embodiments of the present application provide a computer cluster management method, and the computer cluster includes multiple nodes. The method includes the following steps: Upon receiving an inspection instruction of the computer cluster, state information of the multiple nodes is acquired, and the multiple nodes include an initial master node and multiple initial slave nodes; If it is determined based on the state information of the multiple nodes that there is a target node in failure and multiple non-target nodes in normal state among the multiple nodes, and the target node includes the initial master node, a standby upgrade slave node and a target slave node are acquired from the multiple non-target nodes based on the state information of the non-target nodes; The standby upgrade slave node is upgraded to a target master node, and the target master node is controlled to perform master-slave replication with the target slave node.

[0006] In the above technical solution, after the state information of the computer cluster is acquired, it is determined based on the state information of the multiple nodes whether there is a target node in failure among the multiple nodes. If there is a target node in failure among the multiple nodes, and the target node includes the initial master node, it indicates that the core function of the computer cluster is affected, and the multiple non-target nodes in normal state are all initial slave nodes. The state information of the non-target nodes can reflect the current running condition of the non-target nodes. Therefore, in order to ensure the work continuity of the computer cluster, the standby upgrade slave node and the target slave node are acquired from the multiple non-target nodes based on the state information of the non-target nodes, the standby upgrade slave node is upgraded to the target master node, and the target master node is controlled to perform master-slave replication with the target slave node, so that the inspection operation of the computer cluster is automatically completed.

[0007] It can be seen that the embodiments of the present application can automatically detect whether there is a target node in a fault state in the plurality of nodes by state information of each node, and when there is a target node in a fault state in the plurality of nodes, the server cluster is reconstructed based on a non-target node in a normal state, thereby ensuring normal work of the computer cluster. Therefore, the method of the embodiments of the present application can provide operation and maintenance capability for the server cluster, and achieve the purpose of automatically inspecting the server cluster. In this way, the dependence on the operation and maintenance personnel capability can be reduced, and the recovery timeliness of the server node in a fault state can be improved.

[0008] In a possible implementation, the plurality of nodes includes a first node, and the state information of the first node at least includes a network state of the first node. The method further includes: If the network state of the first node indicates that the first node is in a network outage state, it means that the first node cannot realize data synchronization, and the first node is determined as the target node; In a possible implementation, if the first node is in a network outage state, the method further includes: If it is detected that the target node includes an initial slave node in a fault state in the plurality of initial slave nodes, it means that the initial slave node cannot communicate, and whether the computer cluster includes the initial slave node has little effect on the overall operation of the computer cluster. Therefore, the initial slave node in a fault state can be deleted from the plurality of nodes.

[0009] In a possible implementation, each of the plurality of nodes is installed with an application program, and the method further includes: If the network state of the first node indicates that the first node is in a networked state, it means that the first node meets the basic condition for the application program to execute a task. Therefore, a start instruction of a test task can be sent, and the start instruction of the test task is used to instruct the application program installed in the first node to execute the test task; If it is detected that the application program fails to execute the test task, it means that although the first node can be networked, the application program is in a fault state, and the application program needs to be repaired. Therefore, the first node is determined as the target node; If it is detected that the test task of the application program is executed successfully, it means that the first node can be networked and can normally execute a task. Therefore, the first node is in a normal state, and the first node is determined as the non-target node.

[0010] In a possible implementation, when the first node is in a networked state and the application program fails to execute the test task, the method further includes: If the target node includes the initial slave node in the fault state, it indicates that the initial slave node in the fault state can communicate normally, but the application installed in the initial slave node in the fault state has a problem, so the application of the initial slave node in the fault state can be repaired to obtain the repaired slave node. If the non-target node includes the initial master node, it indicates that the initial master node is normal, so the repaired slave node can be controlled to perform master-slave replication with the initial master node. If the target node further includes the initial master node, it indicates that the initial master node has a fault, and the to-be-upgraded slave node needs to be obtained based on the multiple non-target nodes, and the to-be-upgraded slave node is upgraded to the target master node to rebuild the computer cluster, so the repaired slave node can be controlled to perform master-slave replication with the target master node.

[0011] In a possible implementation, repairing the initial slave node in the fault state to obtain the repaired slave node includes: The application of the slave node in the fault state is instructed to restart, and if it is detected that the application restart fails, it indicates that the application cannot be repaired, so the application of the slave node in the fault state can be reinstalled to obtain the repaired slave node. On this basis, the repaired slave node is controlled to perform master-slave replication with the initial master node or the target master node according to whether the initial master node is replaced by the target master node.

[0012] In a possible implementation, the state information of the non-target node at least includes synchronization state information of the non-target node, and the to-be-upgraded slave node and the target slave node are obtained from the multiple non-target nodes based on the state information of the non-target node, including: Based on the synchronization state information of the multiple non-target nodes, the synchronization capability indicators of the multiple non-target nodes are determined. The to-be-upgraded slave node is obtained from the multiple non-target nodes based on the synchronization state information of the multiple non-target nodes, and the to-be-upgraded slave node is one non-target node in the multiple non-target nodes whose synchronization capability indicator is greater than or equal to a preset indicator. The target slave node is obtained from the multiple non-target nodes based on the to-be-upgraded slave node, and the target slave node is a non-target node in the multiple non-target nodes except the to-be-upgraded slave node.

[0013] When the synchronization state information of the non-target node is greater than or equal to the preset index, it indicates that the data similarity between the to-be-upgraded slave node and the initial master node is high, and therefore, the to-be-upgraded slave node is upgraded to the target master node, which can reduce the influence degree on the computer cluster. At this time, the non-target node with the synchronization capability index greater than or equal to the preset index can be obtained from the multiple non-target nodes, and the non-target node is taken as the to-be-upgraded slave node. After the to-be-upgraded slave node is upgraded to the target master node, the data difference between the target master node and the initial master node is small, which can reduce the possibility of data loss of the computer cluster after the computer cluster is constructed.

[0014] In a possible implementation, the to-be-upgraded slave node is upgraded to the target master node, including: Based on the identity information of the to-be-upgraded slave node, a slave node upgrade request is sent to the local terminal; In response to an acknowledgement message from the local terminal for the upgrade request, the to-be-upgraded slave node is upgraded to the target master node.

[0015] The application embodiment sends the slave node upgrade request to the local terminal, so that the slave node upgrade of the computer cluster is controllable, thereby further ensuring that the target master node obtained by upgrading meets the requirements.

[0016] In a possible implementation, the method further includes: In response to an addition indication of the second node from the local terminal, the second node is added in the computer cluster; The application program is installed in the second node, the second node is taken as a slave node, and the second node is controlled to perform master-slave replication with the target master node.

[0017] The application embodiment can automatically add a new slave node in the computer cluster by interacting with the local terminal, which can further improve the high availability of the computer cluster without high professional knowledge.

[0018] In a possible implementation, the method further includes: Based on the number of target nodes and the number of multiple nodes, a node failure rate of the computer cluster is determined; If the node failure rate is greater than a preset failure rate, it indicates that the number of failed nodes in the computer cluster is too large, which causes the computer cluster to be difficult to work normally, and therefore, the computer cluster can be confirmed to be collapsed.

[0019] In a second aspect, the application embodiment further provides a computer cluster management device, the computer cluster including multiple nodes, and the device includes: The communication module is configured to acquire state information of a plurality of nodes including an initial master node and a plurality of initial slave nodes when receiving an inspection instruction of the computer cluster. The determination module is configured to acquire a to-be-upgraded slave node and a target slave node from the plurality of non-target nodes based on the state information of the non-target nodes if it is determined that there is a target node in a failure state and a plurality of non-target nodes in a normal state in the plurality of nodes based on the state information of the plurality of nodes, and the target node includes the initial master node. The repair module is configured to upgrade the to-be-upgraded slave node to a target master node, and control the target master node to perform master-slave replication with the target slave node.

[0020] In a third aspect, an embodiment of the present application further provides a computer device, comprising: a processor; and a memory storing a program; The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to the first aspect of the embodiments of the present application or any possible implementation manner of the first aspect.

[0021] In a fourth aspect, an embodiment of the present application further provides a computer storage medium storing computer instructions, when the program instructions run on an electronic device, causing a processor of the electronic device to perform the method according to the first aspect of the embodiments of the present application or any possible implementation manner of the first aspect.

[0022] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of the first aspect or any possible implementation manner of the first aspect.

[0023] The beneficial effects brought by the technical solutions of the second aspect to the fifth aspect of the embodiments of the present application can refer to the beneficial effects of the method of the first aspect of the embodiments of the present application or any possible implementation manner of the first aspect, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0024] In the following description of exemplary embodiments in conjunction with the drawings, more details, features and advantages of the present application are described, and the drawings are as follows: Figure 1 A schematic diagram of an example framework of a computer cluster management system in which the various methods described herein can be implemented according to embodiments of the present application is shown; Figure 2 A simplified process diagram of a redis program installation is shown as an example of two nodes; Figure 3A flowchart of a process in which a management node of an embodiment of the application installs an application on a node is shown. Figure 4 A schematic diagram of the principle of cluster initialization of an embodiment of the application is shown. Figure 5 A flowchart of the process of cluster initialization of an embodiment of the application is shown. Figure 6 A flowchart of a management method of a computer cluster of an embodiment of the application is shown. Figure 7 A flowchart of a node fault detection and repair method of an embodiment of the application is shown. Figure 8 A flowchart of a fault repair method for a slave node in a fault state of an embodiment of the application is shown. Figure 9 A functional module schematic block diagram of a management device of a computer cluster according to an exemplary embodiment of the application is shown. Figure 10 A schematic block diagram of a chip according to an exemplary embodiment of the application is shown. Figure 11 A structural block diagram of an exemplary computer device that can be used to implement embodiments of the application is shown. DETAILED DESCRIPTION

[0025] Embodiments of the application will be described in more detail with reference to the drawings. Although certain embodiments of the application are shown in the drawings, it should be understood that the application can be embodied in various forms and should not be interpreted in a limiting manner as set forth in the embodiments described herein, but rather the embodiments are provided to more thoroughly and completely understand the application. It should be understood that the drawings and embodiments of the application are for exemplary purposes only and are not intended to limit the scope of protection of the application.

[0026] It should be understood that the various steps recited in the method embodiments of the application can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit performing the steps shown. The scope of the application is not limited in this respect.

[0027] As used herein, the term "includes" and its variants are open-ended, meaning that "includes but is not limited to". The term "based on" means "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related terms shall be construed accordingly. It needs to be noted that the terms "first", "second" and the like in the description and in the claims are used to distinguish between similar elements and not necessarily to indicate the chronological order of the steps in the process.

[0028] It needs to be noted that the terms "one", "multiple", "a", "another", "some" in the present application are illustrative and not restrictive, and those skilled in the art should understand that "one" or "a" should be understood as "one or more" unless the context clearly indicates otherwise. Before introducing the embodiments of the present application, first, the related terms involved in the embodiments of the present application are explained as follows: Heterogeneous resources refer to multiple different types of resources in the same system, which can be computing nodes of different performance (such as central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), etc.), storage devices, and network bandwidth, etc.

[0029] Multi-dimensional heterogeneous resources refer to a collection of various resources (such as computing, storage, network, middleware, etc.) with multi-dimensional attributes of physics, logic, space-time, service, etc., and significant differences in types, structures, performance, interfaces, etc. in the cloud platform.

[0030] Resource weight refers to the relative importance value given to various resources (such as computing, storage, network, GPU, etc.) or different attributes (such as performance, cost, energy consumption, availability, etc.) of the resources. It is the core basis for resource scheduling, priority sorting, and decision optimization, and is used to quantify the value proportion of different resources in a specific scenario.

[0031] A server cluster is a group of computers that work together to manage and participate in workload management. A server cluster connects two or more computers through a high-speed network, enabling these computers to work together to provide users with application programs, system resources, and data services.

[0032] The Model Context Protocol (MCP) defines the way context information is exchanged between applications and artificial intelligence models, enabling developers to connect various data sources, tools, and functionalities to artificial intelligence models in a consistent manner (an intermediate protocol layer). The goal is to create a universal standard that makes the development and integration of artificial intelligence applications easier and more uniform.

[0033] Redis is an open-source in-memory data structure store that supports various data structures such as strings, hashes, lists, sets, and sorted sets. It can be used as a database, cache, and message broker, and excels in performance, scalability, and flexibility.

[0034] Master-slave replication is a mechanism in databases that allows data to be replicated from one database server (master) to one or more database servers (slaves). The core of this mechanism is to maintain data consistency and availability while providing load balancing and data backup functions.

[0035] The Slave Of command transforms the current server into a slave server of the specified server. If the current server is already a slave of some master server, executing SLAVEOF host port will stop the current machine from synchronizing with the old master, discard the old dataset, and start synchronizing with the new master.

[0036] The Slave Of No One command is a key command in Redis that immediately promotes a slave node to a master node, stopping its replication behavior and allowing it to handle read and write requests independently.

[0037] Secure Shell (SSH) is a secure network protocol developed by the Internet Engineering Task Force (IETF) based on the application layer. It is designed specifically for secure remote login sessions and other network services, effectively addressing network vulnerabilities.

[0038] Master-Slave mode is a common cluster deployment method used to ensure system high availability and fault tolerance. In this mode, each node in the system can play the role of master (Master) and slave (Slave). The master node is responsible for handling all requests and transactions, while the slave node is in standby mode, replicating the master's data in real time to take over its work in case of failure.

[0039] The replication offset is a common parameter in Redis, which is mainly used to mark the data synchronization progress between the master node and the slave node, and ensure that the slave node accurately chases the data of the master node.

[0040] Figure 1 A schematic diagram of an example framework of a computer cluster management system in which the various methods described herein can be implemented according to embodiments of the present application is shown. As shown, Figure 1 The computer cluster management system 100 of embodiments of the present application includes a local terminal 101, a management node 102, and a computer cluster 103.

[0041] As shown, Figure 1 The local terminal 101 can be a terminal with display function, and the terminal can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and a wearable device based on augmented reality (AR) and / or virtual reality (VR) technology, etc.

[0042] As shown, Figure 1 When the local terminal 101 is a wearable device, the wearable device can also be a general term for devices that can be designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes, etc. The wearable device is a portable device that can be directly worn on the body or integrated into the user's clothes or accessories.

[0043] It can be understood that the wearable device is not only a hardware device, but also a powerful function realized through software support and data interaction and cloud interaction. The general wearable smart device includes a full function, a large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, etc., and only focuses on a certain application function, and needs to be used in cooperation with other devices such as a smart phone, such as various smart bracelets, smart jewelry, etc. for monitoring vital signs.

[0044] As shown, Figure 1As shown, the computer cluster 103 of the embodiments of the present application can include multiple nodes. These nodes can be server nodes, edge computing nodes, and the like computer nodes. In the computer cluster 103 (such as a distributed system, a cloud cluster, a container cluster, and the like scenarios), according to the logic of “centralized management and decentralized execution”, the multiple nodes can include a master node and a slave node (also commonly referred to as a worker node).

[0045] Optionally, as shown, Figure 1 As shown, the local terminal 101 can communicate with the computer cluster 103 through the management node 102, so as to send Redis commands (such as GET, SET) to the nodes (master node and slave node) included in the computer cluster 103 by the local terminal 101, and the nodes directly return the results to the local terminal 101.

[0046] As shown, Figure 1 According to the functional division of the computer cluster 103, the computer cluster 103 can be a redis cluster, a task queue cluster, a database cluster, and the like. Taking the redis cluster as an example, the redis master-slave mode is a mode of data backup and read-write separation. In this mode, there is a master node (Master) and one or more slave nodes (Slave). All write operations are performed on the master node, while read operations can be performed on the master node and the slave node. The slave node replicates the data of the master node to achieve data backup.

[0047] As shown, Figure 1 The management node 102 of the embodiments of the present application can implement various management of the computer cluster 103, which can implement automatic installation of application programs of nodes, cluster initialization, addition of slave nodes, deletion of slave nodes, and automatic failover (automatic inspection), and the like.

[0048] Optionally, as shown, Figure 1 The management node 102 can communicate with the local terminal 101, and the user can send a task instruction to the management node 102 through the local terminal 101, so that the management node 102 can execute the corresponding task under the trigger of the task instruction.

[0049] Optionally, as shown, Figure 1 The management node 102 can monitor the cluster state and perform operation and maintenance. For example, the management node 102 collects the state data of each node by directly connecting all nodes (master node and slave node), and the administrator can send an operation and maintenance instruction to the management platform through the local terminal 101, and the management platform performs automatic operation and maintenance (such as failover, etc.) on each node under the instruction of the operation and maintenance instruction.

[0050] In some embodiments, asFigure 1 As shown, the management node 102 can include an MCP-client 1021, an MCP-server 1022, and an inference module 1023. Taking a redis cluster as an example of a computer cluster 103, the LLM model can be deployed in the master-slave mode of the redis cluster on the management node 102, the Redis High Availability MCP Server and the Redis High Availability MCP Client are deployed on the management node 102, the Redis High Availability MCP Server is configured as the MCP-server 1022, and the Redis High Availability MCP Client is configured as the MCP-client 1021. The MCP-client 1021 can be used as a calling end, and the relevant request information can be obtained in the form of a question and answer through the local terminal 101, so that the MCP-server 1022 can install an application program on each node of the computer cluster 103 and initialize the computer cluster 103, so that the LLM model accesses the computer cluster 103.

[0051] The administrator can send a request message to the MCP-client 1021 included in the management node 102 through the local terminal 101, the MCP-client 1021 can forward the request message to the MCP-server 1022, the MCP-server 1022 can return a loading function based on the request message to the MCP-client 1021, the MCP-client 1021 transmits the loading function to the inference module 1023, the inference module 1023 can perform semantic understanding on the loading function based on the LLM model, and returns an execution function and parameters to the MCP-client 1021; the MCP-client 1021 can forward the execution function and the parameters to the MCP-server 1022, and the MCP-server 1022 can operate the computer cluster 103 based on the execution function and the parameters, such as automatic installation of an application program on a node, cluster initialization, addition of a slave node, deletion of a node, and automatic failover (automatic inspection).

[0052] When the request message includes installation of an application program on a node of the computer cluster, Figure 2 A simplified process diagram of redis program installation is shown as an example of two nodes. As shown in FIG. 4, Figure 2 As shown, the nodes include node A and node B, and the MCP-server 201 can distribute a redis installation package to node A and node B through SSH, so that the redis program can be automatically installed on node A.

[0053] Figure 3 A flowchart of the management node of the embodiment of the application in the process of installing an application program on a node is shown. As shown in FIG. 5, Figure 3As shown, the method for installing an application program by the management node in the embodiment of the application includes steps 301-308.

[0054] In step 301, the MCP-server detects the availability of each candidate node upon receiving the installation command of the application program forwarded by the MCP-client.

[0055] The administrator can input the application program installation request of the candidate node through the local terminal and send it to the MCP-client of the management node, which contains the identity information of the multiple candidate nodes included in the computer cluster. The MCP-client can send the application program request message to the MCP-server, so that the MCP-server returns the loading function to the MCP-client. The MCP-client obtains the execution function and parameters from the LLM model of the inference module based on the loading function and forwards them to the MCP-server. The MCP-server can extract the installation command of the application program from the execution function and parameters.

[0056] The MCP-client can receive the execution function and parameters returned by the LLM model of the inference module and forward them to the MCP-server. The MCP-server can extract the installation command of the application program from the execution function and parameters.

[0057] Optionally, the MCP-server can detect whether each candidate node can be connected to the network. If a certain candidate node is disconnected from the network, it means that the candidate node is unavailable, and step 302 can be performed. If a certain candidate node can be connected to the network, it means that the candidate node is available, and step 303 can be performed.

[0058] In step 302, the MCP-server adds the unavailable candidate node to the list of unavailable nodes.

[0059] In step 303, the MCP-server generates an initial configuration template of the application program and automatically acquires the installation package of the application program through networking. For example, the installation package of the application program can be a redis installation package, and can also be a MySQL installation package, but is not limited thereto.

[0060] In step 304, the MCP-server distributes the installation package of the application program to the available candidate nodes through SSH and controls each available candidate node to automatically install and start the application program through the installation package of the application program.

[0061] In step 305, the MCP-server uninstalls the application program of the available candidate node when detecting that the application program of the available candidate node cannot normally perform a task, and adds the available candidate node to the list of unavailable nodes.

[0062] In step 306, the MCP-server adds the node to the available node list when detecting that the application program of the available candidate node is running normally.

[0063] In step 307, the MCP-server calculates the node information of the computer cluster based on the available node list and the unavailable node list.

[0064] In step 308, the MCP-server returns the node information of the computer cluster to the local terminal through the MCP-client. The local terminal can display the node information of the computer cluster, so that the construction of the computer cluster can be completed.

[0065] As shown in the following table, when the request message includes cluster initialization, Figure 1 the MCP-server can send the Slave Of command to node A and node C, so that node A can perform master-slave replication with node B, and node C can perform master-slave replication with node B. After the master-slave replication is completed, node A and node C are slave nodes of the computer cluster, and node B is the master node of the computer cluster.

[0066] In order to describe the process of cluster initialization in more detail, Figure 4 a principle diagram of cluster initialization of an embodiment of the present application is shown, Figure 5 a flowchart of cluster initialization of an embodiment of the present application is shown. As shown in Figure 4 and Figure 5 the method for cluster initialization of the management node of the embodiment of the present application can include steps 501-505.

[0067] In step 501, the MCP-server 401 obtains the resource information of each node through SSH. For example, the MCP-server 401 can scan the default port of each node to obtain the resource information of each node according to the default port of each node. Taking three redis nodes as an example, the node resource information can be obtained from redis node 1, redis node 2 and redis node 3.

[0068] Optionally, the administrator can input the request message of cluster initialization through the local terminal and send it to the MCP-client 402 of the management node, which contains the identity information of the multiple nodes included in the computer cluster. The MCP-client 402 can obtain the loading function from the MCP-server 401 based on the request message, obtain the execution function and parameters from the LLM model of the inference module 403 based on the loading function, and forward them to the MCP-server 401. The MCP-server 401 can extract the cluster initialization command from the execution function and parameters.

[0069] Optionally, the node resource information can include, for example, computing resources, storage resources of the node, and network resources of the node. For a redis cluster, the computing resources can include memory, a central processing unit (CPU), a graphics processing unit (GPU), and a neural processing unit (NPU); the storage resources can include a hard disk and a display memory; and the network resources include throughput, packet loss rate, and port latency.

[0070] In step 502, the MCP-server 401 forwards the respective node information to the inference module 403 through the MCP-client 402, so that the inference module 403 obtains the identity information of the master node from the plurality of nodes based on the respective node information by using the LLM model.

[0071] Optionally, the LLM model can analyze whether each resource information in the plurality of node resource information meets the resource requirement of the master node. If the resource requirement of the master node is met, the identity information of the node can be considered as the identity information of the master node. If the number of nodes meeting the resource requirement of the master node is more than one, the identity information of one of the nodes can be selected as the identity information of the master node.

[0072] For example, the inference module 403 can input the resource state information of each node into the LLM model, and infer the identity information of a candidate master node suitable for being the master node by using the LLM model. Here, a large amount of node identity information and node resource information of a computer cluster can be collected, the node identity information is taken as reference information, and the node resource information is taken as input information. The LLM model is trained, and then the LLM model obtained by the training is deployed on the inference module 403.

[0073] In step 503, the inference module 403 returns the identity information of the master node to the MCP-client 402, so that the MCP-client 402 returns the identity information of the master node to the MCP-server 401.

[0074] In step 504, the MCP-server 401 determines the Slave Of command and the identity information of the slave node based on the identity information of the master node.

[0075] Optionally, based on the identity information of the master node, the IP address and the port of the master node can be obtained, the IP address and the port of the master node are defined as interface information of the master node, and the Slave Of command is determined based on the interface information of the master node. Meanwhile, in the case where the identity information of the master node is determined, the identity information of the slave node can be obtained from the plurality of nodes.

[0076] In step 505, the MCP-server 401 sends a Slave Of command to the slave node based on the identity information of the slave node, so that the slave node and the master node perform master-slave replication.

[0077] Optionally, the Slave Of command contains the port information of the master node, so that the MCP-server 401 can control the slave node to perform master-slave replication between the slave node and the master node based on the Slave Of command, thereby completing the computer cluster construction (i.e. cluster initialization).

[0078] Taking three redis nodes as an example, if the master node is redis2, the MCP-server 401 sends a Slave Of command to redis node 1 and redis node 3, so that redis node 1 and redis node 2 perform master-slave replication, and redis 3 and redis 2 perform master-slave replication.

[0079] When the request message includes adding a slave node, the administrator can send the node information (such as identity information) to be added to the MCP-client included in the management node through the local terminal, and the MCP-client, the MCP-server and the inference model cooperate with each other, so that the MCP-server can download the installation package (redis installation package) of the application program after obtaining the execution function and the parameter. Of course, the installation package of the application program can also be stored in the management node. The MCP-server obtains the installation package of the application program, and installs the application program in the node to be added by using the installation package of the application program. After that, the MCP-server can also send a Slave Of command to the node to be added, and the Slave Of command contains the interface information (such as the IP address and the port of the master node) of the master node, so that the node to be added can perform master-slave replication with the master node based on the interface information of the master node, thereby completing the addition of the node to be added in the computer cluster.

[0080] When the request message includes adding a slave node, the administrator can send the node information (such as identity information) to be added to the MCP-client included in the management node through the local terminal, and the MCP-client, the MCP-server and the inference model cooperate with each other, so that the MCP-server can determine the identity information of the slave node to be deleted after obtaining the execution function and the parameter. The MCP-server can also link to the slave node to be deleted based on the identity information of the slave node to be deleted through SSH, control the slave node to be deleted to uninstall the application program, and the MCP-server can delete the slave node to be deleted from the available node list of the computer cluster.

[0081] The embodiment of the present application further provides a management method of a computer cluster, which can automatically perform inspection on the computer cluster, so as to timely recover the computer cluster when the computer cluster fails, realize automatic operation and maintenance under multiple copies, and reduce the professional ability requirement for operation and maintenance personnel.

[0082] The method of the embodiment of the present application can be executed by a management node or a chip applied to the management node, Figure 6 A flowchart of the management method of the computer cluster of the embodiment of the present application is shown. As shown in the figure, Figure 6 The method of the embodiment of the present application includes steps 601-604.

[0083] In step 601, when receiving an inspection instruction of a computer cluster, state information of multiple nodes is acquired, the multiple nodes including an initial master node and multiple initial slave nodes.

[0084] In the embodiment of the present application, the initial master node can refer to a master node in the computer cluster before the computer cluster is inspected, and the initial slave node can refer to a slave node in the computer cluster before the computer cluster is inspected.

[0085] Optionally, the MCP-client can periodically send an inspection instruction of a computer cluster to the reasoning module, the reasoning module can determine a cluster inspection strategy based on the inspection instruction of the computer cluster, and forward the cluster inspection strategy to the MCP-server through the MCP-client, and the MCP-server can acquire state information of multiple nodes through the cluster inspection strategy.

[0086] In an example, the reasoning module can acquire an execution function and parameters corresponding to the inspection instruction by using the semantic understanding capability of the LLM model. The execution function and the parameters can define the inspection strategy.

[0087] Optionally, for each node, the node is installed with an application program, which can be a redis program, a MySQL program, or other programs, and the specific program can be determined according to the type of the computer cluster.

[0088] Optionally, the state information of the node can include resource state information of the node and synchronization state information of the node. The resource state information of the node can reflect the current resource usage of the node, and the synchronization state information of the node can reflect the data proximity between the slave node and the master node.

[0089] In an example, the resource state information can include state information of a computing resource, state information of a storage resource, and network state information. For example, the state information of the computing resource includes a usage rate of a CPU, a usage rate of a GPU, a usage rate of an NPU, a usage rate of a memory, and the like, the state information of the storage resource can include a usage rate of a hard disk and a usage rate of a display memory, and the like, and the network resource can include a throughput rate, a packet loss rate, and a port delay, and the like.

[0090] In an example, when the computer cluster is a redis cluster, the synchronization state information of the node can include an offset value; in an example, when the computer cluster is a MySQL cluster, the synchronization state information of the node can include a binlog value, which is mainly used to mark the data synchronization progress between the master node and the slave node, and ensure that the slave node accurately catches up with the data of the master node.

[0091] For example, the binlog value can be a slave status value Seconds_Behind_Master, which can feed back the number of seconds that the slave library lags behind the master library, that is, the difference between the time when the slave library last synchronizes the Binlog of the master library and the current time of the master library. For another example, the binlog value can include Read_Master_Log_Pos and Exec_Master_Log_Pos. Wherein, Read_Master_Log_Pos can mean that the I / O thread of the slave library has read the Binlog position from the master node, and Exec_Master_Log_Pos can mean that the SQL thread of the slave node has executed (played back) to the Binlog position.

[0092] In step 602, if it is determined based on the state information of the plurality of nodes that there is a target node in a fault state and a plurality of non-target nodes in a normal state in the plurality of nodes, and the target node includes an initial master node, a standby node to be upgraded and a target slave node are obtained from the plurality of non-target nodes based on the state information of the non-target nodes.

[0093] In the embodiments of the present application, the plurality of nodes include a first node, which can be any one of the computer nodes, and the first node can be an initial master node or an initial slave node. Since the state information of the first node can include resource state information of the first node and synchronization state information of the first node, the resource state information of the first node can reflect the current resource usage of the node, and the synchronization state information of the first node can reflect the closeness of the data between the slave node and the master node, therefore, whether the first node is in a fault state can be determined based on the state information of the first node.

[0094] Optionally, when the target node in the plurality of nodes is in a failure state, the nodes in the plurality of nodes other than the target node are non-target nodes. And the target node can be repaired according to the type of the target node. If the target node includes an initial master node, the MCP-server can forward the state information of the non-target nodes to the inference module through the MCP-client, the inference module can input the state information of the non-target nodes into the LLM model to obtain the identity information of the to-be-upgraded slave node, and then forward the identity information of the to-be-upgraded master node to the MCP-server through the MCP-client. The MCP-server can obtain the target slave node from the plurality of non-target nodes based on the identity information of the to-be-upgraded master node. Here, the number of target slave nodes can be one or more.

[0095] In order to reduce unnecessary operations, the node failure rate of the computer cluster can be determined based on the number of target nodes and the number of nodes. If the node failure rate is greater than the preset failure rate, it means that the number of failed nodes in the computer cluster is too large, which makes the computer cluster difficult to work normally and difficult to repair, so it can be confirmed that the computer cluster has collapsed. For example, if the number of nodes included in the computer cluster is N, the number of failure nodes that the computer cluster can tolerate can be (N-1) / 2 nodes, so the preset failure rate can be (N-1) / 2N.

[0096] Optionally, when the MCP-server detects that the node failure rate is greater than the preset failure rate, it can return an alarm message to the MCP-client, and the MCP-client can send the alarm message to the local terminal, so that the administrator can quickly dispose the computer cluster failure.

[0097] In step 603, the to-be-upgraded slave node is upgraded to the target master node. Here, in order to further improve the reliability of the recovered master node, the upgrade request of the slave node can be sent to the local terminal based on the identity information of the to-be-upgraded slave node.

[0098] The local terminal can send a confirmation message for the upgrade request to the management node in response to the confirmation operation of the upgrade request, and the management node can upgrade the to-be-upgraded slave node to the target master node in response to the confirmation message for the upgrade request from the local terminal.

[0099] Optionally, the MCP-server can forward the identity information of the to-be-upgraded slave node to the local terminal in the form of an upgrade request through the MCP-server client. When the local terminal detects a confirmation operation for the upgrade request, a confirmation message for the request message can be sent to the MCP-client of the management node, the MCP-client forwards the confirmation message for the request message to the MCP-server, and the MCP-server can upgrade the to-be-upgraded master node to the target master node in response to the confirmation message. In this way, the upgrade of the slave node of the computer cluster can be controlled, thereby further ensuring that the target master node obtained by the upgrade meets the requirements.

[0100] Optionally, when the to-be-upgraded master node is upgraded to the target master node, an upgrade master request can be sent to the to-be-upgraded slave node, and the upgrade master request can request the to-be-upgraded slave node to disconnect with the initial master node and change the node type to a master node.

[0101] For example, taking a redis cluster as an example, the MCP-server can send a Slave Of No One command to the to-be-upgraded master node, and the to-be-upgraded master node can stop the data replication function under the trigger of the Slave Of No One command, so that the redis instance of the upgraded master node disconnects the replication link with the initial master node; and the original slave node type is changed to a master node type.

[0102] In step 604, the target master node is controlled to perform master-slave replication with the target slave node. For example, the MCP-server can send a Slave Of command to the target slave node, so that the target slave node performs master-slave replication with the target master node under the trigger of the Slave Of command, thereby realizing the master-slave replication of the target master node and the target slave node.

[0103] After obtaining the state information of the computer cluster, it can be determined whether there is a target node in a fault state in the plurality of nodes based on the state information of the plurality of nodes. If there is a target node in a fault state in the plurality of nodes, if the target node includes an initial master node, it indicates that the core function of the computer cluster is affected, and the plurality of non-target nodes in a normal state are all initial slave nodes. The state information of the non-target node can reflect the current running condition of the non-target node. Therefore, in order to ensure the working continuity of the computer cluster, a to-be-upgraded slave node and a target slave node can be obtained from the plurality of non-target nodes based on the state information of the non-target node, and then the to-be-upgraded slave node is upgraded to a target master node, and the target master node is controlled to perform master-slave replication with the target slave node, thereby automatically completing the inspection operation of the computer cluster.

[0104] It can be seen that the embodiments of the present application detect whether the target node in the fault state exists in the plurality of nodes by automatically detecting the state information of each node, and when the target node in the fault state exists in the plurality of nodes, the server cluster is reconstructed based on the non-target node in the normal state, so as to ensure that the computer cluster works normally. Therefore, the method of the embodiments of the present application can provide operation and maintenance capability for the server cluster, and achieve the purpose of automatically inspecting the server cluster. In this way, the dependence on the operation and maintenance personnel capability can be reduced, and the recovery timeliness of the server node with the fault can be improved.

[0105] In a possible implementation, the state information of the first node at least includes the network state of the first node. Figure 7 A flowchart of a node fault detection and repair method of the embodiments of the present application is shown. As shown in Figure 7 The node fault detection method of the embodiments of the present application can include steps 701-704.

[0106] In step 701, based on the network state of the first node, it is determined whether the first node is in the network interruption state. If the first node is in the network interruption state, it means that the first node cannot realize data synchronization, and step 702 can be performed. If the first node is in the network connection state, it means that the first node meets the basic condition for the application program to execute the task, and therefore, step 703 can be performed.

[0107] Optionally, when the network state of the first node includes the connectivity test result, if the connectivity test result of the first node indicates that the network state of the first node is the network interruption state, it means that the management node cannot communicate with the first node, and therefore, it can be confirmed that the first node has a fault. Moreover, if the first node has a fault, the resource state information of the first node cannot be obtained, and therefore, for the first node whose connectivity test result indicates the network interruption state, the obtained state information of the first node only includes the connectivity test result.

[0108] In step 702, the first node is confirmed as the target node. Moreover, if the detected target node includes the initial master node, the state information of the non-target node can be used to obtain the to-be-upgraded slave node and the target slave node from the plurality of non-target nodes, the to-be-upgraded slave node is upgraded to the target master node, and the target master node is controlled to perform the master-slave replication with the target slave node.

[0109] If it is detected that the target node includes the initial slave node with the fault in the plurality of initial slave nodes, it means that the initial slave node cannot communicate, and whether the computer cluster includes the initial slave node has little influence on the overall operation of the computer cluster, and therefore, the initial slave node with the fault can be deleted from the plurality of nodes.

[0110] For example, when deleting the initial slave node with a fault, the application program installed by the initial node with a fault can be unloaded, and then the initial node with a fault is deleted from the list of available nodes.

[0111] In consideration of the fact that the number of slave nodes in the computer cluster can be maintained from fluctuating greatly after deleting the initial slave node with a fault, in response to an addition instruction from the local terminal, a second node is added in the computer cluster, an application program is installed in the second node, the second node is controlled to perform master-slave replication with the target master node, and the second node is used as a slave node.

[0112] Optionally, the local terminal can send the addition instruction of the second node to the MCP-client of the management node, the MCP-client sends the addition instruction of the second node to the MCP-server, the MCP-server can forward the corresponding loading function to the inference module through the MCP-client, so that the inference module can feed back the addition strategy of the slave node to the MCP-client by using the LLM model, the MCP-client sends the addition strategy of the slave node to the MCP-server, and the MCP-server can parse the addition strategy of the slave node to obtain the execution parameters and the parameters, and then complete the addition of the second node by using the addition strategy of the slave node.

[0113] In step 703, a start instruction of a test task is sent, and the start instruction of the test task is used to instruct the application program installed in the first node to execute the test task.

[0114] When the application program in the first node executes the test task, if the first node is a master node, it can be tested whether the application program in the first node can support read-write operation and data synchronization function. If the read-write operation and the data synchronization function can be supported, it is determined that the execution of the test task by the application program is successful, and step 704 can be executed, otherwise, it is determined that the execution of the test task by the application program fails, which indicates that although the first node can be connected to a network, the application program has a fault, and the application program needs to be repaired, and step 702 can be executed.

[0115] Of course, when the state information of the first node further includes resource state information of the first node, the resource state of the first node can also be detected through the resource state information of the first node to confirm whether the resources of the first node meet the requirements of the application program.

[0116] In step 704, it is confirmed that the first node is a non-target node. For example, when the first node is a master node, it is indicated that even if there is a target node in a failure state in the plurality of nodes, the node included by the target node can only be a slave node (if there is one master node in the computer cluster). When the first node is a slave node, it is indicated that when there is a target node in a failure state in the plurality of nodes, the target node can include both slave nodes and master nodes.

[0117] In an optional manner, when the first node is in a networking state and the application program fails to perform the test task, Figure 8 A flowchart of a method for repairing a failure of a slave node in a failure state according to an embodiment of the present application is shown. As shown in Figure 8 Steps 801-804 are included.

[0118] In step 801, if it is detected that the target node includes an initial slave node in a failure state in a plurality of initial slave nodes, the application program of the initial slave node in the failure state is repaired to obtain a repaired slave node.

[0119] When it is detected that the target node includes an initial slave node in a failure state in a plurality of initial slave nodes, it is indicated that the initial slave node in the failure state can normally communicate, but the application program installed in the initial slave node in the failure state has a problem, so as long as the initial slave node in the failure state is repaired, the failure of the initial slave node in the failure state is resolved.

[0120] Optionally, the application program of the slave node in the failure state can be instructed to restart, and if it is detected that the application program fails to restart, it is indicated that the application program cannot be repaired, so the application program of the initial slave node in the failure state can be reinstalled to obtain a repaired slave node.

[0121] Step 802: Determine whether the non-target node includes an initial master node. When the non-target node includes an initial master node, it is indicated that the initial master node is normal, so step 803 can be performed; when the non-target node does not include an initial master node, it is indicated that the target node includes an initial master node, i.e., the initial master node has a problem, so step 804 is performed with reference to the plurality of non-target nodes. Figure 6 Based on the plurality of non-target nodes, a to-be-upgraded slave node is obtained, and the to-be-upgraded slave node is upgraded to a target master node, so as to repair the initial master node and rebuild the computer cluster, and then step 804 is performed.

[0122] In step 803, the repaired slave node is controlled to perform master-slave replication with the initial master node. The method of master-slave replication can refer to the related description in the foregoing, so as to ensure that the repaired slave node can normally perform data synchronization with the initial master node.

[0123] In step 804, the control repaired slave node performs master-slave replication with the target master node. The method of master-slave replication can refer to the related description in the foregoing, so as to ensure that the repaired slave node normally performs data synchronization with the target master node.

[0124] In a possible implementation, the state information of the non-target node at least includes synchronization state information of the non-target node. At this time, the synchronization capability indicators of the plurality of non-target nodes can be determined based on the synchronization state information of the plurality of non-target nodes, the to-be-upgraded slave node is obtained from the plurality of non-target nodes based on the synchronization state information of the plurality of non-target nodes, the to-be-upgraded slave node is one of the plurality of non-target nodes whose synchronization capability indicator is greater than or equal to a preset indicator, and the target slave node is obtained from the plurality of non-target nodes based on the to-be-upgraded slave node, the target slave node being one of the plurality of non-target nodes other than the to-be-upgraded slave node.

[0125] When the synchronization state information of the non-target node is greater than or equal to the preset indicator, it indicates that the data similarity between the to-be-upgraded slave node and the initial master node is relatively high, and therefore, the to-be-upgraded slave node is upgraded to the target master node, which can reduce the degree of influence on the computer cluster. At this time, the non-target node whose synchronization capability indicator is greater than or equal to the preset indicator can be obtained from the plurality of non-target nodes, and used as the to-be-upgraded slave node. In this way, after the to-be-upgraded slave node is upgraded to the target master node, the data difference between the target master node and the initial master node is relatively small, which can reduce the possibility of data loss of the computer cluster after the computer cluster is constructed.

[0126] In an example, taking the computer cluster as a redis cluster, the synchronization state information of the non-target node can include an offset value. The greater the offset value, the higher the data synchronization progress of the initial master node and the non-target node, and therefore, the offset value can be set as the synchronization capability indicator of the non-target node, and one of the plurality of non-target nodes whose synchronization capability indicator is greater than or equal to the preset indicator is selected from the plurality of non-target nodes and used as the to-be-upgraded slave node, which can reduce the data difference between the to-be-upgraded slave node and the initial master node and reduce the adverse effects of master node repair on the computer cluster.

[0127] The above describes the scheme provided by the embodiments of the present application from the perspective of the management node. It can be understood that, in order to implement the above functions, the management node comprises hardware structures and / or software modules for implementing respective functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments of the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0128] The embodiments of the present application can divide the functional units of the management node according to the above method examples. For example, each functional module can be divided according to respective functions, or two or more functions can be integrated in one processing module. The above integrated module can be implemented in the form of hardware or a software functional module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical functional division. Actual implementation can have another division manner.

[0129] In the case of dividing each functional module according to respective functions, the exemplary embodiments of the present application provide a management device of a computer cluster, which can be used for a computer cluster. The computer cluster comprises a plurality of nodes. The device can be a management node or a chip applied to a management node. Figure 9 A functional module schematic block diagram of the management device of the computer cluster according to the exemplary embodiments of the present application is shown. As shown in the figure, the management device 900 of the computer cluster comprises: Figure 9 The communication module 901 is configured to acquire state information of a plurality of nodes including an initial master node and a plurality of initial slave nodes when receiving an inspection instruction of the computer cluster. The determination module 902 is configured to, if it is determined based on the state information of the plurality of nodes that there is a target node in a fault state and a plurality of non-target nodes in a normal state in the plurality of nodes, acquire a to-be-upgraded slave node and a target slave node from the plurality of non-target nodes based on the state information of the non-target nodes when the target node comprises the initial master node. The repair module 903 is configured to upgrade the to-be-upgraded slave node to a target master node, and control the target master node to perform master-slave replication with the target slave node.

[0130] ​In a possible implementation, the plurality of nodes comprises a first node, and the state information of the first node comprises at least a network state of the first node. The determining module 902 is further configured to determine that the first node is the target node if it is determined, based on the network state of the first node, that the first node is in a network outage state.

[0131] In a possible implementation, the repairing module 903 is further configured to delete, from the plurality of nodes, a faulty initial slave node if it is detected that the target node comprises the faulty initial slave node among the plurality of initial slave nodes.

[0132] In a possible implementation, each of the plurality of nodes is installed with an application. The communication module 901 is further configured to send an initiation indication of the test task if it is determined, based on the network state of the first node, that the first node is in a network-connected state, the initiation indication being used to instruct the application installed in the first node to execute the test task.

[0133] The confirming module 902 is further configured to determine that the first node is the target node if it is detected that the application fails to execute the test task, and determine that the first node is not the target node if it is detected that the application succeeds in executing the test task.

[0134] In a possible implementation, the repairing module 903 is further configured to repair, if the target node comprises an initial slave node in a fault state among the plurality of initial slave nodes, the application of the initial slave node in the fault state to obtain a repaired slave node; control the repaired slave node to perform master-slave replication with an initial master node if the target node comprises the initial master node; and control the repaired slave node to perform master-slave replication with a target master node if the target node further comprises the target master node.

[0135] In a possible implementation, the communication module 901 is configured to instruct the slave node in the fault state to restart the application; and the repairing module 903 is configured to reinstall the application in the slave node in the fault state if it is detected that the application fails to restart, to obtain a repaired slave node.

[0136] In a possible implementation, the state information of the non-target node comprises at least synchronization state information of the non-target node. The determining module 902 is configured to determine a synchronization capability indicator of the plurality of non-target nodes based on the synchronization state information of the plurality of non-target nodes; obtain a to-be-upgraded slave node from the plurality of non-target nodes based on the synchronization capability indicators of the plurality of non-target nodes; and obtain the target slave node from the plurality of non-target nodes based on the to-be-upgraded slave node, the target slave node being a non-target node of the plurality of non-target nodes other than the to-be-upgraded slave node, and the to-be-upgraded slave node being a non-target node of the plurality of non-target nodes whose synchronization capability indicator is greater than or equal to a preset indicator. In one possible implementation, the communication module 901 is further configured to send a master node switching request to the local terminal based on the identity information of the slave node to be upgraded; the repair module 903 is configured to upgrade the slave node to be upgraded to the target master node in response to the confirmation message from the local terminal for the switching request.

[0137] In one possible implementation, the determining module 902 is further used to determine the node failure rate of the computer cluster based on the number of target nodes and the number of multiple nodes; if the node failure rate is greater than the preset failure rate, the computer cluster is confirmed to have crashed.

[0138] Figure 10 A schematic block diagram of a chip according to an exemplary embodiment of this application is shown. Figure 10 As shown, the chip 1000 includes one or more processors 1001 and a communication interface 1002. The communication interface 1002 can support the management node in performing the data transmission and reception steps in the above method, and the processor 1001 can support the management node in performing the data processing steps in the above method.

[0139] Optional, such as Figure 10 As shown, the chip 1000 also includes a memory 1003, which may include read-only memory and random access memory, and provides operation instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).

[0140] In some implementations, such as Figure 10 As shown, processor 1001 executes corresponding operations by calling operation instructions stored in memory (which may be stored in the operating system). Processor 1001 controls the processing operations of any terminal device; processor can also be called a central processing unit (CPU). Memory 1003 may include read-only memory and random access memory, and provides instructions and data to processor 1001. A portion of memory 1003 may also include NVRAM. For example, in applications, memory, communication interfaces, and other components are coupled together via a bus system, which may include, in addition to a data bus, a power bus, a control bus, and a status signal bus, etc. However, for clarity, in... Figure 10 The general labeled all buses as Bus System 1004.

[0141] The method disclosed by the embodiments of the present application can be applied to a processor or implemented by the processor. The processor can be an integrated circuit chip having a signal processing capability. In the implementation process, the steps of the method can be completed by an integrated logic circuit or an instruction in the form of software in the processor. The processor can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logic block diagram in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method applied in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage media in the art. The storage medium is located in the storage, and the processor reads the information in the storage and combines the hardware to complete the steps of the method.

[0142] The exemplary embodiments of the present application further provide a computer device, including at least one processor, and a memory connected with the at least one processor. The memory stores a computer program capable of being executed by the at least one processor, and the computer program is used for causing the computer device to execute the method according to the embodiments of the present application when being executed by the at least one processor.

[0143] The exemplary embodiments of the present application further provide a non-transitory computer readable storage medium storing a computer program, and the computer program is used for causing a computer to execute the method according to the embodiments of the present application when being executed by a processor of the computer.

[0144] The exemplary embodiments of the present application further provide a computer program product, including a computer program, and the computer program is used for causing a computer to execute the method according to the embodiments of the present application when being executed by a processor of the computer.

[0145] Reference Figure 11The following is a structural block diagram of the computer device 1100 that can serve as the present application, which is an example of a hardware device that can be applied to various aspects of the present application. The term "computer device" is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, computers, blade computers, mainframe computers, and other suitable computers. The computer device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0146] like Figure 11 As shown, computer device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1102 or a computer program loaded from storage unit 1108 into random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of computer device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.

[0147] like Figure 11 As shown, multiple components in computer device 1100 are connected to I / O interface 1105, including: input unit 1106, output unit 1107, storage unit 1108, and communication unit 1109. Input unit 1106 can be any type of device capable of inputting information to computer device 1100. Input unit 1106 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the computer device. Output unit 1107 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1108 may include, but is not limited to, hard disks and optical disks. Communication unit 1109 allows computer device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0148] like Figure 11As shown, the computing unit 1101 can be various general purpose and / or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, or the like. The computing unit 1101 performs various methods and processes described above. For example, in some embodiments, the methods of the present embodiments can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage unit 1108. In some embodiments, portions or all of the computer program can be loaded and / or installed onto the computer device 1100 via the ROM 1102 and / or the communication unit 1109. In some embodiments, the computing unit 1101 can be configured, by way of other any suitable means, such as by way of firmware, to perform the methods of the present embodiments.

[0149] Program code for carrying out methods of the present application can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions / acts specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or computer.

[0150] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include, but are not limited to, an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0151] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0152] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0153] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

[0154] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are performed. The computer can be a general purpose computer, a special purpose computer, a computer network, a terminal, user equipment or other programmable apparatus. The computer programs or instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer programs or instructions can be transferred from one website site, computer, computer or data center to another website site, computer, computer or data center through wired or wireless manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a computer, data center, etc. integrated with one or more available media. The available media can be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape; an optical medium, such as a digital video disc (digital video disc, DVD); and a semiconductor medium, such as a solid state drive (solid state drive, SSD).

[0155] Although the present application is described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations are possible without departing from the spirit and scope of the present application. Accordingly, the specification and drawings are merely illustrative of the exemplary embodiments of the present application, and are considered to cover any and all modifications, variations, combinations or equivalents that fall within the scope of the present application. Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.

Claims

1. A management method of a computer cluster, characterized by, The computer cluster comprises a plurality of nodes, and the method comprises: Upon receiving an inspection instruction of the computer cluster, obtaining state information of the plurality of nodes, the plurality of nodes comprising an initial master node and a plurality of initial slave nodes; If it is determined based on the state information of the plurality of nodes that there is a target node in a fault state and a plurality of non-target nodes in a normal state among the plurality of nodes, and the target node comprises the initial master node, obtaining a to-be-upgraded slave node and a target slave node from the plurality of non-target nodes based on the state information of the non-target nodes; Upgrading the to-be-upgraded slave node to a target master node, and controlling the target master node to perform master-slave replication with the target slave node.

2. The method of claim 1, wherein, The plurality of nodes comprises a first node, and the state information of the first node at least comprises a network state of the first node, and the method further comprises: If it is determined based on the network state of the first node that the first node is in a network outage state, confirming that the first node is the target node.

3. The method of claim 2, wherein, The method further comprises: If it is detected that the target node comprises an initial slave node that is in a fault state among the plurality of initial slave nodes, deleting the initial slave node that is in a fault state from the plurality of nodes.

4. The method of claim 2, wherein, Each of the plurality of nodes is installed with an application program, and the method further comprises: If it is determined based on the network state of the first node that the first node is in a networked state, sending a start instruction of a test task, the start instruction of the test task being used to instruct the application program installed in the first node to execute the test task; If it is detected that the application program fails to execute the test task, confirming that the first node is the target node, and if it is detected that the application program succeeds in executing the test task, confirming that the first node is the non-target node.

5. The method of claim 4, wherein, The method further comprises: If the target node comprises an initial slave node that is in a fault state among the plurality of initial slave nodes, repairing the application program of the initial slave node that is in a fault state to obtain a repaired slave node; If the non-target node comprises the initial master node, controlling the repaired slave node to perform master-slave replication with the initial master node; If the target node also comprises the initial master node, controlling the repaired slave node to perform master-slave replication with the target master node.

6. The method of claim 5, wherein, The repairing of the initial slave node that is in a fault state to obtain a repaired slave node comprises: Instructing the initial slave node that is in a fault state to restart the application program; If it is detected that the application program fails to restart, reinstalling the application program in the initial slave node that is in a fault state to obtain a repaired slave node.

7. The method according to any one of claims 1 to 6, characterized in that, The state information of the non-target node at least comprises synchronization state information of the non-target node, and the obtaining of a to-be-upgraded slave node and a target slave node from the plurality of non-target nodes based on the state information of the non-target nodes comprises: Determining synchronization capability indicators of the plurality of non-target nodes based on the synchronization state information of the plurality of non-target nodes; obtaining a to-be-upgraded slave node from the plurality of non-target nodes based on the synchronization capability indicators of the plurality of non-target nodes, the to-be-upgraded slave node being a non-target node whose synchronization capability indicator is greater than or equal to a preset indicator among the plurality of non-target nodes; obtaining the target slave node from the plurality of non-target nodes based on the to-be-upgraded slave node, the target slave node being a non-target node other than the to-be-upgraded slave node among the plurality of non-target nodes.

8. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: sending a switching request of a master node to a local terminal based on the identity information of the to-be-upgraded slave node; upgrading the to-be-upgraded slave node to a target master node in response to an acknowledgement message from the local terminal for the switching request.

9. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: determining a node failure rate of the computer cluster based on the number of target nodes and the number of nodes; confirming that the computer cluster crashes if the node failure rate is greater than a preset failure rate.

10. A computer device, comprising: comprises: a processor; and a memory storing a program; wherein the program comprises instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-9.