A monitoring method and monitoring device of an index server
By obtaining multi-dimensional monitoring information and setting alarm rules, the problem of scattered index service monitoring parameters was solved, and fast and accurate fault diagnosis was achieved.
Patent Information
- Application Number
- CN202111306693.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2041-11-05
AI Technical Summary
In the prior art, the monitoring parameters of the index service are scattered, which makes it impossible to quickly and accurately determine the cause of the failure when a problem occurs, and requires manual analysis of a large number of scattered monitoring parameters.
Provided is a monitoring method for an index server, which obtains monitoring information of imported data, index service status and index service usage, sets target alarm rules based on this information, and outputs alarm information for faults.
This enables fast and accurate identification of faults in indexing services without the need for manual analysis of monitoring parameters, improving the efficiency and accuracy of fault diagnosis.
Smart Images

Figure CN114020571B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing and analysis, and in particular to a monitoring method and monitoring device for an index server. Background Art
[0002] The indexing service is a key module in the search service, and its stability is crucial. Inadequate monitoring of the indexing service can impact the business, so a monitoring method is needed to monitor the indexing server that provides the indexing service and identify problems. Currently, various monitoring platforms are available on the market, but they typically perform monitoring from independent perspectives, resulting in fragmented monitoring parameters. When an indexing service problem arises, manual analysis of the failure from a large number of fragmented monitoring parameters is required, making it difficult to quickly and accurately identify the fault within the indexing service. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a monitoring method and a monitoring device for an index server.
[0004] To achieve the above objectives, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0005] In a first aspect, an embodiment of the present disclosure provides a method for monitoring an index server, which can be applied to monitoring an index server;
[0006] Acquire target monitoring information, the target monitoring information including at least one of monitoring information of imported data, monitoring information of indexing service status, and monitoring information of indexing service usage;
[0007] Determining a target alarm rule corresponding to the target monitoring information, wherein the target alarm rule corresponds to at least one fault setting;
[0008] When the target monitoring information satisfies the target alarm rule, alarm information for the at least one fault is output.
[0009] As an optional implementation of the embodiment of the present disclosure, the target monitoring information includes: monitoring information of imported data:
[0010] When calling a first API to import first data into a message queue, if a first request error occurs, recording the first request error in a log file, where the first API is an API of the message queue;
[0011] After the first data is imported into the message queue, when a second API interface is called to import the first data in the message queue into the indexing service, if a second request error occurs, the second request error is recorded in the log file;
[0012] Obtaining the first request error and / or the second request error from the log file;
[0013] Obtaining the amount of consumed data and / or the amount of unconsumed data from the message queue;
[0014] At least one of the first request error, the second request error, the amount of consumed data, and the amount of unconsumed data is used as monitoring information of the imported data.
[0015] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0016] There is an error in the first request;
[0017] There is a second request error;
[0018] The amount of consumption data is less than or equal to a first amount threshold;
[0019] During a first period of time, the amount of consumption data is less than or equal to a first quantity threshold;
[0020] The unconsumed quantity is greater than or equal to a second quantity threshold;
[0021] During the second time period, the amount of unconsumed data is greater than or equal to a second amount threshold;
[0022] The ratio of the unconsumed quantity to the consumed quantity is greater than or equal to a preset ratio;
[0023] During a third period of time, the ratio of the unconsumed quantity to the consumed quantity is greater than or equal to a preset ratio;
[0024] The message backlog rate is greater than or equal to a ratio threshold, and the message backlog rate is: a ratio of the unconsumed quantity to the total amount of data corresponding to the message queue within a fourth time period.
[0025] As an optional implementation of the embodiment of the present disclosure, the index server is a server cluster including multiple servers, and the target monitoring information includes: monitoring information of the index service status;
[0026] The obtaining of target monitoring information includes:
[0027] Obtaining operating status information of the multiple servers; the operating status information includes at least one of the following:
[0028] Load rate, slow query logs of index services;
[0029] The load rate includes at least one of CPU usage, memory usage, bandwidth usage, and disk usage.
[0030] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0031] The load rate of a single server is greater than or equal to a first preset ratio;
[0032] The total load ratio is greater than or equal to a second predetermined ratio;
[0033] There are two servers whose load difference is greater than or equal to the preset difference;
[0034] The existence of slow query logs for the index service;
[0035] The slow query log of the index service indicates that the response time of the index service is greater than or equal to the preset time.
[0036] As an optional implementation of the embodiment of the present disclosure, the target monitoring information includes: monitoring information used by the indexing service;
[0037] The obtaining of target monitoring information includes:
[0038] If a target error occurs during the use of the index service, the target error is recorded in the log file, where the target error includes at least one of: failure to connect to the index server and timeout in connecting to the index server;
[0039] If the indexing service is used, the user's search history is saved, and the search history includes: user ID, time, indexing server ID, and search duration.
[0040] The target error record is obtained from the log file as monitoring information used by the indexing service.
[0041] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0042] There is the target error described;
[0043] The search time is greater than or equal to a preset time.
[0044] As an optional implementation of the embodiment of the present disclosure, obtaining target monitoring information includes:
[0045] By importing first simulation data, obtaining monitoring information of the imported data;
[0046] and / or,
[0047] By using the indexing service for the second simulation data, monitoring information of the indexing service state and / or monitoring information of the indexing service usage is obtained.
[0048] As an optional implementation of the embodiment of the present disclosure, the outputting of alarm information includes:
[0049] Based on the alarm information, an alarm interface is displayed; the alarm interface includes at least one functional control, and the at least one functional control is used to trigger a processing operation for the at least one fault, wherein each functional control is used to trigger a processing operation for one or more faults.
[0050] In a second aspect, a monitoring device for an index server is provided, comprising:
[0051] An acquisition module, configured to acquire target monitoring information, wherein the target monitoring information includes at least one of monitoring information of imported data, monitoring information of index service status, and monitoring information of index service usage;
[0052] a determination module, configured to determine a target alarm rule corresponding to the target monitoring information, wherein the target alarm rule corresponds to at least one fault setting;
[0053] An output module is used to output alarm information for the at least one fault when the target monitoring information meets the target alarm rule.
[0054] In a third aspect, a monitoring device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for monitoring an index server according to the first aspect or any one of its optional embodiments is implemented.
[0055] In a fourth aspect, the present invention discloses a computer-readable storage medium, comprising: a computer program stored on the computer-readable storage medium, which, when executed by a processor, implements a monitoring method for an index server as described in the first aspect or any one of its optional embodiments.
[0056] In a fifth aspect, a computer program product is provided, comprising: when the computer program product is run on a computer, enabling the computer to implement the index server monitoring method as described in the first aspect or any one of its optional implementations.
[0057] The technical solution provided by the embodiment of the present disclosure has the following advantages compared with the existing technology: monitoring information in three aspects, namely, monitoring information of imported data, monitoring information of index service status, and monitoring information of index service usage, can be obtained, and corresponding target alarm rules can be set based on different monitoring information, and these alarm rules can be associated with at least one fault setting. In this way, when the monitoring information meets the target alarm rules, alarm information for at least one fault can be output. Without manually analyzing the monitoring parameters or alarm information, it is possible to know what kind of fault exists in the index service provided by the index server, so that the fault in the index service can be quickly and accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] 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.
[0059] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0060] Figure 1 A schematic diagram of a scenario provided by an embodiment of the present disclosure;
[0061] Figure 2 A modular schematic diagram of a monitoring device provided in an embodiment of the present disclosure;
[0062] Figure 3 A schematic diagram of a monitoring information collection process provided by an embodiment of the present disclosure;
[0063] Figure 4 A flowchart of a monitoring method for an index server provided in an embodiment of the present disclosure;
[0064] Figure 5 A schematic diagram of the structure of a monitoring device provided in an embodiment of the present disclosure;
[0065] Figure 6 A schematic diagram of the hardware structure of a monitoring device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0066] 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 therein can be combined with each other in the absence of conflict.
[0067] 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.
[0068] There are various monitoring platforms on the market, which usually monitor from an independent perspective. Therefore, the monitoring parameters obtained are relatively scattered. When problems occur in the indexing service, it is necessary to manually analyze the fault from a large number of scattered monitoring parameters. Therefore, it is impossible to quickly and accurately determine the fault problem in the indexing service.
[0069] In order to solve the above problems, a monitoring method for an index server is provided in an embodiment of the present disclosure, which can obtain monitoring information in three aspects: monitoring information of imported data, monitoring information of index service status, and monitoring information of index service usage. Corresponding target alarm rules can be set based on different monitoring information, and these alarm rules can be associated with at least one fault setting. In this way, when the monitoring information meets the target alarm rules, alarm information for at least one fault can be output. Without manually analyzing the monitoring parameters or alarm information, it is possible to know what kind of fault exists in the index service provided by the index server, so that the fault in the index service can be quickly and accurately determined.
[0070] The index server monitoring method provided in the embodiments of the present disclosure can be applied to a monitoring device, which can be a component of the index server or a device independent of the index server. The monitoring device involved in the embodiments of the present disclosure can be a functional module or functional entity in the monitoring device that can implement the monitoring method.
[0071] like Figure 1 As shown, a schematic diagram of a scenario provided by an embodiment of the present disclosure includes: an index server 11, a monitoring device 12, and clients 13, 14, and 15, wherein any client can access the index server 11 to allow the index server 11 to provide it with index services. The index server 11 will provide index services to the client based on the information provided by the client during access and return search results. In the embodiment of the present disclosure, the monitoring device 12 can be used to monitor the index server, collect monitoring information, and make judgments based on the collected monitoring information according to corresponding alarm rules. When an abnormality occurs, an alarm message for the fault is output, and the fault can be handled.
[0072] like Figure 2 , which is a modular schematic diagram of a monitoring device in an embodiment of the present disclosure, the monitoring device includes: a monitoring acquisition module 21 , a monitoring analysis module 22 and an alarm and fault processing module 23 .
[0073] (1) Monitoring and acquisition module 21, used to collect monitoring information from multiple dimensions and send the collected monitoring information to monitoring and analysis module 22;
[0074] For example, Figure 3 As shown in the figure, a monitoring information collection process diagram provided by the embodiment of the present disclosure is provided. Figure 3 The method shown here briefly divides the monitoring information that needs to be collected into three dimensions. These three dimensions are actually a data processing flow, from raw data to the final use by the search business. Figure 3 As shown in , dimension 1 is the acquisition of monitoring information of the data import process. During this process, when the index server imports data, it will first import the data into the message queue, and then import it from the message queue to the index service. The monitoring information collected by dimension 1 is called the monitoring information of the imported data in the embodiment of this disclosure; dimension 2 is the acquisition of monitoring information of the running status of the index service. In the embodiment of this disclosure, the monitoring information collected by dimension 2 is called the monitoring information of the index service status; dimension 3 is the acquisition of monitoring information of the search business when the index service is used. In the embodiment of this disclosure, the monitoring information collected by dimension 3 is called the monitoring information used by the index service.
[0075] (2) Monitoring and analysis module 22, which is used to perform comprehensive analysis based on monitoring information using corresponding alarm rules to determine whether there is a problem and feed back the analysis results to the alarm and fault handling module 23;
[0076] (3) Alarm and fault handling module 23, which is used to issue some fault alarms based on the analysis results and provide some functional controls that can quickly handle these faults so that maintenance personnel can handle these faults in a timely manner.
[0077] like Figure 4 As shown, a monitoring method for an index server provided by an embodiment of the present disclosure includes:
[0078] 401. Obtain target monitoring information.
[0079] 402. Determine target alarm rules corresponding to target monitoring information.
[0080] The target monitoring information includes at least one of monitoring information of imported data, monitoring information of index service status, and monitoring information of index service usage.
[0081] In the embodiment of the present disclosure, the monitoring information of the imported data can be obtained by importing the first simulation data.
[0082] In the embodiment of the present disclosure, the monitoring information of the index service state and / or the monitoring information of the index service usage are obtained by using the index service for the second simulation data.
[0083] It should be noted that the imported data involved in the embodiments of the present invention refers to operations on one or more data changes, such as data insertion, data deletion, and data update.
[0084] Since the index service program does not run when there is no data change, the above-mentioned monitoring information cannot be obtained and the fault cannot be discovered. At this time, you can use simulation scripts to simulate data import and simulate the use of index services. In this way, the simulation script can run all parts involved in the entire index service process, so that monitoring information of various dimensions can be obtained. For the index service, you can define multiple scripts, each script performs different tasks, such as data insertion, data update, and data deletion, so that data insertion, update, and deletion operations can be completed. Furthermore, you can also add query scripts. For data changes, you can query the corresponding information by searching the business interface.
[0085] The target alarm rule corresponds to at least one fault setting.
[0086] In the embodiment of the present invention, the alarm rules are set corresponding to the monitoring information, and which alarm rule is specifically applied depends on which monitoring information is collected.
[0087] In other words, target monitoring information has the following situations:
[0088] Case 1: Importing data monitoring information;
[0089] Case 2: Monitoring information of indexing service status;
[0090] Case 3: Monitoring information used by the indexing service;
[0091] Case 4: Monitoring information of imported data and indexing service status;
[0092] Case 5: Monitoring information of indexing service status and monitoring information of indexing service usage;
[0093] Case 6: Monitoring information of imported data and monitoring information used by the indexing service;
[0094] Case 7: Monitoring information of imported data, monitoring information of indexing service status, and monitoring information of indexing service usage.
[0095] For the above situation 1, the target monitoring information includes the monitoring information of the imported data. Then, the methods for obtaining the monitoring information of the imported data include:
[0096] Embodiment 1: When calling a first API to import first data into a message queue, if a first request error occurs, the request error is recorded in a log file. The first API is an API for the message queue. After the first data is imported into the message queue, when calling a second API interface to import the first data in the message queue into an indexing service, if a second request error occurs, the second request error is recorded in a log file. The second API interface is an API interface for the indexing service.
[0097] Get the first request error and / or the second error request error from the log file;
[0098] Get the number of consumed data and / or the number of unconsumed data from the message queue;
[0099] At least one of the first request error, the second error request error, the amount of consumed data, and the amount of unconsumed data is used as monitoring information of the imported data.
[0100] The first request error includes: the request to the client times out, and the client cannot connect to the message queue.
[0101] The second request error includes: the request to the message queue times out, the message queue cannot connect to the indexing service, and the indexing service data writing speed is lower than the speed threshold.
[0102] In the embodiment of the present disclosure, the index service is a functional module in the index server that provides an indexing function. Importing the first data into the index service can be understood as storing the first data in a database corresponding to the indexing function in the index server.
[0103] For the monitoring information of the imported data obtained in the first embodiment above, the target alarm rule may include at least one of the following:
[0104] (a) There is a first request error;
[0105] (b) there is a second request error;
[0106] (c) the amount of consumption data is less than or equal to the first amount threshold;
[0107] (d) within the first time period, the amount of consumption data is less than or equal to the first quantity threshold;
[0108] (e) the unconsumed quantity is greater than or equal to a second quantity threshold;
[0109] (f) within the second time period, the amount of unconsumed data is greater than or equal to a second quantity threshold;
[0110] (g) The ratio of the unconsumed quantity to the consumed quantity is greater than or equal to the preset ratio;
[0111] (h) During the third period, the ratio of the unconsumed quantity to the consumed quantity is greater than the preset ratio;
[0112] (i) The message backlog ratio is greater than or equal to the ratio threshold, where the message backlog ratio is: the ratio of the unconsumed quantity to the total amount of data corresponding to the message queue within the fourth time period.
[0113] Among them, the first duration, the second duration, the third duration and the fourth duration can be set based on actual needs. These durations can be set to be the same or different, which is not limited in the embodiments of the present disclosure.
[0114] Embodiment 2: The first data can be directly imported from the client into the index service by calling the second API interface. During this process, if a third request error occurs, the third request error is recorded in the log file; the third request error is obtained from the log file as monitoring information for importing data.
[0115] The third request error includes: a request to the client times out, the client cannot connect to the indexing service, or the indexing service data writing speed is lower than a speed threshold.
[0116] With respect to the monitoring information of the imported data obtained in the above-mentioned second embodiment, the target alarm rule may be: (j) there is a third request error.
[0117] It should be noted that, in the actual data import process, there may be a situation where both implementation methods 1 and 2 exist for importing data. In this case, one or more of the nine rules (a) to (i) in the above alarm rules can be combined with alarm rule (j) to form the final alarm rule.
[0118] For the above situation 2: the index server is a server cluster including multiple servers, and the target monitoring information is monitoring information of the index service status. Then, the methods for obtaining monitoring information of the index service status include:
[0119] Obtaining operation status information of multiple servers; the operation status information includes: at least one of load rate and slow query log of index service; wherein the load rate includes: at least one of CPU usage, memory usage, bandwidth usage, and disk usage.
[0120] That is, the above-mentioned running status information includes at least one of: CPU usage, memory usage, bandwidth usage, disk usage, and slow query log of the index service.
[0121] For the above situation 2, the target alarm rule may include at least one of the following:
[0122] (k) the load ratio of a single server is greater than or equal to a first preset ratio;
[0123] If a server's CPU usage exceeds a certain ratio, it indicates insufficient computing resources, and user search requests will take longer to complete. If a server's memory usage exceeds a certain ratio, it indicates that the server can no longer process additional user requests. If this level of usage exceeds a certain threshold, the service will crash and will be unable to serve user search requests. Based on this, you can set corresponding thresholds for the load rate (CPU usage, memory usage) of individual services.
[0124] (1) the total load ratio is greater than or equal to a second predetermined ratio;
[0125] (m) There are two servers whose load difference is greater than or equal to a preset difference;
[0126] From the perspective of the entire server cluster, you can also check its overall load and the disk usage of the entire cluster. If the disk usage exceeds the threshold and the accessed data is recent data, it is necessary to isolate hot and cold data in the index server cluster.
[0127] From the perspective of the entire server cluster, if the cluster load utilization (CPU, memory, and disk usage) exceeds the threshold and the message queue consumption exceeds the threshold, it means that the overall cluster load is large. Consider increasing the number of servers in the server cluster or splitting the original index service into multiple server clusters to provide services.
[0128] If there are two servers with a load difference greater than the preset difference, then the access to the cluster is uneven, and the cluster access strategy needs to be optimized to balance the service range of the servers.
[0129] (n) There is a slow query log for the index service;
[0130] (o) The slow query log of the index service indicates that the response time of the index service is greater than or equal to the preset time.
[0131] In actual applications, the above alarm rules can also be combined with other alarm rules to form comprehensive alarm rules. For example, one or more of the 10 rules (a) to (j) in the above alarm rules can be combined with one or more of the 5 rules (k) to (o) in the above alarm rules to form the final alarm rule.
[0132] In the disclosed embodiments, the different log information in the log files is obtained through multiple collections. We can distinguish the storage formats and log information types of different log information, and classify the log information into different types and levels. We store this log information in the search server for subsequent query analysis. For example, we can also annotate special information in some log files to indicate the purpose of this information.
[0133] Case 3: The target monitoring information is the monitoring information used by the indexing service. The methods for obtaining the monitoring information used by the indexing service include:
[0134] If a target error occurs during the use of the indexing service, the target error is recorded in the log file, and the target error includes at least one of: failure to connect to the index server and timeout of connecting to the index server;
[0135] If the indexing service is used, the user's search history is saved, and the search history includes: the search time.
[0136] The target error record and the search time duration are obtained from the log file as monitoring information used by the indexing service.
[0137] If the client is not connected to the index server, it means that there is a problem with the index service processing, the index server may be faulty, or there is a problem with the network connection between the client and the index server.
[0138] The connection to the index server times out, meaning the index service times out while processing the user's search request. This indicates that the index service is under heavy load.
[0139] For the above situation 3, the target monitoring information is the monitoring information used by the indexing service, and the corresponding target alarm rules can include at least one of the following:
[0140] (p) There is a target error;
[0141] (q) The search duration is greater than or equal to the preset duration.
[0142] In actual applications, the above alarm rules can also be combined with other alarm rules to form comprehensive alarm rules. For example, one or more of the 15 rules (a) to (o) in the above alarm rules can be combined with the above rules (p) and / or (q) to form the final alarm rule.
[0143] Furthermore, the above search record may also include: user ID, search time, server ID, etc.
[0144] By analyzing the search records, we can understand the usage of each server in the search server, and then analyze the load of each server in the cluster, so as to facilitate subsequent load balancing adjustments of multiple servers in the entire search server.
[0145] Furthermore, the alarm rule can also be set with a corresponding usage time frequency, limiting repeated use within a certain time interval.
[0146] 403. Determine whether the target monitoring information satisfies the target alarm rule.
[0147] If the target monitoring information meets the target alarm rule, the following 404 is executed; if the target monitoring information does not meet the target alarm rule, the process returns to execute the above 401.
[0148] 404. Output alarm information for at least one fault.
[0149] In some embodiments, outputting alarm information for at least one fault includes: displaying an alarm interface based on the alarm information; the alarm interface includes at least one functional control, and the at least one functional control is used to trigger a processing operation for the at least one fault, wherein each functional control is used to trigger a processing operation for one or more faults.
[0150] In the embodiments of the present disclosure, by adding some controls that can handle faults in a timely manner, online problems can be quickly handled through these functional controls. For example, the functional control for pausing message queue processing in a text message can trigger the temporary suspension of message queue processing to buy time for operation and maintenance personnel to fix the problem.
[0151] Rule 1: Run once every minute, that is, make a judgment based on the following two rules every minute. If all the rules are met, an alarm message will be output:
[0152] Rule 1: 80% of API calls exceed 300ms (i.e., there is an error in the first request and the request to the client times out);
[0153] Rule 2: The server CPU usage rate exceeds 80% (i.e., the server load rate is greater than or equal to the second preset ratio);
[0154] Then an alarm is sent to the mobile phone number 150XXXXXXXX. The alarm content may be: the current search service has a large number of visits and a slow response time, the overall server load is high, and the service flow should be limited.
[0155] Rule 2: Run once every 5 minutes, that is, make a judgment every 5 minutes based on the following two rules. If all the rules are met, an alarm message will be output:
[0156] Rule 1: The number of accumulated messages in the message queue exceeds 2,000 (i.e., there is too much unconsumed data);
[0157] Rule 2: Server CPU usage is less than 80%, and memory usage is less than 80%;
[0158] Then send an alarm message to the mobile phone number 150XXXXXXXX. The alarm content is that the indexing business is normal, but the message queue is backlogged and consumption is slow.
[0159] The disclosed embodiment provides a monitoring method for an index server, which can obtain monitoring information in three aspects: monitoring information of imported data, monitoring information of index service status, and monitoring information of index service usage. Corresponding target alarm rules can be set based on different monitoring information, and these alarm rules can be associated with at least one fault setting. In this way, when the monitoring information meets the target alarm rules, alarm information for at least one fault can be output. Without manually analyzing the monitoring parameters or alarm information, it is possible to know what kind of fault exists in the index service provided by the index server, so that the fault in the index service can be quickly and accurately determined.
[0160] like Figure 5 As shown, an embodiment of the present disclosure provides a monitoring device for an index server, comprising:
[0161] An acquisition module 501 is configured to acquire target monitoring information, wherein the target monitoring information includes at least one of monitoring information of imported data, monitoring information of indexing service status, and monitoring information of indexing service usage;
[0162] A determination module 502 is configured to determine a target alarm rule corresponding to the target monitoring information, wherein the target alarm rule corresponds to at least one fault setting;
[0163] The output module 503 is configured to output alarm information for the at least one fault when the target monitoring information satisfies the target alarm rule.
[0164] As an optional implementation of the embodiment of the present disclosure, the target monitoring information includes: monitoring information of imported data:
[0165] The acquisition module 501 is specifically configured to:
[0166] When calling a first API to import first data into a message queue, if a first request error occurs, recording the request error in a log file, where the first API is an API of the message queue;
[0167] After the first data is imported into the message queue, when a second API interface is called to import the first data in the message queue into the indexing service, if a second request error occurs, the second request error is recorded in the log file, wherein the second API interface is an API interface of the indexing service;
[0168] Obtaining the first request error and / or the second error request error from the log file;
[0169] Obtaining the amount of consumed data and / or the amount of unconsumed data from the message queue;
[0170] At least one of the first request error, the second error request error, the amount of consumed data, and the amount of unconsumed data is used as monitoring information of the imported data.
[0171] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0172] There is an error in the first request;
[0173] There is a second request error;
[0174] The amount of consumption data is less than or equal to a first amount threshold;
[0175] During a first period of time, the amount of consumption data is less than or equal to a first quantity threshold;
[0176] The unconsumed quantity is greater than or equal to a second quantity threshold;
[0177] During the second time period, the amount of unconsumed data is greater than or equal to a second amount threshold;
[0178] The ratio of the unconsumed quantity to the consumed quantity is greater than or equal to a preset ratio;
[0179] During a third period of time, the ratio of the unconsumed quantity to the consumed quantity is greater than or equal to a preset ratio;
[0180] The message backlog rate is greater than or equal to a ratio threshold, and the message backlog rate is: a ratio of the unconsumed quantity to the total amount of data corresponding to the message queue within a fourth time period.
[0181] As an optional implementation of the embodiment of the present disclosure, the index server is a server cluster including multiple servers, and the target monitoring information includes: monitoring information of the index service status;
[0182] The acquisition module 501 is specifically configured to:
[0183] Obtaining operating status information of the multiple servers; the operating status information includes at least one of the following:
[0184] Load rate, slow query logs of index services;
[0185] The load rate includes at least one of CPU usage, memory usage, bandwidth usage, and disk usage.
[0186] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0187] The load rate of a single server is greater than or equal to a first preset ratio;
[0188] The total load ratio is greater than or equal to a second predetermined ratio;
[0189] There are two servers whose load difference is greater than or equal to the preset difference;
[0190] The existence of slow query logs for the index service;
[0191] The slow query log of the index service indicates that the response time of the index service is greater than or equal to the preset time.
[0192] As an optional implementation of the embodiment of the present disclosure, the target monitoring information includes: monitoring information used by the indexing service;
[0193] The acquisition module 501 is specifically configured to:
[0194] If a target error occurs during the use of the index service, the target error is recorded in a log file, wherein the target error includes at least one of: failure to connect to the index server and timeout of connecting to the index server;
[0195] If the indexing service is used, the user's search history is saved, and the search history includes: the search time.
[0196] The target error record and the search time duration are obtained from the log file as monitoring information used by the indexing service.
[0197] As an optional implementation of the embodiment of the present disclosure, the target alarm rule includes at least one of the following:
[0198] There is the target error described;
[0199] The search time is greater than or equal to a preset time.
[0200] The acquisition module 501 is specifically configured to:
[0201] By importing first simulation data, obtaining monitoring information of the imported data;
[0202] and / or,
[0203] By using the indexing service for the second simulation data, monitoring information of the indexing service state and / or monitoring information of the indexing service usage is obtained.
[0204] The output module 503 is specifically configured to:
[0205] Based on the alarm information, an alarm interface is displayed; the alarm interface includes at least one functional control, and the at least one functional control is used to trigger a processing operation for the at least one fault, wherein each functional control is used to trigger a processing operation for one or more faults.
[0206] like Figure 6 As shown, an embodiment of the present disclosure provides a monitoring device, comprising: a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When executed by the processor 601, the computer program implements the various processes of the index server monitoring method in the above-described method embodiment. The same technical effects can be achieved, and to avoid repetition, the details are not repeated here.
[0207] An embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the various processes of the monitoring method of the index server in the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0208] The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0209] An embodiment of the present invention provides a computer program product, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the monitoring method of the index server in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0210] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0211] In the present disclosure, a processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0212] In this disclosure, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0213] In this disclosure, computer-readable media includes permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media 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 disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0214] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0215] The above are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily 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 is not limited to these embodiments, but is to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A monitoring method for an index server, characterized in that: Used to monitor index servers; Acquire target monitoring information, the target monitoring information including at least one of monitoring information of imported data, monitoring information of indexing service status, and monitoring information of indexing service usage; Determining a target alarm rule corresponding to the target monitoring information, wherein the target alarm rule corresponds to at least one fault setting; When the target monitoring information satisfies the target alarm rule, outputting alarm information for the at least one fault; The target monitoring information includes: the monitoring information of the imported data: The obtaining of target monitoring information includes: When calling a first API to import first data into a message queue, if a first request error occurs, recording the first request error in a log file, where the first API is an API of the message queue; After the first data is imported into the message queue, when a second API interface is called to import the first data in the message queue into the indexing service, if a second request error occurs, the second request error is recorded in the log file, wherein the second API interface is the API interface of the indexing service; Obtaining the first request error and / or the second request error from the log file; Obtaining the amount of consumed data and / or the amount of unconsumed data from the message queue; At least one of the first request error, the second request error, the amount of consumed data, and the amount of unconsumed data is used as monitoring information of the imported data.
2. The method according to claim 1, characterized in that The target alarm rule includes at least one of the following: There is an error in the first request; There is a second request error; The amount of consumption data is less than or equal to a first amount threshold; During a first period of time, the amount of consumption data is less than or equal to a first quantity threshold; The unconsumed quantity is greater than or equal to a second quantity threshold; During the second time period, the amount of unconsumed data is greater than or equal to a second amount threshold; The ratio of the unconsumed quantity to the consumed quantity is greater than or equal to a preset ratio; During the third period, the ratio of the unconsumed quantity to the consumed quantity is greater than a preset ratio; The message backlog rate is greater than or equal to a ratio threshold, and the message backlog rate is: a ratio of the unconsumed quantity to the total amount of data in the message queue within a fourth time period.
3. The method according to claim 1, characterized in that The index server is a server cluster including a plurality of servers, and the target monitoring information includes: monitoring information of the index service status; The obtaining of target monitoring information includes: Obtaining operating status information of the multiple servers; the operating status information includes at least one of the following: Load rate, slow query logs of index services; The load rate includes at least one of CPU usage, memory usage, bandwidth usage, and disk usage.
4. The method according to claim 3, characterized in that The target alarm rule includes at least one of the following: The load rate of a single server is greater than or equal to a first preset ratio; The total load ratio is greater than or equal to a second predetermined ratio; There are two servers whose load difference is greater than or equal to the preset difference; The existence of slow query logs for the index service; The slow query log of the index service indicates that the response time of the index service is greater than or equal to the preset time.
5. The method according to claim 1, wherein The target monitoring information includes: monitoring information used by the indexing service; The obtaining of target monitoring information includes: During the use of the indexing service, if a target error occurs, the target error is recorded in a log file, wherein the target error includes at least one of: failure to connect to the indexing server and timeout of connecting to the indexing server; During the use of the indexing service, the user's search history is saved, and the search history includes: the search time; The target error record and the search time duration are obtained from the log file as monitoring information used by the indexing service.
6. The method according to claim 5, characterized in that The target alarm rule includes at least one of the following: There is the target error described; The search time is greater than or equal to a preset time.
7. The method according to claim 1, characterized in that The obtaining of target monitoring information includes: By importing first simulation data, obtaining monitoring information of the imported data; and / or, By using the indexing service for the second simulation data, monitoring information of the indexing service state and / or monitoring information of the indexing service usage is obtained.
8. The method according to any one of claims 1 to 7, characterized in that The outputting alarm information for the at least one fault includes: Based on the alarm information, an alarm interface is displayed; the alarm interface includes at least one functional control, and the at least one functional control is used to trigger a processing operation for the at least one fault, wherein each functional control is used to trigger a processing operation for one or more faults.
9. A monitoring device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for monitoring the index server according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Data acquisition method and device
CN107896175A
Business performance end-to-end monitoring method, system and device
CN109120461A
Data reading and writing method and system
CN110287248A
Abnormity early warning method, device and equipment and storage medium
CN111756579A
Message queue monitoring method and device
CN112965875A