Load balancing method, device, equipment and storage medium

By setting up a data acquisition module and a time-series database in the load balancer, and combining them with Prometheus for aggregation query processing, the problem of not being able to monitor Layer 7 and Layer 4 load balancers simultaneously in existing technologies is solved. This achieves a highly efficient load balancing and alarm mechanism, improving monitoring efficiency and flexibility.

CN114064377BActive Publication Date: 2026-02-24CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010746156.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-29
Publication Date
2026-02-24
Estimated Expiration
2040-07-29

AI Technical Summary

Technical Problem

Existing monitoring systems cannot monitor both Layer 7 and Layer 4 load balancers simultaneously, and their efficiency in acquiring monitoring information is low, making it difficult to implement efficient load balancing and alarm mechanisms in container cloud platforms.

Method used

By setting up a data acquisition module in the load balancer, business data from Layer 7 and Layer 4 load balancers is collected and stored in a time-series database. Prometheus is then used for aggregation and query processing to enable monitoring of the load balancer.

Benefits of technology

It improves the monitoring efficiency of the load balancer, enabling rapid response to server downtime, dynamic adjustment of load node weights to achieve cluster load balancing, and timely notification to administrators through an alarm mechanism to avoid business disruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064377B_ABST
    Figure CN114064377B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a monitoring method and device of a load balancer, equipment and a storage medium, wherein the method comprises: acquiring service data collected by a collection module in the load balancer, wherein the collection module can collect service data of a seven-layer load balancer and a four-layer load balancer; storing the service data in a time series database; and performing aggregated query processing on the service data to monitor the load balancer. By arranging the collection module in the load balancer, the service data of the seven-layer load balancer and the four-layer load balancer is collected, the service data is stored in the time series database, the service data is convenient to view, and the monitoring efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus, device and storage medium for monitoring a load balancer. Background Technology

[0002] Currently, cluster deployment is very common in container cloud platforms to handle high concurrency and high load business demands. When it is necessary to monitor the running status and current load of all servers in the server cluster, the monitoring system sends information about available and low-load servers to the caller based on the server's running status and load, in order to achieve cluster load balancing. If a server crashes, a rapid response is required, and server information must be fed back to the caller to notify them to switch to an available server, while simultaneously initiating the appropriate alarm mechanism. However, existing monitoring systems cannot monitor both Layer 7 and Layer 4 load balancers simultaneously, and the efficiency of obtaining monitoring information is relatively low. Summary of the Invention

[0003] In view of this, embodiments of this application provide a method, apparatus, device, and computer-readable storage medium for monitoring a load balancer.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a method for monitoring a load balancer, the method comprising:

[0006] The system acquires service data collected by the acquisition module in the load balancer, wherein the acquisition module is capable of acquiring service data from the Layer 7 load balancer and the Layer 4 load balancer.

[0007] The business data is stored in a time-series database;

[0008] The business data is aggregated and queried to monitor the load balancer.

[0009] This application embodiment provides a monitoring device for a load balancer, the device comprising:

[0010] The first acquisition module is used to acquire business data collected by the acquisition module in the load balancer, wherein the acquisition module is capable of acquiring business data from the Layer 7 load balancer and the Layer 4 load balancer.

[0011] A storage module is used to store the business data in a time-series database;

[0012] The processing module is used to perform aggregation query processing on the business data in order to monitor the load balancer.

[0013] This application embodiment provides a monitoring device for a load balancer, the device comprising at least:

[0014] Processor; and

[0015] Memory for storing computer programs that can run on the processor;

[0016] The computer program, when executed by the processor, implements the steps of the above-described load balancer monitoring method.

[0017] This application provides a computer-readable storage medium storing computer-executable instructions configured to perform the steps of the above-described load balancer monitoring method.

[0018] This application provides a method, apparatus, device, and computer-readable storage medium for monitoring a load balancer. By setting a data acquisition module in the load balancer, it enables the acquisition of business data from both Layer 7 and Layer 4 load balancers. By storing the business data in a time-series database and performing aggregation and query processing on the business data in the time-series database, it facilitates the viewing of business data and improves monitoring efficiency. Attached Figure Description

[0019] In the accompanying drawings, similar reference numerals may describe similar parts in different views. The drawings illustrate, by way of example and not limitation, the various embodiments discussed herein. The drawings are not necessarily drawn to scale.

[0020] Figure 1 A flowchart illustrating one implementation of the load balancer monitoring method provided in this application embodiment;

[0021] Figure 2 A flowchart illustrating the implementation method of aggregating and querying the business data to monitor the load balancer, as provided in this application.

[0022] Figure 3 This is a schematic diagram of the composition structure of the monitoring device for the load balancer provided in the embodiments of this application;

[0023] Figure 4 A schematic diagram of the composition structure of the monitoring device for the load balancer provided in the embodiments of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, 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.

[0026] If the application documents contain similar descriptions such as "first, second, third", the following explanation shall be added: In the following description, the terms "first, second, third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0027] Unless otherwise defined, 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 this application only and is not intended to limit this application.

[0028] To better understand the monitoring method, apparatus, device, and storage medium of the load balancer provided in the embodiments of this application, the problems existing in the monitoring methods of load balancers in related technologies are first analyzed and explained.

[0029] With the rapid development of my country's economy and science and technology, cloud computing has achieved rapid growth in recent years. More and more enterprises, institutions, and government agencies are building their own cloud computing platforms to improve the resource utilization of data centers. Kubernetes, as the most popular cloud container management platform, brings efficiency and convenience to application deployment and maintenance, but also presents new challenges to the monitoring of applications and their performance.

[0030] Kubernetes is now used by almost all major enterprises worldwide to build their container cloud platforms. The emergence of Kubernetes has greatly improved the workload portability and application availability of cloud computing platforms. As an emerging platform for building and deploying applications, Kubernetes has gradually gained industry recognition, and more and more applications are starting to use Kubernetes as the underlying resource abstraction platform. However, no matter how advanced or advantageous container technologies like Kubernetes are, stability is always the most important aspect for users, making performance monitoring particularly crucial.

[0031] During the development of container cloud platforms, a number of excellent tools for cloud platform performance monitoring have emerged. Currently, the popular monitoring solutions in the industry can be roughly categorized as follows:

[0032] Nagios is an enterprise-level monitoring system that monitors the operational status of services and network information. It can monitor specified local or remote host services and parameters and has excellent anomaly alarm functions, but the effective storage of monitoring data needs further improvement.

[0033] Ganglia, an open-source cluster monitoring platform, is a cross-platform, high-performance, and scalable distributed monitoring system suitable for grids and clusters. However, Ganglia lacks an alerting mechanism, requiring users to spend considerable time and effort on its maintenance.

[0034] sFlow can analyze network traffic information, making it convenient for users to analyze and track network transmission problems in real time and in detail, but its monitoring of hosts and other components is not ideal.

[0035] Zabbix is ​​a distributed monitoring system still widely used by many enterprises. Zabbix stores collected data in a local database, then analyzes and processes the data, offering rich functionality and flexible scalability. However, its drawbacks include an imperfect alerting mechanism and relatively high resource consumption, which deviates from the lightweight principle followed by current cloud platforms.

[0036] Prometheus is an open-source service monitoring system and time-series database. It collects information metrics from configured monitored objects at specified time intervals, visualizes and efficiently stores the data, and provides alerting functionality. Prometheus's strength lies in its use of a high-dimensional data model, defining time series using metric names and key-value pairs. Furthermore, it supports a flexible query language, enabling the processing, charting, and alerting of collected multi-dimensional time-series data. Thanks to its multi-dimensional data model foundation, Prometheus can easily utilize query language for data filtering and aggregation.

[0037] In summary, each cloud computing platform's monitoring system has its own characteristics. However, in the current cloud platform field, Prometheus is suitable for monitoring both hardware metrics such as servers and highly dynamic service-oriented architectures. For the now-popular microservices, with hundreds or thousands of microservices running in the environment, it is difficult to quickly and effectively locate the problem when a service fails.

[0038] Currently, in container cloud platforms, components expose services externally through servers (Services). Three common ways to access these servers externally include: Node Port, Load Balancer, and Ingress. Ingress primarily provides Hypertext Transfer Protocol (HTTP) layer routing functionality, offering significant advantages over Transmission Control Protocol (TCP) load balancing, and is currently the mainstream exposure method for HTTP / HTTPS services in Kubernetes.

[0039] To handle high concurrency and high load business demands, cluster deployment has become very common. When it is necessary to monitor the operating status and current load of all servers in the server cluster, information on available servers with low load is sent to the caller based on the server's operating status and load to achieve cluster load balancing. If a server crashes, a rapid response is required, and information must be fed back to the caller to notify them to switch to an available server, while simultaneously activating the corresponding alarm mechanism.

[0040] In Kubernetes scenarios, traditional container monitoring solutions face significant challenges due to their reliance on statically configured monitoring agents or centralized servers for resource monitoring and alerting. For example, since containers are primarily scheduled within resource pools, deploying monitoring agents on the host machine can result in a lack of necessary information to identify monitored objects. Furthermore, container lifecycles are shorter than those of traditional applications, and higher-level concepts abstracted from containers, such as replica sets and deployment controllers in Kubernetes, lack effective methods for reverse abstraction from collected data. This makes it difficult to effectively aggregate and alert on container monitoring data, potentially rendering existing monitoring and alerting rules ineffective after application deployment. In China, load balancers (Nginx) are widely used. Older Nginx monitoring solutions might involve periodically collecting data from Nginx's status module or monitoring Nginx logs using scripts. However, these solutions often require script modifications or Nginx configuration changes to meet new monitoring needs, making monitoring inconvenient.

[0041] To address the problems existing in related technologies, this application provides a method for monitoring a load balancer, which is applied to a load balancer monitoring device. The method provided in this embodiment can be implemented by a computer program, which, when executed, completes each step of the load balancer monitoring method provided in this embodiment. In some embodiments, the computer program can be executed by a processor in the load balancer monitoring device. Figure 1 A flowchart illustrating one implementation of the load balancer monitoring method provided in this application embodiment is shown below. Figure 1 As shown, the method includes:

[0042] Step S101: The monitoring device of the load balancer acquires the business data collected by the acquisition module in the load balancer.

[0043] In this embodiment, the data collection module is capable of collecting business data from Layer 7 and Layer 4 load balancers. Before step S101, the data collection module needs to be installed in the load balancer of the container cloud platform. For example, Nginx-module-vts and Nginx-module-sts are compiled into Nginx from the Nginx-ingress-controller source code provided by Kubernetes, thereby enabling the installation of the data collection module in the load balancer.

[0044] In this embodiment, the load balancer is used for the dynamic addition and resolution of registered servers (Services) and their corresponding domain names / Internet Protocol (IP) / ports. Taking the Kubernetes container platform as an example, the load balancer includes a platform ingress and a platform ingress controller. The ingress, as the platform ingress, is responsible for uniformly managing external requests to services in the Kubernetes cluster. This is achieved by defining ingress resources, ingress controllers, and ingress services. The ingress controller interacts with the Kubernetes application programming interface (API) to dynamically obtain changes in ingress rules within the cluster, generate an Nginx configuration, write it to the Nginx-ingress-control data structure (Pod, plain old datastructure), and reload the pod to make the rules effective, thereby enabling the dynamic addition and resolution of registered services and their corresponding domain names / IP / ports.

[0045] Continuing with the example above, the monitoring device of the load balancer typically acquires the business data collected by the acquisition module within the load balancer through the Nginx-vts-sts-exporter within the load balancer's monitoring device. In this embodiment, the Nginx-vts-sts-exporter can simultaneously acquire business data from both Layer 7 and Layer 4 load balancers.

[0046] In this embodiment, the business data includes: the load balancer's own business data and user request information, load information, and performance information collected by the load balancer. For example, the load balancer's own business data includes: the number of accepted client connections, the number of processed client connections, the current number of client connections, and the number of dropped connections.

[0047] In step S102, the monitoring device of the load balancer stores the business data in a time-series database.

[0048] In this embodiment, the time-series database is used to process time-stamped business data. The load balancer's monitoring device stores the business data in the time-series database, which can be executed using the Prometheus application. Prometheus stores the business data in the time-series database along a time dimension. In this embodiment, before step S102, the method may further include installing the Prometheus application on the load balancer's monitoring device. A binary Prometheus can be downloaded from the open-source community, and by installing and editing the configuration file, Prometheus can be deployed on the load balancer's monitoring device.

[0049] In step S103, the monitoring device of the load balancer performs aggregate query processing on the business data in order to monitor the load balancer.

[0050] In this embodiment, since the business data in the time-series database is stored using name and time dimensions, aggregation query processing can be performed on this business data. In this embodiment, aggregation functions can be used to perform aggregation query processing on the business data, allowing for rapid result retrieval, such as quickly calculating the total number, average, maximum, and minimum values ​​of the business data. In this embodiment, the load balancer's monitoring device performs aggregation query processing on the business data to obtain at least the performance parameters and load information of each load node corresponding to the load balancer. In this embodiment, the business data can be aggregated using Prometheus's structured query language (PromQL).

[0051] In this embodiment, the load balancer can be monitored using the performance parameters and load information of each load node corresponding to the load balancer. If an abnormality is detected during monitoring, an alarm message can be output. The load nodes can also be adjusted using the performance parameters and load information of each load node corresponding to the load balancer.

[0052] The load balancer monitoring method provided in this application embodiment realizes the collection of business data from Layer 7 and Layer 4 load balancers by setting up a collection module in the load balancer. By storing the business data in a time-series database and performing aggregation query processing on the business data in the time-series database, it is convenient to view the business data and improves monitoring efficiency.

[0053] In some embodiments, before step S101 "the monitoring device of the load balancer acquires the service data collected by the acquisition module in the load balancer", the method further includes:

[0054] Step S104: The load balancer's monitoring device obtains the environment variable parameters of the configuration data structure pod.

[0055] In this embodiment, the environment variable parameters refer to parameters used in the system to specify the system's operating environment. These environment variable parameters contain information used by one or more applications. In this embodiment, the instructions for configuring the pod's environment variable parameters are typically sent by the user.

[0056] In step S105, the monitoring device of the load balancer sends the environment variable parameters to the pod, and the environment variable parameters enable the interface of the acquisition module to be provided to the pod.

[0057] In this embodiment of the application, when the monitoring device of the load balancer obtains the environment variable parameters of the configuration pod, it sends the environment variable parameters to the pod so that the interface of the acquisition module is provided to the pod.

[0058] Continuing from the example above, by sending this environment variable parameter to the pod, the Nginx-module-vts interface is made available to the pod.

[0059] Correspondingly, in step S101, the monitoring device of the load balancer acquires the service data collected by the acquisition module in the load balancer, including:

[0060] The load balancer's monitoring device obtains the business data collected by the acquisition module from the interface in the pod.

[0061] Continuing with the example above, the Nginx-vts-sts-exporter in the load balancer's monitoring device collects business data from the interface provided by Nginx-module-vts in the pod.

[0062] In some embodiments, in step S103, the monitoring device of the load balancer performs aggregation query processing on the business data to monitor the load balancer, which can be achieved through methods such as... Figure 2 This is achieved through steps S1031 to S1033, as follows: Figure 2 As shown,

[0063] In step S1031, the monitoring device of the load balancer performs aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer.

[0064] In this embodiment, the monitoring device of the load balancer performs aggregation query processing on the business data through aggregation functions to obtain the performance parameters and load information of each load node corresponding to the load balancer. In this embodiment, the performance parameters and load information may include total number, average number, maximum value, and minimum value, etc. In this embodiment, the load node may be a World Wide Web server, a File Transfer Protocol (FTP) server, an enterprise critical application server, and other critical task servers, etc.

[0065] Step S1032: The monitoring device of the load balancer determines the load difference between the load nodes based on the performance parameters and load information of each load node.

[0066] In this embodiment, the load difference between load nodes can be determined based on their performance parameters and load information. For example, load node A has 100 gigabytes (G) of memory and a load of 90G, while load node B has 80G of memory and a load of 75G. It can be determined that load node A can still handle 10G, while load node B can handle 5G. This establishes the load difference between load node A and load node B.

[0067] In step S1033, the monitoring device of the load balancer adjusts the weight of the load node according to the load difference to achieve dynamic adjustment of the load node.

[0068] In this embodiment, the load balancer's monitoring device adjusts the weights of the load nodes based on the load differences. By adjusting the weights of the load nodes, the load nodes are adjusted. Continuing the example above, since the available load of load node A is greater than the available load of load node B, the load balancer's monitoring device can increase the weight of load node A and decrease the weight of load node B. This ensures that when a user request arrives, it is preferentially processed through load node A.

[0069] In this embodiment of the application, when implementing step S1033, the monitoring device of the load balancer can 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 can adjust according to the weight of the load node.

[0070] The load balancer monitoring method provided in this application obtains the performance parameters and load information of each load node corresponding to the load balancer by performing aggregate query processing on business data. The weight of each load node is determined by comprehensively considering the performance parameters and load information of each load node, thereby realizing the dynamic adjustment of load nodes, thereby enhancing the network data processing capabilities of the cloud platform and improving its flexibility and availability.

[0071] In some embodiments, after step S1031, "the monitoring device of the load balancer performs aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer," the method further includes:

[0072] Step S1034: The monitoring device of the load balancer determines whether the load information of each load node is greater than a preset threshold.

[0073] In this embodiment of the application, a threshold can be preset. After obtaining the performance parameters and load information of each load node corresponding to the load balancer, the load information can be compared with the preset threshold to determine whether the load information is greater than the preset threshold.

[0074] Step S1035: When the load information of each load node is greater than the preset threshold, the monitoring device of the load balancer outputs an alarm message.

[0075] In this embodiment of the application, the alarm notification information can be either sound information or text information.

[0076] Continuing with the example above, by configuring alarm rules in Promethues, when the load information of a load node exceeds a preset threshold, an alarm will be automatically generated and sent to the user via SMS or email.

[0077] The load balancer monitoring method provided in this application embodiment enables the load balancer monitoring device to react quickly and notify the administrator when a system failure occurs or is about to occur, thereby enabling rapid handling of the problem or early prevention of the problem, and avoiding the impact on business.

[0078] In some embodiments, after step S1031, "the monitoring device of the load balancer performs aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer," the method further includes:

[0079] Step S1036: The monitoring device of the load balancer acquires service data for a preset duration and determines the change pattern of the service data based on the service data for the preset duration.

[0080] In this embodiment, the preset duration can be set according to actual circumstances, such as 5 minutes or 10 minutes. In this embodiment, the change pattern of business data can be determined based on the business data within the preset duration. For example, the business data can be user request access data; correspondingly, the change pattern of business data can be that user request access gradually increases over time.

[0081] Step S1037: The monitoring device of the load balancer determines the time point for resource expansion and the required amount of resource expansion based on the change pattern and the load information of each load node.

[0082] Continuing the example above, as user access gradually increases over time, we can determine the required capacity at each point in time based on this pattern. Then, we can determine the size of the resources that need to be expanded based on this capacity and load information. For example, if the pattern predicts a demand of 10GB of capacity at noon, and the pattern also predicts that the available load on the load nodes will be 5GB before noon, then the load on the load nodes needs to be expanded by at least 5GB before noon.

[0083] Step S1038: The monitoring device of the load balancer expands the resources of the load node based on the time point and the resource size.

[0084] In this embodiment of the application, once the time point and resource size are determined, the resources of the load node can be expanded according to the time point.

[0085] The load balancer monitoring method provided in this application continuously collects and statistically analyzes business data to determine the patterns of change in the business data over a long period. These patterns allow for the determination of when to scale up the load nodes.

[0086] In some embodiments, after step S101 "the monitoring device of the load balancer acquires the service data collected by the acquisition module in the load balancer", the method further includes:

[0087] In step S106, the monitoring device of the load balancer obtains the target tag information based on the user's operation command to add tag information.

[0088] In this embodiment, users can add tags to business data to monitor ingress requests from different data centers and users. When a user wants to add tag information, they send an operation command to the load balancer's monitoring device to add tag information, thereby enabling the load balancer's monitoring device to receive the user's operation command and obtain the target tag information. In this embodiment, the tag information can be identity document (ID) information or a numeric code. For example, numeric code 1 represents data center A, and numeric code 2 represents data center B.

[0089] In step S107, the monitoring device of the load balancer determines the target tag information as the tag information of the service data.

[0090] In this embodiment of the application, after the monitoring device of the load balancer determines the tag information corresponding to each service data, it can add the tag information to the service data.

[0091] Correspondingly, in step S1031, the monitoring device of the load balancer performs aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer, including:

[0092] The monitoring equipment of the load balancer performs aggregation query processing on the business data based on the target tag information to obtain the performance parameters and load information of each load node corresponding to the load balancer.

[0093] In this embodiment of the application, by adding tag information to the business data, the performance parameters and load information of each load node are also tagged. In this way, the Ingress requests from different data centers and different users can be monitored based on the tag information.

[0094] In some embodiments, the monitoring method for the load balancer further includes:

[0095] Step S108: When a load node malfunctions, the load balancer's monitoring device acquires historical and current business data.

[0096] In this embodiment of the application, both historical business data and current business data are obtained from a time-series database.

[0097] Step S109: The monitoring device of the load balancer determines the cause of the anomaly based on the historical service data and the current service data.

[0098] In this embodiment of the application, historical business data and current business data can be compared to determine the cause of the anomaly.

[0099] The load balancer monitoring method provided in this application embodiment obtains historical business data and current business data when an abnormality occurs in the load node, and determines the cause of the abnormality through the historical business data and the current business data. In this way, the root cause problem can be found and solved, and the abnormality can be located.

[0100] This application provides another method for monitoring a load balancer. It is based on an open-source project and has been modified to add a layer 4 load monitoring function. Using Prometheus to monitor Ingress can automatically monitor related virtual machines and upstream servers. At the same time, Prometheus data tags can be customized to monitor ingress in different data centers and different projects.

[0101] In the Kubernetes container platform, load balancer functionality is implemented using Ingress and Ingress-controller. Ingress serves as the platform entry point, responsible for uniformly managing external requests to services within the Kubernetes cluster. This is achieved by defining Ingress Controllers, Ingress Services, etc. The Ingress Controller interacts with the Kubernetes API to dynamically obtain changes in Ingress rules within the cluster, generates an Nginx configuration, writes it to the Nginx-ingress-control pod, and reloads the pod to make the rules effective. This enables the dynamic addition and resolution of registered services and their corresponding domain names / IP addresses / ports.

[0102] In the presence of a Kubernetes-based container cloud platform, the monitoring methods for load balancers include the following steps:

[0103] Step S1: Deploy Ingress and Ingress-controller on the container cloud platform according to the official Kubernetes documentation.

[0104] Step S2: Download the binary Prometheus executable from the open-source community, install it, and edit the configuration file to deploy Prometheus on the container cloud platform. Then, use Prometheus to query and aggregate data.

[0105] Step S203: Compile Nginx-module-vts and Nginx-module-sts into Nginx from the source code of Nginx-ingress-controller provided by the official Kubernetes documentation. Nginx-module-vts can provide data output in JSON format to enable monitoring of the load balancer.

[0106] Step S3: By creating different Layer 4 or Layer 7 load balancers, Nginx-module-vts can automatically collect data from the load balancers, i.e., the business data in the above embodiments; and expose the Nginx-module-vts metrics interface in the pod using Deployment environment variables; the key Deployment code is as follows:

[0107]

[0108]

[0109]

[0110] In this embodiment of the application, the above deployment file is used to deploy a module including monitoring function when deploying the load balancer. This module is used to expose the monitoring Uniform Resource Locator (URL) of the load balancer through environment variables. The component Nginx-vts-sts-exporter actively collects data through the URL and then performs format conversion to convert it into the Prometheus data format.

[0111] In this embodiment of the application, the monitoring data of the Layer 4 load balancer and the Layer 7 load balancer, i.e. the service data in the above embodiments, are shown in Table 1:

[0112] Table 1 shows the monitoring data for Layer 4 and Layer 7 load balancers.

[0113]

[0114] Step S4: Compile Nginx-vts-exporter to build the image, and use the environment variable Nginx-vts-exporter in the pod to request the Nginx-module-vts metrics interface to obtain the load balancer's monitoring data.

[0115] In step S5, Nginx-vts-exporter collects Nginx monitoring data and provides a monitoring interface to Prometheus. Prometheus monitors the Nginx data provided by Nginx-vts-sts-exporter and stores it in a time-series database. PromQL can be used to query and aggregate the time-series data.

[0116] Step S6: Use Promtheus to aggregate and query the performance of monitoring metrics or backend servers, and periodically adjust the server weight to achieve dynamic adjustment. For example, when the CPU or memory of the load balancer node is insufficient, the load balancer pod will automatically migrate to other nodes.

[0117] Step S7: Configure Alertmanager's alarm rules through Promethues. When the monitored data exceeds the threshold of the set indicator, Alertmanager will automatically generate an alarm and send it to the user via SMS or email.

[0118] In this embodiment of the application, when a system malfunctions or is about to malfunction, the monitoring system needs to react quickly and notify the administrator so that the problem can be dealt with quickly or prevented in advance to avoid impacting business operations.

[0119] In some embodiments, after step S5, the monitoring method for the load balancer further includes:

[0120] Step S8: Perform long-term trend analysis using the collected monitoring data.

[0121] In this embodiment, long-term trend analysis of monitoring indicators is performed through continuous collection and statistics of monitoring data. For example, by judging application request-related indicators, we can predict in advance when resource expansion will be needed.

[0122] In some embodiments, after step S5, the monitoring method for the load balancer further includes:

[0123] Step S9: Compare and analyze the collected monitoring data.

[0124] In this embodiment, the monitoring data can be system concurrency data, load change data, etc. Comparative analysis of the collected monitoring data can be implemented by comparing and analyzing the collected load change data and / or system concurrency data. This comparative analysis helps determine whether system expansion is necessary and / or whether any system anomalies exist.

[0125] In some embodiments, after step S5, the monitoring method for the load balancer further includes:

[0126] Step S10: Perform fault analysis and location based on the collected monitoring data.

[0127] In this embodiment of the application, when a problem occurs and it is necessary to investigate and handle it, the root cause of the problem can be found and resolved by analyzing historical and current data.

[0128] In some embodiments, after step S5, the monitoring method for the load balancer further includes:

[0129] Step S11: Output monitoring data information.

[0130] In this embodiment of the application, data visualization is achieved by outputting monitoring data through a visualization dashboard. The visualization dashboard can directly provide intuitive information such as the system's operating status, resource usage, and service operating status.

[0131] The load balancer monitoring method provided in this application implements monitoring of Layer 4 and Layer 7 load balancers by deploying the load balancer monitoring module Vts-sts-exporter, eliminating the need to embed different exporter modules for different load balancers. Using Prometheus for Ingress monitoring can automatically monitor relevant virtual machines and upstream servers, and also allows for customizing Prometheus data tags to monitor Ingress in different data centers and projects. The monitoring system supporting dynamic load balancing has monitoring functions such as analysis, query, and diagnosis, as well as the advantages of load balancing such as fast response time, high efficiency, and efficient resource utilization.

[0132] Based on the foregoing embodiments, this application provides a monitoring device for a load balancer. The various modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0133] This application embodiment further provides a monitoring device for a load balancer. Figure 3This is a schematic diagram of the composition structure of the monitoring device for the load balancer provided in the embodiments of this application, as shown below. Figure 3 As shown, the monitoring device 300 of the load balancer includes:

[0134] The first acquisition module 301 is used to acquire service data collected by the acquisition module in the load balancer, wherein the acquisition module is capable of acquiring service data from the Layer 7 load balancer and the Layer 4 load balancer.

[0135] Storage module 302 is used to store the business data in a time-series database.

[0136] The processing module 303 is used to perform aggregate query processing on the business data in order to monitor the load balancer.

[0137] In some embodiments, the monitoring device 300 of the load balancer further includes:

[0138] The second acquisition module is used to obtain the environment variable parameters configured for the pod.

[0139] The first sending module is used to send the environment variable parameters to the pod, and the environment variable parameters enable the interface of the acquisition module to be provided to the pod;

[0140] Correspondingly, the processing module 303 includes:

[0141] The first acquisition unit is used to acquire the business data collected by the acquisition module from the interface in the pod.

[0142] In some embodiments, the processing module 303 includes:

[0143] The processing unit is used to perform aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer.

[0144] The determining unit is used to determine the load difference between the load nodes based on the performance parameters and load information of each load node;

[0145] An adjustment unit is used to adjust the weight of the load node according to the load difference, so as to realize dynamic adjustment of the load node.

[0146] In some embodiments, the monitoring device 300 of the load balancer further includes:

[0147] The judgment module is used to determine whether the load information of each load node is greater than a preset threshold.

[0148] The output module is used to output alarm information when the load information of each load node is greater than the preset threshold.

[0149] In some embodiments, the monitoring device 300 of the load balancer further includes:

[0150] The third acquisition module is used to acquire business data for a preset duration and determine the change pattern of the business data based on the business data for the preset duration.

[0151] The first determining module is used to determine the time point for resource expansion and the amount of resources to be expanded based on the change pattern and the load information of each load node.

[0152] The expansion module is used to expand the resources of the load node based on the time point and the resource size.

[0153] In some embodiments, the monitoring device 300 of the load balancer further includes:

[0154] The fourth acquisition module is used to acquire target tag information based on the user's operation command to add tag information;

[0155] The second determining module is used to determine the target tag information as the tag information of the business data;

[0156] Correspondingly, the processing unit includes:

[0157] The processing subunit is used to perform aggregation query processing on the business data based at least on the target tag information to obtain the performance parameters and load information of each load node corresponding to the load balancer.

[0158] In some embodiments, the monitoring device 300 of the load balancer further includes:

[0159] The fifth acquisition module is used to acquire historical and current business data when a load node malfunctions.

[0160] The third determining module is used to determine the cause of the anomaly based on the historical business data and the current business data.

[0161] The load balancer monitoring device 300 provided in this application embodiment includes a first acquisition module 301 that acquires business data collected by the acquisition module in the load balancer, a storage module 302 that stores the business data in a time-series database, and a processing module 303 that performs aggregation query processing on the business data to monitor the load balancer. This device achieves the acquisition of business data from both Layer 7 and Layer 4 load balancers. By storing the business data in a time-series database, it facilitates viewing the business data and improves monitoring efficiency.

[0162] It should be noted that, in the embodiments of this application, if the above-described load balancer monitoring method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0163] Accordingly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the load balancer monitoring method provided in the above embodiments.

[0164] This application provides a monitoring device for a load balancer. Figure 4 This is a schematic diagram of the composition structure of the monitoring device for the load balancer provided in the embodiments of this application, as shown below. Figure 4 As shown, the load balancer monitoring device 400 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. The communication bus 402 is configured to enable communication between these components. The user interface 403 may include a display screen, and the external communication interface 404 may include standard wired and wireless interfaces. The processor 401 is configured to execute a program stored in the memory for a load balancer monitoring method, to implement the steps in the load balancer monitoring method provided in the above embodiment.

[0165] The descriptions of the monitoring devices and storage media embodiments of the load balancer above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the embodiments of the monitoring devices and storage media of the load balancer in this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0166] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0167] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0168] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0169] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0170] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0171] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0172] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0173] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an AC to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0174] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for monitoring a load balancer, characterized in that, The method includes: The system acquires service data collected by the acquisition module in the load balancer, wherein the acquisition module is capable of acquiring service data from the Layer 7 load balancer and the Layer 4 load balancer. The business data is stored in a time-series database; The business data is aggregated and queried to obtain the performance parameters and load information of each load node corresponding to the load balancer; Based on the performance parameters and load information of each load node, determine the load differences between the load nodes; The weights of the load nodes are adjusted based on the load differences to achieve dynamic adjustment of the load nodes.

2. The method according to claim 1, characterized in that, The method further includes: Retrieve environment variable parameters from the configuration data structure pod; The environment variable parameters are sent to the pod, and the environment variable parameters enable the interface of the acquisition module to be provided to the pod; Correspondingly, the acquisition of service data collected by the acquisition module in the load balancer includes: The business data collected by the acquisition module is obtained from the interface in the pod.

3. The method according to claim 1, characterized in that, The method further includes: Determine whether the load information of each load node is greater than a preset threshold; When the load information of each load node exceeds the preset threshold, an alarm message is output.

4. The method according to claim 1, characterized in that, The method further includes: Acquire business data for a preset duration, and determine the pattern of change in the business data based on the business data for the preset duration; Based on the changing patterns and the load information of each load node, determine the timing for resource expansion and the required amount of expanded resources. Based on the time point and the resource size, the load node is expanded in terms of resources.

5. The method according to claim 1, characterized in that, The method further includes: Based on the user's command to add tag information, obtain the target tag information; The target tag information is determined as the tag information of the business data; Correspondingly, the business data is aggregated and queried to obtain the performance parameters and load information of each load node corresponding to the load balancer, including: At least based on the target tag information, the business data is aggregated and queried to obtain the performance parameters and load information of each load node corresponding to the load balancer.

6. The method according to claim 1, characterized in that, The method further includes: When a load node malfunctions, historical and current business data are retrieved. The cause of the anomaly is determined based on the historical business data and the current business data.

7. A monitoring device for a load balancer, characterized in that, The device includes: The first acquisition module is used to acquire business data collected by the acquisition module in the load balancer, wherein the acquisition module is capable of acquiring business data from the Layer 7 load balancer and the Layer 4 load balancer. A storage module is used to store the business data in a time-series database; The processing module is used to perform aggregation query processing on the business data to obtain the performance parameters and load information of each load node corresponding to the load balancer; determine the load difference between each load node based on the performance parameters and load information of each load node; and adjust the weight of the load node according to the load difference to achieve dynamic adjustment of the load node.

8. A monitoring device for a load balancer, characterized in that, The device includes: Processor; and Memory for storing computer programs that can run on the processor; When the computer program is executed by the processor, it implements the steps of the monitoring method for the load balancer according to any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores computer-executable instructions configured to perform the steps of the monitoring method for the load balancer as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multi-live load balancing method and system applied to openstack cloud platform

    CN111274027A

  • Method and device for load balancing, and storage medium

    US20190364103A1