Cluster resource monitoring method, device, cluster, equipment and medium

By distributing resource monitoring tools in the k8s cluster, monitoring and returning node resource usage data, data migration and capacity expansion problems in the existing technology are solved, and efficient and pluggable cluster resource monitoring is achieved.

CN111966558BActive Publication Date: 2025-01-07BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010605264.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-29
Publication Date
2025-01-07
Estimated Expiration
2040-06-29

AI Technical Summary

Technical Problem

The existing k8s cluster monitoring tools have shortcomings in data portability and storage, especially when the cluster size is large, the data that needs to be processed manually is huge and time-consuming, and cannot achieve dynamic capacity expansion and lossless data migration.

Method used

By distributing resource monitoring tools to each node in the cluster, starting and monitoring the resource usage of nodes, generating data back to web pages and returning them, realizing lossless migration and dynamic expansion of node resource usage data, using docker and top tools for multiple purposes Dimensional monitoring, supports automatic elastic scaling.

Benefits of technology

It realizes effective monitoring of the resource usage of k8s cluster nodes and lossless data migration, improves monitoring efficiency and data return success rate, and adapts to the dynamic expansion requirements of the cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966558B_ABST
    Figure CN111966558B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, cluster, equipment and medium for monitoring resources of a cluster, and relate to the fields of resource monitoring, big data and cloud computing technology. The specific implementation scheme is: distribute resource monitoring tools to each node in the cluster; for each node, start the resource monitoring tool, and monitor the resource usage of the node through the resource monitoring tool; use the resource usage data of the monitored node to generate a data return webpage and return it; and download the resource usage data from the data return webpage. The embodiments of the present application can achieve the distribution of monitoring resource tools to nodes in the cluster, obtain the resource usage data of each node in the cluster, and control each node to return the resource usage data through the return data return webpage, which can not only effectively monitor the resource usage of each node in the cluster according to the resource usage data, but also achieve the effect of pluggable monitoring of the cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to the field of resource monitoring, big data and cloud computing technology, and specifically to a cluster resource monitoring method, device, cluster, equipment and medium. Background Art

[0002] In the current era of k8s cluster, performance testing of k8s is also crucial. Although the k8s cluster itself has corresponding monitoring services and displays various trend charts in the form of a platform, the portability, storage and output of performance data are a big project. The larger the cluster, the more data needs to be processed manually and the longer it takes. Summary of the invention

[0003] The present application provides a cluster resource monitoring method, apparatus, cluster, device and medium, and provides a solution for monitoring and collecting resource usage of nodes in a cluster, thereby realizing pluggable monitoring of cluster resources.

[0004] According to one aspect of the present application, a cluster resource monitoring method is provided, comprising:

[0005] Distribute resource monitoring tools to each node in the cluster;

[0006] For each of the nodes, start the resource monitoring tool and monitor the resource usage of the node through the resource monitoring tool;

[0007] Using the monitored resource usage data of the node, generate a data return webpage and return it; and

[0008] The resource usage data is downloaded from the data feedback webpage.

[0009] According to another aspect of the present application, a cluster resource monitoring device is provided, comprising:

[0010] The distribution module is used to distribute resource monitoring tools to each node in the cluster;

[0011] A resource monitoring module, used to start the resource monitoring tool for each of the nodes, and monitor the resource usage of the node through the resource monitoring tool;

[0012] A generating module, used to generate a data return webpage using the monitored resource usage data of the node and return it; and

[0013] The download module is used to download the resource usage data from the data feedback webpage.

[0014] According to another aspect of the present application, a cluster is provided, comprising: a plurality of nodes and a resource monitoring device for the cluster as described in any one of the present applications.

[0015] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cluster resource monitoring method as described in any one of the embodiments of the present application.

[0019] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the cluster resource monitoring method as described in any one of the embodiments of the present application.

[0020] According to another aspect of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the cluster resource monitoring method according to the first aspect of the present application.

[0021] According to the technology of the present application, by distributing resource monitoring tools to each node in the cluster, the resource monitoring tools are used to collect resource usage data of each node, a data return webpage is generated based on the resource usage data, and the data return webpage is returned to download the resource usage data from the data return webpage. Thus, it is possible to distribute monitoring resource tools to nodes in the cluster, obtain resource usage data of each node in the cluster, and control each node to return resource usage data through the return data return webpage, not only to effectively monitor the resource usage of each node in the cluster according to the resource usage data, but also to achieve the effect of pluggable monitoring of the cluster.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0024] Figure 1 It is a flow chart of a cluster resource monitoring method provided by an embodiment of the present application;

[0025] Figure 2 It is a flowchart of another cluster resource monitoring method provided by an embodiment of the present application;

[0026] Figure 3a This is an overall flow chart for monitoring the usage of node resources in a cluster provided by an embodiment of the present application;

[0027] Figure 3b It is a scenario system diagram for monitoring the usage of node resources in a cluster provided by an embodiment of the present application;

[0028] Figure 4 It is a flowchart of another cluster resource monitoring method provided according to an embodiment of the present application;

[0029] Figure 5 It is a flowchart of another cluster resource monitoring method provided according to an embodiment of the present application;

[0030] Figure 6 It is a flowchart of another cluster resource monitoring method provided according to an embodiment of the present application;

