Fault node positioning method and positioning device, and database cluster system

By collecting and analyzing the load values ​​of the database cluster nodes, determining the load tilt status and performing fault checks, the problem of low fault location efficiency in the existing technology is solved, fast and accurate fault location and maintenance are achieved, and the stable operation of the database cluster is guaranteed. .

CN112131077BActive Publication Date: 2024-09-03CHINA CONSTRUCTION BANK
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010997311.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-21
Publication Date
2024-09-03
Estimated Expiration
2040-09-21

AI Technical Summary

Technical Problem

The performance fault locating method of existing distributed database clusters is inefficient. User feedback and manual inspection and collection of log analysis make it difficult to quickly locate faulty nodes in a timely manner, especially under high load conditions, which affects operation and maintenance.

Method used

By collecting the load values ​​of database cluster nodes, we can determine the load tilt status, send alarm information and perform fault inspections, isolate and repair problem nodes, and reduce fault running time.

Benefits of technology

It improves the accuracy and efficiency of fault location, reduces the fault running time of the database cluster, and ensures smooth operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131077B
    Figure CN112131077B
Patent Text Reader

Abstract

The present invention discloses a method and a device for locating a faulty node, as well as a database cluster system, and relates to the field of computer computing. A specific implementation of the method for locating a faulty node includes: collecting the load value on at least one data node included in the database cluster to which it belongs, and determining that the data node with the highest load value is the problem node of this time; judging whether the problem node of this time is in a load tilt state according to the load information of the database cluster to which it belongs; and sending the alarm information of the problem node of this time in the case that the problem node of this time is in a load tilt state, so as to perform a fault check on the machine where the problem node of this time is located. This implementation method can allow operation and maintenance personnel to discover faults in a timely manner, and can also improve the accuracy of fault location, reduce the fault operation time of the database cluster, and ensure the smooth operation of the database cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for locating a faulty node, and a database cluster system. Background Art

[0002] Distributed database clusters allow data to be stored on multiple nodes without affecting the business logic of the enterprise system. They are the preferred solution for many enterprises when processing and storing data. For distributed architectures, requests need to be executed on multiple nodes. The request is completed only when all nodes have executed and returned. Therefore, when performance problems occur, they need to be located on multiple nodes. In other words, multiple nodes will increase the difficulty of operation and maintenance.

[0003] In the prior art performance fault location method of the distributed database cluster, user feedback is required to check the fault; or, the logs of the machine where the node is located are collected manually, and then the collected logs are analyzed to find out the fault problem.

[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: in the method of checking faults only after user feedback, when there are large-scale high-load operations, the operations have been greatly affected by the time the users discover the problem; in the method of manually inspecting and collecting machine logs for analysis, not only is the workload high and the efficiency low, but it is also impossible to locate the faulty node in a timely and rapid manner. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a method and device for locating a faulty node, as well as a database cluster system, which can enable operation and maintenance personnel to discover faults in a timely manner, improve the accuracy of fault locating, reduce the fault operation time of the database cluster, and ensure the smooth operation of the database cluster.

[0006] To achieve the above objective, according to a first aspect of an embodiment of the present invention, a method for locating a faulty node is provided.

[0007] The method for locating a faulty node in an embodiment of the present invention includes: collecting the load value on at least one data node included in the database cluster to which it belongs, and determining that the data node with the highest load value is the problem node; judging whether the problem node is in a load tilt state based on the load information of the database cluster to which it belongs; and sending an alarm message of the problem node when the problem node is in a load tilt state to perform a fault check on the machine where the problem node is located.

[0008] Optionally, the load information of the database cluster includes: the last problematic node of the database cluster, the load average of the database cluster, and the working status of the database cluster.

[0009] Optionally, judging whether the problem node is in a load tilt state based on the load information of the database cluster to which it belongs includes: judging whether the problem node is the same node as the previous problem node, whether the ratio of the load value on the problem node to the load average is greater than a preset ratio threshold, and whether the working state is a non-idle state; if so, confirming that the problem node is in a load tilt state; if not, confirming that the problem node is not in a load tilt state.

[0010] Optionally, before determining whether the last problem node and the current problem node are the same node, the method further includes: acquiring the last problem node; wherein the last problem node is the data node with the highest load value determined in the last collection.

[0011] Optionally, before determining whether the ratio of the load value on the problem node to the load average is greater than a preset ratio threshold, the method further includes: performing average calculation on the load values ​​on the remaining data nodes to obtain the load average of the database cluster to which it belongs; wherein the remaining data nodes are data nodes other than the problem node in at least one data node contained in the database cluster to which it belongs.

[0012] Optionally, determining whether the current working state is a non-idle state includes: determining whether the query statement corresponding to the database cluster to which it belongs is less than a preset number and whether the load value on the problem node is less than a preset load value threshold; if so, determining that the current working state is an idle state, if not, determining that the current working state is a non-idle state.

[0013] Optionally, the method further includes: if the query statements corresponding to the database cluster are not less than a preset number and the load value on the problem node is less than a preset load value threshold, sending abnormal information of the database cluster.

[0014] Optionally, before sending the alarm information of the problem node, the method also includes: querying the operating system log of the machine where the problem node is located to determine whether the error keyword has appeared at least once in the operating system log; if so, sending the alarm information of the problem node, if not, monitoring the status of the problem node; when the problem node is in a load tilt state for a time greater than a preset time, shutting down the machine where the problem node is located to inspect the machine where the problem node is located.

[0015] Optionally, the method also includes: when the problem node is in a load-tilted state, isolating the problem node from at least one data node included in the database cluster to which it belongs; and, after the machine corresponding to the problem node passes the fault inspection and repair, adding the problem node to at least one data node included in the database cluster to which it belongs.

[0016] Optionally, the method further includes: when the problem node is not in a load-skewed state, confirming that the database cluster to which it belongs is operating normally.

[0017] Optionally, the method further includes: acquiring a preset collection time period according to the received request for locating the faulty node, and regularly performing load value collection according to the preset collection time period.

[0018] Optionally, collecting the load value on at least one data node included in the database cluster to which it belongs, and determining the data node with the highest load value as the problem node for this collection, includes: collecting the average load value on at least one data node included in the database cluster to which it belongs within the preset time period, and determining the data node with the highest average load value in this collection as the problem node corresponding to this collection.

[0019] To achieve the above objective, according to a second aspect of an embodiment of the present invention, a device for locating a faulty node is provided.

[0020] The device for locating a faulty node in an embodiment of the present invention comprises: a collection module, used to collect the load value on at least one data node included in the database cluster to which it belongs, and determine that the data node with the highest load value is the problem node; a judgment module, used to judge whether the problem node is in a load tilt state based on the load information of the database cluster to which it belongs; and an alarm module, used to send alarm information of the problem node when the problem node is in a load tilt state, so as to perform a fault check on the machine where the problem node is located.

[0021] Optionally, the load information of the database cluster includes: the last problematic node of the database cluster, the load average of the database cluster, and the working status of the database cluster.

[0022] Optionally, the judgment module is also used to: judge whether the current problem node and the previous problem node are the same node, whether the ratio of the load value on the current problem node to the load average is greater than a preset ratio threshold, and whether the working state is a non-idle state; if so, confirm that the current problem node is in a load tilt state; if not, confirm that the current problem node is not in a load tilt state.

[0023] Optionally, the judgment module is further used to: obtain the last problem node; wherein the last problem node is a data node with the highest load value determined in the last collection.

[0024] Optionally, the judgment module is also used to: calculate the average load values ​​on the remaining data nodes to obtain the load average of the database cluster to which it belongs; wherein the remaining data nodes are data nodes other than the problem node in at least one data node included in the database cluster to which it belongs.

[0025] Optionally, the judgment module is also used to: judge whether the query statement corresponding to the database cluster is less than a preset number and whether the load value on the problem node is less than a preset load value threshold; if so, determine that the current working state is an idle state, if not, determine that the current working state is a non-idle state.

[0026] Optionally, the judgment module is further used to: send abnormal information of the database cluster to which the database cluster belongs if the query statements corresponding to the database cluster to which the database cluster belongs are not less than a preset number and the load value on the problem node this time is less than a preset load value threshold.

[0027] Optionally, the alarm module is also used to: query the operating system log of the machine where the problem node is located, and determine whether the error keyword has appeared at least once in the operating system log; if so, send the alarm information of the problem node, if not, monitor the status of the problem node; when the problem node is in a load tilt state for a time greater than a preset time, shut down the machine where the problem node is located to inspect the machine where the problem node is located.

[0028] Optionally, the acquisition module is also used to: when the problem node is in a load-tilted state, isolate the problem node from at least one data node included in the database cluster to which it belongs; and after the machine corresponding to the problem node passes the fault inspection and repair, add the problem node to at least one data node included in the database cluster to which it belongs.

[0029] Optionally, the alarm module is further used to: when the problem node is not in a load-skewed state, confirm that the database cluster to which it belongs is operating normally.

[0030] Optionally, the collection module is further used to: obtain a preset collection time period according to a received request for locating a faulty node, and regularly perform load value collection according to the preset collection time period.

[0031] Optionally, the collection module is further used to: collect the average load value on at least one data node included in the database cluster within the preset time period, and determine the data node with the highest average load value in this collection as the problem node corresponding to this collection.

[0032] To achieve the above objective, according to a third aspect of an embodiment of the present invention, a database cluster system is provided.

[0033] The database cluster system of the embodiment of the present invention includes at least one set of database clusters, wherein one set of database clusters includes a master node and at least one data node; the master node is used to: execute the fault node locating method described in the embodiment of the present invention to locate the fault of at least one data node included in the database cluster.

[0034] Optionally, the master node is further used to: receive a query statement corresponding to the database cluster to which it belongs, generate a query plan corresponding to the query statement, and distribute the query plan to at least one data node corresponding to the database cluster to which it belongs.

[0035] Optionally, the configuration of the machine where at least one data node included in the database cluster is located is the same; wherein the configuration includes: the number of CPU cores, memory space, network bandwidth and number of instances.

[0036] Optionally, the system further comprises a monitoring configuration module, which is used to configure the parameters of the at least one database cluster, wherein the parameters comprise: an identifier of the database cluster, a super user corresponding to the database cluster, and a threshold corresponding to the database cluster.

[0037] Optionally, the monitoring configuration module is further used to: distribute a collection script to a master node included in the at least one database cluster, and receive load value data collected by the master node.

[0038] Optionally, the database cluster includes a backup node corresponding to the primary node; the backup node is used to provide services instead of the primary node when the primary node is abnormal.

[0039] To achieve the above objective, according to a fourth aspect of an embodiment of the present invention, an electronic device is provided.

[0040] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the fault node locating method according to the embodiment of the present invention.

[0041] To achieve the above objective, according to a fifth aspect of an embodiment of the present invention, a computer-readable medium is provided.

[0042] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the method for locating a faulty node according to an embodiment of the present invention is implemented.

[0043] One embodiment of the above invention has the following advantages or beneficial effects: by collecting the load value on the data node to obtain the problem node, if the problem node is analyzed to be in a load tilt state, it is considered that the machine where the problem node is located is likely to have a fault problem, so the alarm information of the problem node is sent to realize the fault inspection of the machine where the problem node is located, so that the operation and maintenance personnel can find the fault in time, and can also improve the accuracy of fault location, reduce the fault operation time of the database cluster, and ensure the smooth operation of the database cluster. In addition, it can be judged from multiple judgment conditions whether the problem node is in a load tilt state, and it can accurately analyze whether the problem node is in a load tilt state, thereby improving the accuracy of fault location. In addition, the master node can collect the load value on the data node regularly to achieve the purpose of monitoring whether the machine where the data node is located has a fault problem.

[0044] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0046] Figure 1 is a schematic diagram of the system architecture of a database cluster according to an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of main steps of a method for locating a faulty node according to an embodiment of the present invention;

