Database node status monitoring method and device, electronic device and storage medium

By monitoring the state stability of the database node and applying the offline and online rules in the rule database, real-time automatic monitoring and processing of unstable nodes is achieved, and the task execution extension and error reporting problems caused by node instability are solved, and the work efficiency of the database node is improved.

CN119127625BActive Publication Date: 2025-04-04SUZHOU JIBEISI DATA TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411641353.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-04-04
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In the user's actual business system, service or node instability caused by hardware problems and other reasons leads to a longer task execution time or return the result of execution errors. The prior art cannot handle unstable nodes in a timely manner, affecting user service execution.

Method used

By calling the monitoring task, the state stability monitoring of the to be processed nodes is obtained, the first monitoring result is obtained, and multiple offline rules are read from the rule base. When the matching target downline rules exist, the offline processing is executed; then the judgment task corresponding to the target downline rules is called for offline status monitoring, obtain the second monitoring result, and perform the online processing according to the matching target upline rules.

Benefits of technology

Real-time automatic monitoring and processing of unstable nodes is realized, the work efficiency of database nodes is improved, and unstable nodes are processed in a timely manner to avoid affecting user business execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127625B_ABST
    Figure CN119127625B_ABST
Patent Text Reader

Abstract

The present invention provides a database node status monitoring method and device, electronic device and storage medium. It can be applied to the database technology field and the node monitoring field. The node status monitoring method includes: calling a monitoring task to monitor the status stability of a processing node to obtain a first monitoring result; reading multiple offline rules from a rule base; if there is a target offline rule matching the first monitoring result among the multiple offline rules, performing offline processing on the processing node; calling a discrimination task corresponding to the target offline rule to monitor the offline status of the processing node to obtain a second monitoring result; reading a target online rule matching the target offline rule from the rule base; if the second monitoring result matches the target online rule, performing online processing on the processing node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of database technology and node monitoring, and in particular to a database node status monitoring method and device, electronic equipment and storage medium. Background Art

[0002] When a distributed database executes a Structured Query Language (SQL) task, it will send the task to each node for execution. Before sending the task, it will obtain whether the service on the node is running normally. If the service is abnormal, it will be directly removed from the list of sent nodes, and the task will only be sent to nodes with normal services. After all the nodes that sent the task return the execution results, the cluster will collect and summarize the results in a unified manner and return the final execution results to the user. This can not only ensure the timeliness of the normal operation of SQL, but also reduce unnecessary redundant execution errors.

[0003] However, in the user's actual business system, hardware problems and other reasons may cause unstable services or nodes. In this case, although the status monitoring of the database cluster is normal and the tasks are issued normally, the task execution time will be significantly longer. What's worse, the execution error result will still be returned in the end. When manual regular inspections find that the business operation is abnormal, the node is manually set to go offline, and then wait for subsequent manual inspections to determine that the node has returned to normal before it is manually put online. Unstable nodes cannot be handled in time, which affects the user's business execution and misses the best statistical decision time, resulting in poor user experience. Summary of the invention

[0004] In view of the above problems, the present invention provides a node status monitoring method, device, electronic device, storage medium and program product.

[0005] According to a first aspect of the present invention, a node status monitoring method is provided, including: calling a monitoring task to perform status stability monitoring on a processing node to obtain a first monitoring result; reading multiple offline rules from a rule base; if there is a target offline rule that matches the first monitoring result among the multiple offline rules, performing offline processing on the processing node; calling a discrimination task corresponding to the target offline rule to perform offline status monitoring on the processing node to obtain a second monitoring result; reading a target online rule that matches the target offline rule from the rule base; if the second monitoring result matches the target online rule, performing online processing on the processing node.

[0006] According to an embodiment of the present invention, when the second monitoring result does not match the target online rule, the node to be processed is polled to determine whether the second monitoring result matches the target online rule; when the number of polling times reaches the preset upper limit threshold, the polling of the node to be processed is stopped and an alarm prompt is generated.

[0007] According to an embodiment of the present invention, each rule in the rule base includes offline rules, online rules and fault types; the offline rules include the execution time and / or execution results of the monitoring tasks; the online rules include the execution time and / or execution results of the judgment tasks corresponding to the offline rules; the first monitoring results include the execution time and / or execution results of the monitoring tasks; the second monitoring results include the execution time and / or execution results of the judgment tasks corresponding to the target offline rules.

[0008] According to an embodiment of the present invention, after executing offline processing on the node to be processed, it also includes: recording the environmental information of the node to be processed; deleting the monitoring work data of the node to be processed; determining the fault type according to the target offline rule matched by the node to be processed; generating an offline record of the node to be processed, wherein the offline record includes the environmental information and fault type of the node.

[0009] According to an embodiment of the present invention, the first monitoring result is compared with the execution time and the execution results of the monitoring tasks in the multiple offline rules to determine whether there is a target offline rule that matches the first monitoring result among the multiple offline rules; the second monitoring result is compared with the execution time and the execution result of the discrimination task corresponding to the target online rule to determine whether the second monitoring result matches the target online rule.

[0010] According to an embodiment of the present invention, the preset tasks, offline rules and online rules are set according to the execution system environment, network environment and hardware conditions of the database where the node to be processed is located.

[0011] The second aspect of the present invention provides a node status monitoring device, including: a first monitoring module, used to call a monitoring task to perform status stability monitoring on a processing node to obtain a first monitoring result; a first reading module, used to read multiple offline rules from a rule base; an offline module, used to perform offline processing on the processing node when there is a target offline rule that matches the first monitoring result among the multiple offline rules; a second monitoring module, used to call a discrimination task corresponding to the target offline rule to perform offline status monitoring on the processing node to obtain a second monitoring result; a second reading module, used to read a target online rule that matches the target offline rule from the rule base; an online module, used to perform online processing on the processing node when the second monitoring result matches the target online rule.

[0012] The third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, and when the one or more processors execute the one or more computer programs, the steps of the above-mentioned node status monitoring method are implemented.

[0013] The fourth aspect of the present invention further provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the above-mentioned node status monitoring method are implemented.

[0014] The fifth aspect of the present invention also provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned node status monitoring method when executed by a processor.

[0015] According to an embodiment of the present invention, by setting offline rules, online rules, identification tasks and monitoring tasks in the rule base, unstable nodes can be automatically monitored, judged and processed in real time, the working efficiency of database nodes can be improved, and nodes that are unstable but can execute cluster tasks normally can be processed. At the same time, the content in the rule base can be customized according to the software and hardware conditions, network environment and other aspects of the database user, and the threshold of the unstable state can be determined according to its own situation, thereby realizing a more flexible unstable node monitoring method. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0017] Figure 1 An application scenario of a node status monitoring method according to an embodiment of the present invention is shown;

[0018] Figure 2 A flowchart of a node status monitoring method according to an embodiment of the present invention is shown;

[0019] Figure 3 It shows a schematic diagram of the operation of the node status monitoring method according to an embodiment of the present invention;

[0020] Figure 4 A flowchart of a node status monitoring and matching method according to an embodiment of the present invention is shown;

[0021] Figure 5 It shows a structural block diagram of a node status monitoring device according to an embodiment of the present invention;

[0022] Figure 6 A block diagram of an electronic device for a node status monitoring method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0023] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.

[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0027] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0028] It should be noted that the node status monitoring method and device, electronic device and storage medium of the embodiments of the present invention can be applied to the database technology field and the node monitoring field, and can also be used in any field other than the database technology field and the node monitoring field. The embodiments of the present invention do not limit the application field of the above-mentioned node status monitoring method and device, electronic device and storage medium.

[0029] An embodiment of the present invention provides a node status monitoring method, including: calling a monitoring task to perform status stability monitoring on a processing node to obtain a first monitoring result; reading multiple offline rules from a rule base; when there is a target offline rule that matches the first monitoring result among the multiple offline rules, performing offline processing on the processing node; calling a discrimination task corresponding to the target offline rule to perform offline status monitoring on the processing node to obtain a second monitoring result; reading a target online rule that matches the target offline rule from the rule base; when the second monitoring result matches the target online rule, performing online processing on the processing node.

[0030] Figure 1 An application scenario of the node status monitoring method according to an embodiment of the present invention is shown.

[0031] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0032] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0034] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0035] It should be noted that the node status monitoring method provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the node status monitoring device provided in the embodiment of the present invention can generally be set in the server 105. The node status monitoring method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the node status monitoring device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0036] It should be understood that Figure 1 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 implementation requirements.

[0037] The following will be based on Figure 1 The scene described by Figure 2~Figure 4 The node status monitoring method of the disclosed embodiment is described in detail.

[0038] Figure 2 A flow chart of a node status monitoring method according to an embodiment of the present invention is shown.

[0039] like Figure 2 As shown, the node status monitoring method of the embodiment of the present invention includes operations S201 to S206.

[0040] In operation S201, a monitoring task is called to perform state stability monitoring on a node to be processed to obtain a first monitoring result.

[0041] In operation S202, a plurality of offline rules are read from a rule library.

[0042] In operation S203, when there is a target offline rule matching the first monitoring result among the multiple offline rules, offline processing is performed on the node to be processed.

[0043] In operation S204, a discrimination task corresponding to the target offline rule is called to monitor the offline status of the node to be processed to obtain a second monitoring result.

[0044] In operation S205, a target online rule matching the target offline rule is read from a rule library.

[0045] In operation S206, when the second monitoring result matches the target online rule, online processing is performed on the node to be processed.

[0046] According to an embodiment of the present invention, in operation S201, the monitoring task may be a task set by the user for monitoring the node operation status according to the software and hardware facilities, network environment, application field, etc. of the database, and the monitoring task may include multiple task types.

[0047] In some embodiments of the present invention, the time interval for executing the monitoring task can also be set. For example, the polling time of the monitoring task can be set in minutes, such as setting 1 minute or 5 minutes to execute a monitoring task, or executing a group of monitoring tasks to obtain the first monitoring result.

[0048] In some embodiments of the present invention, a statistical time period for the monitoring task may also be set. For example, if the monitoring task is executed for ten minutes, only the execution results from the fourth minute to the fifth minute of the monitoring task execution period may be counted as the first monitoring result.

[0049] According to an embodiment of the present invention, in operation S202, the rule base sets corresponding offline rules according to the software and hardware conditions, network environment, etc. of the database user. 1, 2...n offline rules can be set and can be called at any time, where n is a positive integer.

[0050] In some embodiments of the present invention, multiple offline rules can be set to take effect, n offline rules can be preset, and whether the offline rules are effective can be set based on the usage of the database. When the facility is invalid, this offline rule will not be called.

[0051] According to an embodiment of the present invention, in operation S203, the offline rule that matches the first monitoring result in the rule base is the target offline rule. If the offline rule is met, the node is marked as an unstable node as a failure state and is taken offline. The cluster will not issue tasks to it. In order to ensure the integrity and consistency of the data, a special mark will be recorded according to the data write status after the SQL execution is completed, and the cluster automatic recovery program will perform recovery in the background.

[0052] According to an embodiment of the present invention, in operation S204, after the node is marked as an unstable node offline, the unstable node will call the discrimination task corresponding to the target offline rule in the rule library to execute and obtain the corresponding second monitoring result.

[0053] According to an embodiment of the present invention, in operation S205, the rule base is provided with an online rule that corresponds to the offline rule one by one. When it is determined that the node is offline through the target offline rule, the corresponding online rule is called for subsequent determination to determine whether the node is online. Although the online rules and offline rules in the rule base are in a corresponding relationship, different offline rules can correspond to the same online rule. When setting, the same value can be set for multiple online rules.

[0054] According to an embodiment of the present invention, in operation S206, when the second monitoring result meets the target online rule of the call, it will be considered that the offline unstable node has restored the normal working state and can go online to process the tasks issued by the cluster. At this time, the state of the unstable node is marked as normal and the node is put online.

[0055] In some embodiments of the present invention, after an unstable node comes online, a cluster automatic recovery program recovers the data during the node's offline period in the background, thereby ensuring the integrity and consistency of the data.

[0056] According to an embodiment of the present invention, by setting offline rules, online rules, identification tasks and monitoring tasks in the rule base, unstable nodes can be automatically monitored and judged in real time and processed, the work efficiency of database nodes can be improved, and nodes that are unstable but can execute cluster tasks normally can be processed. At the same time, the content in the rule base can be customized according to the software and hardware conditions, network environment and other aspects of the database user, and the threshold of the unstable state can be determined according to its own situation.

[0057] Figure 3 The operation diagram of the node status monitoring method according to the embodiment of the present invention is shown. Figure 3 The node status monitoring of the embodiment of the present invention is further described as follows:

[0058] like Figure 3 As shown, the operation of the node status monitoring method further includes operation S301 to operation S311.

[0059] Operations S301 to S305 are the same as the above-mentioned operations S201 to S205 and are not described in detail here.

[0060] According to an embodiment of the present invention, in operation S306, after determining whether the second monitoring result matches the target online rule, if they match, operation S307 is executed to change the state of the unstable node and go online; if they do not match, operation S308 is executed to poll whether the second monitoring result and the target online rule match.

[0061] In some embodiments of the present invention, in operation S308, the polling time interval can also be set, for example, the polling time can be set in minutes, such as setting a polling time of 1 minute or 5 minutes; the statistical time period of the polling discrimination task can also be set, such as the discrimination task is executed for a total of ten minutes, and only the execution results from the fourth minute to the fifth minute during the execution of the discrimination task are set to be counted as the second monitoring result for matching determination. In the case of matching the target online rule, operation S309 is performed.

[0062] According to an embodiment of the present invention, in operation S310, an upper limit threshold of the number of polling times can be set. For example, the polling times can be set to 10 times, 20 times or 100 times, etc. After the threshold of the number of polling times is reached, the polling of unstable nodes will be stopped. If the threshold of the number of polling times is not reached, the node will continue to be polled to see whether it meets the online rules.

[0063] In some embodiments of the present invention, in operation S310, an upper limit on the polling time can also be set. For example, regardless of whether the number of polling times reaches the upper limit, if the polling time exceeds 1 hour, 2 hours or 24 hours, polling will be stopped; it can also be set that polling will only be stopped when both the number of polling times and the polling time need to reach a threshold.

[0064] According to an embodiment of the present invention, in operation S311, after reaching the preset threshold of polling, polling of the unstable node is stopped and an alarm prompt is issued. The alarm prompt can be provided to the database user through a preset email, text message, system information, etc. The database user can preset the alarm prompt method in the node monitoring script, such as inserting a script for automatic email reminder, and automatically sending an alarm email to a preset email box after the alarm prompt is generated.

[0065] According to an embodiment of the present invention, after executing offline processing on the node to be processed, it also includes: recording the environmental information of the node to be processed; deleting the monitoring work data of the node to be processed; determining the fault type according to the target offline rule matched by the node to be processed; generating an offline record of the node to be processed, wherein the offline record includes the environmental information and fault type of the node.