[0031] Figure 7 It is a structural diagram of a cluster resource monitoring device provided according to an embodiment of the present application;

[0032] Figure 8 is a schematic diagram of a cluster structure provided according to an embodiment of the present application;

[0033] Fig. 9 It is a block diagram of an electronic device used to implement the cluster resource monitoring method of an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0035] The following specifically describes a cluster resource monitoring method, apparatus, cluster, device and medium provided by an embodiment of the present application with reference to the accompanying drawings. Figure 1 A cluster resource monitoring method provided by an embodiment of the present application is described. Figure 1 This is a flow chart of a cluster resource monitoring method provided by an embodiment of the present application, see Figure 1 , the method comprises the following steps:

[0036] S101, distribute resource monitoring tools to each node in the cluster.

[0037] The cluster resource monitoring method provided in this embodiment can be performed by the cluster resource monitoring device provided in this application embodiment, which can be configured in an electronic device to monitor the node resource usage in the cluster. In this application embodiment, the electronic device can be a resource monitoring server (pressure transmitter).

[0038] In the embodiment of the present invention, the cluster refers to a k8s (Kubernetes) cluster, and k8s includes multiple nodes. Kubernetes (k8s) is a new distributed architecture based on container technology, built on docker technology, and provides containerized applications with rich and diverse functions such as resource scheduling, deployment and operation, service discovery, and capacity expansion and contraction. The feature of k8s is automation, which means that it can realize automatic deployment, automatic restart, automatic replication, and automatic scaling / extension.

[0039] Among them, the resource monitoring tool is a tool used to monitor the resource usage of each node in the cluster.

[0040] Exemplarily, a configuration file can be set in an electronic device by a monitoring personnel. After the configuration file is set, the electronic device is started so that the electronic device distributes the resource monitoring tool to each node in the target monitoring cluster through the network based on the target monitoring cluster information in the configuration file. Among them, the configuration file may include target monitoring cluster information and the type of business to be monitored. In this embodiment, the target monitoring cluster information may refer to the IP of the machine where the k8s cluster is located, etc., which can determine the target monitoring cluster, and it is not specifically limited here. The type of business to be monitored refers to the business scenario that needs to be monitored.

[0041] That is to say, the electronic device of the present application can be flexibly configured as needed. When the electronic device is connected through an interface, the resource monitoring tool can be distributed to each node in the target monitoring cluster. Optionally, the resource monitoring tool can be encapsulated in a compressed package and sent to the nodes in the cluster by issuing the compressed package.

[0042] S102, for each node, start a resource monitoring tool, and monitor the resource usage of the node through the resource monitoring tool.

[0043] The resource usage may include but is not limited to: CPU usage, memory usage, disk usage, etc., which are not specifically limited here.

[0044] When monitoring the resource usage of each node in the cluster, the following methods are usually used in related technologies: Method 1, use the resource monitoring tool (complete metric pipeline prometheus) that comes with the cluster (such as the k8s cluster) to obtain metrics from the kubelet, and then expose it to kubernetes through the adapter, where Prometheus provides visualization services. Method 2, use the top tool to monitor the resource usage of each node in the cluster. However, the above method 1 application scenario can only be used within the cluster. The performance data of each machine and instance (pod) in the node can be searched and viewed, but the data cannot be visualized and losslessly transplanted. At the same time, with the abnormality or deletion of the pod, the data will be lost; Method 2 is relatively simple to implement, and it can also achieve visual and lossless transplantation of data, but it can only collect data from a single machine, which is not suitable for the k8s cluster, and with the expansion of the k8s cluster and the expansion of the pod, it is even more impossible to achieve dynamic expansion monitoring.

[0045] In order to solve the problem that data lossless migration cannot be achieved by using the resource monitoring tool that comes with the cluster in the related art, and that the top tool can only collect a single machine and cannot be dynamically expanded. The embodiment of the present application creatively distributes the resource monitoring tool that can achieve data migration, cluster monitoring, and dynamic expansion corresponding to the expansion of the cluster to each node in the cluster, and then starts the resource monitoring tool on each node to control the resource monitoring tool to monitor the resource usage of the node. Among them, starting the resource monitoring tool on each node can send a resource monitoring tool startup instruction to the electronic device to synchronously start the resource monitoring tool on each node, and realize synchronous monitoring of the resource usage of the node where the resource monitoring tool is located, so as to maximize the lossless migration of data, and no data loss will occur. At the same time, for the automatic elastic scaling characteristics of the k8s cluster, the resource monitoring tool also supports automatically scalable monitoring items, that is, it has the characteristics of automatic elastic scaling.

[0046] S103, using the monitored node resource usage data, generating a data feedback webpage and transmitting it back.

[0047] The resource usage data may include but is not limited to: CPU usage, available memory, free disk space and other data.

[0048] Optionally, after monitoring the resource usage data of each resource node through the resource monitoring tool on each node, the resource usage data of each node needs to be transmitted back to the electronic device so that the electronic device can determine whether there are nodes with abnormal resource usage in the cluster based on the resource usage data transmitted back by each resource monitoring tool.

[0049] In the related art, after a general resource node tool monitors the resource usage data of a node, the node will adopt a resource usage data encryption method to encrypt the resource usage data and then transmit it back to the electronic device. However, the password is sensitive information, so it cannot be easily shared, resulting in a return error or failure. To this end, the embodiment of the present application generates a data return webpage based on the resource usage data of the monitored node, and transmits the data return webpage back to the electronic device, thereby realizing the non-password return of the node's resource usage data and improving the return success rate of the resource usage data.

[0050] S104, downloading resource usage data from the data feedback webpage.

[0051] Optionally, after receiving the data return webpage of each node in the cluster, the electronic device can download the resource usage data of each node in the cluster from the received data return webpage, and determine whether the resource usage of the node is abnormal based on the resource usage data of each node. In other words, this embodiment obtains the resource usage data of the node through the data return webpage, thereby realizing lossless migration of data on the node.

[0052] The technical solution of the embodiment of the present application distributes a resource monitoring tool to each node in the cluster, collects resource usage data of each node by using the resource monitoring tool, generates a data return webpage based on the resource usage data, and returns the data return webpage to download the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, obtaining the resource usage data of each node in the cluster, and controlling each node to return the resource usage data through the return data return webpage, not only can the resource usage of each node in the cluster be effectively monitored according to the resource usage data, but also the effect of pluggable monitoring of the cluster can be achieved.

[0053] Through the above analysis, it can be known that the embodiment of the present application monitors the resource usage of each node through the resource monitoring tool on each node of the cluster, and returns a web page based on the data returned by the node to obtain the resource usage data of each node. In the specific implementation process, multiple instances (pods) can be run on each node in the cluster, and each node may also have a main process of a running business service. In order to monitor the resource usage of multiple instances on each node and the main process of the business service running on each node, the embodiment of the present application can set two resource monitoring programs in the resource monitoring tool, such as a first resource monitoring program and a second resource monitoring program. Through the first resource monitoring program and the second resource monitoring program, the resource usage of each instance on each node and the resource usage of the main process of the business service running on each node are monitored respectively. The following is combined with Figure 2 , the above situation of the cluster resource monitoring method provided in the embodiment of the present application is explained.

[0054] like Figure 2 As shown, the method comprises the following steps:

[0055] S201, distribute resource monitoring tools to each node in the cluster.

[0056] The resource monitoring tool includes a first resource monitoring program and a second resource monitoring program. In an embodiment of the present application, the first resource monitoring program refers to the docker tool; the second resource monitoring program refers to the top tool. Specifically, the docker tool is used to monitor the resource usage of the instance on each node, and the top tool is used to monitor the resource usage of the main process of the business service running on each node.

[0057] That is to say, the embodiments of the present application can monitor the resource usage of the instance and the main process of the running business service on each node in the cluster by using different monitoring programs, thereby realizing multi-dimensional monitoring of the cluster nodes.

[0058] Since the nodes in the cluster include the master node and other nodes (slave nodes) subordinate to the master node, the master node is equivalent to the control node, which not only controls other nodes, but also acts as a transfer mechanism to interact with upper-layer devices (electronic devices). In addition, the master node can also have the functions of other nodes, that is, various instances (pods) are also deployed on the master node.

[0059] To this end, when the embodiment of the present application monitors the resource usage of each node in the cluster, the resource monitoring tool can be distributed to the master node in the cluster, and the master node continues to send the resource monitoring tool to each node subordinate to the master node.

[0060] Since it is necessary to enter the main process of the business service running on other nodes affiliated to the main node when monitoring the resource usage of the main process of the business service running on other nodes, and the monitoring is performed by the second resource monitoring program in the resource monitoring tool on the main node, the resource monitoring tool sent to the main node in the embodiment of the present application includes: a first resource monitoring program and a second resource monitoring program, and the resource monitoring tool sent to each node affiliated to the main node includes: a first resource monitoring program.

[0061] In the present application, a first resource monitoring program and a second resource monitoring program are sent to the main node to monitor the resource usage of multiple instances on the main node and the resource usage of the main process of the business service running on the main node; a first resource monitoring program is sent to each node subordinate to the main node to monitor the resource usage of multiple instances on each node subordinate to the main node, and the second resource monitoring program deployed on the main node is used to monitor the resource usage of the main process of the business service running on other nodes subordinate to the main node.

[0062] That is, the first resource monitoring program and the second resource monitoring program are deployed on the master node, while only the first resource monitoring program is deployed on each node subordinate to the master node. In this application, the master node monitors the resource usage of the main process of each node by utilizing the characteristics of the master node in controlling other nodes, so that the master node can monitor the resource usage of the main process more quickly and feedback to the electronic device, so that the main process can be scheduled in time. By deploying the first resource monitoring program on each node instead of monitoring all by the master node, the monitoring burden of the master node can be effectively reduced.

[0063] S202 , for each node, start and call a first resource monitoring program to monitor resource usage of an instance on the node to obtain first resource usage data of the instance.

[0064] The first resource usage data may include: CPU occupancy, available memory, remaining disk space and other data.

[0065] Optionally, by detecting the type of each node in the cluster, it is possible to determine which nodes belong to the master node and which nodes belong to other nodes of the master node. After determining the master node and other nodes in the cluster, for each master node, start and call the first resource monitoring program in the resource monitoring tool deployed on each master node, monitor the resource usage of each instance on each master node, and obtain the first resource usage data of each instance on each master node. For each other node belonging to the master node, the resource usage of each instance on each other node is monitored by starting and calling the first resource monitoring program in the resource monitoring tool deployed on each other node, and obtain the first resource usage data of each instance on each other node.