[0048] Figure 3 is a schematic diagram of the main steps of determining whether the problem node is in a load tilt state according to an embodiment of the present invention;

[0049] Figure 4 is a schematic diagram of the main process of determining whether the problem node is in a load tilt state according to an embodiment of the present invention;

[0050] Figure 5 is a schematic diagram of the main process of a method for locating a faulty node according to an embodiment of the present invention;

[0051] Figure 6 is a schematic diagram of main modules of a fault node positioning device according to an embodiment of the present invention;

[0052] Figure 7is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0053] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0055] With the development of big data, the amount of data stored at the enterprise level has increased exponentially. The traditional single-node database storage method has become increasingly impractical. Distributed database clusters allow data to be stored on more nodes and will not have much impact on the business logic of the enterprise system. They are a preferred solution for many enterprises when processing and storing big data. However, for distributed architectures, the increase in nodes increases the difficulty of operation and maintenance. This is because data requests need to be executed on multiple nodes, and the request is considered completed only when all nodes are executed and returned. If there is a performance problem in the database, it needs to be located on multiple nodes. Distributed database clusters deploy database programs on multiple machines in the cluster, and their operating performance depends on the underlying hardware. When a machine has a hidden bad disk and is not isolated and removed from the cluster in time, the request will be stuck on the machine, affecting the processing speed of the entire cluster, and the performance of the database cluster will drop sharply, and the job processing cannot be completed in time.

[0056] In the existing method of locating faulty nodes, the fault can be checked through user feedback, but for this method, when there are large-scale high-load operations, the operation will be greatly affected by the time the user discovers it. The existing technology can also collect the logs of the machine where the node is located through manual inspection, and then analyze the collected logs to query the fault problem, but this method is not only labor-intensive and inefficient, but also unable to quickly locate the faulty node in a timely manner.

[0057] In order to solve the above problems, an embodiment of the present invention provides a method for locating a faulty node based on a database cluster system. Considering that the number of nodes involved in a distributed database cluster can reach hundreds, enterprises with many data applications may also deploy dozens of database clusters, involving thousands of machines. For ease of understanding, the database cluster system is first described, and then the method for locating a faulty node based on the database cluster system is described.

[0058] The database cluster system may include at least one database cluster. Figure 1 Schematic diagram of the system architecture of a database cluster according to an embodiment of the present invention. Figure 1 As shown, a database cluster can have a master node and at least one data node. Among them, the database cluster can adopt the working mode of Massively Parallel Processing (MPP for short). Specifically, in the database cluster, each node has an independent disk storage system and memory system. The business data is divided into each node according to the database model and application characteristics. Each data node is connected to each other through a dedicated network or a commercial general network, and they work together to provide database services as a whole. In simple terms, MPP is to distribute tasks in parallel to multiple servers and nodes. After the calculation is completed on each node, the results of each part are aggregated together to obtain the final result.

[0059] As the entrance to the database cluster, the master node can be used to: receive the query statement corresponding to the database cluster, generate the query plan corresponding to the query statement, and distribute the query plan to at least one data node corresponding to the database cluster. For example, there is a database cluster A, A includes the master node A11 and the data nodes A21, A22, A23, then A11 can receive the query statement of the database cluster A, generate the query plan for the received query statement, and then distribute the generated query plan to A21, A22, A23, so that A21, A22, A23 can participate in the query execution work.

[0060] When configuring the machine where the node is located, the same configuration needs to be performed for the machine where the data node is located. That is, for at least one data node contained in a database cluster, the machines where these data nodes are located need to be configured the same. Specifically, the same number of CPU cores, memory space, network bandwidth, and number of instances can be configured. Considering that in a database cluster, when used in accordance with the specifications, the data is evenly distributed on the data nodes, then the data volume of the data nodes in a database cluster is the same. For the same configuration and the same amount of data, when the database cluster is operating normally, the load value, disk read and write, input and output consumption, etc. on the data node are almost the same. Therefore, when a data node in the database cluster fails, the disk read and write performance on the data node will decrease, and the disk read and write busy rate will increase, which will cause the load value to be higher than others. Therefore, the load value on the data node can be used to determine whether the machine where the data node is located has a fault problem.

[0061] That is, if the load value on a data node is high, then the machine where the data node is located may have a performance failure. Therefore, the method for locating a faulty node provided in the embodiment of the present invention can locate the fault by analyzing the load value on the data node. Figure 2 is a schematic diagram of the main steps of the method for locating a faulty node according to an embodiment of the present invention. Considering that a database cluster includes a master node and at least one data node, and the master node can distribute query plans to the data node, that is, the master node can be connected to the data node, so the master node can execute the method for locating a faulty node to locate the fault of at least one data node included in the database cluster. Figure 2 As shown, the main steps of the method for locating a faulty node may include:

[0062] Step S201, collecting the load value of at least one data node included in the database cluster, and determining the data node with the highest load value as the problem node;

[0063] Step S202, judging whether the problem node is in a load tilt state according to the load information of the database cluster to which it belongs;

[0064] Step S203: When the problem node is in a load tilt state, an alarm message of the problem node is sent to perform a fault check on the machine where the problem node is located.

[0065] The database cluster system may include at least one set of database clusters, each set of database clusters including a master node and at least one data node. The database cluster to which the master node belongs refers to the database cluster to which the master node belongs. For example, database cluster A includes master node A11 and data nodes A21, A22, and A23, then the database cluster to which A11 belongs is A. A11 can collect the load values ​​on data nodes A21, A22, and A23 included in database cluster A, and then determine that the data node with the highest load value is the problem node. It should be noted that the problem node in the embodiment of the present invention refers to the data node with the highest load value obtained in a collection, that is, the node is more likely to fail, but the problem node is not necessarily a faulty node. It should also be noted that the master node collects load values ​​at regular intervals, so the master node can collect load values ​​multiple times. For each load value collection, the data point with the highest load value obtained in this collection is the problem node for this time. In the method for locating the faulty node shown in steps S201 to S203, an analysis is performed on a certain collection, and the obtained problem node is named as the problem node for this time, and then the problem node for this time is analyzed. In other words, steps S201 to S203 analyze a single collection.

