CN116225818A - Arbitration service monitoring method and device for database, monitoring equipment and storage medium - Google Patents
Arbitration service monitoring method and device for database, monitoring equipment and storage medium Download PDFInfo
- Publication number
- CN116225818A CN116225818A CN202111465611.XA CN202111465611A CN116225818A CN 116225818 A CN116225818 A CN 116225818A CN 202111465611 A CN202111465611 A CN 202111465611A CN 116225818 A CN116225818 A CN 116225818A
- Authority
- CN
- China
- Prior art keywords
- arbitration
- service
- log file
- detection
- filtering
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3072—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Databases & Information Systems (AREA)
- Mathematical Physics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses an arbitration service monitoring method, an arbitration service monitoring device, monitoring equipment and a storage medium of a database. Wherein the method performed by the monitoring device comprises: performing service detection and arbitration object detection for the monitored arbitration service to obtain detection information; outputting the detection information to a log file; filtering the log file to obtain a filtering result; and determining the state of the arbitration service according to the filtering result. The method can monitor the arbitration service of the database running on line in real time, so that technicians can timely acquire the running condition of the arbitration service, and the current situation that adverse effects are caused to the running of the database due to incapability of timely acquiring and processing the data in the first time after faults occur is avoided; the algorithm is simple, and the practicability is strong; greatly improving the high availability and stability of the database.
Description
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method, an apparatus, a monitoring device, and a storage medium for monitoring an arbitration service of a database.
Background
In some business fields with high demands on data availability, a database for providing support for a business generally adopts an HA (High Availability ) architecture, for example, an MHA (Master HA, a high availability tool) component is used to match with a MySQL database, and a large amount of real-time business data is stored in the database.
The high-availability architecture database generally uses an arbitration service, and the arbitration service is responsible for switching node roles of all database nodes of the database, so that good operation of the arbitration service is a fundamental guarantee for guaranteeing availability and stability of the database, if the arbitration service fails and cannot be found and processed in time, great hidden danger is caused to the database, such as data loss, the database cannot provide service for external applications, even front-end application paralysis of the connected database is caused, and the like.
However, in the prior art, if an abnormality occurs in the arbitration service, the first time cannot be recovered, so that the stability of the database operation cannot be ensured.
Disclosure of Invention
The embodiment of the application provides an arbitration service monitoring method, an arbitration service monitoring device and a storage medium for a database, so that the arbitration service is monitored at regular time, and the stable operation of the arbitration service is ensured, thereby realizing the high availability and stability of the database.
The embodiment of the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for monitoring an arbitration service of a database, performed by a monitoring device, including: performing service detection and arbitration object detection for the monitored arbitration service to obtain detection information; outputting the detection information to a log file; filtering the log file to obtain a filtering result; and determining the state of the arbitration service according to the filtering result.
In some embodiments, the service detection comprises: and detecting the running state of an arbitration process of the arbitration service.
In some embodiments, the arbitration object detection includes: detecting the connection state of the detection activity of the database node.
In some embodiments, the arbitration object detection includes: the data replication state of the database node is detected.
In some embodiments, the filtering the log file to obtain a filtering result includes: filtering the log file based on a log filtering rule containing keywords, and taking the occurrence times of each keyword in the log file as a filtering result; wherein the keywords include: and the first keyword is used for representing the normal service, and the second keyword is used for representing the normal arbitration object.
In some embodiments, the performing service detection and arbitration object detection for the monitored arbitration service includes: performing service detection and arbitration object detection in a first period; the outputting the detection information to the log file comprises: writing detection information in the log file in an overlaying manner; the filtering the log file includes: filtering the log file in a first period; the determining the state of the arbitration service according to the filtering result comprises: if any one of the keywords appears in the log file for 0 times, determining that the state of the arbitration service is abnormal.
In some embodiments, the performing service detection and arbitration object detection for the monitored arbitration service includes: performing service detection and arbitration object detection in a first period; the outputting the detection information to the log file comprises: writing detection information in the log file in a new mode; the filtering the log file includes: filtering the log file in a second period; the determining the state of the arbitration service according to the filtering result comprises: calculating the number of times of each keyword in the second period in the log file, and the difference value of the number of times of the corresponding keyword in the last second period in the log file; if the difference value corresponding to any keyword is not matched with the preset value, determining that the state of the arbitration service is abnormal; the preset value is determined according to the cycle length of the first cycle and the cycle length of the second cycle.
In a second aspect, an embodiment of the present application further provides an arbitration service monitoring apparatus for a database, where the apparatus is applied to a monitoring device, and the method is used to implement any one of the foregoing methods.
In some embodiments, an arbitration service monitoring device of a database includes: the detection unit is used for executing service detection and arbitration object detection aiming at the monitored arbitration service to obtain detection information; the output unit is used for outputting the detection information to a log file; the filtering unit is used for filtering the log file to obtain a filtering result; and the determining unit is used for determining the state of the arbitration service according to the filtering result.
In some embodiments, the detecting unit is configured to detect an operation state of an arbitration process of the arbitration service.
In some embodiments, the detection unit is configured to detect a connection state of the database node.
In some embodiments, the detection unit is configured to detect a data replication state of the database node.
In some embodiments, the filtering unit is configured to filter the log file based on a log filtering rule including keywords, and take the number of times each keyword appears in the log file as a filtering result; wherein the keywords include: and the first keyword is used for representing the normal service, and the second keyword is used for representing the normal arbitration object.
In some embodiments, the detection unit is configured to perform service detection and arbitration object detection in a first period; an output unit for writing detection information in the log file in an overlay manner; the filtering unit is used for filtering the log file in a first period; and the determining unit is used for determining that the state of the arbitration service is abnormal if the number of times of occurrence of any keyword in the log file is 0.
In some embodiments, the detection unit is configured to perform service detection and arbitration object detection in a first period; the output unit is used for writing detection information in the log file in a new mode; a filtering unit, configured to filter the log file in a second period; the determining unit is used for calculating the number of times of each keyword in the second period in the log file and the difference value of the number of times of the corresponding keyword in the last second period in the log file; if the difference value corresponding to any keyword is not matched with the preset value, determining that the state of the arbitration service is abnormal; the preset value is determined according to the cycle length of the first cycle and the cycle length of the second cycle.
In a third aspect, an embodiment of the present application further provides a monitoring device, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium storing one or more programs that, when executed by a monitoring device comprising a plurality of application programs, cause the monitoring device to perform any of the methods described above.
The above-mentioned at least one technical scheme that this application embodiment adopted can reach following beneficial effect: by detecting the arbitration service and determining the state of the arbitration service based on the obtained detection information, the real-time monitoring of the arbitration service of the database running on the line can be realized, so that technicians can timely acquire the running condition of the arbitration service, and the current situation that the running of the database is adversely affected due to the fact that the first time cannot be acquired and cannot be timely processed after the failure occurs is avoided; the algorithm is simple, and the practicability is strong; greatly improving the high availability and stability of the database.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow chart of an arbitration service monitoring method for a database according to one embodiment of the present application;
FIG. 2 is a schematic diagram of an arbitration service monitoring device of a database according to one embodiment of the present application;
fig. 3 is a schematic structural diagram of a monitoring device in an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The high availability technology will be briefly described. Taking MHA as an example, it supports multiple architecture forms, here taking a one master two slave architecture as an example, at least three database servers are needed in the cluster, one serving as master and two serving as slave. The nodes herein are all database nodes.
When the main node fault is monitored, the arbitration service of the MHA can promote the slave node with the latest data to become a new main node, so that the slave node completes one-time node role switching. In addition, MHA supports manual switching node roles.
It can be seen that although the arbitration service can ensure high availability of the master-slave node, high availability of the arbitration service itself cannot be ensured. If the arbitration service fails, the switching work between the nodes cannot be successfully completed, for example, if the master node fails, the master node cannot be successfully switched to one of the slave nodes, the data before the failure is removed is lost, and the external application or service depending on the database may not be performed.
Aiming at the problem, when the arbitration service is in an on-line running state, health check commands are manually executed by operation and maintenance personnel so as to display the health state of the arbitration service, and the method has the advantages of higher labor cost, longer time consumption and easiness in missing part of health state information content; on the other hand, health information cannot be automatically output in real time, and if the arbitration process is abnormal, the arbitration process cannot be timely recovered at the first time, so that adverse effects are caused on the business of the database depending on the arbitration service.
In view of this, the embodiment of the application provides a method for monitoring an arbitration service of a database, which can detect the arbitration service according to detection requirements so as to acquire the health state of the arbitration service at the first time, thereby guaranteeing high availability and stability of the database.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flowchart of an arbitration service monitoring method of a database according to an embodiment of the present application. As can be seen from fig. 1, the method performed by the monitoring device comprises at least the following steps S110 to S140.
In step S110, service detection and arbitration object detection are performed for the monitored arbitration service, resulting in detection information.
In the embodiment of the application, the monitoring of the arbitration service is performed from two aspects of the arbitration service and the arbitration object, the service detection can monitor whether the operation of the arbitration service is normal, and one of the functions of the arbitration service is to perform node role switching on the database nodes and rely on the cooperation of the database nodes, so that the detection of the database nodes which are the arbitration object is also required.
Step S120, outputting the detection information to a log file.
In the embodiment of the application, the log file is used as a carrier medium of the detection information, so that the output of the detection information and the subsequent steps to be executed can be decoupled, and the detection of the arbitration service and the subsequent determination of the state of the arbitration service can be executed asynchronously, such as by using an asynchronous thread.
And step S130, filtering the log file to obtain a filtering result. For example, filtering may be performed by way of regular expressions.
And step S140, determining the state of the arbitration service according to the filtering result.
Therefore, the method shown in fig. 1 can realize real-time monitoring of the arbitration service of the database running on the line by detecting the arbitration service and determining the state of the arbitration service based on the obtained detection information, so that technicians can know the running condition of the arbitration service in time, and the current situation that adverse effects are caused to the running of the database due to incapability of first time acquisition and incapability of timely processing after faults occur is avoided; the algorithm is simple, and the practicability is strong; greatly improving the high availability and stability of the database.
In some embodiments, the service detection comprises: and detecting the running state of an arbitration process of the arbitration service.
If the arbitration process is not running, the arbitration service cannot perform node role switching on the database node, and the arbitration function is lost, so if the running state of the arbitration process is abnormal, the state of the arbitration service is also abnormal. In addition, the command supported by the high-availability component can be utilized to detect the arbitration process, so that the convenience is good.
In some embodiments, the arbitration object detection includes: detecting the connection state of the detection activity of the database node.
The arbitration service can switch according to the state of the database node in addition to realizing manual switching in response to instructions of operation staff. This also requires that the arbitration service be able to learn the state of the data node, i.e., probe the database node.
The probe activity is typically implemented in dependence on a probe activity connection, and an arbitration service is generally required to implement the probe activity connection based on a security protocol, such as SSH (Secure Shell) protocol. Thus, whether the probe connection state is normal may be determined by whether the security protocol state of the database node is normal. For example, the MHA supports an input command to perform SSH detection, which may specifically be to detect whether SSH login was successful.
In some embodiments, the arbitration object detection includes: the data replication state of the database node is detected.
As described above, the database is highly available and requires the deployment of master and slave nodes, and the slave nodes need to copy data from the master node, so if there is an abnormal data copy state of the database nodes, the arbitration service should perform switching of node roles, for example, switching the slave node to the master node, switching the node with the abnormal copy state to the unavailable node, and so on. If there is a data replication state abnormality of the database node, but the arbitration service does not perform the node role switch, it is indicated that the arbitration service fails to implement the intended function, and the state abnormality of the arbitration service should be recognized.
In some embodiments, the filtering the log file to obtain a filtering result includes: filtering the log file based on a log filtering rule containing keywords, and taking the occurrence times of each keyword in the log file as a filtering result; wherein the keywords include: and the first keyword is used for representing the normal service, and the second keyword is used for representing the normal arbitration object.
For example, a cat command may be used to connect to a log file, filtering by grep command and specifying a key, counting the number of lines that the key appears by wc-l command, and thus obtaining the number of times the key appears in the log file. In particular, it may be implemented with shell scripts.
As shown in the foregoing embodiment, when the arbitration object is detected, the state of the probe connection of the database node may be detected, and the state of the data replication of the database node may also be detected, and then the second key may include a key that characterizes that the probe connection is normal, and may also include a key that characterizes that the data replication is normal.
In some embodiments, service detection may be performed first, and in the case that service detection is normal, arbitration object detection is performed again, so as to reduce an influence on a database node and improve a utilization rate of a service on the database node.
In some embodiments, the performing service detection and arbitration object detection for the monitored arbitration service includes: performing service detection and arbitration object detection in a first period; the outputting the detection information to the log file comprises: writing detection information in the log file in an overlaying manner; the filtering the log file includes: filtering the log file in a first period; the determining the state of the arbitration service according to the filtering result comprises: if any one of the keywords appears in the log file for 0 times, determining that the state of the arbitration service is abnormal.
In the embodiment of the present application, the content of the detection information may be a string that characterizes the detection of the normal or abnormal condition, or may be a string that merely indicates the detection of the normal condition, and the detection information having the content is not output when the detection of the abnormal condition is performed, that is, the detection information is null. Writing the log file in an overlay mode means that whether the content of the detection information is empty or not, the content in the original log file is erased, so that if the detection is carried out once and the keyword representing that the corresponding detection item is normal does not appear in the log file, the result of the detection item can be deduced to be abnormal, and the state of the arbitration service is determined to be abnormal. It should be noted that if one type of keyword (the first keyword or the second keyword) includes a plurality of keywords (for example, the second keyword may include a keyword indicating that the probe connection is normal and a keyword indicating that the data copy is normal), it may be determined that the state of the arbitration service is abnormal as long as one keyword does not occur.
In some embodiments, the performing service detection and arbitration object detection for the monitored arbitration service includes: performing service detection and arbitration object detection in a first period; the outputting the detection information to the log file comprises: writing detection information in the log file in a new mode; the filtering the log file includes: filtering the log file in a second period; the determining the state of the arbitration service according to the filtering result comprises: calculating the number of times of each keyword in the second period in the log file, and the difference value of the number of times of the corresponding keyword in the last second period in the log file; if the difference value corresponding to any keyword is not matched with the preset value, determining that the state of the arbitration service is abnormal; the preset value is determined according to the cycle length of the first cycle and the cycle length of the second cycle.
In these embodiments, the log file is not overwritten but is newly added with the detection information. Thus, the cycle length of the first cycle used for both types of detection performed for the arbitration service may be the same or different from the cycle length of the second cycle of the filter log file, which may be an integer multiple of the cycle length of the first cycle.
For two consecutive second periods, the number of occurrences of each key in the log file may be counted at the end of each second period.
For example, with 5s as a first period, service detection and arbitration object detection are performed once every 5s, if both the service detection and the arbitration object detection are normal, detection information indicating that the service detection is normal and detection information indicating that the arbitration object detection is normal are written in the log file, and if one item of detection is abnormal, the corresponding detection information is not written. If 5s is taken as a second period, it can be known that if the arbitration service is normal, the obtained difference should be 1, i.e. the preset value is 1; if 10s is a second period, the preset value is 2, and so on.
In the case that the step S110 and the step S120 are executed by using the first thread, the step S130 and the step S140 are executed by using the second thread, and the first period and the second period may be sleep periods of the first thread and the second thread, respectively, and by reasonably setting the periods, the second thread does not need to communicate with the first thread all the time, and does not need to wait for the running state of the first thread, and the first thread and the second thread may be independent from each other. However, in the overall sequence, it is shown that the detection information is obtained and outputted through the steps S110 and S120, and then the state of the arbitration service is determined through the steps S130 and S140.
In some embodiments of the present application, when it is determined that the status of the arbitration service is abnormal, alarm information may be further generated, and an alarm is performed according to the alarm information by calling an alarm module or the like.
In order to enable a technician to quickly know that the arbitration service is abnormal or faulty, further know the fault type of the arbitration service, the reason of the fault, and the like, alarm information can be generated according to the filtering result. For example, if the first keyword is absent, an alarm message of "the arbitration process does not normally run" may be generated, and then the alarm module may be called, so that the alarm module informs the relevant technician of the failure of the arbitration service, including, but not limited to, means such as sending a short message to the relevant technician; the alarm module can also be connected with an audible and visual alarm, and can give an alarm in the modes of sounding, controlling lamplight to flash and the like under the condition that the state of the arbitration service is abnormal. The alarm module can be set as alarm modules of different departments or different levels according to requirements, such as a general basic alarm module of a company, a door alarm module and the like. In addition, the alarm module can be multiplexing the existing alarm module, and specifically, the existing alarm module can be called through an API interface; the alarm module may also be set separately for the arbitration service, which is not limited in this application.
In some embodiments of the present application, the above-described methods may be implemented based on any of the existing programming languages, such as perl or python.
The embodiment of the application also provides an arbitration service monitoring device of the database, which is applied to monitoring equipment and is used for realizing any one of the methods.
Fig. 2 shows a schematic structural diagram of an arbitration service monitoring device of a database according to an embodiment of the present application. As shown in fig. 2, the arbitration service monitoring means 200 of the database includes:
a detection unit 210, configured to perform service detection and arbitration object detection for the monitored arbitration service, to obtain detection information; an output unit 220 for outputting the detection information to a log file; a filtering unit 230, configured to filter the log file to obtain a filtering result; a determining unit 240, configured to determine a state of the arbitration service according to the filtering result.
In some embodiments, the detecting unit 210 is configured to detect an operation state of an arbitration process of the arbitration service.
In some embodiments, the detecting unit 210 is configured to detect a connection state of a database node.
In some embodiments, the detecting unit 210 is configured to detect a data replication status of a database node.
In some embodiments, the filtering unit 230 is configured to filter the log file based on a log filtering rule including keywords, and take the number of times each keyword appears in the log file as a filtering result; wherein the keywords include: and the first keyword is used for representing the normal service, and the second keyword is used for representing the normal arbitration object.
In some embodiments, the detecting unit 210 is configured to perform service detection and arbitration object detection in a first period; an output unit 220 for writing the detection information in the log file in an overwrite manner; a filtering unit 230, configured to filter the log file with a first period; a determining unit 240, configured to determine that the state of the arbitration service is abnormal if the number of occurrences of any one of the keywords in the log file is 0.
In some embodiments, the detecting unit 210 is configured to perform service detection and arbitration object detection in a first period; an output unit 220 for writing detection information in the log file in a newly added manner; a filtering unit 230 for filtering the log file in a second period; a determining unit 240, configured to calculate a difference between a number of times each keyword appears in the log file in the second period and a number of times each corresponding keyword appears in the log file in the previous second period; if the difference value corresponding to any keyword is not matched with the preset value, determining that the state of the arbitration service is abnormal; the preset value is determined according to the cycle length of the first cycle and the cycle length of the second cycle.
It can be understood that the above-mentioned arbitration service monitoring apparatus for a database can implement each step of the arbitration service monitoring method for a database executed by the monitoring device provided in the foregoing embodiment, and the relevant explanation about the arbitration service monitoring method for a database is applicable to the arbitration service monitoring apparatus for a database, which is not described herein.
Fig. 3 is a schematic structural view of a monitoring device according to an embodiment of the present application. Referring to fig. 3, at the hardware level, the monitoring device includes a processor, and optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the monitoring device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 3, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory to the memory and then runs, and forms an arbitration service monitoring device of the database on a logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
performing service detection and arbitration object detection for the monitored arbitration service to obtain detection information; outputting the detection information to a log file; filtering the log file to obtain a filtering result; and determining the state of the arbitration service according to the filtering result.
The method performed by the arbitration service means of the database disclosed in the embodiment shown in fig. 3 of the present application may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The monitoring device may also execute the method executed by the arbitration service monitoring device of the database in fig. 1, and implement the function of the arbitration service monitoring device of the database in the embodiment shown in fig. 2, which is not described herein again.
The embodiments of the present application also provide a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by a monitoring device including a plurality of application programs, enable the monitoring device to perform a method performed by an arbitration service monitoring apparatus of a database in the embodiment shown in fig. 1, and specifically configured to perform:
performing service detection and arbitration object detection for the monitored arbitration service to obtain detection information; outputting the detection information to a log file; filtering the log file to obtain a filtering result; and determining the state of the arbitration service according to the filtering result.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.
Claims (10)
1. An arbitration service monitoring method of a database, which is executed by a monitoring device, wherein the method comprises:
performing service detection and arbitration object detection for the monitored arbitration service to obtain detection information;
outputting the detection information to a log file;
filtering the log file to obtain a filtering result;
and determining the state of the arbitration service according to the filtering result.
2. The method of claim 1, wherein the service detection comprises: and detecting the running state of an arbitration process of the arbitration service.
3. The method of claim 1, wherein the arbitration object detection comprises: detecting the connection state of the detection activity of the database node.
4. The method of claim 1, wherein the arbitration object detection comprises: the data replication state of the database node is detected.
5. The method of claim 1, wherein the filtering the log file to obtain a filtered result comprises:
filtering the log file based on a log filtering rule containing keywords, and taking the occurrence times of each keyword in the log file as a filtering result;
wherein the keywords include: and the first keyword is used for representing the normal service, and the second keyword is used for representing the normal arbitration object.
6. The method of claim 5, wherein the performing service detection and arbitration object detection for the monitored arbitration service comprises: performing service detection and arbitration object detection in a first period;
the outputting the detection information to the log file comprises: writing detection information in the log file in an overlaying manner;
the filtering the log file includes: filtering the log file in a first period;
the determining the state of the arbitration service according to the filtering result comprises: if any one of the keywords appears in the log file for 0 times, determining that the state of the arbitration service is abnormal.
7. The method of claim 5, wherein the performing service detection and arbitration object detection for the monitored arbitration service comprises: performing service detection and arbitration object detection in a first period;
the outputting the detection information to the log file comprises: writing detection information in the log file in a new mode;
the filtering the log file includes: filtering the log file in a second period;
the determining the state of the arbitration service according to the filtering result comprises: calculating the number of times of each keyword in the second period in the log file, and the difference value of the number of times of the corresponding keyword in the last second period in the log file; if the difference value corresponding to any keyword is not matched with the preset value, determining that the state of the arbitration service is abnormal; the preset value is determined according to the cycle length of the first cycle and the cycle length of the second cycle.
8. An arbitration service monitoring device for a database, applied to a monitoring apparatus, wherein the device is configured to implement the method of any one of claims 1-7.
9. A monitoring device, comprising:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the method of any of claims 1 to 7.
10. A computer readable storage medium storing one or more programs, which when executed by a monitoring device comprising a plurality of application programs, cause the monitoring device to perform the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111465611.XA CN116225818A (en) | 2021-12-03 | 2021-12-03 | Arbitration service monitoring method and device for database, monitoring equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111465611.XA CN116225818A (en) | 2021-12-03 | 2021-12-03 | Arbitration service monitoring method and device for database, monitoring equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116225818A true CN116225818A (en) | 2023-06-06 |
Family
ID=86589649
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111465611.XA Pending CN116225818A (en) | 2021-12-03 | 2021-12-03 | Arbitration service monitoring method and device for database, monitoring equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116225818A (en) |
-
2021
- 2021-12-03 CN CN202111465611.XA patent/CN116225818A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110661659B (en) | Alarm method, device and system and electronic equipment | |
US10127092B1 (en) | Method and apparatus for monitoring a message transmission frequency in a robot operating system | |
GB2517147A (en) | Performance metrics of a computer system | |
CN111176952A (en) | Monitoring method, monitoring system and related device for I2C channel | |
CN108243031B (en) | Method and device for realizing dual-computer hot standby | |
CN111221775A (en) | Processor, cache processing method and electronic equipment | |
WO2016197737A1 (en) | Self-check processing method, apparatus and system | |
JP2019049802A (en) | Failure analysis supporting device, incident managing system, failure analysis supporting method, and program | |
CN114095588B (en) | Sharing method, system and server of multi-protocol ports | |
CN114676019B (en) | Method, device, equipment and storage medium for monitoring state of central processing unit | |
CN110380929A (en) | A kind of idempotent validation checking method, device and equipment | |
CN114363334A (en) | Network configuration method, device and equipment for cloud system and cloud desktop virtual machine | |
CN116225818A (en) | Arbitration service monitoring method and device for database, monitoring equipment and storage medium | |
CN110321261B (en) | Monitoring system and monitoring method | |
CN113778763B (en) | Intelligent switching method and system for three-way interface service faults | |
CN110752972A (en) | Network card state monitoring method, device, equipment and medium | |
CN116126832A (en) | Database switching method, switching device, electronic equipment and storage medium | |
CN112015600A (en) | Log information processing system, log information processing method and device and switch | |
CN115604088A (en) | Main/standby switching method, device, equipment and storage medium of component cluster system | |
CN110399258B (en) | Stability testing method, system and device for server system | |
CN115687026A (en) | Multi-node server fault early warning method, device, equipment and medium | |
CN107797915B (en) | Fault repairing method, device and system | |
CN108647113B (en) | Disaster recovery method and server | |
CN113285817A (en) | Alarm method, system, device and storage medium | |
CN117743008B (en) | Multi-core processor fault diagnosis and exception handling method, main control board and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |