CN114064377A - Load balancer monitoring method, device, equipment and storage medium - Google Patents

Load balancer monitoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN114064377A
CN114064377A CN202010746156.XA CN202010746156A CN114064377A CN 114064377 A CN114064377 A CN 114064377A CN 202010746156 A CN202010746156 A CN 202010746156A CN 114064377 A CN114064377 A CN 114064377A
Authority
CN
China
Prior art keywords
load
load balancer
service data
monitoring
acquisition module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010746156.XA
Other languages
Chinese (zh)
Inventor
毕小红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010746156.XA priority Critical patent/CN114064377A/en
Publication of CN114064377A publication Critical patent/CN114064377A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a monitoring method, a monitoring device, monitoring equipment and a storage medium of a load balancer, wherein the method comprises the following steps: acquiring service data acquired by an acquisition module in a load balancer, wherein the acquisition module can acquire the service data of a seven-layer load balancer and a four-layer load balancer; storing the business data in a time sequence database; and performing aggregation query processing on the service data to monitor the load balancer. The acquisition module is arranged in the load balancer, so that the service data of the seven-layer load balancer and the four-layer load balancer can be acquired, the service data can be conveniently checked by storing the service data in the time sequence database, and the monitoring efficiency is improved.

Description

Load balancer monitoring method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for monitoring a load balancer.
Background
At present, in a container cloud platform, in order to cope with the traffic demands of high concurrency and high load, cluster deployment is very common. When the running states of all servers in a server cluster and the current load conditions of the servers need to be monitored, a monitoring system sends available server information with low load to a calling party of the servers according to the running states and the load conditions of the servers so as to achieve the purpose of cluster load balancing. However, the existing monitoring system cannot monitor the seven-layer and four-layer load balancers at the same time, and the efficiency of acquiring monitoring information is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a device, and a computer-readable storage medium for monitoring a load balancer.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a monitoring method of a load balancer, which comprises the following steps:
acquiring service data acquired by an acquisition module in a load balancer, wherein the acquisition module can acquire the service data of a seven-layer load balancer and a four-layer load balancer;
storing the business data in a time sequence database;
and performing aggregation query processing on the service data to monitor the load balancer.
The embodiment of the application provides a monitoring device of a load balancer, the device includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring service data acquired by an acquisition module in a load balancer, and the acquisition module can acquire the service data of a seven-layer load balancer and a four-layer load balancer;
the storage module is used for storing the service data in a time sequence database;
and the processing module is used for performing aggregation query processing on the service data so as to monitor the load balancer.
The embodiment of the present application provides a monitoring device for a load balancer, where the monitoring device at least includes:
a processor; and
a memory for storing a computer program operable on the processor;
wherein the computer program, when executed by a processor, implements the steps of the monitoring method of the load balancer.
An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are configured to execute the steps of the monitoring method for a load balancer.
The embodiment of the application provides a monitoring method, a monitoring device, a monitoring equipment and a computer-readable storage medium for a load balancer, wherein the collection module is arranged in the load balancer, so that the collection of service data of a seven-layer load balancer and a four-layer load balancer is realized, the service data are stored in a time sequence database, and the service data in the time sequence database are aggregated and inquired, so that the service data are conveniently checked, and the monitoring efficiency is improved.
Drawings
In the drawings, like numerals may describe similar components in different views. The drawings illustrate generally, by way of example, but not by way of limitation, various embodiments discussed herein. Wherein the figures are not necessarily to scale.
Fig. 1 is a schematic flowchart of an implementation manner of a monitoring method of a load balancer according to an embodiment of the present application;
fig. 2 is a schematic flow chart of an implementation manner of performing aggregation query processing on the service data to monitor the load balancer, according to the embodiment of the present application;
fig. 3 is a schematic structural diagram of a monitoring apparatus of a load balancer according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a monitoring device of a load balancer according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
The following description will be added if a similar description of "first \ second \ third" appears in the application file, and in the following description, the terms "first \ second \ third" merely distinguish similar objects and do not represent a specific ordering for the objects, and it should be understood that "first \ second \ third" may be interchanged under certain circumstances in a specific order or sequence, so that the embodiments of the application described herein can be implemented in an order other than that shown or described herein.
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 application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
In order to better understand the monitoring method, apparatus, device and storage medium of the load balancer provided in the embodiments of the present application, first, problems existing in the monitoring method of the load balancer in the related art are analyzed and explained.
With the rapid development of the economic level and the scientific technology of China, in recent years, cloud computing is rapidly developed, and more enterprises and public institutions and government agencies begin to build own cloud computing platforms to improve the resource utilization rate of a data center. The container arrangement engine (kubernets) is used as the most popular cloud computing container management platform at present, so that high efficiency and convenience are brought to deployment, operation and maintenance of applications, and meanwhile, new challenges are brought to monitoring of the applications and performance of the applications.
Kubernets are now used by almost all large enterprises around the world to build their own container cloud platform, and the advent of Kubernets greatly improves the workload portability of cloud computing platforms and the availability of application systems. Kubernets has gained acceptance in the industry as an emerging platform for building and deploying applications, and more applications are beginning to use kubernets as an underlying resource abstraction platform. However, the Kubernetes is a representative example of how advanced and advantageous the container technology is, and the stability is always the most concerned aspect for users, so that the performance monitoring is particularly critical.
In the development process of the container cloud platform, a group of excellent tools for monitoring the performance of the cloud platform are also emerged, and the monitoring schemes popular in the industry at present are roughly such several:
the network monitoring tool (Nagios) is an enterprise-level monitoring system, which monitors the operation state of services and network information, can monitor the specified local or remote host services and parameters, has an excellent abnormal alarm function, but needs further improvement for the effective storage of monitoring data.
The open source cluster monitoring platform (Ganglia) is a cross-platform, high-performance and expandable distributed monitoring system, such as grids and clusters. However, Ganglia has no alarm mechanism, and it takes much time and effort for the user to operate and maintain.
The sFlow can analyze the flow information of the whole network, so that a user can conveniently analyze and track the problem of network transmission in real time and in detail, but monitoring of a host and the like is not ideal.
Zabbix is a distributed monitoring system still used by most enterprises at present, stores acquired data in a local database, analyzes and collates the data, and has rich functions and flexible expansibility. However, the method has the defects that the alarm mechanism is not perfect, the occupied resource is relatively large, and the method deviates from the lightweight principle followed by the current cloud platform.
Prometheus is an open source service monitoring system and time series database. The system can collect information indexes from configured monitoring objects according to a designated time interval, perform visual display and effective data storage, and provide an alarm function. Promethues has the advantage of defining time series using a high dimensional data model, index name and key-value pairs. Meanwhile, the system supports flexible query language, and can process collected multi-dimensional time series data, draw graphs and set alarms. Thanks to the multidimensional data model base, Promeheus can conveniently utilize query languages for filtering and aggregation of data.
In summary, the monitoring systems of the cloud computing platforms have their respective characteristics, but for the current field of the cloud platform, Prometheus is suitable for monitoring hardware indexes such as servers and the like and for monitoring a highly dynamic service-oriented architecture. For the micro services which are popular at present, thousands of micro services are operated in the environment, and when the services break down, the problem is difficult to locate quickly and effectively.
Currently, in a container cloud platform, components of the container cloud platform expose services to the outside through a server (Service), and three common ways of accessing the server from the outside include: node ports (Node ports), Load balancers (Load balancers), Ingress management services (Ingress), and the like. The Ingress mainly provides a hypertext Transfer Protocol (HTTP) layer routing function, has a great advantage compared with load balancing of a Transmission Control Protocol (TCP), and is a mainstream exposure mode of HTTP/HTTPs service in K8s (kubernets) at present.
To cope with high concurrent, high load traffic demands, cluster deployment has become very common. When the running states of all servers in a server cluster and the current load conditions of the servers need to be monitored, available server information with low load is sent to a calling party of the servers according to the running states and the load conditions of the servers so as to achieve the purpose of cluster load balancing.
In a kubernets scenario, a conventional container monitoring scheme performs resource monitoring and alarming through statically configured software or hardware entities (agents) for monitoring autonomous activities or centralized servers, and thus a great problem is encountered. For example, since the container is more scheduled in the resource pool, the host deploying the monitoring agent may result in a lack of necessary information to identify the monitoring object; compared with the traditional application, the life cycle of the container is shorter, and the abstract upper-layer concepts of the container, such as a copy controller (replay Set) and a Deployment controller (Deployment) in kubernets, have no good method for performing reverse abstraction on the collected data, so that the aggregation and alarm of the monitoring data cannot be effectively performed on the pure container monitoring data, and once the application is issued, the original monitoring and alarm rules cannot be effective. Load balancers (Nginx) are used in China, and the monitoring of the Nginx is older, and the monitoring of the Nginx can be realized by periodically collecting data of status modules (status) of the Nginx through running scripts or monitoring logs of the Nginx; however, these monitoring schemes may require modifying the script or changing the Nginx configuration when there is a new monitoring requirement, which makes the monitoring inconvenient.
Based on the problems in the related art, the embodiments of the present application provide a method for monitoring a load balancer, where the method is applied to a monitoring device of the load balancer. The method provided by this embodiment may be implemented by a computer program, and when the computer program is executed, the computer program completes each step in the monitoring method of the load balancer provided by this embodiment. In some embodiments, the computer program may be executed by a processor in a monitoring device of a load balancer. Fig. 1 is a schematic flowchart of an implementation manner of a monitoring method for a load balancer, which is provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
step S101, the monitoring equipment of the load balancer acquires service data acquired by an acquisition module in the load balancer.
In the embodiment of the application, the acquisition module can acquire service data of the seven-layer load balancer and the four-layer load balancer. Before step S101, it is necessary to install an acquisition module in a load balancer of a container cloud platform, and illustratively, a Nginx-module-vts and a Nginx-module-sts are compiled into a Nginx source code from a nginenx-ingress-controller source code provided by kubernets official, so as to implement installation of the acquisition module in the load balancer.
In the embodiment of the present application, the load balancer is used for dynamically adding and analyzing a registered server (Service) and a corresponding domain name/Internet Protocol (IP)/Port. Taking Kubernetes' container platform as an example, the load balancer includes a platform portal (Ingress) and a platform portal-controller (Ingress-controller). Ingress serves as a platform entrance and is responsible for uniformly managing external requests for services in the K8s cluster. The method is realized by defining an Ingress resource (Ingress resource), an Ingress Controller, an Ingress server (Ingress Service), and the like. The Ingress controller interacts with an Application Programming Interface (API) of Kubernetes, can dynamically acquire the change of an entry rule (Ingress) in a cluster (cluster), generates a segment of Nginx configuration, writes the Nginx configuration into a data structure (Pod) of Nginx-entry-control, and reinstalls (reload) a Port to enable the rule to take effect, thereby realizing the dynamic addition and analysis of the registered Service and the corresponding domain name/IP/Port.
Taking the above example, the acquisition of the service data collected by the collection module in the load balancer by the monitoring device of the load balancer is typically performed by the Nginx-vts-sts-exporter in the monitoring device of the load balancer. In the embodiment of the application, the Nginx-vts-sts-exporter can simultaneously collect service data of a seven-layer load balancer and a four-layer load balancer.
In an embodiment of the present application, the service data includes: the service data of the load balancer, the user request information collected by the load balancer, the load information and the performance information of the load node and the like. Illustratively, the traffic data of the load balancer itself includes: the number of accepted client connections, the number of processed client connections, the number of current client links, the number of dropped connections, etc.
And step S102, the monitoring equipment of the load balancer stores the service data in a time sequence database.
In the embodiment of the application, the time sequence database is used for processing the service data with the time labels. The storing of the traffic data in the timing database by the monitoring device of the load balancer may be performed with a Prometheus application. Prometheus stores business data in a time dimension in a time-series database. In this embodiment, before step S102, the method may further include installing a Prometheus application in the monitoring device of the load balancer. The binary Prometheus can be downloaded in an open source community, and the Promethues can be deployed on the monitoring equipment of the load balancer by installing and editing the configuration file.
Step S103, the monitoring device of the load balancer performs aggregation query processing on the service data to monitor the load balancer.
In the embodiment of the present application, since the service data in the time sequence database is stored by name and time dimension, the aggregation query processing may be performed according to the service data. In the embodiment of the application, the monitoring device of the load balancer performs aggregation query processing on the service data, and at least obtains the performance parameters and the load information of each load node corresponding to the load balancer. In the embodiment of the present application, the business data may be subjected to aggregate Query processing through a Prometheus structured Query Language (promm QL).
In the embodiment of the application, the load balancer can be monitored through the obtained performance parameters and the obtained load information of each load node corresponding to the load balancer, and if abnormal alarm information is output in monitoring, the load node can be adjusted through the obtained performance parameters and the obtained load information of each load node corresponding to the load balancer.
According to the monitoring method of the load balancer, the collection module is arranged in the load balancer, so that the collection of the service data of the seven-layer load balancer and the four-layer load balancer is achieved, the service data are stored in the time sequence database, the service data in the time sequence database are aggregated and inquired, the service data are conveniently checked, and the monitoring efficiency is improved.
In some embodiments, before step S101 "the monitoring device of the load balancer acquires the service data collected by the collection module in the load balancer", the method further includes:
step S104, the monitoring equipment of the load balancer acquires the environment variable parameters of the configuration data structure pod.
In the embodiment of the present application, the environment variable parameter refers to some parameters used in a system to specify an operating environment of the system. The environment variable parameters contain information to be used by one or more applications. In the embodiment of the present application, the instruction for configuring the environment variable parameter of the pod is generally sent by the user.
And step S105, the monitoring equipment of the load balancer sends the environment variable parameter to the pod, and the environment variable parameter enables the interface of the acquisition module to be provided for the pod.
In the embodiment of the application, when the monitoring device of the load balancer acquires the environment variable parameter configured with the pod, the environment variable parameter is sent to the pod, so that the interface of the acquisition module is provided for the pod.
Taking over the above example, the interface of Nginx-mobile-vts is provided to the pod by sending the environment variable parameter to the pod.
Correspondingly, in step S101, the acquiring, by the monitoring device of the load balancer, the service data acquired by the acquisition module in the load balancer includes:
and the monitoring equipment of the load balancer acquires the service data acquired by the acquisition module from the interface in the pod.
Taking the above example in mind, the Nginx-vts-sts-exporter in the monitoring device of the load balancer collects the service data from the interface provided by the Nginx-mobile-vts in the pod.
In some embodiments, in step S103, the monitoring device of the load balancer performs aggregation query processing on the service data to monitor the load balancer, which may be implemented by steps S1031 to S1033 in fig. 2, as shown in fig. 2,
and step S1031, the monitoring equipment of the load balancer carries out aggregation query processing on the service data to obtain the performance parameters and the load information of each load node corresponding to the load balancer.
In this embodiment of the present application, a monitoring device of a load balancer performs aggregation query processing on service data through an aggregation function to obtain performance parameters and load information of each load node corresponding to the load balancer. In the embodiment of the present application, the load node may be a World Wide Web (Web) server, a File Transfer Protocol (FTP) server, an enterprise key application server, other key task servers, and the like.
Step S1032, the monitoring device of the load balancer determines the load difference between the load nodes according to the performance parameters and the load information of the load nodes.
In the embodiment of the application, the load difference between the load nodes can be determined according to the performance parameters and the load information of the load nodes. Illustratively, the load node a has a memory of 100 gigabytes (G) and a load of 90G, and the load node B has a memory of 80G and a load of 75G, and it can be determined that the load node a can also load 10G and the load node B can also load 5G. Thereby determining the load difference between load node a and load node B.
Step S1033, the monitoring device of the load balancer adjusts the weight of the load node according to the load difference, so as to dynamically adjust the load node.
In the embodiment of the application, the monitoring equipment of the load balancer adjusts the weight of the load node according to the load difference, and the load node is adjusted by adjusting the weight of the load node. Taking the example above, the load available to load node a is greater than the load available to load node B. Therefore, the monitoring device of the load balancer can increase the weight of the load node A and reduce the weight of the load node B, so that when a user requests, the user can preferentially process the load node A.
In this embodiment of the present application, in the implementation of step S1033, the monitoring device of the load balancer may determine the weight of the load node according to the load difference, and send the weight of the load node to the load balancer, so that the load balancer adjusts according to the weight of the load node.
According to the monitoring method of the load balancer, the service data are subjected to aggregation query processing to obtain the performance parameters and the load information of each load node corresponding to the load balancer, and the weight of each load node is determined by comprehensively considering the performance parameters and the load information of each load node, so that dynamic adjustment of the load nodes is achieved, the network data processing capacity of a cloud platform is further enhanced, and the flexibility and the usability are improved.
In some embodiments, after "the monitoring device of the load balancer performs aggregation query processing on the service data to obtain the performance parameters and the load information of each load node corresponding to the load balancer" in step S1031, the method further includes:
step S1034, the monitoring device of the load balancer determines whether the load information of each load node is greater than a preset threshold.
In this embodiment of the present application, a threshold may be preset, and after the performance parameters and the load information of each load node corresponding to the load balancer are obtained, the load information may be compared with the preset threshold to determine whether the load information is greater than the preset threshold.
In step S1035, when the load information of each load node is greater than the preset threshold, the monitoring device of the load balancer outputs warning prompt information.
In the embodiment of the application, the alarm prompt message may be a sound message or a text message.
Taking the above example, by using the alarm rule configured in Promethues, when the load information of the load node is greater than the preset threshold, an alarm is automatically generated and sent to the user by means of a short message or an email.
According to the monitoring method of the load balancer, when the system breaks down or is about to break down, the monitoring device of the load balancer can quickly respond and inform an administrator, so that problems can be quickly processed or prevented from occurring in advance, and the influence on services is avoided.
In some embodiments, after "the monitoring device of the load balancer performs aggregation query processing on the service data to obtain the performance parameters and the load information of each load node corresponding to the load balancer" in step S1031, the method further includes:
step S1036, the monitoring device of the load balancer obtains service data with preset time length, and determines the change rule of the service data based on the service data with preset time length.
In the embodiment of the present application, the preset time period may be set according to actual situations, and may be, for example, 5 minutes, or 10 minutes. In the embodiment of the application, the change rule of the service data can be determined according to the service data with the preset duration. Illustratively, the service data may be user request access data, and correspondingly, the change rule of the service data may be that the user request access gradually increases with the passage of time.
Step S1037, determining, by the monitoring device of the load balancer, a time point for performing resource expansion and a size of a resource to be expanded according to the change rule and the load information of each load node.
Taking over the above example, since the user's access gradually increases with time, it can be determined from the change law what amount of capacity is needed at which point in time. At this time, the size of the resource that needs to be expanded may be determined according to the capacity and load information. For example, if it is predicted that 10G capacity is required at 12 pm according to the change law and the available load of the load node is 5G before 12 pm according to the change law, the load of the load node needs to be expanded by at least 5G before 12 pm.
Step S1038, the monitoring device of the load balancer performs resource expansion on the load node based on the time point and the resource size.
In the embodiment of the application, when the time point and the resource size are determined, the resource expansion of the load node can be performed according to the time point.
According to the monitoring method of the load balancer, the change rule of the service data is determined by analyzing the long-term trend of the service data through continuous collection and statistics of the service data. The change rule can determine at what time point the load node needs to be expanded.
In some embodiments, after step S101 "the monitoring device of the load balancer acquires the service data collected by the collection module in the load balancer", the method further includes:
and step S106, the monitoring equipment of the load balancer acquires target label information based on an operation instruction of adding label information by a user.
In the embodiment of the application, the user can add the label to the service data, and the purposes of monitoring the ingress requested by different machine rooms and different users are achieved. When a user wants to add label information, an operation instruction for adding the label information is sent to the monitoring equipment of the load balancer, so that the monitoring equipment of the load balancer receives the operation instruction for adding the label information by the user, and target label information is obtained. In this embodiment of the application, the tag information may be Identity (ID) information or may be a digital code. Illustratively, machine room a is represented by numeral code 1, and machine room B is represented by numeral code 2.
Step S107, the monitoring device of the load balancer determines the target tag information as the tag information of the service data.
In the embodiment of the application, after the monitoring device of the load balancer determines the tag information corresponding to each service data, the tag information can be added to the service data.
Correspondingly, in step S1031, the monitoring device of the load balancer performs aggregate query processing on the service data to obtain performance parameters and load information of each load node corresponding to the load balancer, including:
and the monitoring equipment of the load balancer performs aggregation query processing on the service data at least according to the target label information to obtain the performance parameters and the load information of each load node corresponding to the load balancer.
In the embodiment of the application, the tag information is added into the service data, so that the obtained performance parameters and the load information of each load node also have the tag information, and thus, monitoring of Ingress requested by different machine rooms and different users can be realized according to the tag information.
In some embodiments, the load balancer monitoring method further includes:
step S108, when the load node is abnormal, the monitoring equipment of the load balancer acquires historical service data and current service data.
In the embodiment of the application, both historical service data and current service data are acquired from a time sequence database.
Step S109, the monitoring equipment of the load balancer determines the abnormal reason according to the historical service data and the current service data.
In the embodiment of the application, historical business data and current business data can be compared to determine the abnormal reason.
According to the monitoring method of the load balancer, when the load node is abnormal, historical service data and current service data are obtained, and the reason for the abnormality is determined according to the historical service data and the current service data, so that the root cause problem can be found and solved, and the abnormality can be positioned.
The embodiment of the application further provides a monitoring method of the load balancer, which is based on the open source project and carries out secondary development, the Nginx-vts-exporter is modified, a four-layer load monitoring function is added, monitoring of Ingress is carried out by using Prometheus, related virtual machines and an upstream server can be automatically monitored, meanwhile, data tags of the Prometheus can be customized, and monitoring of inress of different machine rooms and different projects is achieved.
In the Kubernetes container platform, load balancer functionality is implemented by Ingress and Ingress-controller. Ingress serves as a platform entry and is responsible for uniformly managing external requests for services in the k8s cluster. The method is realized by defining Ingress resource, Ingress Controller, Ingress Service and the like. The Ingress controller interacts with a Kubernets API, changes of Ingress rules in the Cluster can be dynamically acquired, a section of Nginx configuration is generated, the Nginx configuration is written into a Pod of the Nginx-Ingress-control, and the reload Pod enables rules to take effect. Therefore, the dynamic addition and analysis of the registered Service and the corresponding domain name/IP/Port thereof are realized.
Under the condition that a Kubernetes basic container cloud platform exists, the monitoring method of the load balancer comprises the following steps:
step S1, according to Ingress and Ingress-controller provided by Kubernetes official, deploying on the container cloud platform.
And step S2, downloading a binary Prometheus running program in the open source community, installing and editing a configuration file, and realizing the deployment of Promethues on the container cloud platform. Data was queried and aggregated by Promethues.
Step S203, compiling Nginx-module-vts and Nginx-module-sts into Nginx in a source code mode from Nginx-ingress-controller source codes provided by Kubernets officials, wherein the Nginx-module-vts can provide JSON format data output and realize monitoring of the load balancer.
Step S3, by creating different four-layer or seven-layer load balancers, the Nginx-module-vts can automatically collect data of the load balancers, i.e. the service data in the above embodiments; exposing an index interface of the Nginx-mobile-vts in the pod by adopting the environment variable of the Deployment; the key code of the Deployment is as follows:
Figure BDA0002608416410000131
Figure BDA0002608416410000141
Figure BDA0002608416410000151
in the embodiment of the present application, through the deployment file, when a load balancer is deployed, a module including a monitoring function is deployed, and is configured to expose a monitoring Uniform Resource Locator (URL) of the load balancer by using an environment variable, and a component Nginx-vts-sts-exporter actively collects data through the URL, and then performs format conversion to convert the data into a data format of Prometheus.
In the embodiment of the present application, the monitoring data of the four-layer load balancer and the seven-layer load balancer, that is, the service data in the foregoing embodiments, is as shown in table 1:
TABLE 1 monitoring data for four-tier load balancer and seven-tier load balancer
Figure BDA0002608416410000152
Step S4, compiling a Nginx-vts-exporter to construct a mirror image, and requesting an index interface of the Nginx-mobile-vts to acquire monitoring data of the load balancer through an environment variable Nginx-vts-exporter in the pod;
and step S5, collecting Nginx monitoring data by the Nginx-vts-exporter, and providing a monitoring interface for Prometheus. Prometeus monitors Nginx data provided by Nginx-vts-sts-exporter and stores in a time series database, and can query and aggregate time series data using PromQL.
Step S6, aggregation query processing is carried out on the monitoring index or the performance of the back-end server through Promtheus, dynamic adjustment is realized by periodically adjusting the proportion of the server, and if the CPU or the memory of the load balancing node is insufficient, the pod of the load balancing node automatically drifts to other nodes;
and step S7, configuring an alert rule of Alertmanager through Promethues, and when the monitoring data exceeds a threshold value of a set index, automatically generating an alert by the Alertmanager and transmitting the alert to a user in a short message or mail mode.
In the embodiment of the application, when the system fails or is about to fail, the monitoring system needs to quickly respond and notify an administrator, so that problems can be quickly processed or prevented in advance, and the influence on services is avoided.
In some embodiments, after step S5, the method for monitoring a load balancer further includes:
and step S8, performing long-term trend analysis through the collected monitoring data.
In the embodiment of the application, the monitoring indexes are subjected to long-term trend analysis through continuous collection and statistics of monitoring data. For example, by judging the relevant indexes of the application request, the node can predict in advance when the resource needs to be expanded in the future.
In some embodiments, after step S5, the method for monitoring a load balancer further includes:
at step S9, a comparison analysis is performed with the collected monitoring data.
In the embodiment of the present application, the monitoring data may be concurrent data of the system, change data of the load, and the like. The comparison analysis performed on the collected monitoring data may be performed on the collected load change data and/or the system concurrent data, and the comparison analysis performed on the monitoring data is performed to determine whether the system needs to be expanded and/or determine whether an abnormality exists in the system.
In some embodiments, after step S5, the method for monitoring a load balancer further includes:
and step S10, analyzing and positioning the fault through the collected monitoring data.
In the embodiment of the application, after the problem occurs, when the problem needs to be investigated and processed, the root cause problem can be found and solved by analyzing historical data and current data.
In some embodiments, after step S5, the method for monitoring a load balancer further includes:
in step S11, the monitoring data information is output.
In the embodiment of the application, the data visualization of the data is realized by outputting the monitoring data through the visualization instrument panel, and the visualized information such as the running state, the resource using condition, the service running state and the like of the system can be directly acquired through the visualization instrument panel.
According to the monitoring method of the load balancer, monitoring of the four-layer load balancer and the seven-layer load balancer is achieved by deploying the Vts-sts-exporter aiming at the load balancer, and different exporter modules do not need to be embedded into different load balancers. Monitoring of Ingress by using Prometheus can automatically monitor related virtual machines and upstream servers, and can also customize data tags of Prometheus, thereby realizing monitoring of Ingress of different machine rooms and different projects. The monitoring system supporting dynamic load balancing has the monitoring functions of analysis, query diagnosis and the like, and has the advantages of quick response time, high efficiency, efficient resource utilization and the like.
Based on the foregoing embodiments, the present application provides a monitoring apparatus for a load balancer, where each module included in the monitoring apparatus and each unit included in each module may be implemented by a processor in a computer device; of course, the implementation can also be realized through a specific logic circuit; in the implementation process, the processor may be a Central Processing Unit (CPU), a Microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 3 is a schematic structural diagram of a monitoring apparatus of a load balancer, where as shown in fig. 3, the monitoring apparatus 300 of the load balancer includes:
the first obtaining module 301 is configured to obtain service data collected by a collecting module in the load balancer, where the collecting module can collect service data of a seven-layer load balancer and a four-layer load balancer.
A storage module 302, configured to store the service data in a time sequence database.
The processing module 303 is configured to perform aggregation query processing on the service data to monitor the load balancer.
In some embodiments, the monitoring apparatus 300 of the load balancer further includes:
the second acquisition module is used for acquiring the environment variable parameters of the configuration pod;
the first sending module is used for sending the environment variable parameter to a pod, and the environment variable parameter enables an interface of the acquisition module to be provided for the pod;
correspondingly, the processing module 303 includes:
and the first acquisition unit is used for acquiring the service data acquired by the acquisition module from the interface in the pod.
In some embodiments, the processing module 303 comprises:
the processing unit is used for performing aggregation query processing on the service data to obtain performance parameters and load information of each load node corresponding to the load balancer;
a determining unit, configured to determine a load difference between the load nodes according to the performance parameters and the load information of the load nodes;
and the adjusting unit is used for adjusting the weight of the load node according to the load difference so as to realize dynamic adjustment of the load node.
In some embodiments, the monitoring apparatus 300 of the load balancer further includes:
the judging module is used for judging whether the load information of each load node is greater than a preset threshold value or not;
and the output module is used for outputting alarm prompt information when the load information of each load node is greater than the preset threshold value.
In some embodiments, the monitoring apparatus 300 of the load balancer further includes:
the third acquisition module is used for acquiring the service data with preset time length and determining the change rule of the service data based on the service data with the preset time length;
the first determining module is used for determining the time point for carrying out resource capacity expansion and the size of the resource needing capacity expansion according to the change rule and the load information of each load node;
and the capacity expansion module is used for carrying out resource capacity expansion on the load node based on the time point and the resource size.
In some embodiments, the monitoring apparatus 300 of the load balancer further includes:
the fourth acquisition module is used for acquiring target label information based on an operation instruction of adding label information by a user;
a second determining module, configured to determine the target tag information as tag information of the service data;
correspondingly, the processing unit comprises:
and the processing subunit is configured to perform aggregation query processing on the service data at least according to the target tag information, so as to obtain performance parameters and load information of each load node corresponding to the load balancer.
In some embodiments, the monitoring apparatus 300 of the load balancer further includes:
the fifth acquisition module is used for acquiring historical service data and current service data when the load node is abnormal;
and the third determining module is used for determining an abnormal reason according to the historical service data and the current service data.
In the monitoring apparatus 300 for a load balancer provided in the embodiment of the present application, the first obtaining module 301 obtains service data collected by a collecting module in the load balancer, and the storing module 302 stores the service data in a time sequence database; the processing module 303 performs aggregation query processing on the service data to monitor the load balancer. The method and the device realize the collection of the service data of the seven-layer load balancer and the four-layer load balancer, conveniently check the service data by storing the service data in the time sequence database, and improve the monitoring efficiency.
It should be noted that, in the embodiment of the present application, if the monitoring method of the load balancer is implemented in the form of a software functional module, and is sold or used as a standalone product, it may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Accordingly, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the monitoring method for a load balancer provided in the above embodiments.
An embodiment of the present application provides a monitoring device for a load balancer, where fig. 4 is a schematic structural diagram of a monitoring device for a load balancer, and as shown in fig. 4, the monitoring device 400 for a load balancer includes: a processor 401, at least one communication bus 402, a user interface 403, at least one external communication interface 404 and a memory 405. Wherein the communication bus 402 is configured to enable connective communication between these components. The user interface 403 may include a display screen, and the external communication interface 404 may include a standard wired interface and a wireless interface, among others. The processor 401 is configured to execute a program of the load balancer monitoring method stored in the memory, so as to implement the steps in the load balancer monitoring method provided in the foregoing embodiments.
The above description of the monitoring device and storage medium embodiments of the load balancer is similar to the description of the above method embodiments, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the monitoring device and the storage medium of the load balancer of the present application, please refer to the description of the embodiments of the method of the present application for understanding.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be 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 unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing an AC to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for monitoring a load balancer, the method comprising:
acquiring service data acquired by an acquisition module in a load balancer, wherein the acquisition module can acquire the service data of a seven-layer load balancer and a four-layer load balancer;
storing the business data in a time sequence database;
and performing aggregation query processing on the service data to monitor the load balancer.
2. The method of claim 1, further comprising:
acquiring an environment variable parameter of a configuration data structure pod;
sending the environment variable parameter to a pod, wherein the environment variable parameter enables an interface of the acquisition module to be provided for the pod;
correspondingly, the acquiring the service data acquired by the acquisition module in the load balancer includes:
and acquiring the service data acquired by the acquisition module from the interface in the pod.
3. The method of claim 1, wherein the performing aggregate query processing on the traffic data to monitor the load balancer comprises:
performing aggregation query processing on the service data to obtain performance parameters and load information of each load node corresponding to the load balancer;
determining load difference among the load nodes according to the performance parameters and the load information of the load nodes;
and adjusting the weight of the load node according to the load difference so as to realize dynamic adjustment of the load node.
4. The method of claim 3, further comprising:
judging whether the load information of each load node is greater than a preset threshold value or not;
and outputting alarm prompt information when the load information of each load node is greater than the preset threshold value.
5. The method of claim 3, further comprising:
acquiring service data with preset time length, and determining a change rule of the service data based on the service data with the preset time length;
determining a time point for expanding the capacity of the resource and the size of the resource needing to be expanded according to the change rule and the load information of each load node;
and carrying out resource expansion on the load node based on the time point and the resource size.
6. The method of claim 3, further comprising:
acquiring target label information based on an operation instruction of adding label information by a user;
determining the target label information as the label information of the service data;
correspondingly, performing aggregation query processing on the service data to obtain performance parameters and load information of each load node corresponding to the load balancer, including:
and performing aggregation query processing on the service data at least according to the target label information to obtain performance parameters and load information of each load node corresponding to the load balancer.
7. The method of claim 3, further comprising:
when the load node is abnormal, acquiring historical service data and current service data;
and determining an abnormal reason according to the historical service data and the current service data.
8. An apparatus for monitoring a load balancer, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring service data acquired by an acquisition module in a load balancer, and the acquisition module can acquire the service data of a seven-layer load balancer and a four-layer load balancer;
the storage module is used for storing the service data in a time sequence database;
and the processing module is used for performing aggregation query processing on the service data so as to monitor the load balancer.
9. A monitoring device for a load balancer, the device comprising:
a processor; and
a memory for storing a computer program operable on the processor;
wherein the computer program when executed by a processor implements the steps of the method of monitoring a load balancer of any one of claims 1 to 7.
10. A storage medium having stored thereon computer-executable instructions configured to perform the steps of the method for monitoring a load balancer of any one of claims 1 to 7.
CN202010746156.XA 2020-07-29 2020-07-29 Load balancer monitoring method, device, equipment and storage medium Pending CN114064377A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010746156.XA CN114064377A (en) 2020-07-29 2020-07-29 Load balancer monitoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010746156.XA CN114064377A (en) 2020-07-29 2020-07-29 Load balancer monitoring method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114064377A true CN114064377A (en) 2022-02-18

Family

ID=80226833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010746156.XA Pending CN114064377A (en) 2020-07-29 2020-07-29 Load balancer monitoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114064377A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363092A (en) * 2022-03-17 2022-04-15 万商云集(成都)科技股份有限公司 Gateway and method for cloud container engine micro-service deployment
CN114816916A (en) * 2022-04-22 2022-07-29 中邮消费金融有限公司 Load data management method and system based on load balancer

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363092A (en) * 2022-03-17 2022-04-15 万商云集(成都)科技股份有限公司 Gateway and method for cloud container engine micro-service deployment
CN114363092B (en) * 2022-03-17 2022-05-17 万商云集(成都)科技股份有限公司 Gateway and method for cloud container engine micro-service deployment
CN114816916A (en) * 2022-04-22 2022-07-29 中邮消费金融有限公司 Load data management method and system based on load balancer

Similar Documents

Publication Publication Date Title
US10645022B2 (en) Methods and systems providing a scalable process for anomaly identification and information technology infrastructure resource optimization
US9548886B2 (en) Help desk ticket tracking integration with root cause analysis
US9497072B2 (en) Identifying alarms for a root cause of a problem in a data processing system
CN110493080B (en) Block link point monitoring method and device, electronic equipment and storage medium
US9497071B2 (en) Multi-hop root cause analysis
CN111177095A (en) Log analysis method and device, computer equipment and storage medium
US9280437B2 (en) Dynamically scalable real-time system monitoring
US9276803B2 (en) Role based translation of data
CN111124830B (en) Micro-service monitoring method and device
US20150281011A1 (en) Graph database with links to underlying data
CN111459763A (en) Cross-kubernets cluster monitoring system and method
CN107704387A (en) For the method, apparatus of system early warning, electronic equipment and computer-readable medium
EP3182247A1 (en) Systems and methods for dynamic ups optimization
CN114064377A (en) Load balancer monitoring method, device, equipment and storage medium
CN109614227A (en) Task resource concocting method, device, electronic equipment and computer-readable medium
EP2425585B1 (en) System and method for managing configurations of ncpi devices
US10331484B2 (en) Distributed data platform resource allocator
CN115335821A (en) Offloading statistics collection
US10769218B2 (en) Display for network time series data with adaptable zoom intervals
CN114756301B (en) Log processing method, device and system
Shih et al. Implementation and visualization of a netflow log data lake system for cyberattack detection using distributed deep learning
CN110333930A (en) Digital Platform system
CN115220131A (en) Meteorological data quality inspection method and system
Brim et al. Monitoring extreme-scale Lustre toolkit
CN113570476A (en) Container service monitoring method of power grid monitoring system based on custom alarm rule

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination