Method and system for managing cluster resources, device, cluster and medium

Defining and managing cluster resource attributes and constraint relationships in a declarative manner solves the problem of difficulty in flexibly modifying resource definitions and constraint relationships in existing technologies, realizes self-healing and flexible coordination of cluster resources, and improves the flexibility and flexibility of resource management. Maintainability.

CN113301068BActive Publication Date: 2024-10-22ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010266288.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-07
Publication Date
2024-10-22
Estimated Expiration
2040-04-07

AI Technical Summary

Technical Problem

The existing cluster resource coordination and management mechanism lacks a unified way to define cluster resources and their constraint relationships, making it difficult to flexibly define and modify resource attributes and constraint relationships, and unable to achieve self-repair and coordination of resources.

Method used

Define resource attributes and constraint definitions in a declarative manner, use the resource attribute definition information base and constraint definition information base for storage and verification, provide constraint definition templates and pluggable constraint definition engines, and realize the collection, summary and repair of resource status. Ensure the consistency of resource attributes and constraint relationships.

Benefits of technology

It realizes flexible management and coordination of cluster resources, supports self-healing of resource attributes and constraint relationships, and improves the management flexibility and maintainability of cluster resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113301068B_ABST
    Figure CN113301068B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method and system for managing cluster resources, a device, a cluster and a medium. The method includes: collecting the actual state of resources in the cluster; checking whether there is a conflict between the actual state of resources in the cluster and the resource attribute definition in the resource attribute definition information library and the resource constraint definition in the resource constraint definition information library; if there is a conflict, repairing the actual state of the resources to eliminate the conflict.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to computer cluster technology, and more specifically, to a method and system, device, cluster, and medium for managing cluster resources. Background Art

[0002] A cluster is a collection of logically grouped computer resources that run as a unit. It may be an independent physical cluster or a logical cluster group that includes multiple physical clusters. Cluster resources refer to the various computer physical resources and logical resources required to form a cluster, including underlying infrastructure resources such as hardware, virtual machines, etc., as well as security groups, virtual network groups, etc. Kubernetes cluster (abbreviated as K8s cluster in the industry) is a cluster built based on the open source Kubernetes container orchestration engine.

[0003] The resources of a cluster are diverse, especially for a Kubernetes cluster, which relies more on complex and diverse resources, such as physical or virtual machines for running control plane and data plane components, load balancers required by API (Application Programming Interface) servers that provide externally exposed services or manage clusters, and physical or logical security groups for network isolation.

[0004] In order to form a complete and operational cluster, it is usually necessary to set the attributes of resources, and resources often have complex constraints on each other. For example, the load balancer associated with the externally exposed services provided in the cluster cannot be the same as the load balancer required by the API server required to manage the cluster, otherwise it will cause port conflicts and other problems. The attribute definitions and constraints of resources in the cluster are easily misconfigured or deleted by mistake. Therefore, it is necessary to provide a method for unified management of cluster resources to better and more flexibly manage and coordinate cluster resources. Summary of the invention

[0005] The purpose of the present invention is to provide a technical solution for managing cluster resources so as to better coordinate the resources of the cluster.

[0006] According to a first aspect disclosed in this specification, a method for managing cluster resources is provided, comprising the following steps:

[0007] Collect the actual status of resources in the cluster;

[0008] Check whether there is any conflict between the actual status of resources in the cluster and the resource attribute definitions in the resource attribute definition information base and the resource constraint definitions in the resource constraint definition information base;

[0009] In the event that a conflict exists, the actual state of the resource is repaired to resolve the conflict.

[0010] Optionally, the method further comprises:

[0011] Receiving resource attribute definitions defined by a user in a declarative manner and storing the resource attribute definitions in a resource attribute definition information repository;

[0012] A resource constraint definition defined by a user in a declarative manner is received and the resource constraint definition is stored in a resource constraint definition information repository.

[0013] Optionally, the resource constraint definition includes a resource attribute constraint definition and a constraint relationship definition between resources.

[0014] Optionally, the resources include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

[0015] Optionally, storing the resource attribute definition in a resource attribute definition information repository includes: performing deduplication processing on the resource attribute definition.

[0016] Optionally, storing the resource constraint definitions in a resource constraint definition information repository includes: merging and deduplicating the resource constraint definitions.

[0017] Optionally, collecting the actual status of resources in the cluster includes:

[0018] Collect the actual status of resources in the cluster in a polling manner.

[0019] Optionally, before performing the inspection, the method further includes: summarizing the actual status of the resources in the cluster, wherein the summarizing includes deduplication processing and grouping processing.

[0020] Optionally, the method further comprises: providing a constraint definition template and a constraint definition engine for parsing the constraint definition template; the constraint definition template is used for being called by a user to generate the resource constraint definition.

[0021] Optionally, the constraint definition engine is configured in a pluggable mode.

[0022] According to a second aspect disclosed in this specification, a system for managing cluster resources is provided, including:

[0023] A resource status collection unit, used to collect the actual status of resources in the cluster;

[0024] The monitoring unit is used to check whether there is a conflict between the actual state of resources in the cluster and the resource attribute definitions in the resource attribute definition information library and the resource constraint definitions in the resource constraint definition information library; and, if there is a conflict, control the resource state repair unit to repair the actual state of the resources to eliminate the conflict.

[0025] Optionally, the system further comprises:

[0026] A resource definition processing unit, configured to receive resource attribute definitions defined by a user in a declarative manner and store the resource attribute definitions in a resource attribute definition information repository;

[0027] The constraint definition processing unit is used to receive resource constraint definitions defined by a user in a declarative manner and store the resource constraint definitions in a resource constraint definition information base.

[0028] Optionally, the resource constraint definition includes a resource attribute constraint definition and a constraint relationship definition between resources.

[0029] Optionally, the resources include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

[0030] Optionally, storing the resource attribute definition in a resource attribute definition information repository includes: performing deduplication processing on the resource attribute definition.

[0031] Optionally, storing the resource constraint definitions in a resource constraint definition information repository includes: merging and deduplicating the resource constraint definitions.

[0032] Optionally, collecting the actual status of resources in the cluster includes:

[0033] Collect the actual status of resources in the cluster in a polling manner.

[0034] Optionally, a resource status aggregation unit;

[0035] The resource status aggregation unit is used to aggregate the actual status of the resources collected by the resource status collection unit so as to facilitate the monitoring unit to perform the inspection, and the aggregation processing includes deduplication processing and grouping processing.

[0036] Optionally, the system further comprises: a constraint definition template and a constraint definition engine for parsing the constraint definition template; the constraint definition template is used for being called by a user to generate the resource constraint definition.

[0037] Optionally, the constraint definition engine is configured in a pluggable mode.

[0038] Optionally, the monitoring unit is configured in a pluggable mode.

[0039] According to a third aspect disclosed in this specification, a device for managing cluster resources is provided, including a processor and a memory; the memory stores computer instructions, and when the computer instructions are executed by the processor, the method disclosed in the first aspect of the present invention is implemented.

[0040] According to a fourth aspect disclosed in this specification, a cluster is provided, including the system disclosed in the second aspect of the present invention or the device disclosed in the third aspect of the present invention.

[0041] According to a fifth aspect disclosed in the present specification, there is provided a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the first aspect of the present invention is implemented.

[0042] Features and advantages of the embodiments of the present specification will become apparent from the following detailed description of exemplary embodiments of the present specification with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the specification and, together with the description, serve to explain the principles of the embodiments of the specification.

[0044] Figure 1 is a flow chart of a method for managing cluster resources provided by an embodiment of this specification;

[0045] Figure 2 is a schematic diagram of a system for managing cluster resources provided by an embodiment of this specification;

[0046] Figure 3 It is a block diagram of a device for managing cluster resources provided in an embodiment of this specification. DETAILED DESCRIPTION

[0047] Various exemplary embodiments of the present specification will now be described in detail with reference to the accompanying drawings.

[0048] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the embodiments of the present specification and its application or uses.

[0049] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0050] Traditional cluster resource coordination and management mechanisms, such as the KubeVirt plug-in-based resource management for Kubernetes clusters, can provide users with the same capabilities for managing traditional virtual machine workloads as container workloads. These traditional cluster resource coordination and management mechanisms have the following drawbacks:

[0051] There is no unified way to define the various resources that the cluster depends on and the constraints between these resources. Resource attribute definitions and resource constraint relationships are often embedded in the management and control logic in a hard-coded manner, which lacks flexibility.

[0052] The inspection strategy used to inspect resource attributes and their constraints is tightly coupled with the resource management logic, which makes it impossible to flexibly define and modify the inspection strategy. Once the inspection strategy is changed, all resource management logic needs to be redeployed.

[0053] Using a process imperative definition method to define resources does not record the process status and expected final status during execution, so it cannot be compared with the actual status of the resources. If the definition is not effective, the actual status of the resources cannot be repaired.

[0054] It is impossible to implement flexible resource attribute definition and resource constraint definition, and it is also impossible to implement flexible coordinated resource operation.

[0055] The embodiment of the present invention aims to provide a method for uniformly managing cluster resources, so as to better and more flexibly manage and coordinate cluster resources.

[0056] <Methods for managing cluster resources>

[0057] The resources referred to in the embodiment of the present invention include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

[0058] See also Figure 1 As shown, an embodiment of the present invention provides a method for managing cluster resources, the method comprising the following steps:

[0059] S102: Receive resource attribute definitions defined by a user in a declarative manner and store the resource attribute definitions in a resource attribute definition information repository.

[0060] That is to say, the embodiment of the present invention defines the attribute information of the resource by using a custom resource description file.

[0061] In the embodiment of the present invention, the format of resource attribute definition implementation includes but is not limited to the YAML format or JSON format commonly used in the Kubernetes field.

[0062] The following are two specific examples of resource attribute definitions:

[0063] Example 1: For a load balancer, the resource definition implemented in YAML format is as follows:

[0064]

[0065]

[0066] apiVersion is the API version number, which is used to indicate which API group and version the resource to be defined belongs to.

[0067] kind indicates the type of resource. In Example 1, the type of resource is LoadBalancer.

[0068] Metadata is metadata, which is used to indicate the general properties of resources of this category. The name under metadata is the name of this type of resource.

[0069] spec is the personalized attribute of the resource. The id under spec is the unique identifier of the resource, zone is the domain supported by the resource, and bandwidth is the bandwidth allocated to the resource.

[0070] The master under the zone is the primary domain supported by the resource, and the slave is the slave domain supported by the resource.

[0071] Example 2: For a Kubernetes service, the resource definition implemented in JSON format is as follows:

[0072]

[0073]

[0074] apiVersion is the API version number, which is used to indicate which API group and version the resource to be defined belongs to.

[0075] kind indicates the type of resource.

[0076] Metadata is metadata, which is used to indicate the general properties of resources of this category. The name under metadata is the name of this type of resource.

[0077] spec is the personalized attribute of the resource. The id under spec is the unique identifier of the resource, name is the name of the resource, and ports is the port corresponding to the resource.

[0078] The name under port is the name corresponding to the port, protocol is the protocol type supported by the port, and port is the specific port number.

[0079] The same user or different users may submit multiple partially or completely identical resource attribute definitions. When storing the resource attribute definitions in the resource attribute definition information library in step 102, the resource attribute definitions may be deduplicated.

[0080] In the embodiment of the present invention, the resource attribute definition information library may be implemented in a manner including but not limited to distributed data storage.

[0081] S104: Receive resource constraint definitions defined by the user in a declarative manner and store the resource constraint definitions in a resource constraint definition information repository.

[0082] That is to say, the embodiment of the present invention defines the resource constraint definition by using a custom resource description file.

[0083] In an embodiment of the present invention, a resource constraint definition may be a definition of a constraint on an attribute of a single resource. For example, the constraint definition specifies that a prefix of a resource name should comply with a certain rule. In an embodiment of the present invention, a more complex definition of a constraint on an attribute of a single resource may be made according to actual needs. In an embodiment of the present invention, a constraint may be imposed on an attribute of a single resource within a specific time period.

[0084] In an embodiment of the present invention, a resource constraint definition may be a definition of a constraint relationship between multiple resources. For example, a load balancer that is a key component of a cluster is defined in a constraint definition to be used by only one component and cannot be used by multiple components at the same time. In an embodiment of the present invention, a more complex definition of a constraint relationship between multiple resources may be made based on actual needs. In an embodiment of the present invention, constraints may be imposed on the properties of a certain type of resource or certain resources at a specific time point, and constraints may be imposed on the properties of a certain type of resource or certain resources within a specific time period.

[0085] In the embodiment of the present invention, the format of resource constraint definition implementation includes but is not limited to the YAML format or JSON format commonly used in the Kubernetes field.

[0086] Here are two specific examples of resource constraint definitions:

[0087] Example 3: For a Kubernetes service, in order to ensure that the service follows a specific protocol during use, its name needs to be constrained and defined, and its name prefix must start with grpc. The resource definition implemented in JSON format is as follows:

[0088]

[0089] apiVersion is the API version number, which is used to indicate which API group and version the constraint to be defined belongs to.

[0090] kind indicates the type of constraint. Example 3 is the name constraint of the service port.

[0091] Metadata is metadata, which is used to indicate the general properties of the constraints of this category. The name under Metadata is the name of the constraints of this category.

[0092] spec is the personalized attribute of the constraint. The match under Spec indicates the resource that the constraint targets, and resource is followed by the name of the resource. In Example 3, the resource is a Kubernetes service.

[0093] Rules are the specific constraint rules of the constraint. The name under rules is the name of the rule, context is the context in which the rule takes effect, and assert indicates the specific rule content. The rule content in Example 3 is: the naming rule of this resource must start with "grpc".

[0094] Example 4: Ensure that the load balancer cannot be reused between multiple component resources. The definition implemented in YAML format is as follows:

[0095]

[0096] apiVersion is the API version number, which is used to indicate which API group and version the constraint to be defined belongs to.

[0097] kind indicates the type of constraint. Example 4 is a resource single-use constraint.

[0098] Metadata is metadata, which is used to indicate the general properties of the constraints of this category. The name under Metadata is the name of the constraint of this category. Example 4 is that the load balancer can only be used by one component.

[0099] spec is the personalized attribute of the constraint. The match under Spec indicates the resource that the constraint targets, and resource is used to specify the resource object. In Example 4, the resource is the load balancer.

[0100] Rules are the specific constraint rules of the constraint. The name under rules is the name of the rule, context is the context in which the rule takes effect, and assert indicates the specific rule content. The rule content in Example 4 is: The load balancer can only be used by one component.

[0101] The same user or different users may submit multiple partially or completely identical resource constraint definitions. When storing the resource constraint definitions in the resource constraint definition information base in step 104, the resource constraint definitions may be deduplicated.

[0102] When storing the resource constraint definitions in the resource constraint definition information base in step 104, the resource constraint definitions may also be merged. For example, the first resource constraint definition constrains the A1 attribute of resource A, and the second resource constraint definition constrains the A2 attribute of resource A. Then, the two resource constraint definitions may be merged for easy management and search.

[0103] In the embodiment of the present invention, the resource constraint definition information base may be implemented in a manner including but not limited to distributed data storage.

[0104] Based on step S102 and step S104, the embodiment of the present invention provides a declarative method for defining various resources that a cluster depends on and the constraint relationships between these resources.

[0105] In a specific example, a constraint definition template and a constraint definition engine for parsing the constraint definition template are provided. The constraint definition template may provide expected input parameters and the context required for enforcing constraint rules, and a user may quickly generate the aforementioned resource constraint definition by calling the constraint definition template.

[0106] The constraint definition engine can be implemented in a pluggable manner to support constraint definitions in different systems. Based on the constraint definition engine, users can define different constraint definition strategies and execution rules to form constraint definition templates, which makes it convenient for users to call constraint definition templates to quickly generate resource constraint definitions.

[0107] The following is a specific example of a constraint definition template, which is defined in YAML format:

[0108]

[0109]

[0110] apiVersion is the API version number, which is used to indicate which api group and version the constraint to be defined belongs to. crd is a custom resource definition, targets is a target. target indicates the target correspondence, and assert indicates the specific rule content. listKind is a form, Plural is a plural, singular is a singular, validation is validation, openAPIV3Schema is an openapi-3.0 functional component, properties is a class, items is an entry, type is a data type, name is a name, and match indicates a matching object.

[0111] S106: Collect the actual status of resources in the cluster.

[0112] In a specific example, in step S106, the actual status of resources in the cluster is collected in a polling manner. The actual status of resources includes real-time values, statistical values, etc. of the actual status of resources.

[0113] The statistical value of the actual state of a resource may include the statistical value of the actual state of a single resource in a specific time period, such as the average value, maximum value, minimum value, change value, etc. of the actual state of a resource in a certain time period. For example, the average value, maximum value, minimum value, etc. of the CPU resource usage consumed by a specific container in a certain time period.

[0114] The statistical value of the actual state of resources may include the statistical value of the actual state of a certain type of resources or certain resources at a specific time point. For example, the average value, maximum value, minimum value, etc. of the actual state of a certain type of resources or certain resources at a certain time point. For example, the average value, maximum value, minimum value, etc. of the CPU resource usage rate consumed by a group of containers with the name=APP label at a certain time point.

[0115] The statistics of the actual status of resources can include the statistics of the actual status of a certain type of resources or certain resources in a specific time period. For example, the total average value of a certain type of resources or certain resources in a certain time period. For example, the average value, maximum value, minimum value, etc. of the CPU resource usage consumed by a group of containers with the name=APP label in a certain time period.

[0116] In a specific example, step S106 includes steps S1061 - S1062 .

[0117] S1061. Collect the actual status of resources in the cluster in a polling manner.

[0118] S1062: Perform summary processing on the actual status of resources in the cluster, where the summary processing includes deduplication processing and grouping processing. Grouping processing may, for example, group the actual status of resources of the same type into one group to facilitate subsequent inspection and comparison processes.

[0119] S108. Check whether there is a conflict between the actual status of the resources in the cluster and the resource attribute definitions in the resource attribute definition information base and the resource constraint definitions in the resource constraint definition information base.

[0120] In a specific example, when the resource attribute definitions in the resource attribute definition information library and the resource constraint definitions in the resource constraint definition information library are updated, the actual states of the resources involved in the changes can be filtered out from the collected data to check whether the actual states of these resources meet the definition requirements.

[0121] S110. In the case of a conflict, the actual state of the resource is repaired to eliminate the conflict.

[0122] Repair the actual status of resources to eliminate conflicts, that is, modify the actual status of resources according to the resource attribute definitions in the resource attribute definition information library and the resource constraint definitions in the resource constraint definition information library, so that there is no conflict between the actual status of resources in the cluster and the resource attribute definitions in the resource attribute definition information library and the resource constraint definitions in the resource constraint definition information library.

[0123] Based on steps S108-S110, the embodiment of the present invention provides a self-healing resource management solution, which can correct the actual state of resources according to the definition declared by the user, so that the cluster has self-healing capabilities in terms of resource attributes and constraint relationships.

[0124] The embodiment of the present invention provides a method for adaptively coordinating cluster resources and their constraints, supporting the management of the entire life cycle of cluster resources in a unified manner, including attribute definition of cluster resources, attribute constraints of resources, dependency constraints between resources, etc.

[0125] The cluster involved in the method for managing cluster resources provided by an embodiment of the present invention may be a Kubernetes cluster.

[0126] <System for managing cluster resources>

[0127] Figure 2 is a block diagram of a system for managing cluster resources provided by an embodiment of this specification. Figure 2 As shown, the system 100 for managing cluster resources includes:

[0128] The resource status collecting unit 111 is used to collect the actual status of the resources in the cluster. Optionally, the resource status collecting unit 111 collects the actual status of the resources in the cluster in a polling manner.

[0129] The resource status aggregation unit 110 is used to aggregate the actual status of the resources collected by the resource status collection unit 111 so as to facilitate the inspection by the monitoring unit 103. Optionally, the aggregation process includes deduplication processing and grouping processing.

[0130] The monitoring unit 103 is used to check whether there is a conflict between the actual state of the resources in the cluster and the resource attribute definition in the resource attribute definition information base 105 and the resource constraint definition in the resource constraint definition information base 107. If there is a conflict, the monitoring unit 103 controls the resource state repair unit 112 to repair the actual state of the resources to eliminate the conflict.

[0131] The system 100 for managing cluster resources further includes: a constraint definition template 109 and a constraint definition engine 108 for parsing the constraint definition template 109. The constraint definition template 109 is used for being called by a user to generate a resource constraint definition.

[0132] In one example, the system 100 for managing cluster resources may further include:

[0133] The resource definition processing unit 104 is used to receive the resource attribute definition 101 defined by the user in a declarative manner and store the resource attribute definition 101 in the resource attribute definition information base 105. Optionally, when storing the resource attribute definition 101 in the resource attribute definition information base 105, the resource definition processing unit 104 performs deduplication processing on the resource attribute definition 101.

[0134] The constraint definition processing unit 106 is used to receive the resource constraint definition 103 defined by the user in a declarative manner and store the resource constraint definition 103 in the resource constraint definition information base 107. Optionally, when storing the resource constraint definition 102 in the resource constraint definition information base 107, the constraint definition processing unit 106 merges and removes duplicates of the resource constraint definition 102.

[0135] Optionally, the resource constraint definition includes a resource attribute constraint definition and a constraint relationship definition between resources.

[0136] Optionally, the resources include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

[0137] In the embodiment of the present invention, the monitoring unit 103 can control the work of the resource definition processing unit 104 and the constraint definition processing unit 106. Through the monitoring unit 103, the user can set the specific merging method of the resource constraint definition by the constraint definition processing unit 106.

[0138] In the embodiment of the present invention, the constraint definition engine 108 and the monitoring unit 103 may be configured in a pluggable mode.

[0139] The cluster involved in the system for managing cluster resources provided by an embodiment of the present invention may be a Kubernetes cluster.

[0140] <Device that manages cluster resources>

[0141] See also Figure 3 As shown, an embodiment of the present invention provides a device for managing cluster resources, including a processor 31 and a memory 32. The memory 32 stores computer instructions, which, when executed by the processor 31, implement the cluster resource management method disclosed in any of the above embodiments.

[0142] The cluster involved in the device for managing cluster resources provided by an embodiment of the present invention may be a Kubernetes cluster.

[0143] <cluster>

[0144] An embodiment of the present invention provides a cluster, including the system for managing cluster resources disclosed in any of the above embodiments.

[0145] An embodiment of the present invention provides a cluster, including the device for managing cluster resources disclosed in any of the above embodiments.

[0146] The cluster involved in the embodiment of the present invention may be a Kubernetes cluster.

[0147] <Computer-readable storage media group>

[0148] An embodiment of the present invention provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the cluster resource management method disclosed in any of the above embodiments is implemented.

[0149] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for system and device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0150] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0151] The embodiments of the present specification may be systems, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present specification.

[0152] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0153] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0154] The computer program instructions for executing the operation of the embodiments of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the embodiments of this specification.

[0155] Various aspects of the embodiments of the present specification are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present specification. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0156] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0157] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0158] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of this specification. In this regard, each box in the flowchart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0159] The embodiments of the present specification have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for managing cluster resources, characterized in that: The following steps are involved: Collect the actual status of resources in the cluster; Check whether there is any conflict between the actual status of resources in the cluster and the resource attribute definitions in the resource attribute definition information base and the resource constraint definitions in the resource constraint definition information base; In the event of a conflict, the actual state of the resource is repaired to eliminate the conflict; Wherein, various resources that the cluster depends on and constraint relationships between various resources are defined based on the method of declaring the cluster; The resource attribute definition information base and the resource constraint definition information base are implemented in a manner including distributed data storage.

