Distributed cluster monitoring method and system, electronic equipment and storage medium

By defining the cluster access entry attributes in the object model attributes of the target cluster, using load balancing and failover capabilities, accessible nodes are automatically selected for monitoring, solving the problems of cumbersome monitoring and inconvenient operation and maintenance in the existing technology, and achieving simple and reliable cluster monitoring.

CN119537142APending Publication Date: 2025-02-28CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411608014.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing distributed cluster monitoring methods are relatively cumbersome and are inconvenient for timely operation and maintenance, and cannot effectively reflect the health status of the cluster, especially when nodes cannot be accessed.

Method used

By defining the cluster access entry attributes in the object model attributes of the target cluster, including the URIs of multiple nodes, the load balancing and failover capabilities of the cluster are used to automatically select accessible nodes for monitoring, avoiding dependence on specific nodes and large amounts of data processing.

Benefits of technology

It realizes simple and reliable cluster monitoring, avoids monitoring interruptions caused by individual node failures, improves monitoring accuracy and timeliness, and facilitates operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537142A_ABST
    Figure CN119537142A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed cluster monitoring method and system, electronic equipment and a storage medium, and the method comprises the steps: enabling a cluster access entry attribute in attributes of an object model of a defined target cluster to serve as the input of a client program SDK of the target cluster when the data of the target cluster is requested to be collected; wherein the cluster access entry attribute comprises URIs of a plurality of nodes belonging to the peer-to-peer object in the target cluster; receiving current data of a monitoring index of the target cluster fed back by a node currently accessing the target cluster in response to the current data acquisition request; wherein the node is a node corresponding to a current access entry of the target cluster; the current access entry is generated by selecting a URI of a node from cluster access entry attributes by a client program SDK of the target cluster; and based on the current data of the monitoring index of the target cluster, performing health state feedback on the target cluster according to the monitoring strategy associated with the object model of the target cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cluster monitoring, and in particular to a distributed cluster monitoring method and system, electronic equipment, and storage medium. Background Art

[0002] With the development of the computer industry, distributed technology has been increasingly widely used in the industry. Therefore, for the operation and maintenance field, effective monitoring of distributed clusters has become a major challenge.

[0003] There are currently three main methods for maintaining the health of distributed clusters. One is to deploy a monitoring agent in a specific node of the cluster, so that the monitoring agent can collect the data line of the node to monitor the node, and the monitoring status of the node can be used to reflect the status of the cluster. The second method is to deploy agents in the operating environment of all nodes in the cluster at the same time, and monitor all nodes in the cluster separately. The third method is to establish a selection mechanism to select one node from the multiple nodes of the selected cluster as the master node, and the rest as backup nodes. Then monitor the master node, and when the master node is inaccessible, select a new master node from the backup nodes, so as to ensure that there is always an accessible master node for monitoring to reflect the status of the cluster.

[0004] For the first method, when the specific node is inaccessible, the cluster is not monitored, and it will be identified as a cluster failure at this time. However, the distributed cluster has high availability and is still operating normally at this time, so the monitoring result is not accurate. The second method can effectively solve the problem of the first method, but this method requires collecting data from each node and performing a large amount of data processing, so it consumes a lot of resources and is also relatively cumbersome. The third method can circumvent the problems of the first and second methods, but it is necessary to establish and maintain the corresponding selection mechanism, which increases the complexity and cost of operation and maintenance. In addition, all three methods monitor the nodes, and the node information is obtained when the alarm is issued, resulting in unclear alarm information. It is also necessary to further analyze the node alarm information to obtain the cluster alarm information, so it is not convenient for timely operation and maintenance. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a distributed cluster monitoring method and system, electronic equipment, and storage medium to solve the problem that the existing monitoring method is relatively cumbersome and inconvenient for operation and maintenance.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a distributed cluster monitoring method, comprising:

[0008] When requesting to collect data of a target cluster, a cluster access entry attribute in the attributes of the object model of the defined target cluster is used as an input of the client program SDK of the target cluster; wherein the cluster access entry attribute includes URIs of multiple nodes belonging to peer objects in the selected target cluster;

[0009] Receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request; wherein the node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster; the current access entry of the target cluster is generated by selecting a node URI from the URIs of each node in the input cluster access entry attribute by the client program SDK of the target cluster;

[0010] Based on current data of the monitoring indicators of the target cluster, the health status feedback of the target cluster is performed according to the monitoring strategy associated with the object model of the target cluster.

[0011] Optionally, in the above-mentioned distributed cluster monitoring method, it also includes:

[0012] Define the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster; wherein the properties of the object model of the target cluster include at least the identifier of the target cluster and the cluster access entry properties; the cluster access entry properties include the URIs of the selected multiple nodes belonging to the peer objects in the target cluster and the entry-related information; the properties of the object model of each node include at least the identifier of each node and the identifier of the cluster to which it belongs;

[0013] Collecting the attributes of the object model of the target cluster and the attributes of the object model of each node into the configuration management database through an automatic collection program of the configuration management database;

[0014] Instantiating the object model of the target cluster and the object model of each node by using the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster through the configuration management database;

[0015] Based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs, the object model of the target cluster is associated with the object model of each of the nodes.

[0016] Optionally, in the above-mentioned distributed cluster monitoring method, after associating the object model of the target cluster with the object model of each of the nodes based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs, the method further includes:

[0017] Respond to user's policy configuration operations and configure monitoring policies;

[0018] The object model of the target cluster is queried from the configuration management database, and the object model of the target cluster is associated with the monitoring policy.

[0019] Optionally, in the above-mentioned distributed cluster monitoring method, after selecting a node URI from the URIs of each node in the cluster access entry attribute through the client program SDK of the target cluster to generate the current access entry of the target cluster, and sending the current data collection request to the selected node through the current access entry of the target cluster, it also includes:

[0020] Monitoring whether current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being visited is received within a preset time;

[0021] If it is monitored that the current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being accessed is not received within a preset time, the URI of the node is marked as inaccessible;

[0022] For the current data collection request, the cluster access entry attribute in the attribute of the object model of the target cluster to be defined is returned as the input of the client program SDK of the target cluster.

[0023] Optionally, in the above-mentioned distributed cluster monitoring method, the cluster access entry attribute in the attribute of the object model of the target cluster is defined as the input of the client program SDK of the target cluster, including:

[0024] For each of the current data collection requests, the cluster access entry attribute in the attributes of the object model of the defined target cluster is used as the input of the client program SDK of the target cluster to trigger the client program SDK of the target cluster. For each of the current data collection requests, a node URI is selected from the URIs of each node in the cluster access entry attribute to generate the current access entry of the target cluster corresponding to each current data collection request, and the current data collection request is sent to the selected corresponding node through the current access entry of the target cluster corresponding to each current data collection request; wherein each of the current data collection requests is used to request the collection of at least one monitoring indicator of the target cluster.

[0025] A second aspect of the present application provides a distributed cluster monitoring system, including:

[0026] An access unit, used for, when requesting to collect data of a target cluster, using a cluster access entry attribute in the attributes of the defined object model of the target cluster as an input of a client program SDK of the target cluster;

[0027] A receiving unit, used to receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request; wherein the node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster; the current access entry of the target cluster is generated by selecting a node URI from the URIs of each node in the input cluster access entry attribute by the client program SDK of the target cluster;

[0028] The monitoring feedback unit is used to provide health status feedback to the target cluster based on the current data of the monitoring indicators of the target cluster and the monitoring strategy associated with the object model of the target cluster.

[0029] Optionally, in the above-mentioned distributed cluster monitoring system, it also includes:

[0030] A definition unit, used to define the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster; wherein the properties of the object model of the target cluster at least include the identifier of the target cluster and the cluster access entry properties; the cluster access entry properties include the URIs of the selected multiple nodes belonging to the peer objects in the target cluster and the entry-related information; the properties of the object model of each of the nodes at least include the identifier of each of the nodes and the identifier of the cluster to which it belongs;

[0031] A collection unit, used for collecting the properties of the object model of the target cluster and the properties of the object model of each node into the configuration management database through an automatic collection program of the configuration management database;

[0032] A construction unit, configured to instantiate the object model of the target cluster and the object model of each node by using the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster through the configuration management database;

[0033] The node association unit is used to associate the object model of the target cluster with the object model of each of the nodes based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs.

[0034] Optionally, in the above-mentioned distributed cluster monitoring system, it also includes:

[0035] A policy configuration unit, used to respond to a user's policy configuration operation and configure a monitoring policy;

[0036] The policy association unit is used to query the object model of the target cluster from the configuration management database and associate the object model of the target cluster with the monitoring policy.

[0037] Optionally, in the above-mentioned distributed cluster monitoring system, it also includes:

[0038] A monitoring unit, configured to monitor whether current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being visited is received within a preset time;

[0039] a marking unit, configured to mark the URI of the node as inaccessible when it is detected that the current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being visited is not received within a preset time;

[0040] The returning unit is used to return the cluster access entry attribute in the attribute of the object model of the target cluster to be defined by the access unit for the current data collection request, as an input to the client program SDK of the target cluster.

[0041] Optionally, in the above-mentioned distributed cluster monitoring system, the access unit includes:

[0042] An access subunit is used to define, for each current data collection request, the cluster access entry attribute in the attributes of the object model of the target cluster as the input of the client program SDK of the target cluster, so as to trigger the client program SDK of the target cluster, and select a node URI from the URIs of each node in the cluster access entry attribute for each current data collection request, to generate the current access entry of the target cluster corresponding to each current data collection request, and send the current data collection request to the selected corresponding node through the current access entry of the target cluster corresponding to each current data collection request; wherein each current data collection request is used to request the collection of at least one monitoring indicator of the target cluster.

[0043] A third aspect of the present application provides an electronic device, including:

[0044] Memory and processor;

[0045] Wherein, the memory is used to store programs;

[0046] The processor is used to execute the program, and when the program is executed, it is specifically used to implement the distributed cluster monitoring method as described in any one of the above items.

[0047] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed by a processor, the computer program is used to implement the distributed cluster monitoring method as described in any one of the above.

[0048] The present application provides a distributed cluster monitoring method, which predefines the properties of the object model of the target cluster so that the target cluster can be monitored as an object. Among them, the cluster access entry properties in the properties of the object model of the target cluster include the URIs of multiple nodes belonging to peer objects in the selected target cluster, so through the URIs of each selected node, any node in the range can collect monitoring indicators. In the monitoring process, when requesting to collect data of the target cluster, the cluster access entry properties in the properties of the object model of the defined target cluster are used as the input of the client program SDK of the target cluster, so that the client program SDK of the target cluster can automatically select a node URI from the URIs of each node in the input cluster access entry properties to generate the current access entry of the target cluster, and send the current data collection request to the selected node through the current access entry of the target cluster to access the node. Then receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessed in response to the current data collection request, and finally, based on the current data of the monitoring indicators of the target cluster, according to the monitoring strategy associated with the object model of the target cluster, the health status of the target cluster is fed back. Therefore, by using the configured cluster access entry attributes as input when accessing the cluster, with the help of the cluster's load balancing capability, a node is automatically selected from multiple configured nodes for access each time, and with the help of the cluster's failover capability, when a node is inaccessible, other accessible nodes are automatically selected for access, so cluster monitoring will not be affected by the failure of individual nodes. There is no need to specify specific nodes or select fixed nodes through the established selection mechanism for data collection, or to obtain data from all nodes, so there is no need to establish and maintain a selection mechanism, nor is there a need to collect and process large amounts of data, making cluster monitoring simpler and more secure. In addition, the object model of the target cluster is used as the monitoring object, that is, the cluster is monitored as the monitoring object, rather than monitoring the node, so more direct and accurate cluster monitoring information can be obtained, which facilitates timely operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 A flowchart of a distributed cluster monitoring method provided in an embodiment of the present application;

[0051] Figure 2 A logic diagram of a distributed cluster monitoring method provided in an embodiment of the present application;

[0052] Figure 3 A flowchart of a method for constructing a cluster object model provided in an embodiment of the present application;

[0053] Figure 4 A flowchart of a monitoring strategy configuration method provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of the architecture of a distributed cluster monitoring system provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0057] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0058] The present application embodiment provides a distributed cluster monitoring method, such as Figure 1 As shown, the following steps are included:

[0059] S101 . When requesting to collect data of a target cluster, a cluster access entry attribute in the attributes of the defined object model of the target cluster is used as an input of a client program SDK of the target cluster.

[0060] The target cluster may be any cluster that needs to be monitored and has an object model built. The cluster access entry attribute includes URIs of multiple nodes belonging to peer objects in the selected target cluster.

[0061] When there is a need to request data collection from the target cluster, a corresponding access request, i.e., the current data collection request, will be sent to the target cluster. At this time, the cluster access entry attribute in the attributes of the object model of the defined target cluster will be used as the input of the client program SDK of the target cluster, so that the target cluster can route the current data collection request according to the cluster access entry attribute.

[0062] It should be noted that a cluster is composed of multiple nodes, which is essentially just a logical concept. Therefore, in order to monitor the logical concept of "cluster" as the target instead of monitoring the nodes, in the embodiment of the present application, the object model of the target cluster is pre-constructed, so that the object model of the target cluster can be used as the monitoring target, and the target cluster can be monitored as the monitoring object.

[0063] The construction of the object model of the target cluster is achieved by defining corresponding attributes for it, and the target cluster is described by the defined corresponding attributes. Among them, the cluster access entry attribute in the attributes of the object model of the target cluster is the key attribute for implementing this solution. The cluster access entry attribute determines the access entry of the cluster. In order to monitor the cluster without fixedly accessing a certain node, to avoid being unable to continue monitoring when the node is inaccessible, and to determine that the cluster is inaccessible, in an embodiment of the present application, the URIs of multiple nodes are configured in the cluster access entry attribute, so as to use the load balancing function of the cluster itself to route the access request to any one of the nodes, and not to access a certain node in a fixed manner.

[0064] Since the cluster's own load balancing capability can be used, any node among multiple nodes will be accessed during access. Therefore, it is necessary to ensure that any node configured for access can respond to the request and feedback the data to be collected. Therefore, each selected node needs to belong to a peer object. Among them, a peer object refers to a group of node objects in the cluster that provide the same function or play the same role. External programs can achieve the same effect by accessing any of the nodes in the group. Therefore, the monitoring program can achieve the same effect of data collection by accessing any node configured, that is, it can collect the values ​​of the cluster's monitoring indicators. Since the number of selected nodes does not affect the amount of data collected and the amount of data that needs to be processed, the number of selected nodes can be selected according to demand.

[0065] Optionally, the selected node is usually a node that plays the role of a coordination node, and in order to prevent additional pressure on nodes such as data nodes that already have a high load, a node that does not have the role of a data node in the cluster can be selected, for example, for an Elasticsearch cluster. All nodes in the Elasticsearch cluster play the role of a coordination node by default, that is, calling the API provided by any node in the Elasticsearch cluster through the http protocol can achieve the same effect, so all nodes fully comply with the definition of a peer object cluster. Therefore, all nodes in the Elasticsearch cluster can be selected, and the URIs of all nodes can be configured in the cluster access entry properties. Of course, only some nodes can be selected, such as selecting all nodes in the cluster that do not have the role of data nodes.

[0066] It should also be noted that since this application needs to access the load balancing function and failover function of the cluster, the indicator information is obtained by accessing the cluster API, that is, sending a data collection request to a certain URI to obtain the cluster's monitoring indicator data. Therefore, the remote monitoring method is adopted, and the monitoring agent is deployed on a server with a smooth network of the designated collection target cluster, that is, deployed on a server that can be connected to the cluster access portal network. Figure 2 As shown, when the target cluster needs to be monitored, the information of the object model of the target cluster in the configuration management database (CMDB) and the monitoring policy of the monitoring configuration are sent to the monitoring agent, which accesses the target cluster according to the monitoring policy and the information of the object model of the target cluster to collect the configured monitoring indicator data.

[0067] For distributed clusters, for high availability and load balancing considerations, the client program SDK provided by them will support multiple endpoints as cluster access entries. Therefore, when monitoring indicator data collection is required, that is, when accessing the target cluster, in order for the target cluster to call its own load balancing function, a node is selected from the selected nodes for access. Therefore, when the monitoring agent sends the current data collection request, it will use the cluster access entry attribute in the attributes of the object model of the defined target cluster as the input of the client program SDK of the target cluster.

[0068] Optionally, in another embodiment of the present application, a method for constructing a cluster object model is provided, such as Figure 3 As shown, the following steps are included:

[0069] S301: Define the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster.

[0070] It should be noted that since a cluster is composed of nodes, the representation of a cluster requires not only the description of the cluster's own attributes, but also the description of its relationship with each node. Therefore, it is necessary to build not only the object model of the target cluster, but also the object model of each node in the target cluster. To build the model, it is necessary to define the corresponding attributes, so it is necessary to define the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster.

[0071] Among them, the attributes of the object model of the target cluster include at least the identifier of the target cluster and the cluster access entry attributes. Of course, it can also include attributes such as the cluster name. The cluster access entry attributes include the URIs of multiple nodes belonging to peer objects in the selected target cluster and entry-related information. It should be noted that in addition to the URI, the cluster access entry will also include other relevant information, that is, entry-related information, such as protocol, IP address / domain name, in order to generate a complete access entry.

[0072] Optionally, the cluster access entry attribute can be a collection of multiple groups of endpoints of the APIs related to monitoring, where a group of endpoints consists of a node URI and entry-related information, for example, a URI consisting of protocol + IP address / domain name + port number. When selecting the URI of the node later, the endpoint information including the URI of the node can be directly selected, so that the current access entry can be directly obtained. Of course, it can also be configured separately and then combined later.

[0073] The attributes of the object model of each node include at least the identifier of each node and the identifier of the cluster to which it belongs. Similarly, attributes such as address, port, node name, etc. may also be included.

[0074] S302 : Collect the attributes of the object model of the target cluster and the attributes of the object model of each node into the configuration management database through the automatic collection program of the configuration management database.

[0075] S303: Instantiate the object model of the target cluster and the object model of each node by using the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster through the configuration management database.

[0076] S304: Associating the object model of the target cluster with the object model of each node based on the identifier of the target cluster and the identifier of the cluster to which each node belongs.

[0077] Optionally, in order to meet different monitoring requirements, in the embodiment of the present application, the required monitoring strategy can be configured according to the requirements. Therefore, in another embodiment of the present application, after associating the object model of the target cluster with the object model of each node, it further includes monitoring strategy configuration. Figure 4 As shown, a monitoring strategy configuration method provided in an embodiment of the present application includes the following steps:

[0078] S401. Respond to the user's policy configuration operation and configure a monitoring policy.

[0079] The configured monitoring strategy includes, but is not limited to, monitoring indicators, the collection scope of monitoring indicators, the collection frequency, the alarm threshold, and the alarm strategy. In addition, the specific configuration of each configuration can be configured according to the needs. For example, the monitoring of the Elasticsearch cluster status can be set to collect once every 10 seconds, and the health status of the target cluster can be obtained through the "_cluster / health API" of Elasticsearch. In addition, the Elasticsearch cluster uses colors to mark the cluster health status. Among them, you can configure green to represent complete health, yellow to represent unhealthy but unaffected services, and red to represent that some data cannot be accessed. The alarm strategy can be set as follows: if the cluster status is green, it means normal, if the cluster status is yellow, a secondary alarm is issued, and if the cluster status is red, a major alarm is issued.

[0080] S402: Query the object model of the target cluster from the configuration management database, and associate the object model of the target cluster with the monitoring policy.

[0081] In order to make the configured monitoring policy targeted at the target cluster, it is necessary to query the object model of the target cluster from the configuration management database and associate the object model of the target cluster with the monitoring policy.

[0082] S102: Receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request.

[0083] The node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster. The current access entry of the target cluster is generated by the client program SDK of the target cluster by selecting a node URI from the URIs of each node in the input cluster access entry attribute.

[0084] Optionally, the current data collection request is generated based on a monitoring policy associated with an object model of a configured target cluster, so that data of the configured monitoring indicators required to be collected can be collected.

[0085] It should be noted that when accessing a cluster, the cluster will route the request to one of the nodes through its load balancing function, and the node will respond to the request and feedback the processing result. Therefore, in the embodiment of the present application, the client program SDK of the target cluster will select a node URI from the URIs of each node in the cluster access entry attribute to generate the current access entry of the target cluster, that is, generate the current routing address, and then route the current data collection request initiated by the monitoring agent through the current access entry of the target cluster, thereby passing the current data collection request to the selected node, which will process the current data collection request and feedback the processing result, and collect the collected current data of the monitoring indicators of the target cluster. Correspondingly, the monitoring agent receives the current data of the monitoring indicators of the target cluster that it feedbacks.

[0086] In addition, the client SDK of the cluster has the ability to load balance. In order to ensure high availability, that is, when a node is inaccessible, requests can be processed normally through other nodes, so it usually also has the ability of failover. When it determines that a node is inaccessible, it will automatically select other nodes for routing. Therefore, when there are inaccessible nodes in the cluster access entry attributes, it can still automatically ensure that the cluster can continue to be monitored.

[0087] Optionally, considering that the distributed cluster does not provide an SDK with failover capability or other problems, resulting in failure to perform failover normally, in another embodiment of the present application, after executing step S102, further executing:

[0088] Monitor whether current data of the monitoring indicator of the target cluster fed back by the node of the currently accessed target cluster is received within a preset time.

[0089] If the current data of the monitoring indicator of the target cluster fed back by the node of the currently accessed target cluster is not received within the preset time, it means that the currently selected node may not be accessed normally, which leads to the failure to feed back the data of the monitoring indicator required to be collected for a long time. Therefore, in order to avoid selecting the node for access again, the URI of the node is marked as inaccessible. Of course, the node can also be removed from the cluster access entry attribute.

[0090] In order to pass the current data collection request normally and collect the corresponding monitoring indicator data, it is necessary to return to step S101 for the current data collection request so as to reselect other nodes for routing.

[0091] Optionally, considering that there are many data indicators to be collected, in order to improve collection efficiency, in another embodiment of the present application, a specific implementation of step S102 includes:

[0092] For each current data collection request, the cluster access entry attribute in the attributes of the object model of the defined target cluster is used as the input of the client program SDK of the target cluster to trigger the client program SDK of the target cluster. For each current data collection request, a node URI is selected from the URIs of each node in the cluster access entry attribute to generate the current access entry of the target cluster corresponding to each current data collection request, and the current data collection request is sent to the selected corresponding node through the current access entry of the target cluster corresponding to each current data collection request.

[0093] Among them, each current data collection request is used to request the collection of at least one monitoring indicator of the target cluster. That is, for a monitoring indicator or monitoring indicator, a data collection request is initiated to the target cluster, which can simultaneously route each data collection request through multiple threads, so as to collect data of each monitoring indicator at the same time. It should be noted that at this time, the load balancing processing and failover of each data collection request are independent of each other, so as to ensure that the data of each monitoring indicator can be collected.

[0094] S103 . Based on the current data of the monitoring indicators of the target cluster and in accordance with the monitoring strategy associated with the object model of the target cluster, provide health status feedback to the target cluster.

[0095] Optionally, the health status of the target cluster can be determined based on the current data of the monitoring indicators of the target cluster according to the status threshold in the monitoring strategy associated with the object model of the target cluster, and the health status can be fed back based on the alarm rules in the monitoring strategy, such as minor alarms or major alarms.

[0096] A distributed cluster monitoring method provided by an embodiment of the present application predefines the properties of the object model of the target cluster so that the target cluster can be monitored as an object. Among them, the cluster access entry properties in the properties of the object model of the target cluster include the URIs of multiple nodes belonging to peer objects in the selected target cluster, so through the URIs of each selected node, any node in the range can collect monitoring indicators. In the monitoring process, when requesting to collect data of the target cluster, the cluster access entry properties in the properties of the defined object model of the target cluster are used as the input of the client program SDK of the target cluster, so that the client program SDK of the target cluster can automatically select a node URI from the URIs of each node in the input cluster access entry properties to generate the current access entry of the target cluster, and send a current data collection request to the selected node through the current access entry of the target cluster to access the node. Then receive the current data of the monitoring indicator of the target cluster fed back by the node currently accessed in response to the current data collection request, and finally, based on the current data of the monitoring indicator of the target cluster, according to the monitoring strategy associated with the object model of the target cluster, the health status of the target cluster is fed back. Therefore, by using the configured cluster access entry attributes as input when accessing the cluster, with the help of the cluster's load balancing capability, a node is automatically selected from multiple configured nodes for access each time, and with the help of the cluster's failover capability, when a node is inaccessible, other accessible nodes are automatically selected for access, so cluster monitoring will not be affected by the failure of individual nodes. There is no need to specify specific nodes or select fixed nodes through the established selection mechanism for data collection, or to obtain data from all nodes, so there is no need to establish and maintain a selection mechanism, nor is there a need to collect and process large amounts of data, making cluster monitoring simpler and more secure. In addition, the object model of the target cluster is used as the monitoring object, that is, the cluster is monitored as the monitoring object, rather than monitoring the node, so more direct and accurate cluster monitoring information can be obtained, which facilitates timely operation and maintenance.

[0097] Another embodiment of the present application provides a distributed cluster monitoring system, such as Figure 5 As shown, including:

[0098] The access unit 501 is used to use the cluster access entry attribute in the attributes of the defined object model of the target cluster as the input of the client program SDK of the target cluster when requesting to collect data of the target cluster.

[0099] The receiving unit 502 is used to receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request. The node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster. The current access entry of the target cluster is generated by the client program SDK of the target cluster selecting a node URI from the URIs of each node in the input cluster access entry attribute.

[0100] The monitoring feedback unit 503 is used to provide health status feedback to the target cluster based on the current data of the monitoring indicators of the target cluster and in accordance with the monitoring strategy associated with the object model of the target cluster.

[0101] Optionally, in another embodiment of the present application, the distributed cluster monitoring system further includes:

[0102] A definition unit is used to define the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster. The attributes of the object model of the target cluster include at least the identifier of the target cluster and the cluster access entry attributes. The cluster access entry attributes include the URIs of multiple nodes belonging to peer objects in the selected target cluster and entry-related information. The attributes of the object model of each node include at least the identifier of each node and the identifier of the cluster to which it belongs.

[0103] The collection unit is used to collect the attributes of the object model of the target cluster and the attributes of the object model of each node into the configuration management database through the automatic collection program of the configuration management database.

[0104] The construction unit is used to instantiate the object model of the target cluster and the object model of each node by using the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster through the configuration management database.

[0105] The node association unit is used to associate the object model of the target cluster with the object model of each node based on the identifier of the target cluster and the identifier of the cluster to which each node belongs.

[0106] Optionally, in another embodiment of the present application, the distributed cluster monitoring system further includes:

[0107] The policy configuration unit is used to respond to the user's policy configuration operation and configure the monitoring policy.

[0108] The policy association unit is used to query the object model of the target cluster from the configuration management database and associate the object model of the target cluster with the monitoring policy.

[0109] Optionally, in another embodiment of the present application, the distributed cluster monitoring system further includes:

[0110] The monitoring unit is used to monitor whether the current data of the monitoring indicator of the target cluster fed back by the node of the currently visited target cluster is received within a preset time.

[0111] The marking unit is used to mark the URI of the node as inaccessible when it is detected that the current data of the monitoring indicator of the target cluster fed back by the node of the currently visited target cluster is not received within a preset time.

[0112] The returning unit is used to return the cluster access entry attribute in the attribute of the object model of the target cluster defined by the access unit for the current data collection request as the input of the client program SDK of the target cluster.

[0113] Optionally, an access unit in a distributed cluster monitoring system provided in another embodiment of the present application is used to:

[0114] The access subunit is used to define the cluster access entry attribute in the attribute of the object model of the target cluster as the input of the client program SDK of the target cluster for each current data collection request, so as to trigger the client program SDK of the target cluster, and select a node URI from the URIs of each node in the cluster access entry attribute for each current data collection request to generate the current access entry of the target cluster corresponding to each current data collection request, and send the current data collection request to the selected corresponding node through the current access entry of the target cluster corresponding to each current data collection request. Each current data collection request is used to request to collect at least one monitoring indicator of the target cluster.

[0115] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, which will not be repeated here.

[0116] Another embodiment of the present application provides an electronic device, such as Figure 6 As shown, including:

[0117] Memory 601 and processor 602 .

[0118] The memory 601 is used to store programs.

[0119] The processor 602 is used to execute the program stored in the memory 601. When the program is executed, it is specifically used to implement the distributed cluster monitoring method provided by any one of the above embodiments.

[0120] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed by a processor, it is used to implement the distributed cluster monitoring method provided in any one of the above embodiments.

[0121] The computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0122] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0123] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A distributed cluster monitoring method, characterized in that: include: When requesting to collect data of a target cluster, a cluster access entry attribute in the attributes of the object model of the defined target cluster is used as an input of the client program SDK of the target cluster; wherein the cluster access entry attribute includes URIs of multiple nodes belonging to peer objects in the selected target cluster; Receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request; wherein the node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster; the current access entry of the target cluster is generated by selecting a node URI from the URIs of each node in the input cluster access entry attribute by the client program SDK of the target cluster; Based on current data of the monitoring indicators of the target cluster, the health status feedback of the target cluster is performed according to the monitoring strategy associated with the object model of the target cluster.

2. The method according to claim 1, characterized in that Also includes: Define the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster; wherein the properties of the object model of the target cluster include at least the identifier of the target cluster and the cluster access entry properties; the cluster access entry properties include the URIs of the selected multiple nodes belonging to the peer objects in the target cluster and the entry-related information; the properties of the object model of each node include at least the identifier of each node and the identifier of the cluster to which it belongs; Collecting the attributes of the object model of the target cluster and the attributes of the object model of each node into the configuration management database through an automatic collection program of the configuration management database; Instantiating the object model of the target cluster and the object model of each node by using the attributes of the object model of the target cluster and the attributes of the object model of each node in the target cluster through the configuration management database; Based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs, the object model of the target cluster is associated with the object model of each of the nodes.

3. The method according to claim 2, characterized in that After associating the object model of the target cluster with the object model of each of the nodes based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs, the method further includes: Respond to user's policy configuration operations and configure monitoring policies; The object model of the target cluster is queried from the configuration management database, and the object model of the target cluster is associated with the monitoring policy.

4. The method according to claim 1, characterized in that: After defining the cluster access entry attribute in the attribute of the object model of the target cluster as the input of the client program SDK of the target cluster, the method further includes: Monitoring whether current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being visited is received within a preset time; If it is monitored that the current data of the monitoring indicator of the target cluster fed back by the node of the target cluster currently being accessed is not received within a preset time, the URI of the node is marked as inaccessible; For the current data collection request, a cluster access entry attribute in the attribute of the object model of the target cluster to be defined is returned as an input of the client program SDK of the target cluster.

5. The method according to claim 1, characterized in that The cluster access entry attribute in the attribute of the object model of the target cluster to be defined as the input of the client program SDK of the target cluster includes: For each of the current data collection requests, the cluster access entry attribute in the attributes of the object model of the defined target cluster is used as the input of the client program SDK of the target cluster to trigger the client program SDK of the target cluster. For each of the current data collection requests, a node URI is selected from the URIs of each node in the cluster access entry attribute to generate the current access entry of the target cluster corresponding to each current data collection request, and the current data collection request is sent to the selected corresponding node through the current access entry of the target cluster corresponding to each current data collection request; wherein each of the current data collection requests is used to request the collection of at least one monitoring indicator of the target cluster.

6. A distributed cluster monitoring system, characterized in that: include: An access unit, used to, when requesting to collect data of a target cluster, use a cluster access entry attribute in the attributes of the defined object model of the target cluster as an input of a client program SDK of the target cluster; A receiving unit, used to receive the current data of the monitoring indicators of the target cluster fed back by the node currently accessing the target cluster in response to the current data collection request; wherein the node currently accessing the target cluster is the node corresponding to the current access entry of the target cluster; the current access entry of the target cluster is generated by selecting a node URI from the URIs of each node in the input cluster access entry attribute by the client program SDK of the target cluster; The monitoring feedback unit is used to provide health status feedback to the target cluster based on the current data of the monitoring indicators of the target cluster and the monitoring strategy associated with the object model of the target cluster.

7. The system according to claim 6, characterized in that Also includes: A definition unit, used to define the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster; wherein the properties of the object model of the target cluster at least include the identifier of the target cluster and the cluster access entry properties; the cluster access entry properties include the URIs of the selected multiple nodes belonging to the peer objects in the target cluster and the entry-related information; the properties of the object model of each of the nodes at least include the identifier of each of the nodes and the identifier of the cluster to which it belongs; A collection unit, used for collecting the attributes of the object model of the target cluster and the attributes of the object model of each node into the configuration management database through an automatic collection program of the configuration management database; A construction unit, configured to instantiate the object model of the target cluster and the object model of each node by using the properties of the object model of the target cluster and the properties of the object model of each node in the target cluster through the configuration management database; The node association unit is used to associate the object model of the target cluster with the object model of each of the nodes based on the identifier of the target cluster and the identifier of the cluster to which each of the nodes belongs.

8. The system according to claim 7, characterized in that Also includes: A policy configuration unit, used to respond to a user's policy configuration operation and configure a monitoring policy; The policy association unit is used to query the object model of the target cluster from the configuration management database and associate the object model of the target cluster with the monitoring policy.

9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the distributed cluster monitoring method as described in any one of claims 1 to 5.

10. A computer storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, is used to implement the distributed cluster monitoring method according to any one of claims 1 to 5.