Database fault diagnosis method, device, host and storage medium

By sending access requests to the database and judging the reception of feedback messages, the problems of low efficiency and misjudgment of database fault detection in the prior art are solved, and faster and more accurate fault detection is achieved.

CN113934608BActive Publication Date: 2025-02-25BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010669710.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-13
Publication Date
2025-02-25
Estimated Expiration
2040-07-13

AI Technical Summary

Technical Problem

The prior art is inefficient in database failure detection, and is prone to misjudgment due to network failure or misdetection, so that database failure cannot be discovered in time.

Method used

By sending an access request to the database, the database accesses the system table and generates a feedback message. If no feedback message is received within the preset time range, a database failure is determined.

Benefits of technology

It improves the efficiency of database failure detection, avoids the problem that external hosts cannot detect database failures in time, and reduces the possibility of false detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934608B_ABST
    Figure CN113934608B_ABST
Patent Text Reader

Abstract

The disclosed embodiments relate to a database fault diagnosis method, device, host and storage medium, which send an access request to the database, so that the database accesses the system table of the database and generates an access request feedback message according to the access request, and if the access request feedback message is not received within a first preset time range, it is determined that the database has a fault. The disclosed embodiments can improve the efficiency of database fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of database technology, and in particular to a database fault diagnosis method, device, host, and storage medium. Background Art

[0002] To address the frequent database unavailability issues, related technologies generally use methods such as collecting memory and disk performance indicators within the container or probing database ports to detect database faults.

[0003] However, due to the way of collecting performance indicators, not only the performance indicators of memory and disk need to be collected inside the container, but also the collected performance indicators need to be sent to the host outside the database. Therefore, there is a problem of low fault detection efficiency. If a network failure occurs, the collected performance indicators may not be sent to the external host in time, resulting in the external host being unable to detect the database failure in time. In addition, the method of detecting the database port generally initiates the repair process as soon as it finds that the database port is blocked, but the port blockage at this time may be caused by a network problem, and there is a problem of false detection. Summary of the invention

[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the embodiments of the present disclosure provide a database fault diagnosis method, device, host and storage medium.

[0005] A first aspect of an embodiment of the present disclosure provides a database fault diagnosis method, the method comprising: sending an access request to a database, so that the database accesses a system table of the database and generates an access request feedback message according to the received access request; if no access request feedback message is received within a first preset time range, determining that the database is faulty.

[0006] A second aspect of an embodiment of the present disclosure provides a database fault diagnosis device, the device comprising:

[0007] The first sending module is used to send an access request to the database, so that the database accesses the system table of the database and generates an access request feedback message according to the received access request.

[0008] The first determination module is configured to determine that a database failure occurs when no access request feedback message is received within a first preset time range.

[0009] A third aspect of an embodiment of the present disclosure provides a host, which includes: a memory and a processor; wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of the first aspect can be implemented.

[0010] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.

[0011] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0012] By sending an access request to the database, the database accesses the system table of the database according to the access request and generates an access request feedback message, so that when the access request feedback message is not received within the first preset time range, it is determined that the system table of the database cannot be accessed and the database fails. Since the embodiment of the present disclosure determines whether the database fails by sending an access request to the database, it is not necessary for the container in the database to collect memory and disk performance indicators, nor is it necessary to wait for the performance indicator collection to be completed before sending the performance indicator to the external host of the database, so it can improve the fault detection efficiency of the database and overcome the problem that the external host cannot detect the database fault in time. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0015] Figure 1 is a flow chart of a database fault diagnosis method provided by an embodiment of the present disclosure;

[0016] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0017] Figure 3 is a flowchart of another database fault diagnosis method provided by an embodiment of the present disclosure;

[0018] Figure 4 is a schematic diagram of another application scenario provided by an embodiment of the present disclosure;

[0019] Figure 5 is a flowchart of another database fault diagnosis method provided by an embodiment of the present disclosure;

[0020] Figure 6 It is a structural schematic diagram of a database fault diagnosis device provided by an embodiment of the present disclosure;

