Monitoring method, device and computer readable storage medium

By obtaining and analyzing the resource indicator data of the K3s cluster, determining resource utilization abnormalities, and using the monitoring components of adjacent clusters for cross-cluster monitoring, the monitoring failure problem caused by instability of the K3s cluster network is solved, and resource utilization and monitoring services are improved reliability.

CN115022209BActive Publication Date: 2025-02-11CHINA TELECOM CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210722697.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2025-02-11
Estimated Expiration
2042-06-24

Smart Images

  • Figure CN115022209B_ABST
    Figure CN115022209B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a monitoring method, device and computer-readable storage medium, and to the field of communication technology. The method of the present disclosure includes: obtaining current data and predicted data of multiple resource indicators in the current cluster; determining whether the resource utilization of the current cluster is abnormal according to the current data and predicted data of the multiple resource indicators; in the case of abnormal resource utilization of the current cluster, determining whether the resource utilization of one or more adjacent clusters is abnormal; in the case of a cluster with normal resource utilization among the one or more adjacent clusters, monitoring the current cluster using the monitoring component in the cluster with normal resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a monitoring method, device and computer-readable storage medium. Background Art

[0002] With the need for edge computing, there is an urgent need for a lightweight, reliable, and easy-to-deploy operation and management platform to deploy applications and monitor application status under limited resources on edge nodes. K3s has become one of the main solutions for edge node clusters based on its lightweight, easy deployment, and application deployment that is exactly the same as Kubernetes. K3s itself only requires 60 megabytes of binary files and 200 megabytes of offline data packets. K3s has very low requirements for the operating platform and starts quickly.

[0003] In a Kubernetes cluster, you can use monitoring components (for example, Prometheus) to collect resource indicator data and generate alarm information or store it to monitor the cluster. The monitoring components in a Kubernetes cluster can be applied in K3s. Summary of the invention

[0004] The inventor found that due to the limited resources of K3s, the discrete distribution of equipment in different computer rooms, factory areas, and different geographical areas, the cluster network is unstable, and the load reaches the peak and other network congestion, which causes the monitoring component to fail to obtain resource indicators and generate alarm information. It is difficult for operation and maintenance personnel to determine whether to restart the cluster based on the alarm information. In fact, short-term network congestion does not affect the normal operation of other application services in the container. Direct restart will cause service interruption and waste of resources, and the log data and indicators inside the container level will also be directly lost.

[0005] A technical problem to be solved by the present disclosure is: how to monitor the K3s cluster more accurately and effectively.

[0006] According to some embodiments of the present disclosure, a monitoring method is provided, including: obtaining current data and predicted data of multiple resource indicators in the current cluster; determining whether the resource utilization of the current cluster is abnormal based on the current data and predicted data of the multiple resource indicators; in the case where the resource utilization of the current cluster is abnormal, determining whether the resource utilization of one or more adjacent clusters is abnormal; in the case where there is a cluster with normal resource utilization among the one or more adjacent clusters, monitoring the current cluster using the monitoring components in the cluster with normal resource utilization.

[0007] In some embodiments, determining whether the resource utilization of the current cluster is abnormal based on current data and predicted data of multiple resource indicators includes: determining an availability evaluation value based on the current data of each resource indicator and the threshold value corresponding to each resource indicator; determining an abnormality evaluation value based on the predicted data of each resource indicator; determining a total evaluation value based on the availability evaluation value and the abnormality evaluation value; and determining whether the resource utilization of the current cluster is abnormal based on a comparison between the total evaluation value and a preset evaluation value.

[0008] In some embodiments, the current data of each resource indicator includes: the remaining ratio of each resource indicator. According to the current data of each resource indicator and the threshold value corresponding to each resource indicator, determining the availability evaluation value includes: for each resource indicator, if the remaining ratio of the resource indicator is greater than the threshold value corresponding to the resource indicator, determining that the resource indicator is available; if the remaining ratio of the resource indicator is less than or equal to the threshold value corresponding to the resource indicator, determining that the resource indicator is unavailable; if all resource indicators are available, determining the availability evaluation value to be a first preset value; if all resource indicators are unavailable, determining the availability evaluation value to be a second preset value.

[0009] In some embodiments, the remaining ratio of each resource indicator is determined by the following method: subtracting the requested amount of the resource indicator from the available amount of the resource indicator to obtain the remaining amount of the resource indicator; the ratio of the remaining amount of the resource indicator to the available amount of the resource indicator is used as the remaining ratio of the resource indicator; wherein each resource indicator includes: CPU resource indicator, random access memory RAM resource indicator and hard disk resource indicator.

[0010] In some embodiments, the predicted data of each resource indicator is determined based on the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle. The larger the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle, the smaller the predicted data of the resource indicator.

[0011] In some embodiments, determining the abnormal evaluation value based on the predicted data of each resource indicator includes: weighted summing the predicted data of each resource indicator according to the weights corresponding to each resource indicator; and determining the abnormal evaluation value based on the result of the weighted summation, wherein the smaller the predicted data of each resource indicator, the smaller the abnormal evaluation value.

[0012] In some embodiments, the weight corresponding to each resource indicator is determined based on at least one of the data fluctuation and importance of the resource indicator. The greater the data fluctuation of the resource indicator, the smaller the corresponding weight; the higher the importance of the resource indicator, the greater the corresponding weight.

[0013] In some embodiments, the various resource indicators include: CPU resource indicators, random access memory RAM resource indicators, hard disk resource indicators, application program interface API resource indicators and network resource indicators.

[0014] In some embodiments, monitoring the current cluster using a monitoring component in a cluster with normal resource utilization includes: modifying the port through which the monitoring component in the cluster with normal resource utilization obtains the information to be monitored to a port in the current cluster; establishing cross-cluster communication between the cluster with normal resource utilization and the current cluster; and using the monitoring component in the cluster with normal resource utilization to communicate with the current cluster across clusters through the port in the current cluster to obtain the information to be monitored in the current cluster.

[0015] In some embodiments, the method also includes: in the case that there is no cluster with normal resource utilization in one or more adjacent clusters, determining one or more resource indicators among the multiple resource indicators whose corresponding resource consumption exceeds a preset consumption value as non-monitored resource indicators; modifying at least one of the monitoring rules and alarm rules of the monitoring component of the current cluster, wherein the monitoring rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster abandons collecting data on non-monitored resource indicators, and the alarm rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster stops issuing abnormal alarms and prompts preset information.

[0016] In some embodiments, obtaining current data and predicted data of multiple resource indicators in the current cluster includes: obtaining current data of multiple resource indicators in the current cluster through a container group monitor and a service monitor; predicting the multiple resource indicators to obtain predicted data of the multiple resource indicators.

[0017] According to some other embodiments of the present disclosure, a monitoring device is provided, including: an acquisition unit, used to acquire current data and predicted data of multiple resource indicators in the current cluster; an anomaly detection unit, used to determine whether the resource utilization of the current cluster is abnormal based on the current data and predicted data of the multiple resource indicators; a determination unit, used to determine whether the resource utilization of one or more adjacent clusters is abnormal when the resource utilization of the current cluster is abnormal; and a monitoring control unit, used to monitor the current cluster by using the monitoring components in the cluster with normal resource utilization when there is a cluster with normal resource utilization in the one or more adjacent clusters.

[0018] According to some further embodiments of the present disclosure, a monitoring device is provided, comprising: a processor; and a memory coupled to the processor, for storing instructions, wherein when the instructions are executed by the processor, the processor executes the monitoring method as described in any of the aforementioned embodiments.

[0019] According to some further embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the monitoring method of any of the aforementioned embodiments.

[0020] In the present disclosure, based on the current data and predicted data of multiple resource indicators in the current cluster, it is determined whether the resource utilization in the current cluster is abnormal. In the case of abnormal resource utilization in the current cluster, if there is a cluster with normal resource utilization in the adjacent cluster, the current cluster is monitored by the monitoring component in the cluster with normal resource utilization. In the present disclosure, determining whether resource utilization is abnormal can predict whether the network is blocked. Monitoring the current cluster by the monitoring component in the cluster with normal resource utilization can reduce the occupation of resources in the current cluster by the monitoring component, so that the resource utilization rate of the current cluster is improved, the monitoring data can be saved, and the high reliability of the monitoring service in the K3s cluster is maintained, so that the K3s cluster can be monitored more accurately and effectively.

[0021] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 A flowchart diagram of a monitoring method according to some embodiments of the present disclosure is shown.

[0024] Figure 2 A schematic diagram showing the system architecture of some embodiments of the present disclosure.

[0025] Figure 3 A schematic diagram showing the structure of a monitoring device according to some embodiments of the present disclosure.

[0026] Figure 4 A schematic diagram showing the structure of monitoring devices according to other embodiments of the present disclosure.

[0027] Figure 5 A schematic diagram showing the structure of monitoring devices according to some other embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0029] This paper proposes a monitoring method suitable for clusters with limited resources such as K3s that are prone to network congestion. Figures 1-2 Give a description.

[0030] Figure 1 Flowcharts of some embodiments of the monitoring method disclosed herein. Figure 1 As shown, the method of this embodiment includes: steps S102 to S108.

[0031] In step S102, current data and predicted data of multiple resource indicators in the current cluster are obtained.

[0032] In some embodiments, current data of multiple resource indicators in the current cluster are obtained through a container group monitor (Pod Monitor) and a service monitor (ServiceMonitor). The container group monitor and the service monitor are respectively used to obtain one or more resource indicators related to the container group and one or more resource indicators related to the service. The one or more resource indicators related to the container group include: at least one of a CPU resource indicator, a random access memory (RAM) resource indicator, and a hard disk (Disk) resource indicator. One or more resource indicators related to the service include: an application program interface (API) resource indicator and a network (Internet) resource indicator. Various resource indicators can be obtained from the resource indicators that K3s needs to monitor.

[0033] The monitoring component is, for example, Prometheus, which can pull the data of resource indicators that need to be monitored through the indicator data interface provided by Pod Monitor and ServiceMonitor. For example, CPU resource indicators include the number of CPU cores, CPU usage, etc., RAM resource indicators include RAM space, RAM pressure, etc., and hard disk resource indicators include hard disk space, hard disk pressure, etc., without limitation to the examples given.

[0034] In some embodiments, multiple resource indicators are predicted to obtain prediction data of the multiple resource indicators. For example, an existing prediction model may be used to predict the multiple resource indicators.

[0035] In step S104, it is determined whether the resource utilization of the current cluster is abnormal based on the current data and the predicted data of the plurality of resource indicators.

[0036] In some embodiments, an availability evaluation value is determined based on current data of each resource indicator and a threshold value corresponding to each resource indicator; an abnormality evaluation value is determined based on predicted data of each resource indicator; a total evaluation value is determined based on the availability evaluation value and the abnormality evaluation value; and whether the resource utilization of the current cluster is abnormal is determined based on a comparison between the total evaluation value and a preset evaluation value.

[0037] For example, the total evaluation value is the product of the availability evaluation value and the abnormality evaluation value, which can be expressed by the following formula.

[0038] finalScore= usabilityScore* anomalyScore (1)

[0039] finalScore indicates the total evaluation value, usabilityScore indicates the availability evaluation value, and anomalyScore indicates the anomaly evaluation value. The higher the finalScore is, the better the resource utilization of the current cluster is and the lower the probability of anomaly is. Compare the total evaluation value with the preset evaluation value. If the total evaluation value is higher than the preset evaluation value, the resource utilization of the current cluster is normal, otherwise it is abnormal.

[0040] Furthermore, the current data of each resource indicator includes, for example, the remaining ratio of each resource indicator. The remaining ratio of each resource indicator is determined by the following method: subtracting the requested amount of the resource indicator from the available amount of the resource indicator to obtain the remaining amount of the resource indicator; and taking the ratio of the remaining amount of the resource indicator to the available amount of the resource indicator as the remaining ratio of the resource indicator. Each resource indicator includes, for example, a CPU resource indicator, a RAM resource indicator, and a hard disk resource indicator.

[0041] In some embodiments, for each resource indicator, when the remaining ratio of the resource indicator is greater than the threshold corresponding to the resource indicator, the resource indicator is determined to be available, and when the remaining ratio of the resource indicator is less than or equal to the threshold corresponding to the resource indicator, the resource indicator is determined to be unavailable; when all resource indicators are available, the availability evaluation value is determined to be a first preset value; when all resource indicators are unavailable, the availability evaluation value is determined to be a second preset value. For example, the first preset value is 1, and the second preset value is 0, without limitation to the examples given. For example, the availability evaluation value can be determined using the following formula.

[0042] A1=current[x]%-C x (2)

[0043]

[0044] A2=avaCPU*avaRAM*avaDISK (4)

[0045]

[0046] Where x represents a resource indicator, which can be a CPU resource indicator, a RAM resource indicator, or a DISK resource indicator. Current[x]% represents the remaining proportion of resource indicator x. x Indicates the threshold corresponding to resource indicator x.

[0047] In some embodiments, the prediction data of each resource indicator is determined based on the difference between the predicted request amount of the resource indicator and the request amount of the resource indicator in the previous cycle. The larger the difference between the predicted request amount of the resource indicator and the request amount of the resource indicator in the previous cycle, the smaller the prediction data of the resource indicator. For example, for each resource indicator, the ratio of the absolute value of the difference between the predicted request amount of the indicator and the request amount in the previous cycle to the available amount is determined, and the product of the ratio and the third preset value is subtracted from the third preset value to obtain the prediction data of the resource indicator.

[0048] Furthermore, according to the weights corresponding to the various resource indicators, the predicted data of the various resource indicators are weighted and summed; and the abnormal evaluation value is determined according to the result of the weighted sum, wherein the smaller the predicted data of the various resource indicators is, the smaller the abnormal evaluation value is.

[0049] Furthermore, the weight corresponding to each resource indicator is determined based on at least one of the data fluctuation and importance of the resource indicator. The greater the data fluctuation of the resource indicator, the smaller the corresponding weight, and the higher the importance of the resource indicator, the greater the corresponding weight. The data fluctuation of each resource indicator can be determined based on the statistical variance of the data of the resource indicator. For example, for each resource indicator, the difference between the available amount of the resource indicator and the statistical variance of the data is determined, and the ratio of the difference to the available amount is used as the weight corresponding to the resource indicator.

[0050] For example, the abnormality evaluation value is determined using the following formula.

[0051]

[0052] weight[x]=(total x -variance x ) / total x (7)

[0053] anomalyScore=((weightCpu*predictCpu)+(weightRam*predictRam)+(weightAPI*predictAPI)+(weightDisk*predictDisk)+(weightNetwork*predictNetwork))*β (8)

[0054] Among them, predict x is the predicted request volume of resource indicator x, total x is the available amount of resource indicator x, lastperiod x is the request volume of resource indicator x in the previous period, α is the third preset value, predict[x] is the predicted data of resource indicator x, variance x is the statistical variance of resource indicator x, which can be obtained through the monitoring component, β is the fourth preset value, weight[x] is the weight corresponding to resource indicator x, and x can be a CPU resource indicator, a RAM resource indicator, a DISK resource indicator, an API indicator, or a Network indicator. α and β are used to adjust the value range of anomalyScore. For example, when the value range of anomalyScore is (0, 100), α can be configured as 10 and β can be configured as 2.

[0055] The above formula only considers the data fluctuation of resource indicators. You can also set importance weights for each resource indicator. According to the importance weights corresponding to each resource indicator, the predicted data of each resource indicator are weighted and summed, and the abnormal assessment value is determined according to the result of the weighted summation.

[0056] The method of the above embodiment takes into account the current request volume, available volume, predicted request volume, fluctuation, etc. of various resource indicators, and is used to determine whether abnormal resource utilization will occur. It reflects the prediction of whether resource utilization will reach a peak and the monitoring component will be unable to obtain monitoring data.

[0057] In step S106 , when the resource utilization of the current cluster is abnormal, it is determined whether the resource utilization of one or more adjacent clusters is abnormal.

[0058] For each cluster, after determining whether the resource utilization of the cluster is abnormal, the result is sent to the cloud management platform or the total evaluation value is sent to the cloud management platform. In the case that the resource utilization of the current cluster is abnormal, the cloud management platform can be queried to see whether the resource utilization of one or more adjacent clusters is abnormal. Alternatively, the cloud management platform can be queried for the total evaluation value of one or more adjacent clusters, and whether the resource utilization of one or more clusters is abnormal can be determined based on the total evaluation value.

[0059] When the resource utilization of the current cluster is normal, the monitoring rules and alarm rules of the monitoring components can be restored to the default values.

[0060] In step S108, when there is a cluster with normal resource utilization in one or more adjacent clusters, the monitoring component in the cluster with normal resource utilization is used to monitor the current cluster.

[0061] In some embodiments, the port through which the monitoring component in the cluster with normal resource utilization obtains the information to be monitored is modified to a port in the current cluster; cross-cluster communication between the cluster with normal resource utilization and the current cluster is established; and the monitoring component in the cluster with normal resource utilization is used to communicate with the current cluster across clusters through the port in the current cluster to obtain the information to be monitored in the current cluster.

[0062] For example, the monitoring component is Prometheus, and Prometheus obtains the information to be monitored through the exporter port, and the information to be monitored includes, for example, multiple resource indicators. The exporter port in the current cluster can be exposed to the monitoring component in the normal cluster, and a cross-cluster communication connection resource can be established through Submariner to utilize the Prometheus server of the normal cluster.

[0063] In the method of the above embodiment, it is determined whether the resource utilization in the current cluster is abnormal based on the current data and predicted data of multiple resource indicators in the current cluster. In the case of abnormal resource utilization in the current cluster, if there is a cluster with normal resource utilization in the adjacent cluster, the current cluster is monitored by the monitoring component in the cluster with normal resource utilization. In the method of the above embodiment, determining whether the resource utilization is abnormal can predict whether the network is blocked. Monitoring the current cluster by the monitoring component in the cluster with normal resource utilization can reduce the occupation of resources in the current cluster by the monitoring component, so that the resource utilization rate of the current cluster is improved, the monitoring data can be saved, and the high reliability of the monitoring service in the K3s cluster is maintained, so that the K3s cluster can be monitored more accurately and effectively.

[0064] In some embodiments, the following steps are also included in parallel with step S108: In step S110, when there is no cluster with normal resource utilization in one or more adjacent clusters, one or more resource indicators whose corresponding resource consumption exceeds a preset consumption value among the multiple resource indicators are determined as non-monitored resource indicators.

[0065] For example, the PromQ tool can be used to determine one or more resource indicators whose corresponding resource consumption exceeds the preset consumption value among multiple resource indicators. For example, the PromQ tool is called to calculate Count[indicator]=count by(__name__)({__name__=~“.+”})>High, where High is the preset consumption value, and the resource indicators exceeding the High value are statistically summarized and thrown out.

[0066] In step S112, at least one of the monitoring rules and the alarm rules of the monitoring component of the current cluster is modified.

[0067] For example, modify the monitoring rules of the monitoring components of the current cluster so that the monitoring components of the current cluster give up collecting data on non-monitored resource indicators, modify the alarm rules of the monitoring components of the current cluster so that the monitoring components of the current cluster stop abnormal alarms and prompt preset information. For example, modify the Prometheus collection rules to give up collecting relevant data on non-monitored resource indicators, reduce monitoring resource consumption, modify the alarm rules, stop alarm exceptions and replace them with continuous generation [{Blocking abnormal interruption}+Terminated collection of {non-monitored resource indicators}].

[0068] The method of the above embodiment may be executed periodically.

[0069] The method of the above embodiment can be executed by a monitoring device, and the monitoring device can be set in a master node in the cluster. Figure 2 As shown, the monitoring device may include: a monitoring monitoring module, which is used to monitor multiple resource indicators fed back by the monitoring component and import the current data of multiple resource indicators into the monitoring calculation module; a monitoring calculation module, which is used to determine the total evaluation value and pass it into the monitoring configuration module; a monitoring configuration module, which is used to modify the configuration of the monitoring component according to the preset processing mode. For example, modify the alarm rules in the Prometheus container and the monitoring rules of the exporter, or establish cluster communication to monitor the current cluster using the monitoring component of the cluster with normal resources.

[0070] Some application examples of the monitoring method disclosed in the present invention are described below.

[0071] Taking the monitoring device set in the master node of the K3s cluster as an example, use the Rancher UI to deploy and manage the monitoring device. By default, Rancher has managed 3 K3s clusters. The specific monitoring method is as follows.

[0072] (1) Use Deployment to deploy all YAML files of the monitoring module;

[0073] (2) Connect the monitoring module to the indicator port of Prometheus;

[0074] (3) The monitoring and listening module inputs the current data of multiple resource indicators into the monitoring and calculation module;

[0075] (4) Inputting the thresholds and preset evaluation values ​​corresponding to each resource indicator into the monitoring calculation module;

[0076] (5) The monitoring calculation module determines the total evaluation value of the K3s cluster;

[0077] (6) Enable the Rancher Submariner build service port to connect to the three K3s clusters and synchronize the total evaluation values ​​of the three clusters;

[0078] (7) Query the K3s cluster with abnormal resource utilization in Grafna, and pass multiple resource indicators through the cross-cluster interface;

[0079] (8) The K3s cluster with abnormal resource utilization does not monitor resource indicators that exceed the preset consumption value. The alarm information shows that the network is blocked and lists the resource indicators that exceed the preset consumption value;

[0080] (9) After the K3s cluster with abnormal resource utilization returns to normal, the cross-cluster port is closed and the monitoring components are restored to the default settings.

[0081] The method of the above embodiment can improve the resource utilization rate in the cluster and save the monitoring data. The monitoring component reduces the monitoring of unnecessary resource indicators, reduces the API and network load occupied by unnecessary resource indicator alarms, and can recycle resources, maintaining the high reliability of the monitoring service under the condition of limited resources of the edge node.

[0082] The method of the above embodiment provides a quantitative method for cluster resource utilization, and the jitter fluctuation can be measured to make a prediction in advance whether the resource utilization is abnormal. A cyclic mechanism can be used to periodically evaluate and maintain the health status of the cluster. Reducing the alarm storm also exposes high-consumption resource indicators for maintenance by operation and maintenance personnel.

[0083] The present disclosure also provides a monitoring device, Figure 3 Give a description.

[0084] Figure 3 FIG. 1 is a structural diagram of some embodiments of the monitoring device disclosed in the present invention. Figure 3 As shown, the device 30 of this embodiment includes: an acquisition unit 310, an abnormality detection unit 320, a determination unit 330, and a monitoring control unit 340.

[0085] The acquisition unit 310 is used to acquire current data and predicted data of multiple resource indicators in the current cluster.

[0086] In some embodiments, the acquisition unit 310 is used to acquire current data of multiple resource indicators in the current cluster through a container group monitor and a service monitor; and predict the multiple resource indicators to obtain predicted data of the multiple resource indicators.

[0087] The anomaly detection unit 320 is used to determine whether the resource utilization of the current cluster is abnormal based on the current data and predicted data of multiple resource indicators.

[0088] In some embodiments, the anomaly detection unit 320 is used to determine an availability evaluation value based on current data of each resource indicator and a threshold value corresponding to each resource indicator; determine an anomaly evaluation value based on predicted data of each resource indicator; determine a total evaluation value based on the availability evaluation value and the anomaly evaluation value; and determine whether the resource utilization of the current cluster is abnormal based on a comparison between the total evaluation value and a preset evaluation value.

[0089] In some embodiments, the current data of each resource indicator includes: the remaining ratio of each resource indicator, and the anomaly detection unit 320 is used to determine, for each resource indicator, that the resource indicator is available when the remaining ratio of the resource indicator is greater than a threshold value corresponding to the resource indicator, and to determine that the resource indicator is unavailable when the remaining ratio of the resource indicator is less than or equal to the threshold value corresponding to the resource indicator; when all resource indicators are available, determine the availability evaluation value to be a first preset value; when all resource indicators are unavailable, determine the availability evaluation value to be a second preset value.

[0090] In some embodiments, the remaining ratio of each resource indicator is determined by the following method: subtracting the requested amount of the resource indicator from the available amount of the resource indicator to obtain the remaining amount of the resource indicator; the ratio of the remaining amount of the resource indicator to the available amount of the resource indicator is used as the remaining ratio of the resource indicator; wherein each resource indicator includes: CPU resource indicator, random access memory RAM resource indicator and hard disk resource indicator.

[0091] In some embodiments, the predicted data of each resource indicator is determined based on the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle. The larger the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle, the smaller the predicted data of the resource indicator.

[0092] In some embodiments, the anomaly detection unit 320 is used to perform weighted summation of the predicted data of each resource indicator according to the weight corresponding to each resource indicator; determine the anomaly assessment value according to the result of the weighted summation, wherein the smaller the predicted data of each resource indicator, the smaller the anomaly assessment value.

[0093] In some embodiments, the weight corresponding to each resource indicator is determined based on at least one of the data fluctuation and importance of the resource indicator. The greater the data fluctuation of the resource indicator, the smaller the corresponding weight; the higher the importance of the resource indicator, the greater the corresponding weight.

[0094] In some embodiments, the various resource indicators include: CPU resource indicators, random access memory RAM resource indicators, hard disk resource indicators, application program interface API resource indicators and network resource indicators.

[0095] The determining unit 330 is configured to determine whether resource utilization of one or more adjacent clusters is abnormal when resource utilization of the current cluster is abnormal.

[0096] The monitoring control unit 340 is configured to monitor the current cluster by using the monitoring components in the cluster with normal resource utilization when there is a cluster with normal resource utilization in one or more adjacent clusters.

[0097] In some embodiments, the monitoring control unit 340 is used to modify the port through which the monitoring component in the cluster with normal resource utilization obtains the information to be monitored to the port in the current cluster; establish cross-cluster communication between the cluster with normal resource utilization and the current cluster; utilize the monitoring component in the cluster with normal resource utilization to communicate with the current cluster across clusters through the port in the current cluster to obtain the information to be monitored in the current cluster.

[0098] In some embodiments, the monitoring control unit 340 is also used to determine, when there is no cluster with normal resource utilization in one or more adjacent clusters, one or more resource indicators whose corresponding resource consumption exceeds a preset consumption value as non-monitored resource indicators; modify at least one of the monitoring rules and alarm rules of the monitoring component of the current cluster, wherein the monitoring rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster abandons collecting data on non-monitored resource indicators, and the alarm rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster stops issuing abnormal alarms and prompts preset information.

[0099] The acquisition unit 310 may be arranged in the monitoring and listening module of the aforementioned embodiment, the anomaly detection unit 320 may be arranged in the monitoring and calculating module, and the determination unit 330 and the monitoring control unit 340 may be arranged in the monitoring configuration module.

[0100] The monitoring device in the embodiments of the present disclosure can be implemented by various computing devices or computer systems. Figure 4 as well as Figure 5 Give a description.

[0101] Figure 4 The present disclosure is a block diagram of some embodiments of the monitoring device. Figure 4 As shown, the device 40 of this embodiment includes: a memory 410 and a processor 420 coupled to the memory 410 , and the processor 420 is configured to execute the monitoring method in any of some embodiments of the present disclosure based on instructions stored in the memory 410 .

[0102] The memory 410 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, a database, and other programs.

[0103] Figure 5 FIG. 2 is a structural diagram of some other embodiments of the monitoring device disclosed in the present invention. Figure 5 As shown, the device 50 of this embodiment includes: a memory 510 and a processor 520, which are similar to the memory 410 and the processor 420 respectively. It can also include an input and output interface 530, a network interface 540, a storage interface 550, etc. These interfaces 530, 540, 550 and the memory 510 and the processor 520 can be connected, for example, through a bus 560. Among them, the input and output interface 530 provides a connection interface for input and output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 540 provides a connection interface for various networked devices, for example, it can be connected to a database server or a cloud storage server. The storage interface 550 provides a connection interface for external storage devices such as SD cards and USB flash drives.

[0104] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A monitoring method, comprising: Get current and predicted data of multiple resource indicators in the current cluster; Determining whether resource utilization of the current cluster is abnormal based on current data and predicted data of the multiple resource indicators; In the case where resource utilization of the current cluster is abnormal, determining whether resource utilization of one or more adjacent clusters is abnormal; In the case that there is a cluster with normal resource utilization in one or more adjacent clusters, monitoring the current cluster by using the monitoring component in the cluster with normal resource utilization; In the case that there is no cluster with normal resource utilization in one or more adjacent clusters, determining one or more resource indicators among the multiple resource indicators whose corresponding resource consumption exceeds a preset consumption value as non-monitored resource indicators; Modify at least one of the monitoring rules and alarm rules of the monitoring component of the current cluster, wherein modifying the monitoring rules of the monitoring component of the current cluster causes the monitoring component of the current cluster to abandon collecting data on the non-monitored resource indicators, and modifying the alarm rules of the monitoring component of the current cluster causes the monitoring component of the current cluster to stop issuing abnormal alarms and prompt preset information.

2. The monitoring method according to claim 1, wherein: The determining whether the resource utilization of the current cluster is abnormal according to the current data and the predicted data of the plurality of resource indicators comprises: Determine the availability assessment value based on the current data of each resource indicator and the threshold value corresponding to each resource indicator; Determine the abnormal assessment value based on the predicted data of each resource indicator; Determining a total evaluation value according to the availability evaluation value and the abnormality evaluation value; According to the comparison between the total evaluation value and the preset evaluation value, it is determined whether the resource utilization of the current cluster is abnormal.

3. The monitoring method according to claim 2, wherein: The current data of each resource indicator includes: the remaining ratio of each resource indicator, and the determining of the availability evaluation value according to the current data of each resource indicator and the threshold value corresponding to each resource indicator includes: For each resource indicator, if the remaining ratio of the resource indicator is greater than the threshold corresponding to the resource indicator, the resource indicator is determined to be available; if the remaining ratio of the resource indicator is less than or equal to the threshold corresponding to the resource indicator, the resource indicator is determined to be unavailable; When all resource indicators are available, determining the availability assessment value to be a first preset value; When all resource indicators are unavailable, the availability evaluation value is determined to be a second preset value.

4. The monitoring method according to claim 3, wherein: The remaining proportion of each resource indicator is determined by the following method: Subtract the requested amount of the resource indicator from the available amount of the resource indicator to obtain the remaining amount of the resource indicator; The ratio of the remaining quantity of the resource indicator to the available quantity of the resource indicator is taken as the remaining proportion of the resource indicator; The resource indicators include: CPU resource indicator, random access memory RAM resource indicator and hard disk resource indicator.

5. The monitoring method according to claim 1, wherein: The predicted data of each resource indicator is determined based on the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle. The larger the difference between the predicted request volume of the resource indicator and the request volume of the resource indicator in the previous cycle, the smaller the predicted data of the resource indicator.

6. The monitoring method according to claim 2, wherein: Determining the abnormal evaluation value according to the predicted data of each resource indicator includes: According to the weights corresponding to the various resource indicators, the predicted data of the various resource indicators are weighted and summed; The abnormality evaluation value is determined according to the result of weighted summation, wherein the smaller the predicted data of each resource indicator is, the smaller the abnormality evaluation value is.

7. The monitoring method according to claim 6, wherein: The weight corresponding to each resource indicator is determined based on at least one of the data fluctuation and importance of the resource indicator. The greater the data fluctuation of the resource indicator, the smaller the corresponding weight; the higher the importance of the resource indicator, the greater the corresponding weight.

8. The monitoring method according to claim 6, wherein: The resource indicators include: CPU resource indicators, random access memory RAM resource indicators, hard disk resource indicators, application program interface API resource indicators and network resource indicators.

9. The monitoring method according to claim 1, wherein: The monitoring of the current cluster by using the monitoring components in the normal cluster using the resources includes: Modify the port through which the resource uses the monitoring component in the normal cluster to obtain the information to be monitored to the port in the current cluster; Establishing cross-cluster communication between the cluster that utilizes normal resources and the current cluster; The resources are utilized to utilize a monitoring component in a normal cluster to perform cross-cluster communication with the current cluster through a port in the current cluster, so as to obtain the information to be monitored in the current cluster.

10. The monitoring method according to claim 1, wherein: The acquisition of current data and predicted data of multiple resource indicators in the current cluster includes: Get current data of multiple resource indicators in the current cluster through container group monitors and service monitors; Predict the multiple resource indicators to obtain prediction data of the multiple resource indicators.

11. A monitoring device, comprising: The acquisition unit is used to obtain the current data and predicted data of multiple resource indicators in the current cluster; an abnormality detection unit, used to determine whether the resource utilization of the current cluster is abnormal based on the current data and the predicted data of the multiple resource indicators; a determination unit, configured to determine whether resource utilization of one or more adjacent clusters is abnormal when resource utilization of the current cluster is abnormal; A monitoring control unit is used to monitor the current cluster by using the monitoring components in the cluster with normal resource utilization when there is a cluster with normal resource utilization in one or more adjacent clusters, and to determine one or more resource indicators among multiple resource indicators whose corresponding resource consumption exceeds a preset consumption value as non-monitored resource indicators when there is no cluster with normal resource utilization in one or more adjacent clusters; and to modify at least one of the monitoring rules and alarm rules of the monitoring component of the current cluster, wherein the monitoring rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster abandons collecting data on non-monitored resource indicators, and the alarm rules of the monitoring component of the current cluster are modified so that the monitoring component of the current cluster stops issuing abnormal alarms and prompts preset information.

12. A monitoring device, comprising: processor; as well as A memory coupled to the processor, for storing instructions, wherein when the instructions are executed by the processor, the processor executes the monitoring method according to any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Disaster recovery system, disaster recovery processing method, monitoring node and backup cluster

    CN110377459A

  • Cluster state monitoring method and device

    CN112115031A

  • Service access method, device and equipment and computer readable storage medium

    CN112965784A

  • Prometheus management and control method, device and equipment, and storage medium

    CN112994935A