[0066] After obtaining the problem node, the load information of the database cluster to which it belongs can be used to determine whether the problem node is in a load tilt state. The load tilt state refers to the load value on a data node that differs greatly from the load value on other data nodes. The higher the load value on a data node, the greater the possibility of failure of the data node. Therefore, in an embodiment of the present invention, if the load value on the problem node is high, it can be considered that the problem node is in a load tilt state. In the case that the problem node is in a load tilt state, an alarm message of the problem node can be sent, so that a fault check can be performed on the machine where the problem node is located. If the analysis shows that the problem node is not in a load tilt state, it means that the database cluster to which the master node belongs is operating normally.

[0067] In addition, in a reference embodiment of the present invention, when the problem node is in a load tilt state, the problem node is isolated from at least one data node included in the database cluster to which it belongs; and, after the machine corresponding to the problem node passes the fault inspection and repair, the problem node is added to at least one data node included in the database cluster to which it belongs. For example, database cluster A includes master node A11 and data nodes A21, A22, and A23, then the database cluster to which A11 belongs is A, and A11 can collect the load values ​​on data nodes A21, A22, and A23 included in database cluster A, and then determine that the data node A21 with the highest load value is the problem node. If A21 is in a load tilt state, A21 is isolated from the data nodes included in database cluster A, so that the machine where A21 is located can be checked for faults. If it is checked that the machine where A21 is located has a fault problem, then after the fault repair, A21 can be re-added to the data nodes included in database cluster A. If it is checked that the machine where A21 is located has no fault problem, then A21 can be directly re-added to the data nodes included in database cluster A.

[0068] In the technical solution for locating a faulty node in an embodiment of the present invention, a problem node is obtained by collecting load values ​​on data nodes. If it is analyzed that the problem node is in a load-inclined state, it is considered that the machine where the problem node is located is likely to have a fault problem. Therefore, an alarm message of the problem node is sent to implement a fault check on the machine where the problem node is located. This allows operation and maintenance personnel to discover faults in a timely manner, improves the accuracy of fault locating, reduces the fault operation time of the database cluster, and ensures the smooth operation of the database cluster.

[0069] In a reference embodiment of the present invention, the method for locating a faulty node may further include: obtaining a preset collection time period according to a received request for locating the faulty node, and performing load value collection regularly according to the preset collection time period. Specifically, the master node may obtain a preset collection time period according to the received request for locating the faulty node. Then, the master node may regularly collect the load value on the data node according to the preset collection time period. For example, if the preset collection time period is 15 minutes, the master node may collect the load value every 15 minutes.

[0070] In a reference embodiment of the present invention, collecting the load value on at least one data node included in the database cluster to which it belongs, and determining the data node with the highest load value as the problem node for this time, may include: collecting the average load value on at least one data node included in the database cluster to which it belongs within a preset time period, and determining the data node with the highest average load value in this collection as the problem node corresponding to this collection. If the preset time period is 15 minutes, the master node can collect the load value once every 15 minutes. For a certain load value collection, the master node can collect the average load value within 15 minutes on at least one data node included in the database cluster to which it belongs, and determine the data node with the highest average load value as the problem node for this time.

[0071] In general, the master node can perform at least one load value collection. For each collection, the data node with the highest average load value obtained in this collection can be selected as the problem node this time, that is, the data node with the highest average load value can be analyzed each time to determine whether the node is in a load tilt state.

[0072] If the problem node is in a load-tilted state, it means that the machine where the problem node is located is likely to have a fault problem. Therefore, how to determine whether the problem node is in a load-tilted state through the load information of the database cluster to which it belongs is an important part of the fault node locating method of an embodiment of the present invention.

[0073] In a reference embodiment of the present invention, the load information of the database cluster may include: the last problematic node of the database cluster, the load average of the database cluster, and the working status of the database cluster. Figure 3 FIG. 1 is a schematic diagram of the main steps of determining whether the problem node is in a load tilt state according to an embodiment of the present invention. Figure 3 As shown, the main steps for determining whether the problem node is in a load tilt state may include:

[0074] Step S301, determine whether the current problem node is the same node as the previous problem node, whether the ratio of the load value on the current problem node to the load average is greater than a preset ratio threshold, and whether the working state is a non-idle state. If so, execute step S302; if not, execute step S303;

[0075] Step S302, confirming that the problem node is in a load tilt state;

[0076] Step S303: confirm that the problem node is not in a load tilt state.

[0077] It can be seen that the following three conditions need to be met to confirm that the problem node is in a load tilt state: Condition 1: The problem node is the same as the previous problem node; Condition 2: The ratio of the load value on the problem node to the load average is greater than the preset ratio threshold; Condition 3: The working state of the database cluster is non-idle. Among them, the master node regularly collects the load values ​​of the data nodes included in the database cluster. For each collection, the data node with the highest load value in this collection is determined as the problem node corresponding to this collection, that is, the problem node of this collection.

[0078] For condition 1, determine whether the current problem node is the same node as the previous problem node, where the previous problem node is the data node with the highest load value determined in the previous collection. If the current problem node is the same node as the previous problem node, it means that the current problem node continues to be in a high load value situation, and it can be considered that the machine where the current problem node is located is likely to have a fault problem. Therefore, whether the current problem node is the same node as the previous problem node can be used as a judgment condition for whether the current problem node is in a load tilt state.