[0021] Figure 7 It is a structural diagram of a host provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0024] In the related art, network failures, service suspension inside the database container, and other reasons may cause relational databases such as cloud service databases to become unavailable. Therefore, in order to ensure the availability of the relational database service (RDS), the related art generally detects database container failures by collecting performance indicators of the memory and disk inside the database container (e.g., remaining space, read / write availability, etc.), and detects the database port by probing the database port.

[0025] Specifically, in the method of collecting memory and disk performance indicators, a service is generally configured in the database container, and the system instructions are executed through the service to obtain the performance indicators of the memory and disk inside the container, and the obtained performance indicators are sent to the host outside the database (referring to a host specially set up for database fault diagnosis outside the host equipped with the database), so that the host outside the database can determine whether the database has failed based on these performance indicators. However, the collection of memory and disk performance indicators takes time, and the performance indicators can only be sent to the external host after the performance indicators are collected, resulting in low efficiency of database fault detection and a long time interval from the occurrence of the fault to the solution. In addition, if a network fault occurs, the collected performance indicators will not be sent to the external host. The external host can only discover the network fault after the network times out, and cannot receive the performance indicators and discover the fault in time, which reduces the real-time nature of fault detection.

[0026] In the method of detecting the database port, the connectivity of the database port can be detected by methods such as the Remote Terminal Protocol (or telent protocol) or the Internet Packet Groper (Ping). If the database port is blocked, the repair process is immediately initiated. However, the blocked port may be caused by a network problem. Therefore, the method of detecting the database port has the problem of false detection.

[0027] In addition, neither the method of probing the database port nor the method of collecting performance indicators can determine whether the fault is at the database level, the host level, or the availability zone level, which is not conducive to troubleshooting. Among them, the availability zone refers to an area containing two or more hosts, each of which is equipped with at least one database.

[0028] In view of the above technical defects in the related technologies, the embodiments of the present disclosure provide a database fault diagnosis solution, which determines whether a database fault occurs by sending an access request to the database and whether an access request feedback message can be received within a preset time range. Since the solution does not require the container in the database to collect memory and disk performance indicators, nor does it need to wait for the performance indicator collection to be completed before sending the performance indicator to the database external host, it can improve the database fault detection efficiency and overcome the problem that the external host cannot detect database faults in time.

[0029] In order to better understand the technical solutions of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure are described below in conjunction with exemplary embodiments.

[0030] For example, Figure 1 1 is a flowchart of a database fault diagnosis method provided by an embodiment of the present disclosure. The method can be exemplarily executed by a host outside the database, and the host can be exemplarily understood as a pre-configured host specifically used for database fault diagnosis. Figure 1 As shown, the method includes:

[0031] Step 101: A host outside a database sends an access request to the database, so that the database accesses a system table of the database and generates an access request feedback message according to the received access request.

[0032] Step 102: If the host outside the database does not receive an access request feedback message within a first preset time range, it is determined that the database is faulty.

[0033] The access request referred to in this embodiment can be exemplarily understood as a system table update request, which includes an update instruction, and the update instruction is used to instruct the database to perform one of the following update operations on the system table: write, modify, and delete.

[0034] In one implementation of this embodiment, a host outside the database may send access requests to different databases simultaneously in an asynchronous manner.

[0035] The following takes the system table update request as an example for explanation.

[0036] For example, Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure, such as Figure 2 As shown, in Figure 2 The illustrated scenario includes a host 22, a host 23, and a host 20. Among them, a database is installed on the host 22 and the host 23, and the database can be exemplarily understood as a cloud service database, but is not limited to a cloud service database. The host 22 and the host 23 are located in the same availability zone 21. The host 20 is equipped with a computer program for performing fault diagnosis on the database. When the computer program is executed, the host 20 performs fault diagnosis operations on the databases on the host 22 and the host 23.

[0037] It can be understood by those skilled in the art that Figure 2 The scenario shown is only an exemplary scenario, and is not all scenarios applicable to this embodiment. In fact, in other scenarios applicable to this embodiment, there may be multiple available zones 21 and hosts 20, and each available zone 21 may include two or more hosts. Each host 20 may be used to perform database fault diagnosis operations on hosts in one or more available zones.

[0038] In this embodiment, when performing database fault diagnosis operations, the host outside the database can send system table update requests to databases on different hosts asynchronously based on different threads, or send system table update requests to databases on different hosts one by one on the same thread. Especially for the case of a large number of databases, the above two methods can also be used in combination. For example, in Figure 2 In the embodiment, host 20 may send system table update requests to the databases on host 22 and host 23 concurrently through different threads, or may send system table update requests to the databases on host 22 and host 23 one by one through the same thread, or when there are other hosts in available zone 21, system table update requests may be sent to the databases on host 22 and host 23 asynchronously through the same thread, and system table update requests may be sent to the databases on other hosts in available zone 21 asynchronously through other threads.

[0039] Furthermore, after receiving the system table update request, the host in the available zone performs the corresponding database operation according to the specific content of the system table update request, and feeds back the operation result as a feedback message of successful update to the host outside the database within the first preset time range. If the corresponding database operation cannot be successfully performed, no message is fed back to the host outside the database, or a message of system table update failure is fed back. The first preset time range can be set as needed, and this embodiment does not limit it. For example, Figure 2 In the example, after receiving the system table update request, the host 23 successfully performs the corresponding database operation (such as a write operation), and then feeds back the database operation result as a feedback message to the host 20 within the first preset time range. Accordingly, after receiving the feedback message from the host 23, the host 20 determines that the database on the host 23 is normal. If the host 22 fails to successfully perform the corresponding database operation, no message of successful update is fed back to the host 20. Since the host 20 fails to receive the feedback message of successful update from the host 22 within the first preset time range, it can be determined that the database fails. The failure at this time may be that the memory and / or disk in the database container cannot be read and written, which belongs to the disk and / or memory failure at the database level.

[0040] Since this embodiment determines whether the database is faulty by sending an access request to the database, it does not require the container in the database to collect memory and disk performance indicators, nor does it need to wait for the performance indicator collection to be completed before sending the performance indicator to the external host of the database. Therefore, it can improve the efficiency of database fault detection and overcome the problem that the external host cannot detect database faults in time. In addition, the asynchronous access method in this embodiment is not restricted by the number of host threads, and can send system table update requests to more databases in a unit time, realize fault diagnosis of more databases, and improve the efficiency of database fault detection in the available zone.

[0041] Figure 3 FIG. 1 is a flowchart of another database fault diagnosis method provided by an embodiment of the present disclosure. Figure 3 As shown, after sending an access request to a database so that the database accesses a system table of the database according to the received access request and before generating an access request feedback message, the method provided in this embodiment may further include the following steps:

[0042] Step 301: A host outside the database detects whether the database receives an access request.

[0043] Step 302: When the host outside the database detects that the database does not receive an access request, it determines that the database is faulty.

[0044] Specifically, in this embodiment, after receiving an access request, the database will feedback a response message to the host outside the database to indicate that the access request has been received. If the host outside the database does not receive the response message within a preset time, it is determined that the database has not received the access request.

[0045] After determining that the database has not received the access request, the host outside the database determines the connection status with the database. If it is in a connected state, it is determined that the database has failed. If it is in a disconnected state, a connection request is sent to the database. If no response information of the database to the connection request is received within the second preset time range, the connection request continues to be sent to the database. If the connection is successfully completed within a third preset time range after the second preset time range, it means that the network failed before. If no response information of the connection request is received within the third preset time range, it is determined that the database has failed.

[0046] For example, Figure 4 is a schematic diagram of another application scenario provided by an embodiment of the present disclosure, such as Figure 4 As shown, the availability zone 41 includes a host 42 and a host 43. The host 40 is used to perform fault diagnosis on the database in the availability zone 41. For information about the host 40, the availability zone 41, and the host 42 and the host 43, please refer to Figure 2 The description of the relevant parts will not be repeated here.

[0047] See also Figure 4 , the host 40 asynchronously sends a connection request to the database on the host in the available zone 41 through different threads or the same thread. If the host in the available zone 41 receives the connection request, it will feedback the corresponding response information to the host 40. If it does not receive the connection request, it will not feedback any message to the host 40. For example, if the host 43 in the available zone 41 receives the connection request, it will feedback the response message to the host 40 within the second preset time range. At this time, the host 40 determines that the port of the database is available. If the host 42 does not receive the connection request, it will not feedback any information to the host 40. The host 40 will not receive the response information of the host 42 within the second preset time range. At this time, the cause of this situation may be a network failure or a database port failure.

[0048] In order to further determine the cause of the fault, the host 40 continues to send a connection request to the host 42 after the second preset time range. If no response information fed back by the host 42 is received within a third preset time range after the second preset time range, it is determined that the port of the database is faulty. On the contrary, if a response information fed back by the host 42 is received within the third preset time range after the second preset time range, the connection request is stopped from being sent to the host 42, and it is determined that the fault is a network fault.

[0049] Of course, the above is only Figure 4 The examples are described as examples and are not intended to be the only limitations of the present disclosure.

[0050] This embodiment sends a connection request to the database, and when no response information to the connection request is received within the second preset time range, continues to send connection requests to the database, thereby determining that the current fault is a database fault when no response information from the database is received within the third preset time range, thereby avoiding misjudgment caused by network failures and improving the accuracy of database fault diagnosis.

[0051] Figure 5 is a flowchart of another database fault diagnosis method provided by an embodiment of the present disclosure, such as Figure 5 As shown, in Figure 1 Based on the embodiment, the method provided in this embodiment may also include the following steps:

[0052] Step 501: A host outside a database sends a performance indicator query request to the database, so that a container in the database queries and feeds back a performance indicator of a storage device in the container according to the performance indicator query request.

[0053] Step 502: A host outside the database receives performance indicators fed back by the database.

[0054] Step 503: The host outside the database determines whether the database fails based on the received performance indicators.

[0055] The method of this embodiment can be used with Figure 1 The method of the embodiment is executed in parallel, and can also be Figure 1 Executed before or after a method is executed.

[0056] The storage device referred to in this embodiment can be understood as a memory and a disk. The performance index of the storage device may include but is not limited to the remaining space of the storage device and whether it is readable and writable.

[0057] After collecting the performance indicators of the storage device, the container in the database sends the performance indicators to the host outside the database through a wired network or a wireless network, so that the host outside the database can determine whether the database is faulty based on the performance indicators of the storage device. For example, when the storage device cannot read or write, or the storage space is full, the database is judged to be faulty.

[0058] For example, when a database failure is determined based on performance indicators and / or based on access requests, a host outside the database can send repair instructions to the database through its own high-availability service program, so that the database performs fault repair according to the repair instructions.

[0059] In addition, considering that fault repair also takes a certain amount of time, in order to avoid repeated repair of the same fault in a short period of time, in some implementations, the time of the last repair can be judged after determining that a database fault has occurred based on performance indicators and / or determining that a database fault has occurred based on a system table update request. For example, a timer can be set to start timing after each repair operation. If the time since the last repair is less than a third preset threshold, the current repair is abandoned; otherwise, the current repair operation is performed.

[0060] This embodiment combines the fault diagnosis method based on access requests with the traditional fault diagnosis method based on performance indicators, comprehensively judges the diagnosis results of the two methods, and initiates fault repair when at least one of the two methods detects a database fault. This can avoid the problems of false detection and missed detection that exist in a single method, improve the accuracy of fault detection, and provide a guarantee for timely troubleshooting.

[0061] The present disclosure also provides a database fault diagnosis method. Based on any of the above embodiments, the method may further include the following steps:

[0062] Step 601: A host outside the database determines whether the failure rate of the database exceeds a first preset threshold. If so, it is determined that a host-level failure has occurred, and step 602 is executed.

[0063] The failure rate of the database refers to the ratio of the number of database failures to the total number of database diagnosis times. The total number of database diagnosis times can be obtained from the metadata of the host outside the database.

[0064] The first preset threshold can be set as needed and is not specifically limited in this embodiment.

[0065] Step 602: A host outside the database outputs a host failure alarm.

[0066] The host here is different from the host outside the database, and refers to the host in the available zone on which the database is loaded, and the failure rate of the database loaded on the host exceeds the first preset threshold.

[0067] Step 603: The host outside the database determines whether the number of failed hosts in the availability zone exceeds a second preset threshold. If so, it is determined that an availability zone-level failure has occurred, and step 604 is executed.

[0068] The value of the second preset threshold can be set as needed and is not limited in this embodiment.

[0069] Step 604: Output an available zone failure alarm.

[0070] The available zone referred to in this embodiment includes two or more hosts, each of which is provided with a database. The host outside the database is used to diagnose the database in the available zone.

[0071] This embodiment can judge host-level failures by judging whether the failure rate of the database exceeds the first preset threshold, and can judge availability zone-level failures by judging whether the number of failed hosts in the availability zone exceeds the second preset threshold. This overcomes the problem that related technologies cannot identify host-level failures and availability zone-level failures.

[0072] Figure 6 is a schematic diagram of the structure of a database fault diagnosis device provided by an embodiment of the present disclosure, such as Figure 6 As shown, the fault diagnosis device 60 includes:

[0073] A first sending module 61 is used to send an access request to a database, so that the database accesses a system table of the database and generates an access request feedback message according to the received access request;

[0074] The first determining module 62 is configured to determine that a database failure occurs when the access request feedback message is not received within a first preset time range.

[0075] In one implementation, the access request includes an update instruction, and the update instruction is used to instruct the database to perform one of the following update operations on the system table: write, modify, and delete.

[0076] In one embodiment, the device 60 may further include:

[0077] The detection module is used to detect whether the database has received the access request.

[0078] The second determination module is used to determine that the database fails when it is detected that the database does not receive the access request.

[0079] In one implementation, the second determining module may include:

[0080] The judging unit is used to judge whether the database is in a connected state when it is detected that the database has not received the access request.

[0081] The first determining unit is used to determine that a database failure occurs when the connection state with the database is established.

[0082] The sending unit is used to send a connection request to the database when it is determined that the database is in a disconnected state; and continue to send the connection request to the database when no response information to the connection request is received within a second preset time range.

[0083] The second determining unit is configured to determine that the database fails when no response information to the connection request is received within a third preset time range after the second preset time range.

[0084] In one embodiment, the device 60 may further include:

[0085] The second sending module is used to send a performance indicator query request to the database, so that the container in the database queries and feeds back the performance indicator of the storage device in the container according to the performance indicator query request.

[0086] The receiving module is used to receive the performance index of the storage device fed back by the database.

[0087] The third determination module is used to determine whether the database is faulty according to the performance indicator.

[0088] In one embodiment, the device 60 may further include:

[0089] The third sending module is used to send a repair instruction to the database when a database fault is determined based on the performance indicator and / or a database fault is determined based on the access request, so that the database performs fault repair according to the repair instruction.

[0090] In one embodiment, the device 60 may further include:

[0091] The first judgment module is used to judge whether the failure rate of the database exceeds a first preset threshold.

[0092] The first output module is used to output a host failure alarm when the failure rate of the database exceeds a first preset threshold.

[0093] The host refers to a host on which the database is loaded, and the failure rate of the database refers to the ratio of the number of failures of the database to the total number of diagnosis times of the database.

[0094] In one embodiment, the device 60 may further include:

[0095] A second judgment module is used to judge whether the number of failed hosts in the available zone exceeds a second preset threshold;

[0096] A second output module, configured to output an availability zone failure alarm when the number of failed hosts in the availability zone exceeds a second preset threshold;

[0097] The available zone refers to an area including two or more hosts, on which databases are installed.

[0098] The device provided in this embodiment can execute the method of any of the above method embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.

[0099] Figure 7 is a schematic diagram of the structure of a host provided by an embodiment of the present disclosure, such as Figure 7 As shown, the host 70 includes: a memory 71 and a processor 72;

[0100] Among them, a computer program is stored in the memory 71. When the computer program is executed by the processor 72, the method of any of the above-mentioned method embodiments is implemented. The execution method and beneficial effects are similar and will not be repeated here.

[0101] The embodiments of the present disclosure also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any of the above method embodiments is implemented. The execution method and beneficial effects thereof are similar and will not be described in detail here.

[0102] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0103] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A database fault diagnosis method, characterized in that: The method comprises: Sending an access request to a database, so that the database accesses a system table of the database and generates an access request feedback message according to the received access request; If the access request feedback message is not received within the first preset time range, determining that the database is faulty; The method further comprises: Determining whether the failure rate of the database exceeds a first preset threshold; If so, a host failure alarm is output; The host refers to a host on which the database is loaded, and the failure rate of the database refers to the ratio of the number of failures of the database to the total number of diagnosis times of the database; Determining whether the number of failed hosts in the available zone exceeds a second preset threshold; If so, an availability zone failure alarm is output; The available zone refers to an area including two or more hosts, on which databases are installed.

2. The method according to claim 1, characterized in that The access request includes an update instruction, and the update instruction is used to instruct the database to perform one of the following update operations on the system table: write, modify, and delete.

3. The method according to claim 1, characterized in that After sending the access request to the database so that the database accesses the system table of the database according to the received access request and before generating an access request feedback message, the method includes: detecting whether the database receives the access request; When it is detected that the database does not receive the access request, it is determined that the database fails.

4. The method according to claim 3, characterized in that The method of determining the database failure when detecting that the database does not receive the access request includes: When it is detected that the database has not received the access request, determining whether the database is in a connected state; Wherein, if yes, it is determined that the database fails; If not, sending a connection request to the database; If no response information to the connection request is received within a second preset time range, continue to send the connection request to the database; If no response information to the connection request is received within a third preset time range after the second preset time range, it is determined that the database fails.

5. The method according to claim 1, characterized in that The method further comprises: Sending a performance indicator query request to the database, so that the container in the database queries and feeds back the performance indicator of the storage device in the container according to the performance indicator query request; receiving a performance indicator of the storage device fed back by the database; It is determined whether the database fails according to the performance indicator.

6. The method according to claim 5, characterized in that The method comprises: If the database fault is determined based on the performance indicator and / or the database fault is determined based on the access request, a repair instruction is sent to the database so that the database performs fault repair according to the repair instruction.

7. A database fault diagnosis device, characterized in that: include: A first sending module, used for sending an access request to a database, so that the database accesses a system table of the database and generates an access request feedback message according to the received access request; A first determining module, configured to determine that the database is faulty when no access request feedback message is received within a first preset time range; A first judgment module, used to judge whether the failure rate of the database exceeds a first preset threshold; A first output module, used for outputting a host failure alarm when the failure rate of the database exceeds a first preset threshold; The host refers to a host on which the database is loaded, and the failure rate of the database refers to the ratio of the number of failures of the database to the total number of diagnosis times of the database; A second judgment module is used to judge whether the number of failed hosts in the available zone exceeds a second preset threshold; A second output module, configured to output an availability zone failure alarm when the number of failed hosts in the availability zone exceeds a second preset threshold; The available zone refers to an area including two or more hosts, on which databases are installed.

8. The device according to claim 7, characterized in that The access request includes an update instruction, and the update instruction is used to instruct the database to perform one of the following update operations on the system table: write, modify, and delete.

9. The device according to claim 7, characterized in that The device also includes: A detection module, used to detect whether the database has received the access request; The second determining module is configured to determine that the database fails when detecting that the database does not receive the access request.

10. The device according to claim 9, characterized in that The second determining module comprises: A judging unit, configured to judge whether the database is in a connected state when detecting that the database has not received the access request; A first determining unit, configured to determine that the database is faulty when the database is in a connected state; A sending unit, configured to send a connection request to the database when it is determined that the database is in a disconnected state; and to continue sending the connection request to the database when no response information to the connection request is received within a second preset time range; The second determining unit is configured to determine that the database is faulty when no response information to the connection request is received within a third preset time range after the second preset time range.

11. The device according to claim 7, characterized in that The device also includes: A second sending module, configured to send a performance indicator query request to the database, so that the container in the database queries and feeds back the performance indicator of the storage device in the container according to the performance indicator query request; A receiving module, used for receiving the performance indicator of the storage device fed back by the database; The third determination module is used to determine whether the database is faulty according to the performance indicator.

12. A host, characterized in that: include: Memory and processor; The memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 6 is implemented.

13. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Database agency method and device

    CN103729373A

  • Service request processing method and device

    CN104539713A

  • Database connection exception handling method and device

    CN109002373A

  • Database maintenance method and system

    WO2019047070A1