Slow query fault detection method and device, electronic equipment and storage medium
By obtaining the log files of the MySQL cluster node and searching using preset search methods, the problems of long processing time and poor accuracy of slow query failures in the existing technology are solved, and the rapid and accurate identification of slow query failures is achieved.
Patent Information
- Application Number
- CN202410990266.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, when dealing with slow query failures of MySQL cluster nodes, it is necessary to manually log in the machine to manually read the log file, resulting in a long processing time and poor retrieval accuracy.
Provide a slow query fault detection method. By obtaining the node address of the slow query alarm, obtaining the node's log file, and searching the log file according to the preset search method to obtain the slow query fault log data, including configuring alarm policies and monitoring nodes Data metrics, intercept and segment log files to achieve fast and accurate fault identification.
It realizes fast and accurate identification of slow query faults, reduces processing time, improves retrieval accuracy, and automates the analysis process of log files.
Smart Images

Figure CN118964125A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a method and device for detecting a slow query failure, an electronic device, and a storage medium. Background Art
[0002] Currently, when a MySQL cluster node has a software failure such as a slow query, a maintenance engineer needs to log in to the cluster node, read the logs at the node where the logs exist, and find the slow query statements that meet the conditions for processing.
[0003] Currently, the industry basically relies on staff to log into the machine, find the log files on the machine, and read them manually, manually screening out whether there are slow query statements that meet the conditions one by one.
[0004] These technical means focus on processing slow query statements, lack analysis and methods for quickly retrieving slow query statements, take a long time to process the problem, and have poor retrieval accuracy. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for detecting a slow query fault, the main purpose of which is to solve the problem of long problem processing time and poor retrieval accuracy.
[0006] According to a first aspect of the present disclosure, a method for detecting a slow query failure is provided, comprising:
[0007] When it is determined that there is a slow query fault alarm, obtaining a node address corresponding to the slow query fault alarm;
[0008] Obtaining a log file of a node corresponding to the node address according to the node address;
[0009] The log file is searched according to a preset search formula to obtain slow query fault log data.
[0010] Optionally, searching the log file according to a preset search formula to obtain the slow query fault log data includes:
[0011] Obtaining the preset search formula; wherein the preset search formula includes a search time period and a search formula;
[0012] According to the retrieval time period, intercept a target log file from the log file;
[0013] The target log file is screened according to the search formula to determine the fault log data that meets the search formula.
[0014] Optionally, after intercepting the target log file from the log file according to the retrieval time period, the method further includes:
[0015] The target log file is segmented according to a preset segmentation method.
[0016] Optionally, when it is determined that there is a slow query fault alarm, before obtaining the node address corresponding to the slow query fault alarm, the method further includes:
[0017] Configure an alarm strategy; wherein the alarm strategy includes at least one of the query times and the times threshold convergence period;
[0018] Get the data indicators of the nodes to be monitored;
[0019] The nodes to be monitored are monitored according to the alarm strategy to determine whether there is a slow query fault alarm.
[0020] Optionally, after searching the log file according to a preset search formula to obtain the slow query fault log data, the method further includes:
[0021] The slow query fault log data is output according to a preset method and pushed to a preset user.
[0022] According to a second aspect of the present disclosure, a slow query failure detection device is provided, comprising:
[0023] A first acquisition unit is used to acquire a node address corresponding to the slow query fault alarm when it is determined that there is a slow query fault alarm;
[0024] A second acquisition unit, configured to acquire a log file of a node corresponding to the node address according to the node address;
[0025] The retrieval unit is used to search the log file according to a preset retrieval formula to obtain slow query fault log data.
[0026] Optionally, the retrieval unit further includes:
[0027] An acquisition module, used to acquire the preset search formula; wherein the preset search formula includes a search time period and a search formula;
[0028] An interception module, used for intercepting a target log file from the log file according to the retrieval time period;
[0029] The screening module is used to screen the target log file according to the search formula to determine the fault log data that meets the search formula.
[0030] Optionally, the device further comprises:
[0031] The segmentation unit is used to segment the target log file according to a preset segmentation method after the interception module intercepts the target log file from the log file according to the retrieval time period.
[0032] Optionally, the device further comprises:
[0033] A configuration unit, configured to configure an alarm strategy before the first acquisition unit acquires the node address corresponding to the slow query fault alarm when determining that there is a slow query fault alarm; wherein the alarm strategy includes at least one of the query times and the times threshold convergence period;
[0034] A third acquisition unit is used to acquire data indicators of the node to be monitored;
[0035] The monitoring unit is used to monitor the monitored node according to the alarm strategy to determine whether there is a slow query fault alarm.
[0036] Optionally, the device further comprises:
[0037] The output unit is used to output the slow query fault log data according to a preset method and push it to a preset user after the retrieval unit retrieves the log file according to a preset retrieval formula to obtain the slow query fault log data.
[0038] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0039] at least one processor; and
[0040] a memory communicatively connected to the at least one processor; wherein,
[0041] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0042] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0043] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
[0044] The present disclosure provides a detection method, device, electronic device and storage medium for slow query faults, and the main technical solutions include: first, when it is determined that there is a slow query fault alarm, obtain the node address corresponding to the slow query fault alarm; second, obtain the log file of the node corresponding to the node address according to the node address; finally, search the log file according to a preset search formula to obtain the slow query fault log data. Compared with the related art, the embodiment of the present application searches the log file of the node where the slow query fault alarm occurs after determining that there is a slow query fault alarm, and inquires whether there is slow query fault log data. Through systematic analysis, the problem of slow query fault alarms existing in log files is solved, and accurate identification of slow query fault alarms is achieved.
[0045] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0047] Figure 1 A flowchart of a method for detecting a slow query failure provided by an embodiment of the present disclosure;
[0048] Figure 2 A schematic diagram of a slow query failure process provided by an embodiment of the present disclosure;
[0049] Figure 3 A schematic diagram of a cluster node log retrieval program provided by an embodiment of the present disclosure;
[0050] Figure 4 A flowchart of a method for detecting a slow query failure provided by an embodiment of the present disclosure;
[0051] Figure 5 A flow chart of a log file retrieval process provided by an embodiment of the present application;
[0052] Figure 6 A schematic diagram of the structure of a slow query fault detection device provided by an embodiment of the present disclosure;
[0053] Figure 7 A schematic diagram of the structure of a slow query fault detection device provided by an embodiment of the present disclosure;
[0054] Figure 8 A schematic block diagram of an exemplary electronic device 600 provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0055] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure 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 disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0056] The following describes a slow query failure detection method, device, electronic device, and storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0057] Figure 1 A flowchart of a method for detecting a slow query failure provided by an embodiment of the present disclosure is provided.
[0058] like Figure 1 As shown, the method comprises the following steps:
[0059] Step 101: When it is determined that a slow query fault alarm exists, obtain a node address corresponding to the slow query fault alarm.
[0060] See also Figure 2 , Figure 2 A schematic diagram of a slow query failure process provided by an embodiment of the present application is shown in FIG. Figure 2 As shown, the node alarm is an alarm on a node in the cluster. The alarm center determines whether the alarm is a slow query alarm. If it is determined to be a slow query alarm, the log retrieval program is started.
[0061] In some embodiments, an alarm rule is first configured in the cluster node, that is, when an alarm occurs in the cluster node, it is determined through the alarm rule whether the alarm is a slow query fault.
[0062] In some embodiments, the alarm rules include parameters such as the aggregation method of the number of slow queries, the aggregation period, the threshold, etc.
[0063] In some embodiments, relevant information of the faulty node may be included in the fault alarm, that is, the node address may be obtained in the slow query fault alarm.
[0064] Step 102: Obtain a log file of a node corresponding to the node address according to the node address.
[0065] After determining the node address corresponding to the slow query fault alarm, obtain the log file of the node corresponding to the node address; first determine the operating system of the target node, and determine the corresponding log file path and format according to different operating systems.
[0066] Step 103: search the log file according to a preset search formula to obtain slow query fault log data.
[0067] See also Figure 3 , Figure 3 A schematic diagram of a cluster node log retrieval program provided in an embodiment of the present application, such as Figure 3 As shown, first, a preset search formula is created in advance, and the slow query fault log data is filtered out by the preset search formula. The preset search formula at least includes specific keywords, regular expressions, and log time.
[0068] After reading the log file of the alarm node, the log file is searched by a preset search formula to determine the log data containing the content in the search formula and retain it; when retaining the log file, it can be retained by line or segment, which can be set according to actual needs, and the embodiment of the present application does not limit this. The retrieved slow query fault log data can be recorded, and a report can be generated or further measures can be taken to solve the slow query problem as needed.
[0069] The present invention discloses a method for detecting a slow query fault, and the main technical scheme includes: first, when it is determined that there is a slow query fault alarm, obtaining the node address corresponding to the slow query fault alarm; second, obtaining the log file of the node corresponding to the node address according to the node address; finally, searching the log file according to a preset search formula to obtain the slow query fault log data. Compared with the related art, the embodiment of the present application searches the log file of the node where the slow query fault alarm occurs after determining that there is a slow query fault alarm, and inquires whether there is slow query fault log data. Through systematic analysis, the problem of slow query fault alarms existing in log files is solved, and accurate identification of slow query fault alarms is achieved.
[0070] In some embodiments, see Figure 4 , Figure 4 A flowchart of a method for detecting a slow query failure provided by an embodiment of the present disclosure includes:
[0071] Step 201, obtaining the preset search formula; wherein the preset search formula includes a search time period and a search formula.
[0072] See also Figure 5 , Figure 5 A flow chart of a log file retrieval process provided by an embodiment of the present application is as follows: Figure 5As shown, first obtain a preset search formula, which includes a query time period, query condition parameters, etc.; in actual applications, the search time period can be set according to the time when the slow query failure occurs, such as setting it to the log data of the day before the slow query failure, etc. Specifically, the embodiments of the present application are not limited to this.
[0073] The query condition parameters include search terms, such as keywords, specific data values, etc. When performing a query, the relationship between the search terms can be a union relationship, or an or relationship. Specifically, the embodiments of the present application do not limit this.
[0074] Step 202: extract a target log file from the log file according to the search time period.
[0075] In some embodiments, the retrieval time period includes two time points, one is a start time and the other is an end time.
[0076] First, search for the log start time, and start searching from the first line of the log file for a timestamp that is the same as the start time keyword key1, and continue searching until the end of the file. If no log timestamp is found that is the same as the start timestamp, directly return the log that is earlier than the query time. If a log with the same timestamp is found, store the index in the startind variable.
[0077] Start searching from the first line of the log file for a timestamp that is the same as the end time keyword key2, and continue searching until the end of the file. If no log timestamp is found that is the same as the end timestamp, the log record with the end time exceeding the timestamp is directly returned. If a log with the same timestamp is found, the index is stored in the endind variable.
[0078] Step 203 , screening is performed in the target log file according to the search formula to determine fault log data that meets the search formula.
[0079] In some embodiments, before executing this step, the target log file is first segmented according to a preset segmentation method.
[0080] Store all the contents of the file from index startind to endind in temlog, and then split the target log file into lines of data according to the log format. Then start matching conditions. For example, if you want to retrieve the log content with a log record greater than the input parameter querytime within the time period, match the keyword Querytime from the first line in the temlog log, and then save all the records that meet the conditions and are greater than the input parameter querytime. Then print out the final result. If it does not exist, return the log that does not meet the query condition.
[0081] In some embodiments, when it is determined that there is a slow query fault alarm, before obtaining the node address corresponding to the slow query fault alarm, the method further includes:
[0082] Configure an alarm strategy; wherein the alarm strategy includes at least one of the query times and the times threshold convergence period;
[0083] Get the data indicators of the nodes to be monitored;
[0084] The nodes to be monitored are monitored according to the alarm strategy to determine whether there is a slow query fault alarm.
[0085] First, in the alarm center, use the plug-in cw_mysql_exporter to collect various indicators of the MySQL database, including the indicators related to slow queries involved in this article. The indicator name is: mysql_exporter_slow_queries;
[0086] Send down the collection, and send the corresponding plug-in script to the database server that needs to be monitored and collected; configure the alarm strategy as needed, such as setting more than 300 slow queries per minute, which will trigger the corresponding alarm; and the monitoring scope of slow query failures, such as how many monitoring targets are there, how long the monitoring cycle is, etc. Specifically, the embodiments of this application do not limit this.
[0087] In some embodiments, after searching the log file according to a preset search formula to obtain the slow query fault log data, the method further includes:
[0088] The slow query fault log data is output according to a preset method and pushed to a preset user.
[0089] Corresponding to the above slow query fault detection method, the present invention also provides a slow query fault detection device. Since the device embodiment of the present invention corresponds to the above method embodiment, details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be repeated in the present invention.
[0090] Figure 6 A schematic diagram of a slow query fault detection device provided by an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, including:
[0091] A first acquisition unit 31 is used to acquire a node address corresponding to the slow query fault alarm when it is determined that there is a slow query fault alarm;
[0092] A second acquisition unit 32 is used to acquire a log file of a node corresponding to the node address according to the node address;
[0093] The retrieval unit 33 is used to search the log file according to a preset retrieval formula to obtain slow query fault log data.
[0094] The present invention discloses a detection device for a slow query fault, and the main technical scheme includes: first, when it is determined that there is a slow query fault alarm, the node address corresponding to the slow query fault alarm is obtained; second, the log file of the node corresponding to the node address is obtained according to the node address; finally, the log file is searched according to a preset search formula to obtain the slow query fault log data. Compared with the related art, the embodiment of the present application searches the log file of the node where the slow query fault alarm occurs after determining that there is a slow query fault alarm, and inquires whether there is slow query fault log data. Through systematic analysis, the problem of slow query fault alarms existing in log files is solved, and accurate identification of slow query fault alarms is achieved.
[0095] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the retrieval unit 33 also includes:
[0096] The acquisition module 331 is used to acquire the preset search formula; wherein the preset search formula includes a search time period and a search formula;
[0097] An interception module 332 is used to intercept a target log file from the log file according to the retrieval time period;
[0098] The screening module 333 is used to screen the target log file according to the search formula to determine the fault log data that meets the search formula.
[0099] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the device also includes:
[0100] The segmentation unit 34 is configured to segment the target log file according to a preset segmentation method after the interception module intercepts the target log file from the log file according to the retrieval time period.
[0101] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the device also includes:
[0102] The configuration unit 35 is used to configure an alarm strategy before the first acquisition unit 31 acquires the node address corresponding to the slow query fault alarm when determining that there is a slow query fault alarm; wherein the alarm strategy includes at least one of the query times and the times threshold convergence period;
[0103] The third acquisition unit 36 is used to acquire data indicators of the node to be monitored;
[0104] The monitoring unit 37 is used to monitor the monitored node according to the alarm strategy to determine whether there is a slow query fault alarm.
[0105] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the device also includes:
[0106] The output unit 38 is used to output the slow query fault log data in a preset manner and push it to a preset user after the retrieval unit 33 retrieves the log file according to a preset retrieval formula to obtain the slow query fault log data.
[0107] It should be noted that the above explanation of the method embodiment is also applicable to the device of the embodiment of the present disclosure, and the principle is the same, which is no longer limited in the embodiment of the present disclosure.
[0108] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0109] Figure 8 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0110] like Figure 8 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 to a RAM (Random Access Memory) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.
[0111] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0112] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a method for detecting a slow query fault. For example, in some embodiments, the method for detecting a slow query fault may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the aforementioned slow query failure detection method in any other appropriate manner (for example, by means of firmware).
[0113] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0115] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory) or a flash memory, an optical fiber, a CD-ROM (Compact Dis sc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0118] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0119] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0121] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for detecting a slow query failure, characterized in that: include: When it is determined that there is a slow query fault alarm, obtaining a node address corresponding to the slow query fault alarm; Obtaining a log file of a node corresponding to the node address according to the node address; The log file is searched according to a preset search formula to obtain slow query fault log data.
2. The method according to claim 1, characterized in that The searching of the log file according to the preset search formula to obtain the slow query fault log data includes: Obtaining the preset search formula; wherein the preset search formula includes a search time period and a search formula; According to the retrieval time period, intercept a target log file from the log file; The target log file is screened according to the search formula to determine the fault log data that meets the search formula.
3. The method according to claim 2, characterized in that After intercepting the target log file from the log file according to the retrieval time period, the method further includes: The target log file is segmented according to a preset segmentation method.
4. The method according to claim 1, characterized in that: When it is determined that there is a slow query fault alarm, before obtaining the node address corresponding to the slow query fault alarm, the method further includes: Configure an alarm strategy; wherein the alarm strategy includes at least one of the query times and the times threshold convergence period; Get the data indicators of the nodes to be monitored; The nodes to be monitored are monitored according to the alarm strategy to determine whether there is a slow query fault alarm.
5. The method according to any one of claims 1 to 4, characterized in that After searching the log file according to a preset search formula to obtain the slow query fault log data, the method further includes: The slow query fault log data is output according to a preset method and pushed to a preset user.
6. A slow query fault detection device, characterized in that: include: A first acquisition unit is used to acquire a node address corresponding to the slow query fault alarm when it is determined that there is a slow query fault alarm; A second acquisition unit, configured to acquire a log file of a node corresponding to the node address according to the node address; The retrieval unit is used to search the log file according to a preset retrieval formula to obtain slow query fault log data.
7. The device according to claim 6, characterized in that The retrieval unit also includes: An acquisition module, used to acquire the preset search formula; wherein the preset search formula includes a search time period and a search formula; An interception module, used for intercepting a target log file from the log file according to the retrieval time period; The screening module is used to screen the target log file according to the search formula to determine the fault log data that meets the search formula.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