[0066] S203, calling a second resource monitoring program to monitor resource usage of a main process of a business service running on the node to obtain second resource usage data of the main process.

[0067] The second resource usage data may include: CPU occupancy, available memory, remaining disk space and other data.

[0068] In the embodiment of the present application, the main process can be compared to a store, which provides merchandise services. There may be other sales stalls next to the store, such as fruit stalls, vegetable stalls, etc. In this case, other sales stalls are secondary and do not need to be paid attention to. The service provided by the store is the main process.

[0069] Optionally, the main process of the business service can be determined by obtaining the business service running on each node in the cluster, and then determining whether the node to which the main process of each business service in the cluster belongs is the main node or another node subordinate to the main node. After determining that the node to which the main process of the business service belongs is the main node, start and call the second resource monitoring program in the resource monitoring tool deployed on each main node to monitor the resource usage of the main process of the business service running on each main node, so as to obtain the second resource usage data of the main process of the business service running on each main node. After determining that the node to which the main process of the business service belongs is another node subordinate to the main node, start and call the second resource monitoring program in the resource monitoring tool deployed on the main node to which each other node belongs to monitor the resource usage of the main process of the business service running on each other node, so as to obtain the second resource usage data of the main process of the business service running on each other node. Thus, the management of the resource usage monitoring of the main process of the business service running on other nodes subordinate to the main node is realized through the main node.

[0070] That is, the present embodiment calls the second resource monitoring program to monitor the resource usage of the main process of the business service running on the node to obtain second resource usage data, including: obtaining the business service running on each node; obtaining the main process of the business service; and calling the second resource monitoring program deployed on the master node to monitor the resource usage of the main process of the business service on the master node and each node subordinate to the master node, respectively, to obtain second resource usage data of the main process.

[0071] It can be understood that in S202 and S203 of this embodiment, when the resource usage of each node in the cluster is monitored by the resource monitoring tool, two methods are adopted: the first resource monitoring program (docker tool) and the second resource monitoring program (top tool). The docker monitoring needs to be delivered to the monitoring service of each node, focusing on monitoring and collecting the usage of various service resources under this node; the top monitoring collection uses the master node (master) as the execution entry, kubectlexec obtains the business services running in the cluster, and further obtains the main process pid of the running business services, and then collects resource usage through the pid of the main process. The specific implementation code is as follows:

[0072] pid=$(kubectl exec-i$element-n$namespace--ps-ef|grep java|awk'{print$2'})

[0073] kubectl exec-i$element-n$namespace--top-bd$interval-p$pid

[0074] S204, using the monitored node resource usage data, generating a data feedback webpage and transmitting it back.

[0075] S205, downloading resource usage data from the data feedback webpage.

[0076] In order to clearly illustrate this embodiment, Figure 3a and Figure 3b Describes the process of monitoring resource usage of each node in the cluster.

[0077] like Figure 3a As shown, the monitoring personnel can first perform step 1 to set the configuration file through the unified configuration entry. After the configuration file is set, step 2 is performed to start the electronic device monitoring service through the unified execution entry. The electronic device distributes the resource monitoring tool to each node in the target monitoring cluster based on the startup instruction, and synchronously starts the resource monitoring tool on each node, so that the resource monitoring tool on each node monitors the resource usage. Since the configuration file also includes: the business type to be monitored, the resource monitoring tool can also collect corresponding resource usage data according to the business type to be monitored, and judge the running state of the monitoring service; if the monitoring service stops running, it is determined that the monitoring service stops, then each node in the cluster uses the resource usage data monitored by the resource monitoring tool to generate a data return webpage and return it to the electronic device, so that the electronic device downloads the resource usage data of each node from the data return webpage. If the monitoring service is not stopped, the resource usage continues to be monitored, and it is determined whether to manually stop the monitoring service. If yes, it is determined that the monitoring service stops, then each node in the cluster uses the resource usage data monitored by the resource monitoring tool to generate a data return webpage and return it to the electronic device, so that the electronic device downloads the resource usage data of each node from the data return webpage.

[0078] Combine the following Figure 3bThe system diagram is illustrated. Specifically, the configuration file can be set through the unique configuration entry on the electronic device in the upper layer, and then the start and stop of the monitoring service can be controlled through the unique execution entry on the electronic device. If the target monitoring cluster information in the lower layer is obtained from the configuration file, the electronic device sends the resource monitoring tool including the docker tool and the top tool to the master node in the determined target cluster according to the target monitoring cluster information, and then the master node continues to send the resource monitoring tool including the docker tool to each node affiliated with the master node. If the instruction to start the monitoring service is detected, the resource usage of the instance on the node can be monitored through the docker tool on the master node, and the resource usage of the main process of the business service running on the node can be monitored through the top tool on the master node; the resource usage of the instance on the node can be monitored through the docker tool on other nodes affiliated with the master node, and the resource usage of the main process of the business service running on the node can be monitored through the top tool on the master node. Afterwards, the master node and other nodes in the cluster can generate a resource return page based on the monitored resource usage data, and send the resource return page back to the electronic device, so that the electronic device downloads the resource usage data from the resource return page. Among them, Figure 3b The master node part also includes: machine resource usage monitoring service, service limit settings, pod master process resource usage monitoring service, docker monitoring data collection and data return service. Service limit settings are resource settings for pods in the k8s cluster. Among them, the pod's own resource usage is to more clearly understand whether each pod has any abnormal resource usage when service limits are configured, and the additional resource monitoring is set up.

[0079] The technical solution of the embodiment of the present application is to distribute a resource monitoring tool including a first resource monitoring program and a second resource monitoring program to each node in the cluster, so as to use the first resource monitoring program to monitor the resource usage of the instance on each node to obtain the first resource usage data of the instance, and call the second resource monitoring program to monitor the resource usage of the main process of the business service running on each node to obtain the second resource usage data of the main process, and then use the first resource usage data and the second resource usage data of each node monitored to generate a data return webpage and return it, so that the electronic device downloads the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, obtaining the resource usage data of each node in the cluster, and controlling each node to return the resource usage data through the return data return webpage, not only the resource usage of each node in the cluster is effectively monitored according to the resource usage data, but also the effect of pluggable monitoring of the cluster can be achieved. In addition, the resource monitoring tool adds multi-dimensional resource monitoring, which provides a more convenient way to locate problems in cluster performance.

[0080] Figure 4 1 is a flow chart of another cluster resource monitoring method provided according to an embodiment of the present application. This embodiment is an optional solution proposed based on the above embodiment. Figure 4 , the method comprising:

[0081] S401, distribute resource monitoring tools to each node in the cluster.

[0082] S402, distributing a web page service program for generating a data return web page to each node.

[0083] Among them, the web page service program refers to the web service.

[0084] Optionally, this embodiment distributes web services to each node in the cluster so that each node can generate a data return web page based on the web service and return the data return web page, thereby realizing the non-confidential return of the node's resource usage data, improving the return success rate of the resource usage data, and realizing lossless migration of data on the node.

[0085] It is understandable that the execution order of S401 and S402 can be to distribute the web page service program for generating the data return web page to each node while distributing the resource monitoring tool to each node in the cluster; or, after distributing the resource monitoring tool to each node in the cluster, distribute the web page service program for generating the data return web page to each node; or, before distributing the resource monitoring tool to each node in the cluster, distribute the web page service program for generating the data return web page to each node. There is no specific limitation here.

[0086] Since the nodes in the cluster include the master node and other nodes subordinate to the master node, and the master node is equivalent to the control node, which can control other nodes. To this end, the embodiment of the present application distributes a web page service program for generating the data return web page to each node, including: issuing the web page service program to each master node in the cluster, and the master node continues to issue the web page service program to each node subordinate to the master node.

[0087] S403, for each node, start a resource monitoring tool, and monitor the resource usage of the node through the resource monitoring tool.

[0088] S404, using the monitored node resource usage data, based on a web page service program for generating a data return web page, a data return web page is generated and returned.

[0089] S405, downloading resource usage data from the data feedback webpage.

[0090] Continue with Figure 3b Take this as an example to illustrate: Figure 3b Web services are configured on the master node and other nodes subordinate to the master node.

[0091] The technical solution of the embodiment of the present application is to distribute resource monitoring tools to each node in the cluster, distribute a web page service program for generating data return web pages to each node, collect resource usage data of each node by using the resource monitoring tool, generate a data return web page based on the web page service program for generating data return web pages by using the monitored resource usage data of the node, and return the data return web page to download resource usage data from the data return web page. Thus, by distributing monitoring resource tools to nodes in the cluster, obtaining resource usage data of each node in the cluster, and controlling each node to return resource usage data by returning data return web pages, not only effectively monitoring the resource usage of each node in the cluster according to resource usage data, but also achieving the effect of pluggable monitoring of the cluster. In addition, by adopting the resource usage data monitored, generating a data return web page, and returning the data return web page to the electronic device, the resource usage data of the node is returned without secrets, the return success rate of the resource usage data is improved, and the data on the node is transplanted without loss.

[0092] Figure 5 This is a flow chart of another cluster resource monitoring method provided according to an embodiment of the present application. This embodiment is an optional solution proposed on the basis of the above embodiment. Specifically, after downloading the resource usage data from the data return webpage, the cluster expansion information is also monitored, and the resource monitoring tool is distributed to the newly added node (first node) in the expansion information to obtain the resource usage data of the newly added node. Figure 5 , the method comprising:

[0093] S501, monitoring the capacity expansion information of the cluster to obtain each first node added by the capacity expansion in the cluster and the first instance deployed on the first node.

[0094] S502: Distribute a resource monitoring tool to the first node to obtain resource usage data of the first node.

[0095] The expansion information refers to the information of the new node added in the cluster and the instance on the new node. In the embodiment of the present invention, the new node is the first node, and the instance on the new node is the first instance deployed on the first node. There is at least one first node and first instance.

[0096] Generally, the k8s cluster has an automatic elastic scaling feature, that is, a dynamic expansion feature. There are two general types of k8s cluster expansion: the first type: node expansion; the second type: node instance (pod) expansion. In this embodiment, a resource monitoring tool is distributed to each node in the cluster, and after the resource monitoring tool is deployed on each node, the resource monitoring tool can also automatically identify the first node after expansion and all instances on the first node. Then, the resource monitoring tool is distributed to the first node to obtain resource usage data of the first node.

[0097] The resource usage data of the first node is obtained, including: resource usage data of each instance on the first node, and resource usage data of the main process of the business service running on the first node.

[0098] S503: Generate a data return webpage using the monitored resource usage data of the first node and return it.

[0099] S504, downloading the resource usage data of the first node from the data feedback webpage.

[0100] Optionally, the resource usage data of the monitored first node can be used to generate a data return web page according to the distributed web service program, and the data return web page can be sent back to the electronic device, so that the electronic device downloads the resource usage data from the data return web page to analyze whether there is any abnormality in the resource usage of the instance on the first node and / or the main process of the running business service.

[0101] The technical solution of the embodiment of the present application distributes a resource monitoring tool to each node in the cluster, collects the resource usage data of each node by using the resource monitoring tool, generates a data return webpage based on the resource usage data, and returns the data return webpage to download the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, the resource usage data of each node in the cluster is obtained, and each node is controlled to return the resource usage data through the return data return webpage, which not only effectively monitors the resource usage of each node in the cluster according to the resource usage data, but also achieves the effect of pluggable monitoring of the cluster. In addition, the expansion information of the cluster is also monitored to obtain each first node newly added by the expansion in the cluster and the first instance deployed on each first node, and the resource monitoring tool is distributed to each first node to obtain the resource usage data of the first node, so as to determine whether the resource usage of the first node is abnormal based on the resource usage data, and when the resource usage of any first node is abnormal, the abnormal node can be intuitively located, which provides a more convenient way to locate the node abnormality problem.

[0102] Figure 6 1 is a flow chart of another cluster resource monitoring method provided according to an embodiment of the present application. This embodiment is an optional solution proposed based on the above embodiment. Figure 6 , the method comprising:

[0103] S601, distribute resource monitoring tools to each node in the cluster.

[0104] S602, for each node, start a resource monitoring tool, and monitor the resource usage of the point through the resource monitoring tool.

[0105] S603, using the monitored node resource usage data, generate a data return webpage and return it.

[0106] S604, downloading resource usage data from the data feedback webpage.

[0107] S605: extract metadata from the resource usage data and store the metadata locally.

[0108] Among them, metadata refers to data that describes resource usage data, or structural data used to provide information resources.

[0109] Optionally, by storing the metadata extracted from the resource usage data locally, it is possible to manage a large amount of resource usage data simply and efficiently; and to achieve effective discovery, search, integrated organization and management of information resources.

[0110] Furthermore, after storing the metadata, this embodiment further includes: generating a visualization data result of the node according to the extracted metadata.

[0111] That is, visualization data results of the nodes are generated based on the extracted metadata, so that the executors can intuitively and quickly locate the nodes with abnormal resource usage and the instances on the nodes or the main processes of the business services running on the nodes based on the visualization data results.

[0112] The technical solution of the embodiment of the present application distributes a resource monitoring tool to each node in the cluster, collects the resource usage data of each node by using the resource monitoring tool, generates a data return webpage based on the resource usage data, and returns the data return webpage to download the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, the resource usage data of each node in the cluster is obtained, and each node is controlled to return the resource usage data through the return data return webpage, which not only effectively monitors the resource usage of each node in the cluster according to the resource usage data, but also achieves the effect of pluggable monitoring of the cluster. In addition, the metadata extracted from the resource usage data is stored on the ground, which can realize simple and efficient management of a large amount of resource usage data; and realizes the effective discovery, search, integrated organization and effective management of information resources.

[0113] Figure 7 Schematic diagram of a cluster resource monitoring device provided according to an embodiment of the present application. Figure 7 , the embodiment of the present application discloses a cluster resource monitoring device 700, the device 700 can be configured in an electronic device, the device 700 includes: a distribution module 710, a resource monitoring module 720, a generation module 730 and a download module 740;

[0114] Wherein, the distribution module 710 is used to distribute the resource monitoring tool to each node in the cluster;

[0115] The resource monitoring module 720 is used to start the resource monitoring tool for each of the nodes and monitor the resource usage of the node through the resource monitoring tool;

[0116] A generating module 730 is used to generate a data return webpage using the monitored resource usage data of the node and return it; and

[0117] The download module 740 is used to download the resource usage data from the data feedback webpage.

[0118] Optionally, the resource monitoring tool includes a first resource monitoring program and a second resource monitoring program, and the resource monitoring module 720 includes:

[0119] a first monitoring unit, configured to call the first resource monitoring program for each node to monitor resource usage of the instance on the node to obtain first resource usage data of the instance; and

[0120] The second monitoring unit is used to call the second resource monitoring program to monitor the resource usage of the main process of the business service running on the node to obtain second resource usage data of the main process.

[0121] Optionally, the distribution module 710 is further configured to:

[0122] The resource monitoring tool is distributed to the master node in the cluster, and the master node continues to distribute the resource monitoring tool to each node subordinate to the master node.

[0123] Optionally, the first resource monitoring program and the second resource monitoring program are deployed on the master node, and each node subordinate to the master node is only deployed with the first resource monitoring program.

[0124] Optionally, the second monitoring unit includes:

[0125] A first acquisition subunit is used to acquire the business service running on each node;

[0126] A second acquisition subunit is used to acquire the main process of the business service; and

[0127] The monitoring subunit is used to call the second resource monitoring program deployed on the main node to monitor the resource usage of the main process of the business service on the main node and each node subordinate to the main node to obtain the second resource usage data of the main process.

[0128] Optionally, the distribution module 710 is further used to distribute a web page service program for generating the data return web page to each node.

[0129] Optionally, the distribution module 710 is further configured to:

[0130] The web page service program is issued to each master node in the cluster, and the master node continues to issue the web page service program to each node subordinate to the master node.

[0131] Optionally, the device 700 further includes:

[0132] An expansion monitoring module, used to monitor the expansion information of the cluster to obtain each first node newly added by the expansion in the cluster and the first instance deployed on the first node; and

[0133] The distribution module 710 is further configured to distribute the resource monitoring tool to the first node to obtain resource usage data of the first node.

[0134] Optionally, the device 700 further includes:

[0135] The storage module is used to extract metadata from the resource usage data after downloading the resource usage data from the data feedback webpage, and store the metadata locally.

[0136] Optionally, the device 700 further includes:

[0137] A visualization module is used to generate visualization data results of the slave node according to the extracted metadata after the metadata is stored locally.

[0138] It should be noted that the above explanation of the cluster resource monitoring method embodiment is also applicable to the cluster resource monitoring device of this embodiment, and the implementation principles are similar, which will not be repeated here.

[0139] The technical solution of the embodiment of the present application distributes a resource monitoring tool to each node in the cluster, collects resource usage data of each node by using the resource monitoring tool, generates a data return webpage based on the resource usage data, and returns the data return webpage to download the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, obtaining the resource usage data of each node in the cluster, and controlling each node to return the resource usage data through the return data return webpage, not only can the resource usage of each node in the cluster be effectively monitored according to the resource usage data, but also the effect of pluggable monitoring of the cluster can be achieved.

[0140] The present application embodiment also provides a cluster. Figure 8 As shown, the cluster 800 includes: a plurality of nodes 810 and a cluster resource monitoring device 700 as described in any one of the present applications.

[0141] The technical solution of the embodiment of the present application distributes a resource monitoring tool to each node in the cluster, collects resource usage data of each node by using the resource monitoring tool, generates a data return webpage based on the resource usage data, and returns the data return webpage to download the resource usage data from the data return webpage. Thus, by distributing the monitoring resource tool to the nodes in the cluster, obtaining the resource usage data of each node in the cluster, and controlling each node to return the resource usage data through the return data return webpage, not only can the resource usage of each node in the cluster be effectively monitored according to the resource usage data, but also the effect of pluggable monitoring of the cluster can be achieved.

[0142] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0143] like Fig. 9 Shown is a block diagram of an electronic device according to the resource monitoring method of the cluster of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0144] like Fig. 9 As shown, the electronic device includes: one or more processors 901, a memory 902, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 901 is taken as an example.

[0145] The memory 902 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to execute the cluster resource monitoring method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to execute the cluster resource monitoring method provided in the present application.

[0146] The memory 902, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the cluster resource monitoring method in the embodiment of the present application (for example, the distribution module 710, the resource monitoring module 720, the generation module 730 and the download module 740). The processor 901 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 902, that is, implements the cluster resource monitoring method in the above method embodiment.

[0147] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of an electronic device for cluster resource monitoring, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 902 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the electronic device for cluster resource monitoring via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0148] The electronic device of the cluster resource monitoring method may further include: an input device 903 and an output device 904. The processor 901, the memory 902, the input device 903 and the output device 904 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0149] The input device 903 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the webpage audio live broadcast, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 904 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0150] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0151] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0153] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0154] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0155] The present application also provides a computer program product, which implements the resource monitoring method of the cluster as described above when an instruction processor in the computer program product executes.

[0156] The technical solution of the embodiment of the present application is to process the current audio frame to synchronize the current video frame with the processed current audio frame when the current video frame and the current audio frame are out of sync, based on the extracted video display timestamp of the current video frame and the audio display timestamp of the current audio frame. Thus, in the process of out-of-sync audio and video playback, the video information is retained by processing the audio to improve the integrity of the visual information.

[0157] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0158] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A cluster resource monitoring method, wherein: include: Distribute resource monitoring tools to each node in the cluster; For each of the nodes, start the resource monitoring tool and monitor the resource usage of the node through the resource monitoring tool; Using the monitored resource usage data of the node, a data return webpage is generated and returned; as well as Downloading the resource usage data from the data feedback webpage; The resource monitoring tool includes a first resource monitoring program and a second resource monitoring program, wherein the first resource monitoring program is used to monitor the resource usage of the instance on each node, and the second resource monitoring program is used to monitor the resource usage of the main process of the business service running on each node, and the nodes in the cluster include the main node and the nodes subordinate to the main node; The step of distributing the resource monitoring tool to the nodes in the cluster includes: Distributing the resource monitoring tool to a master node in the cluster, and having the master node continue to distribute the resource monitoring tool to each node subordinate to the master node; Among them, the first resource monitoring program and the second resource monitoring program are deployed on the master node, and only the first resource monitoring program is deployed on each node affiliated to the master node. The second resource monitoring program deployed on the master node is used to monitor the resource usage of the main process of the business service running on the master node and the resource usage of the main process of the business service running on each node affiliated to the master node.

2. The cluster resource monitoring method according to claim 1, wherein the monitoring of the resource usage of the node by the resource monitoring tool comprises: For each node, calling the first resource monitoring program to monitor resource usage of the instance on the node to obtain first resource usage data of the instance; as well as The second resource monitoring program is called to monitor the resource usage of the main process of the business service running on the node to obtain second resource usage data of the main process.

3. The cluster resource monitoring method according to claim 2, wherein: The calling of the second resource monitoring program to monitor resource usage of the main process of the business service running on the node to obtain second resource usage data includes: Obtain the business services running on each node; Obtaining the main process of the business service; and The second resource monitoring program deployed on the master node is called to monitor the resource usage of the main process of the business service on the master node and each node subordinate to the master node, so as to obtain the second resource usage data of the main process.

4. The cluster resource monitoring method according to any one of claims 1 to 3, wherein: Also includes: A web page service program for generating the data return web page is distributed to each node.

5. The cluster resource monitoring method according to claim 4, wherein: The distributing to each node a web page service program for generating the data return web page comprises: The web page service program is issued to each master node in the cluster, and the master node continues to issue the web page service program to each node subordinate to the master node.

6. The cluster resource monitoring method according to any one of claims 1 to 3, wherein: Also includes: Monitoring the expansion information of the cluster to obtain each first node newly added by the expansion in the cluster and the first instance deployed on the first node; as well as The resource monitoring tool is distributed to the first node to obtain resource usage data of the first node.

7. The cluster resource monitoring method according to any one of claims 1 to 3, wherein: After downloading the resource usage data from the data feedback webpage, the method further includes: Metadata is extracted from the resource usage data, and the metadata is stored locally.

8. The cluster resource monitoring method according to claim 7, wherein: After the metadata is stored locally, the method further includes: Generate a visualization data result of the node according to the extracted metadata.

9. A cluster resource monitoring device, wherein: include: The distribution module is used to distribute resource monitoring tools to each node in the cluster; A resource monitoring module, used to start the resource monitoring tool for each of the nodes, and monitor the resource usage of the node through the resource monitoring tool; A generation module, used to generate a data return webpage using the monitored resource usage data of the node and return it; as well as A download module, used to download the resource usage data from the data feedback webpage; The resource monitoring tool includes a first resource monitoring program and a second resource monitoring program, wherein the first resource monitoring program is used to monitor the resource usage of the instance on each node, and the second resource monitoring program is used to monitor the resource usage of the main process of the business service running on each node, and the nodes in the cluster include the main node and the nodes subordinate to the main node; Wherein, the distribution module is further used for: Distributing the resource monitoring tool to a master node in the cluster, and having the master node continue to distribute the resource monitoring tool to each node subordinate to the master node; Among them, the first resource monitoring program and the second resource monitoring program are deployed on the master node, and only the first resource monitoring program is deployed on each node affiliated to the master node. The second resource monitoring program deployed on the master node is used to monitor the resource usage of the main process of the business service running on the master node and the resource usage of the main process of the business service running on each node affiliated to the master node.

10. The cluster resource monitoring device according to claim 9, wherein: The resource monitoring module includes: a first monitoring unit, configured to call the first resource monitoring program for each node to monitor resource usage of the instance on the node to obtain first resource usage data of the instance; and The second monitoring unit is used to call the second resource monitoring program to monitor the resource usage of the main process of the business service running on the node to obtain second resource usage data of the main process.

11. The cluster resource monitoring device according to claim 10, wherein: The second monitoring unit includes: A first acquisition subunit is used to acquire the business service running on each node; A second acquisition subunit is used to acquire the main process of the business service; and The monitoring subunit is used to call the second resource monitoring program deployed on the main node to monitor the resource usage of the main process of the business service on the main node and each node subordinate to the main node to obtain the second resource usage data of the main process.

12. The cluster resource monitoring device according to any one of claims 9 to 11, wherein: The distribution module is also used to distribute a web page service program for generating the data return web page to each node.

13. The cluster resource monitoring device according to claim 12, wherein: The distribution module is further used for: The web page service program is issued to each master node in the cluster, and the master node continues to issue the web page service program to each node subordinate to the master node.

14. The cluster resource monitoring device according to any one of claims 9 to 11, wherein: Also includes: An expansion monitoring module, used to monitor the expansion information of the cluster to obtain each first node newly added by the expansion in the cluster and the first instance deployed on the first node; as well as The distribution module is further used to distribute the resource monitoring tool to the first node to obtain resource usage data of the first node.

15. The cluster resource monitoring device according to any one of claims 9 to 11, wherein: Also includes: The storage module is used to extract metadata from the resource usage data after downloading the resource usage data from the data feedback webpage, and store the metadata locally.

16. The cluster resource monitoring device according to claim 15, wherein: Also includes: A visualization module is used to generate visualization data results of the node according to the extracted metadata after the metadata is stored locally.

17. A cluster, wherein: include: A resource monitoring device for a plurality of nodes and a cluster as described in any one of claims 9 to 16.

18. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cluster resource monitoring method according to any one of claims 1 to 8.

19. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the cluster resource monitoring method according to any one of claims 1 to 8.

20. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the cluster resource monitoring method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Distributed container cluster framework resource management method based on domestic CPU and operating system

    CN108829509A