2. The method according to claim 1, further comprising: Receiving resource attribute definitions defined by a user in a declarative manner and storing the resource attribute definitions in a resource attribute definition information repository; A resource constraint definition defined by a user in a declarative manner is received and the resource constraint definition is stored in a resource constraint definition information repository. 3 . The method according to claim 1 , wherein the resource constraint definition comprises a resource attribute constraint definition and a constraint relationship definition between resources. 4 . The method according to claim 1 , wherein the resources include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

5. The method according to claim 2, wherein storing the resource attribute definition in the resource attribute definition information repository comprises: De-duplicate resource attribute definitions.

6. The method according to claim 2, wherein storing the resource constraint definition in a resource constraint definition information repository comprises: Merge and remove duplicate resource constraint definitions.

7. The method according to claim 1, wherein collecting the actual status of resources in the cluster comprises: Collect the actual status of resources in the cluster in a polling manner.

8. The method according to claim 1, before performing the inspection, further comprising: The actual status of the resources in the cluster is aggregated, and the aggregation includes deduplication and grouping.

9. The method according to claim 2, further comprising: Providing a constraint definition template and a constraint definition engine for parsing the constraint definition template; The constraint definition template is used for being called by a user to generate a resource constraint definition.

10. The method of claim 9, wherein the constraint definition engine is configured in a pluggable mode.

11. A system for managing cluster resources, characterized in that: include: A resource status collection unit, used to collect the actual status of resources in the cluster; A monitoring unit, used to check whether there is a conflict between the actual state of resources in the cluster and the resource attribute definition in the resource attribute definition information base and the resource constraint definition in the resource constraint definition information base; and, in the event of a conflict, controlling the resource state repair unit to repair the actual state of the resource to eliminate the conflict; Wherein, various resources that the cluster depends on and constraint relationships between various resources are defined based on the method of declaring the cluster; The resource attribute definition information base and the resource constraint definition information base are implemented in a manner including distributed data storage.

12. The system according to claim 11, further comprising: A resource definition processing unit, configured to receive resource attribute definitions defined by a user in a declarative manner and store the resource attribute definitions in a resource attribute definition information repository; The constraint definition processing unit is used to receive resource constraint definitions defined by a user in a declarative manner and store the resource constraint definitions in a resource constraint definition information base.

13. The system according to claim 11, wherein the resource constraint definition comprises a resource attribute constraint definition and a constraint relationship definition between resources.

14. The system according to claim 11, wherein the resources include physical devices required for cluster operation and logical function unit components on which cluster operation depends.

15. The system according to claim 12, wherein storing the resource attribute definition in the resource attribute definition information repository comprises: De-duplicate resource attribute definitions.

16. The system according to claim 12, wherein storing the resource constraint definition in the resource constraint definition information repository comprises: Merge and remove duplicate resource constraint definitions.

17. The system according to claim 11, wherein collecting the actual status of resources in the cluster comprises: Collect the actual status of resources in the cluster in a polling manner.

18. The system of claim 11, further comprising: Resource status aggregation unit; The resource status aggregation unit is used to perform aggregation processing on the actual status of the resources collected by the resource status collection unit, and the aggregation processing includes deduplication processing and grouping processing.

19. The system of claim 12, further comprising: A constraint definition template and a constraint definition engine for parsing the constraint definition template; The constraint definition template is used for being called by a user to generate a resource constraint definition.

20. The system of claim 19, the constraint definition engine being configured in a pluggable mode.

21. The system according to claim 11, wherein the monitoring unit is configured in a pluggable mode.

22. A device for managing cluster resources, characterized in that: The method comprises a processor and a memory; the memory stores computer instructions, and when the computer instructions are executed by the processor, the method according to any one of claims 1 to 10 is implemented.

23. A cluster, characterized in that: Includes the system according to any one of claims 11 to 21 or the device according to claim 22.

24. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.