[0066] According to an embodiment of the present invention, after the node to be processed is offlined, the environmental information of the node to be processed can also be recorded, such as network status, the network connection status of the node, including whether it is online, network delay, bandwidth, etc.; hardware information, the hardware configuration of the node, such as the central processing unit model, memory size, storage capacity, etc.; software information, the operating system, software version, patch level, etc. running on the node; security status, the security settings of the node, including firewalls, anti-virus software, security protocols, etc.; load status, the current workload of the node, such as CPU usage, memory usage, disk input / output (I / O), etc., as well as system logs, configuration information , geographic location, etc.; delete the monitoring work data of the node to be processed, because the monitoring work data at this time is meaningless and there is no need to retain the monitoring work data; the rule library has a definition of the fault type for each offline rule, which is the fault type specified when writing the node status monitoring script, and finally outputs the fault type and environmental information as an offline record. The offline record can be viewed at any time by the database administrator to manually query the working status of the database, the stability judgment of the node, the number of unstable nodes, etc. The method of the present invention can not only automatically monitor and automatically process the unstable state of the node, but also generate records for viewing.

[0067] According to an embodiment of the present invention, each rule in the rule base includes offline rules, online rules and fault types; the offline rules include the execution time and / or execution results of the monitoring tasks; the online rules include the execution time and / or execution results of the judgment tasks corresponding to the offline rules; the first monitoring results include the execution time and / or execution results of the monitoring tasks; the second monitoring results include the execution time and / or execution results of the judgment tasks corresponding to the target offline rules.

[0068] According to an embodiment of the present invention, the rule base may be embodied by the following Table 1.

[0069] Table 1 Schematic example of rule base content

[0070]

[0071] Among them, the classification of fault types in the table can be reflected in the offline record. The offline rule can be a specific judgment of the execution time and execution result. For example, the execution time is set to a threshold of 60 seconds. When the monitoring task is executed for more than 60 seconds, it is considered to meet the offline rule. The execution result is judged by whether the monitoring task execution result passes or fails to match. For example, the execution result has two results, "1" or "0". Whether it meets the offline rule is judged by whether the result matches. It is also possible to judge whether it meets the offline rule only by the execution time or only by the execution result, and it can be flexibly called and judged according to the preset rule library. The online rule is a corresponding result judgment of the execution result of the judgment task corresponding to the offline rule one by one, for example, it can be a judgment of a specific execution time and execution result. For example, the corresponding judgment task execution time is set to a threshold of 30 seconds. When the execution of the monitoring task is less than 30 seconds, it is considered to meet the online rule. The execution result is judged by whether the execution result passes or fails to match. For example, the execution result has two results, "1" or "0". Whether it meets the online rule is judged by whether the result matches. For example, when the execution result is "1", it is considered that the judgment task is executed successfully, then it is considered to meet the online rule, and the node can be put online. It is also possible to judge whether it meets the online conditions by passing both the execution result and the execution time.

[0072] Figure 4 The flowchart of the node status monitoring matching method according to the embodiment of the present invention is shown. Figure 4 The node status monitoring of the embodiment of the present invention is further described as follows:

[0073] like Figure 4 As shown, the operation of the node status monitoring method further includes operation S401 to operation S408. Figure 4 In the embodiment, operation S402 is substantially the same as the aforementioned operation S202, operation S405 is substantially the same as the aforementioned operation S204, and operation S406 is substantially the same as the aforementioned operation S205, which will not be described in detail herein.

[0074] In some embodiments of the present invention, in operation S401, the time consumption and execution result statistics of the SQL task on all data nodes can be performed according to the monitoring task, and each task issuing node respectively counts the execution results of the tasks issued by each node, and records the execution results in the system table to obtain the first monitoring result. Apply for a memory buffer on each coordination node, which is named memory area 1 here, and is used to receive the first monitoring result after the task is executed on each data node. The memory is divided into blocks according to the number of CPU cores n. In response to the situation where multiple data nodes return execution results concurrently, when each execution node returns the result, the allocation thread allocates which memory area to write to. When allocating the principle, the hash value (hash) of the task number of the execution node is calculated modulo n, and the result obtained is the corresponding memory area.

[0075] In some embodiments of the present invention, the statistical results in the memory can be written into the system table. If one statistic is written, there will be competition pressure for the system table lock and the input and output (I / O) of system resources. To solve this problem, the batch processing principle is adopted. After the pre-allocated memory is full, it is uniformly submitted to the system table to reduce the number of lock applications and the input and output (I / O) interaction pressure. If the memory is not full within 1 minute, the submission is also triggered to ensure the timeliness of the data. The memory data is assembled into a way to add new data (such as "insert values" statement) and inserted into the system table. There are 2 system tables involved. The first system table records the cluster SQL unique identifier, cluster SQL content, and insertion timestamp. The second system table records the execution status of SQL at each node. The record content includes the cluster SQL unique identifier, the data node Internet Protocol Address (IP) address, the data node task number, the execution time, the execution result (success record 1, failure record 0), and the specific information of the execution result.

[0076] According to an embodiment of the present invention, in operation S403, the execution time and execution results of the monitoring tasks in the first monitoring result are compared with the multiple offline rules to determine whether there is a target offline rule that matches the first monitoring result in the multiple offline rules. The first monitoring result is compared with the multiple offline rules one by one, and if a certain offline rule is met, the rule is determined to be the target offline rule for the node, and then the subsequent operations of offline and polling online are performed.

[0077] In some embodiments of the present invention, processing can be added to the existing cluster process. When the executor counts the task execution results, preprocessing calculations are added to write tasks whose execution time is greater than the preset time and whose execution errors meet the preset errors into the memory, which is the first monitoring result.

[0078] In some embodiments of the present invention, round-robin detection can be performed according to a custom detection time. First, it is determined whether there is data in the second system table. If so, an associated query is performed on the second system table and the first system table to filter out nodes and fault categories that meet the fault requirements within the current statistical period.

[0079] In some embodiments of the present invention, in operation S404, if there is a qualified fault environment, the fault node setting can be performed, and the specific setting method is to set it through SQL, such as "set nodestate state='failure' ip=ip1". The SQL operation needs to complete the setting of the cluster node state; record the problem environment information into the first system table, and the record content may include ID and IP information, setting status, fault type, number of detections, and setting time; delete the relevant record data from the first system table and the second system table. The above content is combined into one atomic operation. Unless all three actions are successful, the operation is considered successful, otherwise it is considered an operation failure.

[0080] According to an embodiment of the present invention, in operation S407, the execution time and execution result of the discrimination task corresponding to the second monitoring result and the target online rule are compared to determine whether the second monitoring result matches the target online rule. The second monitoring result is judged and matched with the target online rule corresponding to the determined target offline rule. If it matches, it is considered that the node has met the online conditions and is no longer an unstable node, and the subsequent online operation is performed.

[0081] In some embodiments of the present invention, in operation S408, after the service of the cluster coordination node is started, the recovery thread starts working and performs polling detection according to the polling time of the custom judgment task. First, it is determined whether there is data in the first system table of the system table. If so, it is determined whether the number of detections of the fault reaches the maximum value of the polling according to the fault type. If not, the corresponding judgment task is called. The cluster is responsible for scheduling the task and determines whether to perform online processing based on the returned result. If it returns normal, an online command statement such as "set nodestate state='normal' ip=ip1" is issued, otherwise the number of detections of the corresponding fault in the first system table is increased by 1, and the next polling cycle is continued. The processing logic of setting the online command is to call the cluster state component to set the node state to normal; delete the records related to this IP in the first system table of the system table.

[0082] According to an embodiment of the present invention, the preset tasks, offline rules and online rules are set according to the execution system environment, network environment and hardware conditions of the database where the node to be processed is located.

[0083] According to the embodiments of the present invention, the database execution system environment, such as the operating system, different operating systems have a direct impact on the performance and stability of the database; database version, different versions of database systems may have different performance optimizations and functional characteristics; system configuration, including system resource allocation, such as the number of processes and threads, etc.; network environment, including network architecture, the database server may be located in a local area network (LAN), wide area network (WAN) or cloud environment, and the network architecture has an impact on the database access speed and stability; bandwidth, the network bandwidth determines the data transmission rate and has a direct impact on the read and write performance of the database; delay, network delay affects the response time of database operations, especially in distributed database systems; network Network security, including firewalls, VPNs, encrypted communications, etc., to ensure the security of data transmission; hardware conditions include processors (CPUs), the performance of which directly affects the processing speed and concurrent processing capabilities of the database; memory (RAM), sufficient memory can improve the cache efficiency of the database and reduce disk input and output (I / O) operations; storage devices; storage architecture, such as redundant array of independent disks (RAID) configuration, can provide data redundancy and performance improvement; network interface cards (NICs), high-performance NICs can improve the network processing capabilities of the database server, etc. The rule base of unstable nodes can be set according to the actual usage of the database to obtain an unstable node monitoring solution that is more suitable for this database.

[0084] Figure 5 A structural block diagram of a node status monitoring device according to an embodiment of the present invention is shown.

[0085] like Figure 5 As shown, the node status monitoring device 500 of this embodiment includes a first monitoring module 510 , a first reading module 520 , an offline module 530 , a second monitoring module 540 , a second reading module 550 , and an online module 560 .

[0086] The first monitoring module 510 is used to call the monitoring task to monitor the state stability of the processing node to obtain a first monitoring result. In one embodiment, the first monitoring module 510 can be used to perform the operation S201 described above, which will not be repeated here.

[0087] The first reading module 520 is used to read a plurality of offline rules from the rule base. In one embodiment, the first reading module 520 can be used to perform the operation S202 described above, which will not be described in detail here.

[0088] The offline module 530 is used to perform offline processing on the node to be processed when there is a target offline rule matching the first monitoring result among the multiple offline rules. In one embodiment, the offline module 530 can be used to perform the operation S203 described above, which will not be repeated here.

[0089] The second monitoring module 540 is used to call the discrimination task corresponding to the target offline rule to monitor the offline status of the node to be processed to obtain a second monitoring result. In one embodiment, the second monitoring module 540 can be used to perform the operation S204 described above, which will not be repeated here.

[0090] The second reading module 550 is used to read the target online rule that matches the target offline rule from the rule library. In one embodiment, the second reading module 550 can be used to perform the operation S205 described above, which will not be described in detail here.

[0091] The online module 560 is used to perform online processing on the node to be processed when the second monitoring result matches the target online rule. In one embodiment, the online module 560 can be used to perform the operation S206 described above, which will not be repeated here.

[0092] According to an embodiment of the present invention, any multiple modules among the first monitoring module 510, the first reading module 520, the offline module 530, the second monitoring module 540, the second reading module 550, and the online module 560 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module.

[0093] According to an embodiment of the present invention, at least one of the first monitoring module 510, the first reading module 520, the offline module 530, the second monitoring module 540, the second reading module 550, and the online module 560 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by an appropriate combination of any of them. Alternatively, at least one of the first monitoring module 510, the first reading module 520, the offline module 530, the second monitoring module 540, the second reading module 550, and the online module 560 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0094] According to an embodiment of the present invention, by setting offline rules, online rules, identification tasks and monitoring tasks in the rule base, unstable nodes can be automatically monitored and judged in real time and processed, the work efficiency of database nodes can be improved, and nodes that are unstable but can execute cluster tasks normally can be processed. At the same time, the content in the rule base can be customized according to the software and hardware conditions, network environment and other aspects of the database user, and the threshold of the unstable state can be determined according to its own situation.

[0095] Figure 6 A block diagram of an electronic device for a node status monitoring method according to an embodiment of the present invention is shown.

[0096] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0097] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.

[0098] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0099] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0100] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0101] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the above method provided by the embodiment of the present invention.

[0102] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0103] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0104] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0105] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0106] 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.

[0107] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.

[0108] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A database node status monitoring method, characterized in that: The following operations are included: Calling a monitoring task to perform state stability monitoring on a pending database node to obtain a first monitoring result, wherein the pending database node is a node of a distributed database, and the state stability detection result is stored in a memory buffer and is uniformly submitted to be written into a system table after being filled or every 1 minute to obtain the first monitoring result; Reading multiple offline rules from a rule base, wherein the rule base includes multiple rules, each rule includes an offline rule, an online rule, a discrimination task, a monitoring task and a fault type, and multiple rules have a setting method of whether to take effect; When there is a target offline rule matching the first monitoring result among the multiple offline rules, performing offline processing on the database node to be processed; Calling a discrimination task corresponding to the target offline rule to monitor the offline status of the database node to be processed to obtain a second monitoring result; Reading a target online rule matching the target offline rule from the rule base; Wherein, the offline rule includes the execution time and / or execution result of the monitoring task; the online rule includes the execution time and / or execution result of the discrimination task corresponding to the offline rule; the first monitoring result includes the execution time and / or execution result of the monitoring task; the second monitoring result includes the execution time and / or execution result of the discrimination task corresponding to the target offline rule; When the second monitoring result matches the target online rule, online processing is performed on the database node to be processed, and the cluster where the database node to be processed is located recovers the data of the database node to be processed during the offline period.

2. The method according to claim 1, characterized in that Also includes: In the case where the second monitoring result does not match the target online rule, polling the database node to be processed to determine whether the second monitoring result matches the target online rule; When the polling times reaches a preset upper limit threshold, the polling of the database node to be processed is stopped and an alarm prompt is generated.

3. The method according to claim 1, characterized in that After the offline processing of the database node to be processed is performed, the method further includes: Recording the environment information of the database node to be processed; Deleting the monitoring work data of the database node to be processed; Determine the fault type according to the target offline rule matching the database node to be processed; Generate an offline record of the database node to be processed, wherein the offline record includes environmental information of the database node to be processed and the fault type.

4. The method according to claim 1, characterized in that: Also includes: Comparing the first monitoring result with the execution time and the execution result of the monitoring tasks in the plurality of offline rules to determine whether there is a target offline rule matching the first monitoring result in the plurality of offline rules; The second monitoring result is compared with the execution time and the execution result of the discrimination task corresponding to the target online rule to determine whether the second monitoring result matches the target online rule.

5. The method according to claim 1, characterized in that The monitoring task, the offline rule and the online rule are set according to the execution system environment, network environment and hardware conditions of the database where the database node to be processed is located.

6. A database node status monitoring device, characterized in that: include: A first monitoring module is used to call a monitoring task to perform state stability monitoring on a pending database node to obtain a first monitoring result, wherein the pending database node is a node of a distributed database, and the state stability detection result is stored in a memory buffer and is uniformly submitted to be written into a system table after it is full or every 1 minute to obtain the first monitoring result; A first reading module is used to read multiple offline rules from a rule base, wherein the rule base includes multiple rules, each rule includes an offline rule, an online rule, a discrimination task, a monitoring task and a fault type, and multiple rules have a setting method of whether to take effect; An offline module, configured to execute offline processing on the database node to be processed if there is a target offline rule matching the first monitoring result among the multiple offline rules; A second monitoring module is used to call a discrimination task corresponding to a target offline rule to monitor the offline status of the database node to be processed, and obtain a second monitoring result; A second reading module is used to read a target online rule matching the target offline rule from the rule base; An online module, configured to perform online processing on the database node to be processed when the second monitoring result matches the target online rule; Wherein, the offline rule includes the execution time and / or execution result of the monitoring task; the online rule includes the execution time and / or execution result of the discrimination task corresponding to the offline rule; the first monitoring result includes the execution time and / or execution result of the monitoring task; the second monitoring result includes the execution time and / or execution result of the discrimination task corresponding to the target offline rule; When the second monitoring result matches the target online rule, online processing is performed on the database node to be processed, and the cluster where the database node to be processed is located recovers the data of the database node to be processed during the offline period.

7. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Anormaly detection method and device, electronic equipment, medium and program product

    CN113064834A

  • State adjusting method and device, storage medium and electronic device

    CN116841834A