Node determination method and apparatus, storage medium, and electronic device
Patent Information
- Application Number
- CN202510552124.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,相关技术仅依据优先级重新确定主节点,可能导致选取的不是最优的节点,进而影响系统的稳定性
[0019]借由上述技术方案,本申请提供的一种节点确定方法、装置、存储介质及电子设备,响应于主节点发生故障,获取所述主节点对应的从节点的节点信息;然后根据所述节点信息,评估所述从节点的多个选举指标对应的指标评分,所述多个选举指标包括故障预测指标、节点状态指标和历史故障指标;再依据所述从节点对应的多个指标评分,确定所述从节点对应的选举评分;最后根据所述选举评分,在所述从节点中重新确定主节点。与现有技术相比,本申请能够根据从节点的多个选举指标对各个从节点进行综合评估,基于故障预测指标、节点状态指标、历史故障指标等多个维度,获取整体评估从节点的选举评分,最后依据该评分以从中选取最优的从节点提升为主节点,进而提高系统稳定性。
Smart Images

Figure CN123020337A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a node determination method, apparatus, storage medium and electronic device. Background Technology
[0002] A high-availability system refers to a system that uses redundancy design, automatic failover, and rapid recovery mechanisms to design and deploy a series of technologies and architectures to ensure that the system can quickly recover or automatically switch to backup components when a failure occurs, thus providing continuous service to users.
[0003] Currently, in high-availability systems of related technologies, when the primary node fails, the highest priority backup node is usually selected as the primary node based on the pre-set priority of backup nodes, and a failover is performed.
[0004] However, the relevant technology only determines the master node based on priority, which may result in the selection of a non-optimal node, thus affecting the stability of the system. Summary of the Invention
[0005] In view of this, this application provides a node determination method, apparatus, storage medium and electronic device, the main purpose of which is to improve the technical problem that the current related technology only redetermines the master node based on priority, which may result in the selection of a non-optimal node, thereby affecting the stability of the system.
[0006] Firstly, this application provides a node determination method, including:
[0007] In response to a failure of the master node, obtain the node information of the slave node corresponding to the master node;
[0008] Based on the node information, evaluate the indicator scores corresponding to multiple election indicators of the slave node, including fault prediction indicators, node status indicators, and historical fault indicators.
[0009] The election score corresponding to the slave node is determined based on the multiple indicator scores corresponding to the slave node;
[0010] Based on the election score, a new master node is determined among the slave nodes.
[0011] Secondly, this application provides a node determination apparatus, comprising:
[0012] The acquisition module is configured to acquire node information of the slave node corresponding to the master node in response to a failure of the master node;
[0013] The evaluation module is configured to evaluate the indicator scores corresponding to multiple election indicators of the slave node based on the node information. The multiple election indicators include fault prediction indicators, node status indicators, and historical fault indicators.
[0014] The determination module is configured to determine the election score corresponding to the slave node based on multiple indicator scores corresponding to the slave node;
[0015] The determination module is configured to redetermine the master node among the slave nodes based on the election score.
[0016] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the node determination method described in the first aspect.
[0017] Fourthly, this application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the computer program to implement the node determination method described in the first aspect.
[0018] Fifthly, this application provides a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the node determination method described in the first aspect.
[0019] By employing the above technical solutions, this application provides a node determination method, apparatus, storage medium, and electronic device. In response to a master node failure, it acquires node information of the slave nodes corresponding to the master node; then, based on the node information, it evaluates the indicator scores corresponding to multiple election indicators of the slave nodes, including fault prediction indicators, node status indicators, and historical fault indicators; furthermore, based on the multiple indicator scores corresponding to the slave nodes, it determines the election score corresponding to the slave node; finally, based on the election score, it re-determines the master node from among the slave nodes. Compared with existing technologies, this application can comprehensively evaluate each slave node based on multiple election indicators, obtaining an overall evaluation election score for the slave nodes based on multiple dimensions such as fault prediction indicators, node status indicators, and historical fault indicators. Finally, based on this score, it selects the optimal slave node to be promoted to master node, thereby improving system stability.
[0020] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0024] Figure 2 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0025] Figure 3 A flowchart illustrating a node determination method provided in an embodiment of this application is shown.
[0026] Figure 4 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0027] Figure 5 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0028] Figure 6 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0029] Figure 7 A schematic diagram of a node determination device provided in an embodiment of this application is shown. Detailed Implementation
[0030] The embodiments of this application will now be described in more detail with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0031] In related technologies, high-availability software typically manages a group of software programs. This group has one master node providing services externally, while multiple backup nodes are used for failover. These backup nodes do not carry business operations during daily operation, resulting in extremely low resource utilization and significant resource waste. Even if some high-availability software can manage multiple software programs, these programs are not interconnected. In such a master-slave scenario, only the master node provides services externally, and only the master node has business load at any given time. The backup nodes are all idle, leading to significant resource waste on the backup nodes.
[0032] For example, such as Figure 1 As shown, when providing high availability for two software groups, each with a 1-master-2-slave architecture, six servers are required. For the first high-availability (HA) group, Group 1, one master node and two slave nodes are needed, requiring three servers (Server1, Server2, Server3). For the second high-availability group, HA Group 2, another master node and two slave nodes are needed, requiring an additional three servers (Server4, Server5, Server6). For systems using a large amount of middleware and databases, some middleware, databases, and business applications are deployed using a 1-master-1-slave configuration, with the master node providing services externally via a VIP. Figure 2 As shown in the figure, the 6 software groups are divided into 6 high-availability clusters, all of which are in a one-master-one-standby mode, using a total of 12 servers for business support.
[0033] Secondly, in the case of multiple backup nodes, when the primary node fails, the current method relies solely on simple priority for election, failing to comprehensively consider multiple states and intelligently select the most suitable backup node to take over the primary node's role. This failover election mechanism has shortcomings, potentially leading to a suboptimal node being elected as the primary node, thereby affecting system stability and performance.
[0034] To address the technical issue that current technologies, which rely solely on priority to redetermine the master node, may result in suboptimal node selection, thus affecting system stability, this embodiment provides a node determination method, such as... Figure 3 As shown, the method includes:
[0035] Step 101: In response to a failure of the master node, obtain the node information of the corresponding slave node.
[0036] In some embodiments, if the master node of the current software configuration fails, a new master node should be elected from the corresponding slave nodes, and a failover should be performed with the failed master node. This means transferring the software configured on the failed master node to the newly elected master node for processing, thus ensuring system stability. Specifically, in response to a master node failure, all corresponding slave nodes can be identified, and node information for each slave node can be obtained. This node information may include, but is not limited to, total node resources, resource utilization, historical failure types, historical failure frequencies, and load during the failure.
[0037] Step 102: Based on the node information, evaluate the indicator scores corresponding to multiple election indicators of the slave node.
[0038] The election metrics can include, but are not limited to, fault prediction metrics, node status metrics, historical fault metrics, and priority metrics. Specifically, fault prediction metrics can be used to assess the probability of a slave node failing after being promoted to master node; node status metrics can reflect the current load and other key performance parameters of a slave node, assessing its overall health and service capabilities; historical fault metrics can be used to assess the reliability and stability of a slave node based on its historical fault data; priority metrics can be manually preset priorities for slave nodes, used to determine which slave node is prioritized for master node election or failover, reflecting user trust in each slave node. This method of evaluating multiple election metrics allows for a comprehensive assessment of slave nodes from multiple dimensions, facilitating the selection of the optimal slave node.
[0039] In some embodiments, after obtaining the node information of the slave nodes, the indicator information corresponding to each election indicator can be extracted using this information. This indicator information can be used for fault prediction, node status analysis, historical fault analysis, and other processing to evaluate multiple election indicators. A hierarchical scoring system is adopted to score each election indicator, thereby quantifying these indicators. Each election indicator can be scored based on the processing results of the node information, thereby more comprehensively evaluating the stability and reliability of each slave node, providing support for the election and decision-making of the master node, and thus improving system stability.
[0040] Step 103: Determine the election score for the slave node based on the multiple indicator scores corresponding to the slave node.
[0041] In some embodiments, each slave node is scored based on multiple indicators, and these scores are aggregated into a final election score. For example, the election score can be obtained by summing the scores of each indicator. Accordingly, different indicators may have different importance. Before calculating the final election score, different weights can be assigned to each indicator to reflect the importance of the indicator in the overall score. Then, the election score of each slave node is calculated based on the indicator scores and their weights, thereby adjusting the node selection method according to user needs.
[0042] Step 104: Based on the election score, re-determine the master node from the slave nodes.
[0043] In some embodiments, the slave node with the highest election score can be promoted to master node. In this way, a comprehensive election score of each slave node can be obtained, realizing a more comprehensive evaluation of each slave node. This allows for the objective selection of the best-performing slave node as the new master node, thereby ensuring system stability.
[0044] Compared to existing technologies, this embodiment, in response to a master node failure, obtains the node information of the corresponding slave nodes; then, based on the node information, it evaluates the slave nodes' scores according to multiple election metrics, including fault prediction metrics, node status metrics, and historical fault metrics; furthermore, based on the slave node's multiple metric scores, it determines the slave node's election score; finally, based on the election score, it re-determines the master node from among the slave nodes. Compared to existing technologies, this application can comprehensively evaluate each slave node based on multiple election metrics, obtaining an overall evaluation score for the slave nodes based on multiple dimensions such as fault prediction metrics, node status metrics, and historical fault metrics. Finally, based on this score, it selects the optimal slave node to be promoted to master node, thereby improving system stability.
[0045] Furthermore, as a refinement and extension of the above embodiments, in order to specifically illustrate the specific node determination process, the method of this embodiment may optionally include: determining a first node among the slave nodes as the master node for deploying the first software, and determining the remaining nodes among the slave nodes as slave nodes for deploying the first software; determining a second node among the slave nodes as the master node for deploying the second software, and determining the remaining nodes among the slave nodes as slave nodes for deploying the second software, wherein the first node and the second node are different nodes in the same high-availability cluster.
[0046] In some embodiments, nodes in a high-availability cluster can be used to deploy multiple software packages. For the first software, the first node can be the master node for deploying the first software, and the other nodes in the high-availability cluster can be slave nodes for deploying the first software. Similarly, the first node can be a slave node for deploying the second software. The second node can be the master node for deploying the second software, and the other nodes in the high-availability cluster can be slave nodes for deploying the second software. In other words, the first node can be a slave node for deploying the second software. This approach allows for the mixed deployment of multiple software packages within the same high-availability cluster, fully utilizing the resources of each node in the cluster, thereby improving system resource utilization and reducing resource waste.
[0047] For example, such as Figure 4As shown, three software groups can be deployed in the same high-availability cluster (HA Cluster). This cluster can include five servers: Server1, Server2, Server3, Server4, and Server5. Different nodes can be selected as the master nodes for different software. For example, for the first software APP1, Server1 can be the master node, and the other nodes can be slave nodes, forming the first high-availability group HA Group1; for the second software APP2, Server2 can be the master node, and the other nodes can be slave nodes, forming the second high-availability group HA Group2; for the third software APP3, Server3 can be the master node, and the other nodes can be slave nodes, forming the third high-availability group HA Group3. This allows for the mixed deployment of multiple software groups within the same cluster, reducing resource waste. The high-availability group management architecture allows multiple software groups to be deployed on multiple servers, saving resources while meeting high availability requirements. For example, deploying three high-availability software groups, each using a 1-master-4-slave high-availability architecture, would require 15 servers in a traditional model. However, using high-availability group management for mixed deployment, only 5 servers are needed while still meeting high availability requirements, significantly saving server resources.
[0048] Correspondingly, such as Figure 5 As shown, six high-availability groups can be built on eight servers in the same HASoft Cluster, each deploying different software, such as Niginx1, Niginx2, MySQL, PostgreSQL, APP1, and APP2. Compared to the primary and backup configuration of each software group in related technologies, this embodiment upgrades to a primary-multiple-backup architecture where multiple software groups share a primary-backup structure. This reduces the number of servers required in the primary-backup configuration from 12 to 8, while maintaining software reliability above 99.9%. Based on the principle of extremely low probability of simultaneous failure of multiple hardware and software systems, a hybrid deployment is adopted for the managed high-availability groups, improving the utilization of server resources.
[0049] Optionally, step 102 may specifically include: extracting first software information corresponding to the software deployed on the node and second software information corresponding to the software not deployed on the node from the node information; and evaluating the fault prediction score corresponding to the fault prediction index based on the first software information and the second software information.
[0050] The first software information may include the software information already deployed in the currently evaluated slave node, and the second software information may include the software information not deployed in the currently evaluated slave node. The intelligent election algorithm can be used to comprehensively score the software deployed in the current node and the probability of other software failures that may occur after the failure is transferred to this node.
[0051] Optionally, evaluating the fault prediction score corresponding to the fault prediction index based on the first software information and the second software information may specifically include: using a preset prediction model, based on the first software information and the second software information, predicting the fault probability after the slave node is determined to be the master node; and evaluating the fault prediction score based on the fault probability.
[0052] The preset prediction model can be a neural network model, which records a large number of failure cases through self-learning, including the probability of failure caused by different software deployed on different hardware devices and the probability of failure caused by mixed deployment of different software (such as deploying similar disk I / O software on the same server may increase the probability of disk failure). It is used to predict the impact of introducing undeployed software (new software) after a node is promoted to master node on the stability of the server and the stability of the software itself. The following mathematical expression can be used to represent the forward propagation process of the neural network model:
[0053] H_1 = sigma(W_{memory}) cdot X_{memory}+W_{disk}\ cdot X_{disk}+W_{ CPU}\ cdo tX_{ CPU}+W_{network}\cdot X_{network});
[0054] H_2 = sigma(H_1) cdot W_{new}\cdot X_{new});
[0055] Where X_{memory} can be used to represent the deployment of memory-intensive software; X_{disk} can be used to represent the deployment of disk I / O-intensive software; X_{cpu} can be used to represent the deployment of CPU-intensive software; X_{network} can be used to represent the deployment of network-intensive software; X_{new} can be used to represent the deployment of new software that belongs to a certain resource-intensive type; (\sigma) can be used to represent the activation function (such as ReLU or Sigmoid); W can represent the weight parameters; and H_1 and H_2 can represent the hidden layer outputs of the neural network.
[0056] This expression is fed into a neural network model, which is then trained to learn and predict the impact of new software introductions on server stability and the stability of the software itself.
[0057] Accordingly, the formula for calculating the fault prediction score (probability of future node failure) is as follows:
[0058] f(x) = \sigma(W_2\ cdot\sigma(W_1\ cdot X+b_1)+b_2)
[0059] In the formula, f(x) can represent the fault prediction score.
[0060] Optionally, step 102 may further include: obtaining historical resource information corresponding to the slave node based on the node information, the historical resource information including multiple node resource indicators corresponding to the slave node; determining the resource weights corresponding to the multiple node resource indicators based on the historical resource information corresponding to the slave node; and evaluating the node status score corresponding to the node status indicator using the resource weights corresponding to the multiple node resource indicators and a preset status evaluation algorithm.
[0061] The node resource metrics may include CPU utilization, memory utilization, disk utilization, IO utilization, network utilization, etc., which comprehensively consider the server's resource usage to determine the overall status and availability of the server node. The preset status evaluation algorithm can adopt a weighted summation algorithm, in which each metric is assigned a resource weight, and then the values of all metrics are multiplied by their corresponding resource weights and summed to obtain the final node status score.
[0062] For example, the formula for calculating the node status score (the current health status of a node) is as follows:
[0063] f(m)=w_1.CPU_used(%)+w_2.Memory_used(%)+w_3.Disk_used(%)+w_4.IO_used(%)+w_5.Network_used(%)
[0064] In the formula, f(m) can represent the node status score, w_1 represents the weight corresponding to CPU utilization (CPU_used), w_2 represents the weight corresponding to memory utilization (Memory_used), w_3 represents the weight corresponding to disk utilization (Disk_used), w_4 represents the weight corresponding to IO utilization (IO_used), and w_5 represents the weight corresponding to network utilization (Network_used). Each weight can represent its importance in the overall score.
[0065] Specifically, for calculating resource weights in server resource utilization, historical resource utilization is used to dynamically calculate resource weights to reflect the importance of different resources at different time periods. Considering the complexity of dynamic weight calculation, the Exponentially Weighted Moving Average (EWMA) is used to calculate changes in resource utilization, and resource weights are dynamically adjusted based on their trends. For example, assuming that for resource i, its historical utilization data at t time points are (U_{i,1},U_{i,2},\ldots,U_{i,t}), then the EWMA of this resource can be calculated using the following formula:
[0066] EWMA_{it}=(1-\alpha)\times EWMA_{i,t-1}+\alpha\times U_{i,t};
[0067] In the formula, (\alpha) is a smoothing factor that controls the weight of the trend of change (0<\alpha<1).
[0068] Next, the relative resource weights can be calculated based on the EWMA_{i,t} values of different resources:
[0069] w_i\ fra c{EWMA_{i,t}}{\sum_{j=1}^{n}EWMA_{j,t}}
[0070] In the formula, n is the number of resources, and w_i is the resource weight corresponding to resource i.
[0071] In this way, by dynamically updating the weights of resource utilization, the importance of different resources at different time periods can be better reflected, providing the scoring algorithm with more flexible and adaptable weight parameters.
[0072] Optionally, step 102 may further include: extracting historical fault information corresponding to the slave node from the node information; determining the fault weight corresponding to the historical fault information; and evaluating the historical fault score corresponding to the historical fault index based on the fault weight and the historical fault information.
[0073] Accordingly, node historical fault analysis calculates all historical faults of a node, identifies a fault through multiple dimensions, and uses a linear weighted sum to calculate the server's historical fault score (historical health status score). Assuming the following four dimensions: fault type score (fault_type_score), fault impact score (fault_impact_score), fault frequency score (fault_frequency_score), and server abnormal state score (server_status_score), a weight value can be assigned to each dimension. The calculation formula for node historical fault analysis is as follows:
[0074] f(n)W_1\times\text{fault type score}+w_2\times\text{fault impact range score}+w_3\times\text{fault occurrence frequency score}+w_4\times\text{server abnormal state score}
[0075] In the formula, w_1 represents the fault type weight, w_2 represents the fault impact range weight, w_3 represents the fault occurrence frequency weight, and w_4 represents the server abnormal state weight. The weight relationship between the various indicators can be: w_3>w_2>w_4>w_1.
[0076] Optionally, this embodiment also provides a node priority parameter for user configuration. Node priority is a constant used for manual intervention in the election process. Once a priority is set by the user, the priority value will be included in the total score during failover, thus affecting the election results. Note that the priority score corresponding to the node priority ranges from 0 to 10.
[0077] Specifically, the election score is calculated based on multiple indicators corresponding to the node, using the following formula:
[0078] f(w)=f(x)+f(m)+f(n)+a
[0079] In the formula, f(w) represents the election score of the slave node, f(x) represents the fault prediction score of the slave node, f(m) represents the node status score of the slave node, f(n) represents the historical fault score of the slave node, and a represents the priority score of the slave node.
[0080] For example, as shown in Table 1, compared to the traditional method of electing nodes based solely on node priority, this embodiment adopts an intelligent scheduling mode, which can comprehensively evaluate multiple aspects such as node priority, current node health status, historical fault analysis, and future node failure probability.
[0081] Table 1
[0082]
[0083]
[0084] This approach provides an election score for the current node from multiple dimensions, enabling it to compete with other nodes for the master node position. An advanced intelligent election algorithm is employed. This algorithm, while prioritizing performance, comprehensively considers the current health status of backup nodes, historical failure records, and the predicted probability of future failures. It intelligently selects the optimal node from among multiple backup nodes and promotes it to master. This intelligent election mechanism significantly improves the system's reliability, stability, and performance. By comprehensively considering multiple key server metrics, and through in-depth analysis and precise calculations, the best-performing backup node is ultimately selected and given the new master node status.
[0085] Specifically, the detailed metrics for the server are shown in Table 2.
[0086] Table 2
[0087]
[0088]
[0089] For example, such as Figure 6 The diagram illustrates a node election architecture. When the master node fails, an intelligent election algorithm, combined with machine learning, optimizes the master election process after a high-availability architecture failure, electing a superior slave node as the new master. The algorithm calculates scores for each slave node based on factors such as node priority, current state, historical failure analysis, and future failure probability. For example, if two slave nodes have total scores of 35 and 36 respectively, the slave node with a score of 36 is selected as the new master. By employing an advanced intelligent election algorithm, intelligent scheduling evaluates the current state of nodes based on priority, uses advanced algorithms to calculate and assess the historical failures of the nodes, and evaluates the probability of future failures. By combining multiple dimensions to comprehensively evaluate nodes, a superior slave node can be selected, significantly enhancing the software's high availability.
[0090] Furthermore, thanks to the implementation of a hybrid deployment model, server resources are effectively optimized while improving high availability, resulting in significant resource cost savings. It also provides multiple interfaces for real-time configuration of high availability groups, enabling greater flexibility. Additionally, the high availability software itself is configured for the cluster, or it uses third-party coordination software such as ZooKeeper to achieve high availability on its own.
[0091] Optionally, after a new master node is determined, traffic from the failed master node can be switched to the newly determined master node to achieve high availability failover. Specifically, its main task is to automatically and seamlessly switch client traffic to the intelligently elected new master node in the event of a failure.
[0092] Optionally, this embodiment supports two high-availability failover methods. One method is similar to keepalived, using a VIP to achieve master-slave switching. In the event of a failure, the client does not need to perform any operation, and traffic can automatically switch to the new master node. The other method is similar to the registry center function of ZooKeeper, which saves the information of the current master node. If a failover occurs, it updates the saved node information. After a client fails to connect to the master, it can automatically obtain the latest master information from the software. Through this failover function, the high availability of the system can be guaranteed.
[0093] Compared with existing technologies, this embodiment can select different nodes as master nodes for different software in the same high-availability cluster, enabling the hybrid deployment of multiple software groups on the same cluster. It provides a high-availability method for intelligent scheduling of reusable resources. Intelligent scheduling is achieved through high-availability group management, intelligent scheduling, and failover. The innovative hybrid deployment management of multiple high-availability groups solves the problem of resource waste under high-availability architecture. High-availability group management performs hybrid deployment and management of multiple high-availability software groups. Under the premise that the probability of multiple hardware and software failures at the same time is extremely low, it achieves a high degree of resource saving. The failover selects a better slave node, which greatly saves server resources and can greatly save hardware costs.
[0094] Furthermore, as Figure 3 To illustrate the specific implementation of the method shown, this embodiment provides a node determination device, such as... Figure 7 As shown, the device includes: an acquisition module 31, an evaluation module 32, and a determination module 33.
[0095] The acquisition module 31 is configured to acquire node information of the slave node corresponding to the master node in response to a failure of the master node;
[0096] Evaluation module 32 is configured to evaluate the indicator scores corresponding to multiple election indicators of the slave node based on the node information. The multiple election indicators include fault prediction indicators, node status indicators and historical fault indicators.
[0097] Module 33 is configured to determine the election score of a slave node based on multiple indicator scores corresponding to the slave node.
[0098] Module 33 is configured to re-determine the master node from the slave nodes based on the election score.
[0099] In some examples of this embodiment, the evaluation module 32 is specifically configured to extract first software information corresponding to the software deployed in the slave node and second software information corresponding to the software not deployed in the slave node from the node information; and evaluate the fault prediction score corresponding to the fault prediction index based on the first software information and the second software information.
[0100] In some examples of this embodiment, the evaluation module 32 is specifically configured to use a preset prediction model to predict the failure probability after the slave node is determined to be the master node, based on the first software information and the second software information; and to evaluate the failure prediction score according to the failure probability.
[0101] In some examples of this embodiment, the evaluation module 32 is further configured to obtain historical resource information corresponding to the slave node based on the node information, the historical resource information including multiple node resource indicators corresponding to the slave node; determine the resource weights corresponding to the multiple node resource indicators based on the historical resource information corresponding to the slave node; and evaluate the node status score corresponding to the node status indicator using the resource weights corresponding to the multiple node resource indicators and a preset status evaluation algorithm.
[0102] In some examples of this embodiment, the evaluation module 32 is further configured to extract historical fault information corresponding to the slave node from the slave node information; determine the fault weight corresponding to the historical fault information; and evaluate the historical fault score corresponding to the historical fault index based on the fault weight and the historical fault information.
[0103] In some examples of this embodiment, the determining module 33 is further configured to determine a first node as the master node for deploying the first software and the remaining nodes in the slave nodes as slave nodes for deploying the first software; and to determine a second node as the master node for deploying the second software and the remaining nodes in the slave nodes as slave nodes for deploying the second software, wherein the first node and the second node are different nodes in the same high-availability cluster.
[0104] It should be noted that other corresponding descriptions of the functional units involved in the node determination device provided in this embodiment can be found in [reference]. Figure 3 The corresponding description in [the document] will not be repeated here.
[0105] Based on the above, Figure 3 Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figure 3 The method shown.
[0106] Based on the above, Figure 3Accordingly, this embodiment also provides a computer program product on which a computer program is stored, which, when executed by a processor, implements the above-described method. Figure 3 The method shown.
[0107] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive) and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the method of the implementation scenario of this application.
[0108] Based on the above, Figure 3 The method shown, and Figure 7 To achieve the above objectives, the present application also provides an electronic device, such as a personal computer, server, laptop, smartphone, intelligent robot, or other intelligent terminal, as illustrated in the virtual device embodiment. This device includes a storage medium and a processor; the storage medium stores a computer program; and the processor executes the computer program to implement the above-described virtual device. Figure 3 The method shown.
[0109] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0110] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0111] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or it can be implemented by hardware. By applying the technical solution of this embodiment, different nodes can be selected as master nodes for different software in the same high-availability cluster, realizing the hybrid deployment of multiple software groups on the same cluster. It provides a high-availability method for intelligent scheduling of reusable resources. Intelligent scheduling is achieved through high-availability group management, intelligent scheduling, and failover. The innovative hybrid deployment management of multiple high-availability groups solves the problem of resource waste under high-availability architecture. High-availability group management performs hybrid deployment and hybrid management of multiple high-availability software groups. Under the premise that the probability of multiple hardware and software failures at the same time is extremely low, it achieves a high degree of resource saving. The slave node selected for failover is better, which greatly saves server resources and can greatly save hardware costs.
[0113] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0114] The above are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A node determination method, characterized in that, include: In response to a failure of the master node, obtain the node information of the slave node corresponding to the master node; Based on the node information, evaluate the indicator scores corresponding to multiple election indicators of the slave node, including fault prediction indicators, node status indicators, and historical fault indicators. The election score corresponding to the slave node is determined based on the multiple indicator scores corresponding to the slave node; Based on the election score, a new master node is determined among the slave nodes.
2. The method according to claim 1, characterized in that, The step of evaluating the indicator scores corresponding to multiple election indicators of the slave node based on the node information includes: From the node information, extract the first software information corresponding to the software deployed in the slave node, and the second software information corresponding to the software not deployed in the slave node; Based on the first software information and the second software information, evaluate the fault prediction score corresponding to the fault prediction index.
3. The method according to claim 2, characterized in that, The step of evaluating the fault prediction score corresponding to the fault prediction index based on the first software information and the second software information includes: Using a preset prediction model, based on the first software information and the second software information, the failure probability of the slave node after it is determined to be the master node is predicted; The fault prediction score is evaluated based on the fault probability.
4. The method according to claim 1, characterized in that, The step of obtaining multiple election indicators corresponding to the slave node based on the node information further includes: Based on the node information, obtain the historical resource information corresponding to the slave node, wherein the historical resource information includes multiple node resource indicators corresponding to the slave node; Based on the historical resource information corresponding to the slave nodes, determine the resource weights corresponding to the resource indicators of the multiple nodes; The node status score corresponding to the node status index is evaluated by using the resource weights corresponding to the multiple node resource indicators and the preset status evaluation algorithm.
5. The method according to claim 1, characterized in that, The step of obtaining multiple election indicators corresponding to the slave node based on the node information further includes: Extract the historical fault information corresponding to the slave node from the node information; Determine the fault weights corresponding to the historical fault information; Based on the fault weights and the historical fault information, evaluate the historical fault scores corresponding to the historical fault indicators.
6. The method according to claim 1, characterized in that, The method further includes: Among the slave nodes, the first node is determined as the master node for deploying the first software, and the remaining nodes among the slave nodes are used as slave nodes for deploying the first software. Among the slave nodes, the second node is determined as the master node for deploying the second software, and the remaining nodes among the slave nodes are used as slave nodes for deploying the second software. The first node and the second node are different nodes in the same high-availability cluster.
7. A node determination device, characterized in that, include: The acquisition module is configured to acquire node information of the slave node corresponding to the master node in response to a failure of the master node; The evaluation module is configured to evaluate the indicator scores corresponding to multiple election indicators of the slave node based on the node information. The multiple election indicators include fault prediction indicators, node status indicators, and historical fault indicators. The determination module is configured to determine the election score corresponding to the slave node based on multiple indicator scores corresponding to the slave node; The determination module is configured to redetermine the master node among the slave nodes based on the election score.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
9. An electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.
10. A computer program product having a computer program stored thereon, characterized in that, When the computer program product is executed by a processor, it implements the method of any one of claims 1 to 6.