[0079] For condition 2, determine whether the ratio of the load value on the problem node to the load average is greater than a preset ratio threshold. In a reference embodiment of the present invention, the load values ​​on the remaining data nodes are averaged to obtain the load average of the database cluster to which they belong; wherein the remaining data nodes are data nodes other than the problem node in at least one data node contained in the database cluster to which they belong. For example, database cluster A includes master node A11 and data nodes A21, A22, and A23, then the database cluster to which A11 belongs is A, A11 can collect the load values ​​on data nodes A21, A22, and A23 contained in database cluster A, and then determine that data node A21 with the highest load value is the problem node this time, then the remaining data nodes are A22 and A23, and the load values ​​on A22 and A23 are averaged to obtain the load average of database cluster A. It should be noted that the load average is the load average of A corresponding to this collection. Considering that during the operation of the database cluster, there is a situation where the load value on a certain node is high for a short period of time. To avoid misjudgment caused by this situation, if the ratio of the load value on the problem node to the load average of the remaining data nodes is not less than the preset ratio threshold, it can be determined that the problem node is running at a high load for a long time. Therefore, whether the ratio of the load value on the problem node to the load average is greater than the preset ratio threshold can be used as a judgment condition for whether the problem node is in a load tilt state.

[0080] For condition three, determine whether the current working state of the database cluster is non-idle. Considering that when the database cluster is idle, the load values ​​on the data nodes it contains are low. For example, the load value on the problem node is 8, and the average load value on other data nodes is 4. Although the difference is 4, the ratio can reach 2. In this case, although the ratio is greater than the preset ratio threshold, it cannot be considered that the problem node is running at a high load for a long time. Therefore, whether the current working state of the database cluster is non-idle can be used as a judgment condition for whether the problem node is in a load tilt state.

[0081] Therefore, in the reference embodiment of the present invention, it can be determined whether the query statements corresponding to the database cluster are less than the preset number and whether the load value on the problem node is less than the preset load value threshold; if so, the current working state is determined to be an idle state, and if not, the current working state is determined to be a non-idle state. For example, if the number of query statements corresponding to the database cluster is less than 20 and the load value on the problem node is less than 10, the database cluster is considered to be in an idle state, otherwise, the database cluster is considered to be in a non-idle state.

[0082] In addition, in the reference embodiment of the present invention, if the number of query statements corresponding to the database cluster is not less than the preset number and the load value on the problem node is less than the preset load value threshold, the abnormal information of the database cluster is sent. For example, if the number of query statements corresponding to the database cluster is not less than 20 and the load value on the problem node is less than 10, it means that the submitted query statements are simple, but the probability of this situation is very low. Therefore, when this happens, it means that the possibility of failure of the database cluster is high, and it is necessary to send the abnormal information of the database cluster, so that the operation and maintenance personnel can check whether the database cluster fails or the database cluster product itself has problems.

[0083] Figure 4 FIG. 1 is a schematic diagram of the main process of determining whether the problem node is in a load tilt state according to an embodiment of the present invention. Figure 4 As shown, the main process of determining whether the problem node is in a load tilt state may include:

[0084] Step S401, determine whether the current problem node is the same as the previous problem node, if so, execute step S402, if not, execute step S405;

[0085] Step S402, determining whether the ratio of the load value on the problem node to the load average is greater than a preset ratio threshold, if so, executing step S403, if not, executing step S405;

[0086] Step S403, determining whether the working state of the database cluster is a non-idle state, if so, executing step S404, if not, executing step S405;

[0087] Step S404, confirming that the problem node is in a load tilt state;

[0088] Step S405: confirm that the problem node is not in a load tilt state.

[0089] Among them, the three judgment orders of step S401 to step S403 can be adjusted according to the actual situation, but it should be noted that the problem node can be considered to be in a load tilt state only when all three judgment conditions are met. Correspondingly, as long as one judgment condition is not met, it is considered that the problem node is not in a load tilt state. In the method for judging whether the problem node is in a load tilt state in the embodiment of the present invention, judging from multiple conditions can accurately analyze whether the problem node is in a load tilt state, thereby improving the accuracy of fault location.

[0090] In a reference embodiment of the present invention, before sending the alarm information of the problem node, the method for locating the faulty node may also include: querying the operating system log of the machine where the problem node is located, and determining whether the error keyword has appeared at least once in the operating system log; if so, sending the alarm information of the problem node, if not, monitoring the status of the problem node; when the problem node is in a load tilt state for a period greater than a preset time, shutting down the machine where the problem node is located to inspect the machine where the problem node is located.

[0091] After determining that the problem node is in a load tilt state, but the machine where the problem node is located has no fault problem, it can be considered that the alarm is wrong. In order to avoid the false alarm rate after the load tilt caused by this situation, after determining that the problem node is in a load tilt state, the operating system log of the machine where the problem node is located can be analyzed. Since all errors will be recorded in the operating system log, the operating system log of the machine where the problem node is located can be queried to determine whether the error keyword has appeared once or multiple times in the operating system log. It should be noted that the operating system log of the machine where the problem node is located is generally queried on the same day. Of course, the query time range of the operating system log can also be set according to actual needs. If the error keyword appears once or multiple times, an alarm will be issued immediately so that the machine where the problem node is located can be checked for faults in time. If the check shows that there is a fault problem, it will be repaired in time. If the error keyword has not appeared, the status of the problem node can be monitored. If it is found that the time for the problem node to be in a load tilt state is greater than the preset time, it means that the machine where the problem node is located has affected the operation of the database cluster to which it belongs, and the machine where the problem node is located needs to be shut down to check the machine where the problem node is located. After the check is passed, the operation of the machine where the problem node is located can be restored.

[0092] Figure 5 FIG. 1 is a schematic diagram of the main process of a method for locating a faulty node according to an embodiment of the present invention. The method for locating a faulty node is executed by a master node included in a database cluster and can locate faults of data nodes included in the database cluster. Figure 5 As shown, the main process of the method for locating a faulty node may include:

[0093] Step S501, collecting an average load value of at least one data node included in the database cluster within a preset time period;

[0094] Step S502, determining the data node with the highest average load value in this collection as the problem node corresponding to this collection, that is, the problem node of this collection;

[0095] Step S503, obtaining the load information of the database cluster, including the last problem node of the database cluster, the load average of the database cluster, and the working status of the database cluster;

[0096] Step S504, determine whether the current problem node is the same as the previous problem node, if so, execute step S505, if not, execute step S508;

[0097] Step S505, determining whether the ratio of the load value on the problem node to the load average is greater than a preset ratio threshold, if so, executing step S506, if not, executing step S508;

[0098] Step S506, determining whether the working state of the database cluster is a non-idle state, if so, executing step S507, if not, executing step S508;

[0099] Step S507, confirming that the problem node is in a load tilt state;

[0100] Step S508, confirming that the problem node is not in a load-skewed state, so as to determine that the database cluster to which it belongs is operating normally;

[0101] Step S509, query the operating system log of the machine where the problem node is located, and determine whether the error keyword has appeared at least once in the operating system log. If so, execute step S510, if not, execute step S511;

[0102] Step S510, sending the alarm information of the problem node to perform a fault check on the machine where the problem node is located;

[0103] Step S511, monitoring the status of the problem node, determining whether the time for which the problem node is in a load tilt state is greater than a preset time, if so, executing step S512, if not, executing step S508;

[0104] Step S512: shut down the machine where the problem node is located to check the machine where the problem node is located.

[0105] It should be noted that the method for locating the faulty node shown in the above steps S501 to S512 is that the master node performs a collection and analyzes the obtained problem node. The master node can also obtain a preset collection time period according to the received request for locating the faulty node, and perform load value collection regularly according to the preset collection time period, that is, the master node can perform multiple load value collections, so that the problem node obtained each time can be analyzed, that is, the master node can collect the load value on the data node regularly to achieve the purpose of monitoring whether the machine where the data node is located has a fault problem.

[0106] In addition, while sending the alarm information of the problem node in step S510, the problem node can also be isolated from at least one data node included in the database cluster to which it belongs, and after the machine corresponding to the problem node passes the fault inspection and maintenance, the problem node can be added to at least one data node included in the database cluster to which it belongs. In addition, before executing step S504, it is necessary to obtain the last problem node; before executing step S505, it is necessary to calculate the load average of the database cluster to which it belongs; before executing step S506, it is necessary to determine the working status of the database cluster to which it belongs. And, in the process of determining the working status of the database cluster to which it belongs, if the query statement corresponding to the database cluster to which it belongs is not less than the preset number and the load value on the problem node this time is less than the preset load value threshold, then send the abnormal information of the database cluster to which it belongs. In addition, the three judgment orders of step S504 to step S506 can be adjusted according to the actual situation, but it should be noted that the problem node can only be considered to be in a load tilt state when all three judgment conditions are met. Correspondingly, as long as one judgment condition is not met, it is considered that the problem node is not in a load tilt state.

[0107] According to the method for locating a faulty node in an embodiment of the present invention, the problem node is obtained by collecting the load value on the data node. If the problem node is analyzed to be in a load tilt state, it is considered that the machine where the problem node is located is likely to have a fault problem. Therefore, the alarm information of the problem node is sent to realize a fault check on the machine where the problem node is located, so that the operation and maintenance personnel can find the fault in time, and the accuracy of fault location can be improved, the fault operation time of the database cluster can be reduced, and the smooth operation of the database cluster can be guaranteed. In addition, it can be judged from multiple judgment conditions whether the problem node is in a load tilt state, and it can accurately analyze whether the problem node is in a load tilt state, thereby improving the accuracy of fault location. In addition, the master node can collect the load value on the data node at a regular interval to achieve the purpose of monitoring whether the machine where the data node is located has a fault problem.

[0108] In addition, if Figure 1As shown in the figure, the database cluster can also contain a backup node corresponding to the primary node. In order to ensure high availability, when the machine where the primary node is located fails and cannot provide services, it can be switched to the backup node, and the service is provided by the backup node. Therefore, during the operation of the database cluster, it is necessary to ensure data synchronization between the primary node and the backup node, so that when the primary node is abnormal, the backup node can provide services instead of the primary node.

[0109] The database cluster system may also include: a monitoring configuration module. The monitoring configuration module may be used to: configure at least one set of database cluster parameters. The parameters include: an identifier of the database cluster, a super user corresponding to the database cluster, and a threshold value corresponding to the database cluster. The identifier of the database cluster may be an identifier of the machine where the master node contained in the database cluster is located. Since the master node can receive query statements and provide services to the outside, an external request can be connected to the master node. The super user corresponding to the database cluster refers to a user who has all permissions of the database cluster, generally an administrator. The threshold value corresponding to the database cluster refers to the threshold value required to be used in the method of locating the faulty node executed by the master node, such as a preset ratio threshold value, a preset number, a preset load value threshold value, a preset time, and a preset collection time period.

[0110] In addition, the monitoring configuration module can also be used to distribute the collection script to the master node included in at least one set of database clusters, so that the master node can use the collection sample to collect the load value data of the data node. Then, the monitoring configuration module can be used to receive the load value data collected by the master node. That is to say, for a set of database clusters, the master node included in the database cluster can collect the load value of the data node included in the database cluster, and then send the collected load value to the monitoring configuration module, which facilitates the management of at least one set of database clusters included in the database cluster system.

[0111] Figure 6 FIG. 1 is a schematic diagram of main modules of a fault node positioning device according to an embodiment of the present invention. Figure 6 As shown, the main modules 600 of the fault node positioning device may include: a collection module 601 , a judgment module 602 and an alarm module 603 .

[0112] Among them, the collection module 601 can be used to collect the load value on at least one data node included in the database cluster to which it belongs, and determine that the data node with the highest load value is the problem node this time; the judgment module 602 can be used to judge whether the problem node this time is in a load tilt state based on the load information of the database cluster to which it belongs; the alarm module 603 can be used to send the alarm information of the problem node this time when the problem node is in a load tilt state, so as to perform a fault check on the machine where the problem node is located.

