Monitoring method, device, terminal and storage medium of distributed file systemTechnical Field
The invention relates to the technical field of cloud storage, in particular to a monitoring method, a monitoring device, a monitoring terminal and a monitoring storage medium for a distributed file system.
Background
With the wide use of cloud storage, how to ensure the stable operation of the cloud storage is an important problem which is paid attention to by cloud storage construction parties earlier than the time when a user finds out the operation problem of the cloud storage and solves the problem as early as possible.
The existing cloud storage monitoring mainly aims at monitoring cloud storage services and storage hardware, for example, when the services are stopped or a storage disk is subjected to a bad disk alarm, the monitoring alarm is sent when the abnormality occurs, the abnormal problem is solved timely to ensure stable operation of the cloud storage, and the problem that the performance of the service at the bottom layer of a distributed file system is reduced in the cloud storage operation process is not considered, for example, when a user uploads and downloads files of the same type, the response time is increased in operation, the user experience is directly reduced, and the loss of the user can be caused under the serious condition. Therefore, a scheme for monitoring the performance based on the response parameters of the files of the same type operated by the user becomes an urgent problem to be solved.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a terminal and a storage medium for monitoring a distributed file system, which are capable of quickly determining the log occurrence abnormality in a specific level corresponding to a specific operation type by calculating the deviation value between the response parameter of different levels in different types and the preset baseline data, thereby improving the operation and maintenance efficiency.
A first aspect of the present invention provides a method for monitoring a distributed file system, where the method includes:
acquiring a log output by a distributed file system to be monitored;
identifying the operation type of each row of data in the log;
classifying the data in the log according to the operation type;
dividing data of the same operation type into different grades;
calculating the response parameter of each grade in the same operation type;
calculating deviation values of the response parameters and corresponding preset baseline data;
judging whether each deviation value is within a preset deviation threshold range;
and when each deviation value is determined to be within the preset deviation threshold value range, outputting a result that the distributed file system operates normally.
Preferably, the calculating the response parameter of each step in the same operation type includes:
acquiring a response parameter of each data of each grade in the same operation type;
calculating the average response parameter of each grade in each operation type according to the response parameters;
and determining the average response parameter as the response parameter of the corresponding grade.
Preferably, the creating process of the preset baseline data includes:
acquiring a historical log in a preset time period;
equally dividing the historical logs into a plurality of sub-historical logs according to the time sequence of the historical log records;
identifying the operation type of each row of data in each sub-history log;
classifying the data in each sub-history log according to the operation type;
dividing data of the same operation type in each sub-history log into different grades;
calculating the response parameter of each data of each grade in the same operation type in each sub-history log;
calculating a first average response parameter of each grade in the same operation type in the same sub-history log according to the response parameters;
calculating a second average response parameter of the multiple sub-history logs of each grade in the same operation type according to the first average response parameter;
and taking the second average response parameter as preset baseline data of the corresponding type-grade.
Preferably, the calculating the deviation value between the response parameter and the corresponding preset baseline data includes:
acquiring preset baseline data of a corresponding type-grade;
calculating the difference value between the response parameter of the corresponding type-grade and the preset baseline data of the corresponding type-grade;
and dividing the absolute value of the difference value by the preset baseline data of the corresponding type-grade to obtain a value serving as a deviation value.
Preferably, the method further comprises:
and when at least one deviation value is determined not to be within the preset deviation threshold range, outputting the result of abnormal operation of the distributed file system.
Preferably, after the outputting the result of the distributed file system running exception, the method further includes:
and sending alarm information to an administrator.
Preferably, after the sending of the warning information to the administrator, the method further includes:
and identifying abnormal data in the log output by the distributed file system to be monitored.
A second aspect of the present invention provides a monitoring apparatus for a distributed file system, the apparatus comprising:
the acquisition module is used for acquiring logs output by the distributed file system to be monitored;
the identification module is used for identifying the operation type of each line of data in the log;
the classification module is used for classifying the data in the log according to the operation type;
the dividing module is used for dividing the data of the same operation type into different grades;
the first calculation module is used for calculating the response parameter of each grade in the same operation type;
the second calculation module is used for calculating deviation values of the response parameters and the corresponding preset baseline data;
the judging module is used for judging whether each deviation value is within a preset deviation threshold value range;
and the output module is used for outputting the result that the distributed file system operates normally when the judgment module determines that each deviation value is within the preset deviation threshold range.
A third aspect of the invention provides a terminal comprising a processor for implementing the method of monitoring a distributed file system when executing a computer program stored in a memory.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of monitoring a distributed file system.
In summary, the monitoring method, the monitoring device, the monitoring terminal and the monitoring storage medium of the distributed file system according to the present invention obtain the log output by the distributed file system to be monitored; identifying the operation type of each row of data in the log; classifying the data in the log according to the operation type; dividing data of the same operation type into different grades; calculating the response parameter of each grade in the same operation type; calculating deviation values of the response parameters and corresponding preset baseline data; judging whether each deviation value is within a preset deviation threshold range; when each deviation value is determined to be within a preset deviation threshold value range, outputting a result that the distributed file system normally operates; and when one deviation value is determined not to be within the preset deviation threshold value range, outputting the result of abnormal operation of the distributed file system. According to the method and the device, the deviation value of the response parameter of different levels in different types and the preset baseline data is calculated, whether each deviation value meets the preset threshold range is judged, the log in the specific level corresponding to the specific operation type can be quickly determined to be abnormal, the time for troubleshooting abnormal data is shortened, the operation and maintenance efficiency is improved, the user experience is improved, and the operation stability of the distributed file system is ensured.
Drawings
Fig. 1 is a flowchart of a monitoring method for a distributed file system according to an embodiment of the present invention.
Fig. 2 is a structural diagram of a monitoring apparatus of a distributed file system according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention.
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are merely a subset of the embodiments of the present invention, rather than a complete embodiment. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Example one
Fig. 1 is a flowchart of a monitoring method for a distributed file system according to an embodiment of the present invention.
In this embodiment, the monitoring method for the distributed file system may be applied to a terminal, and for a monitoring terminal that needs to perform the distributed file system, the monitoring function of the distributed file system provided by the method of the present invention may be directly integrated on the terminal, or may be run in the terminal in the form of a Software Development Kit (SKD).
As shown in fig. 1, the monitoring method of the distributed file system specifically includes the following steps, and the order of the steps in the flowchart may be changed, and some steps may be omitted according to different requirements.
S11: and acquiring a log output by the distributed file system to be monitored.
In this embodiment, a period for acquiring a log output by the distributed file system to be monitored may be preset, and the preset period may be set to 1 hour or 2 hours. And when the period of the log output by the distributed file system to be monitored reaches a preset period, acquiring the log output by the distributed file system to be monitored.
S12: and identifying the operation type of each row of data in the log.
In this embodiment, the log output by the distributed file system to be monitored is recorded in a log record table, an operation identifier is recorded in the log record table, and the operation type of the single line of data can be determined by identifying the operation identifier of each line of data in the log.
The operation type may include uploading, downloading, deleting, or querying, etc.
S13: and classifying the data in the log according to the operation type.
In this embodiment, the operation types of the log are various, the response parameters of the output log corresponding to each operation type are very different, and the data in the log is classified according to different operation types, for example: classifying the data in the log with the operation type of uploading into an uploading operation file; and classifying the data in the log with the operation type of downloading into a downloading operation file. By classifying the logs of the same operation type, the occurrence of large differences of response parameters of the logs output by the distributed file system to be monitored, which are caused by data mixing in the logs of different operation types, can be avoided to a certain extent.
S14: data of the same operation type is divided into different grades.
In this embodiment, the level may be set according to a size range of data or a type of data, where the type of data may include: text files, video files, audio files, picture files, and the like. In other embodiments, the division of the levels may also be defined according to actual situations, and the invention is not limited herein.
The following illustrates how data of the same operation type is divided into different levels according to the size range of the data. Assuming that the operation type is an uploading operation, dividing the size range of all data corresponding to the uploading operation into three levels, and dividing the data with the size range of 10K-500K in the uploading operation into a first level; dividing data with the size range of 500K-2000K in the uploading operation into a second grade; and dividing the data with the size range of 2000K-3M in the uploading operation into a third grade.
The following illustrates how data of the same operation type is divided into different levels according to the type of the data. Assuming that the operation type is a downloading operation, all data corresponding to the downloading operation can be divided into four grades according to the data type, and the data of which the data type is a text file in the downloading operation is divided into a first grade; dividing the data with the data type of the video file in the downloading operation into a second grade; dividing the data with the data type of the audio file in the downloading operation into a third grade; and dividing the data with the data type of the picture file in the downloading operation into a fourth grade.
S15: the response parameters for each step in the same operation type are calculated.
In this embodiment, the same operation type includes multiple levels, each level includes multiple data, and response parameters of the multiple data with the same level in the same operation type are calculated.
Preferably, the calculating the response parameter of each step in the same operation type includes:
acquiring a response parameter of each data of each grade in the same operation type;
calculating the average response parameter of each grade in each operation type according to the response parameters;
and determining the average response parameter as the response parameter of the corresponding grade.
In this embodiment, the response parameters of the multiple data with the same level in the same operation type are averaged to obtain the response parameters of the multiple data with the same level in the same operation type.
Illustratively, the first file in the uploading operation type includes 3 data, the response parameter of the first data is X1, the response parameter of the second data is X2, the response parameter of the third data is X3, and the calculated average response parameter corresponding to the first file in the uploading operation is Y ═ X1+ X2+ X3 ÷ 3.
In this embodiment, by calculating response parameters of a plurality of data having the same level in the same operation type, the calculation time of the response parameters can be shortened, and the monitoring efficiency can be improved.
S16: and calculating deviation values of the response parameters and the corresponding preset baseline data.
In this embodiment, baseline data may be preset, and deviation values between response parameters of different levels of different types and response parameters of corresponding types-levels may be calculated according to the baseline data.
Preferably, before calculating the deviation value between the response parameter of different levels of the different types and the preset baseline data, the method further includes:
baseline data is created in advance.
In this embodiment, the baseline data is created in advance according to response parameters of history logs of different levels in different types.
Preferably, the creating process of the preset baseline data includes:
acquiring a historical log in a preset time period;
equally dividing the historical logs into a plurality of sub-historical logs according to the time sequence of the historical log records;
identifying the operation type of each row of data in each sub-history log;
classifying the data in each sub-history log according to the operation type;
dividing data of the same operation type in each sub-history log into different grades;
calculating the response parameter of each data of each grade in the same operation type in each sub-history log;
calculating a first average response parameter of each grade in the same operation type in the same sub-history log according to the response parameters;
calculating a second average response parameter of the multiple sub-history logs of each grade in the same operation type according to the first average response parameter;
and taking the second average response parameter as preset baseline data of the corresponding type-grade.
In this embodiment, a time period may be preset, a history log in a preset time period is obtained, the history log is equally divided into n parts according to time information carried by the history log, for example, the preset time period is 30 days, and the history log of each day is taken as one part according to the time carried by the history log and is divided into 30 parts of sub-history logs in total. Identifying the operation type of each row of data in each sub-history log, dividing the same operation type according to different grades, calculating a first average response parameter of each sub-history log with the same grade in the same operation type, calculating a second average response parameter of each sub-history log in a preset time period according to the first average response parameter, and obtaining preset baseline data of the history log response parameters.
The following are exemplary: dividing the historical logs in a preset time period into n parts, wherein each grade in the same operation type of the first part of the historical logs comprises i data, calculating a first average response parameter of the i data in each grade in the same operation type of each part of the historical logs, as shown in table one, the first average response parameter of the first level of the first upload operation is A1 ═ a11+ a12+ … … + A1i ÷ i, the first average response parameter of the first level of the second upload operation is A2 ═ a21+ a22+ … … + A2i) ÷ i, the average value of a plurality of first response parameters of the same level in the same operation type is calculated to obtain the second average response parameter, as shown in table two, the second average response parameter of the first level in the upload operation is a ═ (a1+ a2+ … … + An) ÷ n, the second average response parameter is preset baseline data of the response parameters of the historical log.
First calculation of a first average response parameter
TABLE II calculates second average response parameter
Preferably, the calculating the deviation value between the response parameter and the corresponding preset baseline data includes:
acquiring preset baseline data of a corresponding type-grade;
calculating the difference value between the response parameter of the corresponding type-grade and the preset baseline data of the corresponding type-grade;
and dividing the absolute value of the difference value by the preset baseline data of the corresponding type-grade to obtain a value serving as a deviation value.
In this embodiment, a response parameter of a corresponding type and a corresponding level is obtained from the preset baseline data, a difference between the response parameter of the corresponding type and the corresponding level in the log output by the distributed file system to be monitored and the preset baseline data of the corresponding type and the corresponding level is calculated, and the deviation value is equal to an absolute value of the difference divided by the second average response parameter of the type and the corresponding level corresponding to the log in the preset baseline data.
Illustratively, the response parameter Y is obtained, Y represents an average response parameter of a first level of the uploading operation, a second average response parameter a of the corresponding first level of the uploading operation in the preset baseline data is obtained, and a deviation value Z of the monitoring data and the preset baseline data is ═ Y-a | ÷ a.
S17: and judging whether each deviation value is within a preset deviation threshold value range.
In this embodiment, a deviation threshold may be preset, for example, the preset deviation threshold is set to 10%, each calculated deviation value is compared with the preset deviation threshold, and whether each deviation value is within a preset deviation value threshold range is determined.
In this embodiment, by calculating the deviation values of the response parameters of different levels in different types and the preset baseline data, the deviation values of the response parameters of the log output by the distributed file system to be monitored in the same operation type and the response parameters of the same type-level corresponding to the historical log can be determined at the first time, and whether the deviation values are within the preset deviation threshold range or not is determined, so that whether the data in the specific level corresponding to the specific operation type is abnormal or not can be rapidly determined, the operation and maintenance efficiency is improved, and the operation stability of the distributed file system is ensured.
When it is determined that each deviation value satisfies within the preset deviation threshold range, performing step S18; when it is determined that at least one deviation value is not within the preset deviation threshold range, step S19 is performed.
S18: and outputting the result that the distributed file system operates normally.
In this embodiment, when each deviation value of the log output by the distributed file system to be monitored is within the preset deviation threshold range, it is determined that each deviation value of the data of the log output by the distributed file system to be monitored meets the requirement, and no abnormal data appears, and a result that the distributed file system operates normally is output.
S19: and outputting the abnormal operation result of the distributed file system.
In this embodiment, when one of the deviation values of the logs output by the distributed file system to be monitored is not within the preset deviation threshold range, it is determined that the data in the log corresponding to the deviation value which is not within the preset deviation threshold range is abnormal, which causes the distributed file system to operate abnormally, and the abnormal result is output.
Further, after the outputting the result of the distributed file system running exception, the method further includes:
and sending alarm information to an administrator.
In this embodiment, after the distributed file system outputs a result of an abnormal operation, the alarm information carrying the abnormal result is sent to an administrator, where the alarm information includes a specific operation type of abnormal data and a specific level corresponding to the specific operation type of the abnormal data.
Further, after sending the alarm information to the administrator, the method further includes:
and identifying abnormal data in the log output by the distributed file system to be monitored.
In the embodiment, the alarm information is sent to the administrator to inform the administrator that the data in the specific grade in the specific operation type is abnormal and identify the abnormal data in the log output by the distributed file system to be monitored, so that the administrator can directly position the abnormal data and perform later maintenance conveniently, the time for checking the abnormal data is shortened, the operation and maintenance efficiency is improved, and meanwhile, the operation stability of the distributed file system is improved, the user experience is improved, and the operation stability of the distributed file system is ensured.
In summary, in the monitoring method for the distributed file system according to the present invention, the log output by the distributed file system to be monitored is obtained; identifying the operation type of each row of data in the log; classifying the data in the log according to the operation type; dividing data of the same operation type into different grades; calculating the response parameter of each grade in the same operation type; calculating deviation values of the response parameters and corresponding preset baseline data; judging whether each deviation value is within a preset deviation threshold range; when each deviation value is determined to be within a preset deviation threshold value range, outputting a result that the distributed file system normally operates; and when one deviation value is determined not to be within the preset deviation threshold value range, outputting the result of abnormal operation of the distributed file system. According to the method and the device, the deviation value of the response parameter of different levels in different types and the preset baseline data is calculated, whether each deviation value meets the preset threshold range or not is judged, the log in the specific level corresponding to the specific operation type can be quickly determined to be abnormal, the time for troubleshooting abnormal data is shortened, the operation and maintenance efficiency is improved, the user experience is improved, and the operation stability of the distributed file system is ensured.
Example two
Fig. 2 is a structural diagram of a monitoring apparatus of a distributed file system according to a second embodiment of the present invention.
In some embodiments, the monitoring device 20 of the distributed file system may comprise a plurality of functional modules consisting of program code segments. The program code of the various program segments in the monitoring means 20 of the distributed file system may be stored in a memory of the terminal and executed by the at least one processor to perform (see detailed description of fig. 1) the monitoring of the presence of the distributed file system.
In this embodiment, the monitoring apparatus 20 of the distributed file system may be divided into a plurality of functional modules according to the functions executed by the monitoring apparatus. The functional module may include: the system comprises anacquisition module 201, arecognition module 202, aclassification module 203, adivision module 204, afirst calculation module 205, asecond calculation module 206, acreation module 207, ajudgment module 208, anoutput module 209, a sendingmodule 210 and anidentification module 211. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The acquisition module 201: the method is used for acquiring the log output by the distributed file system to be monitored.
In this embodiment, a period for acquiring a log output by the distributed file system to be monitored may be preset, and the preset period may be set to 1 hour or 2 hours. And when the period of the log output by the distributed file system to be monitored reaches a preset period, acquiring the log output by the distributed file system to be monitored.
The identification module 202: for identifying the type of operation of each line of data in the log.
In this embodiment, the log output by the distributed file system to be monitored is recorded in a log record table, an operation identifier is recorded in the log record table, and the operation type of the single line of data can be determined by identifying the operation identifier of each line of data in the log.
The operation type may include uploading, downloading, deleting, or querying, etc.
The classification module 203: the operation type is used for classifying the data in the log according to the operation type.
In this embodiment, the operation types of the log are various, the response parameters of the output log corresponding to each operation type are very different, and the data in the log is classified according to different operation types, for example: classifying the data in the log with the operation type of uploading into an uploading operation file; and classifying the data in the log with the operation type of downloading into a downloading operation file. By classifying the logs of the same operation type, the occurrence of large differences of response parameters of the logs output by the distributed file system to be monitored, which are caused by data mixing in the logs of different operation types, can be avoided to a certain extent.
The dividing module 204: for dividing data of the same operation type into different levels.
In this embodiment, the level may be set according to a size range of data or a type of the data, where the type of the data may include: text files, video files, audio files, picture files, and the like. In other embodiments, the division of the levels may also be defined according to actual situations, and the invention is not limited herein.
The following illustrates how data of the same operation type is divided into different levels according to the size range of the data. Assuming that the operation type is an uploading operation, dividing the size range of all data corresponding to the uploading operation into three levels, and dividing the data with the size range of 10K-500K in the uploading operation into a first level; dividing data with the size range of 500K-2000K in the uploading operation into a second grade; and dividing the data with the size range of 2000K-3M in the uploading operation into a third grade.
The following illustrates how data of the same operation type is divided into different levels according to the type of the data. Assuming that the operation type is a downloading operation, all data corresponding to the downloading operation can be divided into four grades according to the data type, and the data of which the data type is a text file in the downloading operation is divided into a first grade; dividing the data with the data type of the video file in the downloading operation into a second grade; dividing the data with the data type of the audio file in the downloading operation into a third grade; and dividing the data with the data type of the picture file in the downloading operation into a fourth grade.
The first calculation module 205: for calculating the response parameters for each step in the same operation type.
In this embodiment, the same operation type includes multiple levels, each level includes multiple data, and response parameters of the multiple data with the same level in the same operation type are calculated.
Preferably, the calculating the response parameter of each level in the same operation type by thefirst calculating module 205 includes:
acquiring a response parameter of each data of each grade in the same operation type;
calculating the average response parameter of each grade in each operation type according to the response parameters;
and determining the average response parameter as the response parameter of the corresponding grade.
In this embodiment, the response parameters of the multiple data with the same level in the same operation type are averaged to obtain the response parameters of the multiple data with the same level in the same operation type.
Illustratively, the first file in the uploading operation type includes 3 data, the response parameter of the first data is X1, the response parameter of the second data is X2, the response parameter of the third data is X3, and the calculated average response parameter corresponding to the first file in the uploading operation is Y ═ X1+ X2+ X3 ÷ 3.
In this embodiment, by calculating response parameters of a plurality of data having the same level in the same operation type, the calculation time of the response parameters can be shortened, and the monitoring efficiency can be improved.
The second calculation module 206: and the deviation value of the response parameter and the corresponding preset baseline data is calculated.
In this embodiment, baseline data may be preset, and deviation values between response parameters of different levels of different types and response parameters of corresponding types-levels may be calculated according to the baseline data.
Preferably, before thesecond calculating module 206 calculates the deviation value between the response parameter of different levels of the different types and the preset baseline data, the monitoring apparatus of the distributed file system further includes:
the creation module 207: for pre-creating baseline data.
In this embodiment, the baseline data is created in advance according to response parameters of history logs of different levels in different types.
Preferably, the process of creating the preset baseline data by the creatingmodule 207 includes:
acquiring a historical log in a preset time period;
equally dividing the historical logs into a plurality of sub-historical logs according to the time sequence of the historical log records;
identifying the operation type of each row of data in each sub-history log;
classifying the data in each sub-history log according to the operation type;
dividing data of the same operation type in each sub-history log into different grades;
calculating the response parameter of each data of each grade in the same operation type in each sub-history log;
calculating a first average response parameter of each grade in the same operation type in the same sub-history log according to the response parameters;
calculating a second average response parameter of the multiple sub-history logs of each grade in the same operation type according to the first average response parameter;
and taking the second average response parameter as preset baseline data of the corresponding type-grade.
In this embodiment, a time period may be preset, a history log in a preset time period is obtained, the history log is equally divided into n parts according to time information carried by the history log, for example, the preset time period is 30 days, and the history log of each day is divided into 30 parts according to the time carried by the history log. And identifying the operation type in each sub-history log, dividing the same operation type according to different grades, and calculating a first average response parameter of each sub-history log with the same grade in the same operation type. And calculating a second average response parameter of each sub-historical log in a preset time period according to the first average response parameter to obtain preset baseline data of the historical log response parameters.
The following are exemplary: dividing the historical logs in a preset time period into n parts, wherein each grade in the same operation type of the first part of the historical logs comprises i data, calculating a first average response parameter of the i data in each grade in the same operation type of each part of the historical logs, as shown in table one, the first average response parameter of the first level of the first upload operation is A1 ═ a11+ a12+ … … + A1i ÷ i, the first average response parameter of the first level of the second upload operation is A2 ═ a21+ a22+ … … + A2i) ÷ i, the average value of a plurality of first response parameters of the same level in the same operation type is calculated to obtain the second average response parameter, as shown in table two, the second average response parameter of the first level in the upload operation is a ═ (a1+ a2+ … … + An) ÷ n, the second average response parameter is preset baseline data of the response parameters of the historical log.
First calculation of a first average response parameter
TABLE II calculates second average response parameter
Preferably, the calculating, by thesecond calculating module 206, the deviation value between the response parameter and the corresponding preset baseline data includes:
acquiring preset baseline data of a corresponding type-grade;
calculating the difference value between the response parameter of the corresponding type-grade and the preset baseline data of the corresponding type-grade;
and dividing the absolute value of the difference value by the preset baseline data of the corresponding type-grade to obtain a value serving as a deviation value.
In this embodiment, a response parameter of a corresponding type and a corresponding level is obtained from the preset baseline data, a difference between the response parameter of the corresponding type and the corresponding level in the log output by the distributed file system to be monitored and the preset baseline data of the corresponding type and the corresponding level is calculated, and the deviation value is equal to an absolute value of the difference divided by the second average response parameter of the type and the corresponding level corresponding to the log in the preset baseline data.
In this embodiment, the target preset baseline data refers to response parameters of the same type and the same level corresponding to the type and the level in the log, a difference between the response parameters of the same level in the same operation type in the log output by the distributed file system to be monitored and the target preset baseline data corresponding to the type and the level is calculated, and the difference is equal to an absolute value of the difference divided by the second average response parameter of the type-level corresponding to the log in the preset baseline data.
Illustratively, the response parameter Y is obtained, Y represents an average response parameter of a first level of the uploading operation, a second average response parameter a of the corresponding first level of the uploading operation in the preset baseline data is obtained, and a deviation value Z of the monitoring data and the preset baseline data is ═ Y-a | ÷ a.
The judging module 208: and the deviation value judging module is used for judging whether each deviation value is within a preset deviation threshold value range.
In this embodiment, a deviation threshold may be preset, for example, the preset deviation threshold is set to 10%, each calculated deviation value is compared with the preset deviation threshold, and whether each deviation value is within a preset deviation value threshold range is determined.
In this embodiment, by calculating the deviation values of the response parameters of different levels in different types and the preset baseline data, the deviation values of the response parameters of the log output by the distributed file system to be monitored in the same operation type and the response parameters of the same type-level corresponding to the historical log can be determined at the first time, and whether the deviation values are within the preset deviation threshold range or not is determined, so that whether the data in the specific level corresponding to the specific operation type is abnormal or not can be rapidly determined, the operation and maintenance efficiency is improved, and the operation stability of the distributed file system is ensured.
The output module 209: when the judgingmodule 208 determines that each deviation value meets the preset deviation threshold range, outputting a result that the distributed file system operates normally.
In this embodiment, when each deviation value of the log output by the distributed file system to be monitored is within the preset deviation threshold range, it is determined that each deviation value in the data of the log output by the distributed file system to be monitored meets the requirement, no abnormal data occurs, and a result that the distributed file system operates normally is output.
The output module 209: and is further configured to output a result of abnormal operation of the distributed file system when the determiningmodule 208 determines that at least one deviation value does not meet the preset deviation threshold range.
In this embodiment, when one of the deviation values of the logs output by the distributed file system to be monitored is not within the preset deviation threshold range, it is determined that the data in the log corresponding to the deviation value which is not within the preset deviation threshold range is abnormal, which causes the distributed file system to operate abnormally, and the abnormal result is output.
Further, after theoutput module 209 outputs the result of the abnormal operation of the distributed file system, the monitoring apparatus of the distributed file system further includes:
the sending module 210: for sending alarm information to the administrator.
In this embodiment, after the distributed file system outputs a result of an abnormal operation, the alarm information carrying the abnormal result is sent to an administrator, where the alarm information includes a specific operation type of abnormal data and a specific level corresponding to the specific operation type of the abnormal data.
Further, after the sendingmodule 210 sends the warning message to the administrator, the monitoring apparatus of the distributed file system further includes:
the identification module 211: the method is used for identifying abnormal data in the log output by the distributed file system to be monitored.
In the embodiment, the alarm information is sent to the administrator to inform the administrator that the data in the specific grade in the specific operation type is abnormal and identify the abnormal data in the log output by the distributed file system to be monitored, so that the administrator can directly position the abnormal data and perform later maintenance conveniently, the time for checking the abnormal data is shortened, the operation and maintenance efficiency is improved, and meanwhile, the operation stability of the distributed file system is improved, the user experience is improved, and the operation stability of the distributed file system is ensured.
In summary, the monitoring device for a distributed file system according to the present invention obtains the log output by the distributed file system to be monitored; identifying the operation type of each row of data in the log; classifying the data in the log according to the operation type; dividing data of the same operation type into different grades; calculating the response parameter of each grade in the same operation type; calculating deviation values of the response parameters and corresponding preset baseline data; judging whether each deviation value is within a preset deviation threshold range; when each deviation value is determined to be within a preset deviation threshold value range, outputting a result that the distributed file system normally operates; and when one deviation value is determined not to be within the preset deviation threshold value range, outputting the result of abnormal operation of the distributed file system. According to the method and the device, the deviation value of the response parameter of different levels in different types and the preset baseline data is calculated, whether each deviation value meets the preset threshold range is judged, the log in the specific level corresponding to the specific operation type can be quickly determined to be abnormal, the time for troubleshooting abnormal data is shortened, the operation and maintenance efficiency is improved, the user experience is improved, and the operation stability of the distributed file system is ensured.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention. In the preferred embodiment of the present invention, theterminal 3 includes amemory 31, at least oneprocessor 32, at least onecommunication bus 33, and atransceiver 34.
It will be appreciated by those skilled in the art that the configuration of the terminal shown in fig. 3 is not limiting to the embodiments of the present invention, and may be a bus-type configuration or a star-type configuration, and theterminal 3 may include more or less hardware or software than those shown, or a different arrangement of components.
In some embodiments, theterminal 3 is a terminal capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. Theterminal 3 may further include a client device, which includes, but is not limited to, any electronic product capable of performing human-computer interaction with a client through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, and the like.
It should be noted that theterminal 3 is only an example, and other existing or future electronic products, such as those that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
In some embodiments, thememory 31 is used for storing program codes and various data, such as the monitoring device 20 of the distributed file system installed in theterminal 3, and realizes high-speed and automatic access to programs or data during the operation of theterminal 3. TheMemory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable rewritable Read-Only Memory (EEPROM), and a compact disc Read-Only Memory (CD-ROM). In addition, thememory 31 may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, or other non-volatile solid state storage device.
In some embodiments, the at least oneprocessor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The at least oneprocessor 32 is a Control Unit (Control Unit) of theterminal 3, connects various components of theentire terminal 3 by using various interfaces and lines, and executes various functions of theterminal 3 and processes data, such as monitoring of a distributed file system, by running or executing programs or modules stored in thememory 31 and calling data stored in thememory 31.
In some embodiments, the at least onecommunication bus 33 is arranged to enable connection communication between thememory 31 and the at least oneprocessor 32 or the like.
Although not shown, theterminal 3 may further include a power supply (such as a battery) for supplying power to various components, and preferably, the power supply may be logically connected to the at least oneprocessor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. Theterminal 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a terminal, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present invention.
In a further embodiment, in conjunction with fig. 2, the at least oneprocessor 32 may execute operating means of theterminal 3 and various installed application programs (such as the monitoring means 20 of the distributed file system), program code, etc., such as the respective modules described above.
Thememory 31 has program code stored therein, and the at least oneprocessor 32 can call the program code stored in thememory 31 to perform related functions. For example, the modules illustrated in fig. 2 are program code stored in thememory 31 and executed by the at least oneprocessor 32, so as to implement the functions of the modules for the purpose of monitoring the distributed file system.
In one embodiment of the invention, thememory 31 stores a plurality of instructions that are executed by the at least oneprocessor 32 to enable monitoring of a distributed file system.
Specifically, the at least oneprocessor 32 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, and details are not repeated here.
Example four
An embodiment of the present invention further provides a computer-readable storage medium, where computer-executable instructions are stored on the computer-readable storage medium, and when executed by a processor of a computer device, the instructions implement a monitoring method for a distributed file system, where the monitoring method for the distributed file system includes:
acquiring a log output by a distributed file system to be monitored;
identifying the operation type of each row of data in the log;
classifying the data in the log according to the operation type;
dividing data of the same operation type into different grades;
calculating the response parameter of each grade in the same operation type;
calculating deviation values of the response parameters and corresponding preset baseline data;
judging whether each deviation value is within a preset deviation threshold range;
and when each deviation value is determined to be within the preset deviation threshold value range, outputting a result that the distributed file system operates normally.
Specifically, the instructions executed by the processor to implement the monitoring of the distributed file system may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not repeated herein.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.