[0113] In the embodiment of the present invention, the load information of the database cluster may include: the last problematic node of the database cluster, the load average of the database cluster, and the working status of the database cluster.

[0114] In an embodiment of the present invention, the judgment module 602 can be used to: judge whether the current problem node is the same node as the previous problem node, whether the ratio of the load value on the current problem node to the load average is greater than a preset ratio threshold, and whether the working state is a non-idle state; if so, confirm that the current problem node is in a load tilt state; if not, confirm that the current problem node is not in a load tilt state.

[0115] In the embodiment of the present invention, the judgment module 602 may be used to: obtain the last problematic node; wherein the last problematic node is the data node with the highest load value determined in the last collection.

[0116] In an embodiment of the present invention, the judgment module 602 can be used to: calculate the average load value on the remaining data nodes to obtain the load average of the database cluster to which it belongs; wherein the remaining data nodes are data nodes other than the problem node in at least one data node included in the database cluster to which it belongs.

[0117] In an embodiment of the present invention, the judgment module 602 can be used to: judge whether the query statement corresponding to the database cluster is less than a preset number and whether the load value on the problem node is less than a preset load value threshold; if so, determine that the current working state is an idle state, if not, determine that the current working state is a non-idle state.

[0118] In the embodiment of the present invention, the judgment module 602 can be used to send abnormal information of the database cluster if the query statements corresponding to the database cluster are not less than a preset number and the load value on the problem node is less than a preset load value threshold.

[0119] In an embodiment of the present invention, the alarm module 603 can be used to: query the operating system log of the machine where the problem node is located, and determine whether the error keyword has appeared at least once in the operating system log; if so, send the alarm information of the problem node, if not, monitor the status of the problem node; when the problem node is in a load tilt state for a time greater than a preset time, shut down the machine where the problem node is located to inspect the machine where the problem node is located.

[0120] In an embodiment of the present invention, the acquisition module 601 can be used to: when the problem node is in a load-tilted state, isolate the problem node from at least one data node included in the database cluster to which it belongs; and after the machine corresponding to the problem node passes the fault inspection and repair, add the problem node to at least one data node included in the database cluster to which it belongs.

[0121] In the embodiment of the present invention, the alarm module 603 can be used to: confirm that the database cluster to which it belongs is operating normally when the problem node is not in a load tilt state. In the embodiment of the present invention, the collection module 601 can be used to: obtain a preset collection time period according to a received request for locating a faulty node, and perform load value collection regularly according to the preset collection time period.

[0122] In an embodiment of the present invention, the collection module 601 can be used to: collect the average load value of at least one data node included in the database cluster within a preset time period, and determine the data node with the highest average load value in this collection as the current problem node corresponding to this collection.

[0123] The fault node positioning device of the embodiment of the present invention can obtain the problem node by collecting the load value on the data node. If it is analyzed that the problem node is in a load tilt state, it is considered that the machine where the problem node is located is likely to have a fault problem. Therefore, the alarm information of the problem node is sent to realize the fault inspection of the machine where the problem node is located, so that the operation and maintenance personnel can find the fault in time, and the accuracy of fault positioning can be improved, the fault operation time of the database cluster can be reduced, and the smooth operation of the database cluster can be guaranteed. In addition, it can be judged from multiple judgment conditions whether the problem node is in a load tilt state, and it can accurately analyze whether the problem node is in a load tilt state, thereby improving the accuracy of fault positioning. In addition, the master node can collect the load value on the data node regularly to achieve the purpose of monitoring whether the machine where the data node is located has a fault problem.

[0124] Figure 7 An exemplary system architecture 700 is shown to which the method for locating a faulty node or the apparatus for locating a faulty node according to the embodiments of the present invention can be applied.

[0125] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0126] The user can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 701, 702, 703. The terminal devices 701, 702, 703 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, etc.

[0127] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.

[0128] It should be noted that the method for locating a faulty node provided in the embodiment of the present invention is generally executed by the server 705, and accordingly, the device for locating a faulty node is generally disposed in the server 705. It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0129] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0130] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0131] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0132] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0133] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0134] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0135] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor including a collection module, a judgment module, and an alarm module. The names of these modules do not constitute limitations on the modules themselves in certain cases. For example, the collection module may also be described as "a module that periodically collects the load value on at least one data node included in the database cluster to which it belongs, and determines that the data node with the highest load value is the problem node of this time."

[0136] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: collecting the load value on at least one data node included in the database cluster to which it belongs, and determining that the data node with the highest load value is the problem node of this time; judging whether the problem node of this time is in a load tilt state according to the load information of the database cluster to which it belongs; and sending the alarm information of the problem node of this time in the case that the problem node of this time is in a load tilt state, so as to perform a fault check on the machine where the problem node of this time is located.

[0137] According to the technical solution of the embodiment of the present invention, the problem node is obtained by collecting the load value on the data node. If the problem node is analyzed to be in a load tilt state, it is considered that the machine where the problem node is located is likely to have a fault problem. Therefore, the alarm information of the problem node is sent to realize the fault inspection of the machine where the problem node is located, so that the operation and maintenance personnel can find the fault in time, and the accuracy of fault location can be improved, the fault operation time of the database cluster can be reduced, and the smooth operation of the database cluster can be guaranteed. In addition, it can be judged from multiple judgment conditions whether the problem node is in a load tilt state, and it can accurately analyze whether the problem node is in a load tilt state, thereby improving the accuracy of fault location. In addition, the master node can collect the load value on the data node regularly to achieve the purpose of monitoring whether the machine where the data node is located has a fault problem.

[0138] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for locating a faulty node, characterized in that: include: Collect the load value of at least one data node included in the database cluster, and determine that the data node with the highest load value is the problem node; According to the load information of the database cluster to which it belongs, judging whether the problem node is in a load tilt state, including: obtaining the last problem node; wherein the last problem node is the data node with the highest load value determined in the last collection; calculating the average of the load values ​​on the remaining data nodes to obtain the load average of the database cluster to which it belongs; wherein the remaining data nodes are data nodes other than the problem node of this time in at least one data node included in the database cluster to which it belongs; judging whether the problem node of this time is the same node as the last problem node, whether the ratio of the load value on the problem node of this time to the load average is greater than a preset ratio threshold, and whether the working state is a non-idle state; if so, confirming that the problem node of this time is in a load tilt state; if not, confirming that the problem node of this time is not in a load tilt state; Wherein, the determination of whether the current working state is a non-idle state includes: determining whether the query statements corresponding to the database cluster are less than a preset number and whether the load value on the problem node is less than a preset load value threshold; if so, determining that the current working state is an idle state; if not, determining that the current working state is a non-idle state; the load information of the database cluster includes: the last problem node of the database cluster, the load average of the database cluster, and the working state of the database cluster; When the problem node is in a load tilt state, alarm information of the problem node is sent to perform a fault check on the machine where the problem node is located.

2. The method according to claim 1, characterized in that: The method further comprises: If the query statements corresponding to the database cluster to which it belongs are not less than a preset number and the load value on the problem node is less than a preset load value threshold, the abnormal information of the database cluster to which it belongs is sent.

3. The method according to claim 1, characterized in that Before sending the warning information of the problem node, the method further includes: Query the operating system log of the machine where the problem node is located to determine whether the error keyword has appeared at least once in the operating system log; If yes, then send the alarm information of the problem node; if no, then monitor the status of the problem node; When the problem node is in a load tilt state for a period longer than a preset time, the machine where the problem node is located is shut down to inspect the machine where the problem node is located.

4. The method according to claim 1, characterized in that: The method further comprises: When the problem node is in a load-skewed state, isolating the problem node from at least one data node included in the database cluster to which it belongs; and After the machine corresponding to the node with the problem passes the fault inspection and repair, the node with the problem is added to at least one data node included in the database cluster to which it belongs.

5. The method according to claim 1, characterized in that The method further comprises: When the problem node is not in a load-skewed state, it is confirmed that the database cluster to which it belongs is operating normally.

6. The method according to claim 1, characterized in that The method further comprises: According to the received request for locating the faulty node, a preset collection time period is obtained, and load value collection is performed regularly according to the preset collection time period.

7. The method according to claim 6, characterized in that The collecting of the load value of at least one data node included in the database cluster to which the data is attached, and determining the data node with the highest load value as the problem node, includes: The average load value of at least one data node included in the database cluster to which the data node belongs is collected within the preset collection time period, and the data node with the highest average load value in this collection is determined as the problem node corresponding to this collection.

8. A fault node positioning device, characterized in that: include: A collection module is used to periodically collect the load value of at least one data node included in the database cluster to which it belongs, and determine that the data node with the highest load value is the problem node; A judgment module is used to judge whether the problem node is in a load tilt state according to the load information of the database cluster to which it belongs, including: obtaining the last problem node; wherein the last problem node is the data node with the highest load value determined in the last collection; performing average calculation on the load values ​​on the remaining data nodes to obtain the load average of the database cluster to which it belongs; wherein the remaining data nodes are data nodes other than the problem node of this time in at least one data node included in the database cluster to which it belongs; judging whether the problem node of this time is the same node as the last problem node, whether the ratio of the load value on the problem node of this time to the load average is greater than a preset ratio threshold, and whether the working status state is a non-idle state; if so, confirm that the problem node is in a load tilt state; if not, confirm that the problem node is not in a load tilt state; wherein, the determination of whether the current working state is a non-idle state comprises: determining whether the query statement corresponding to the database cluster is less than a preset number and whether the load value on the problem node is less than a preset load value threshold; if so, determining that the current working state is an idle state; if not, determining that the current working state is a non-idle state; the load information of the database cluster comprises: the last problem node of the database cluster, the load average of the database cluster, and the working state of the database cluster; The alarm module is used to send the alarm information of the problem node when the problem node is in a load tilt state, so as to perform a fault check on the machine where the problem node is located.

9. The device according to claim 8, characterized in that The alarm module is also used for: Query the operating system log of the machine where the problem node is located to determine whether the error keyword has appeared at least once in the operating system log; If yes, then send the alarm information of the problem node; if no, then monitor the status of the problem node; When the problem node is in a load tilt state for a period longer than a preset time, the machine where the problem node is located is shut down to inspect the machine where the problem node is located.

10. A database cluster system, characterized in that: The system includes at least one database cluster, wherein a database cluster includes a master node and at least one data node; The master node is used to: execute the fault node locating method described in any one of claims 1-7 to locate the fault of at least one data node included in the database cluster to which it belongs.

11. The system according to claim 10, characterized in that The master node is also used to: Receive a query statement corresponding to the database cluster, generate a query plan corresponding to the query statement, and distribute the query plan to at least one data node corresponding to the database cluster.

12. The system according to claim 10, characterized in that The configuration of the machine where at least one data node included in the database cluster is located is the same; wherein the configuration includes: the number of CPU cores, memory space, network bandwidth and number of instances.

13. The system according to claim 10, characterized in that The system also includes a monitoring configuration module, which is used to: The at least one set of parameters of the database cluster is configured, wherein the parameters include: an identifier of the database cluster, a super user corresponding to the database cluster, and a threshold corresponding to the database cluster.

14. The system according to claim 13, characterized in that The monitoring configuration module is also used to distribute collection scripts to the master nodes included in the at least one database cluster, and receive load value data collected by the master nodes.

15. The system according to claim 10, characterized in that The database cluster includes a backup node corresponding to the master node; The standby node is used to provide services instead of the main node when the main node is abnormal.

16. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

17. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method, device and system for scheduling distributed buffer resources

    CN102577241A

  • Method, equipment and system for recognizing hotpot and possible fault in server system

    CN103580903A

  • Fault processing method of computer cluster system

    CN103607297A

  • HAC system, warning method based on HAC system and warning system based on HAC system

    CN105138441A

  • Operation method, device and equipment of data exchange system

    CN111046091A