Methods, apparatus, electronic devices and media for cluster resource management and resource registration

By receiving the physical resource information of nodes to be registered and calculating the target elastic configuration and virtual resource information using a preset mapping relationship, the problem of inflexible elastic resource adjustment in the resource management module of the YARN system is solved, thereby improving resource utilization and accurately estimating cluster resource prices.

CN116643871BActive Publication Date: 2026-11-17BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210138198.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-15
Publication Date
2026-11-17
Estimated Expiration
2042-02-15

AI Technical Summary

Technical Problem

In the Apache Hadoop YARN system, the resource management module has difficulty in flexibly adjusting the elasticity coefficient of elastic resources, resulting in insufficient resource management and an inability to accurately estimate cluster resource prices.

Method used

By receiving the physical resource information of the nodes to be registered, using the preset mapping relationship between node attributes and elastic configuration information, the target elastic configuration information is determined, and the target virtual resource information is calculated based on this information, generating the resource contribution information of the resource management object and updating the cluster resource information.

Benefits of technology

It enables flexible scaling of resources, improves resource utilization, accurately queries physical and virtual resources, and solves the problem that resource management nodes cannot estimate cluster resource prices based on physical core utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116643871B_ABST
    Figure CN116643871B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, electronic device, and medium for cluster resource management and resource registration. The method for cluster resource management includes: receiving a registration request sent by a node to be registered in a service cluster, the registration request carrying physical resource information of the node to be registered; determining target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information; wherein the elastic configuration information is used to characterize the functional relationship between physical resources and virtual resources of a node's specific attributes; determining target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information; and generating resource contribution information of a resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and updating the cluster resource information accordingly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of big data and distributed cluster management technology, and in particular to a method, apparatus, electronic device and medium for cluster resource management and resource registration. Background Technology

[0002] With the development of big data and distributed storage / computing technologies, the management and scheduling of cluster resources has become a crucial technical aspect.

[0003] Taking Hadoop (a distributed system infrastructure developed by the Apache Software Foundation) as an example of distributed storage and distributed computing architecture in big data, Apache Hadoop YARN, as the mainstream cluster management and scheduling system in the current big data field, mainly consists of a resource management (RM, ResourceManager) module, a node management (NM, NodeManager) module, and an application management (AM, ApplicationMaster) module. Currently, in the YARN system, cluster resources are mainly aggregated and managed through the registration of the NM module with the RM module.

[0004] However, the current resource management method involves the NM sending virtual resources to the RM for registration. The expansion or contraction of elastic resources generated on the RM side depends on the status change information of the virtual resources sent by the NM. It is difficult for the RM side to flexibly adjust the elasticity coefficient of the elastic resources. Summary of the Invention

[0005] To address or at least partially address the aforementioned technical problems, embodiments of this disclosure provide a method, apparatus, electronic device, and medium for cluster resource management and resource registration.

[0006] In a first aspect, embodiments of this disclosure provide a method for cluster resource management. The method includes: receiving a registration request from a node to be registered in a service cluster, the registration request carrying physical resource information of the node to be registered; determining target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information; wherein the elastic configuration information is used to characterize the functional relationship between physical and virtual resources of a node's specific attributes; determining target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information; and generating resource contribution information for a resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and updating the cluster resource information accordingly.

[0007] According to embodiments of this disclosure, determining the target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information includes: determining whether the registration request carries attribute identification information of the node to be registered; if the registration request carries the attribute identification information, determining whether there is matching elastic configuration information corresponding to the attribute identification information based on the mapping relationship; and if there is matching elastic configuration information, determining the matching elastic configuration information as the target elastic configuration information corresponding to the node to be registered.

[0008] According to embodiments of this disclosure, determining the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information further includes: if the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, determining the preset default elastic configuration information as the target elastic configuration information corresponding to the node to be registered.

[0009] According to embodiments of this disclosure, while generating resource information for the resource management object corresponding to the aforementioned node to be registered, the method further includes: updating the status of the aforementioned resource management object to a running state.

[0010] According to embodiments of this disclosure, the above-described cluster resource management method further includes: generating a mapping relationship between node attributes and elastic configuration information.

[0011] In one embodiment, generating the mapping relationship between node attributes and elastic configuration information includes: receiving elastic configuration information associated with node attributes in the service cluster by a user; and generating and storing the mapping relationship between the node attributes and the elastic configuration information based on the node attributes and the elastic configuration information.

[0012] Alternatively, in another embodiment, generating the mapping relationship between node attributes and elastic configuration information includes: inputting node attributes into a performance prediction model and outputting resource utilization prediction information corresponding to the node attributes, wherein the performance prediction model is trained based on the node's operating indicator data within a historical operating cycle; generating elastic configuration information corresponding to the node attributes based on the resource utilization prediction information; and generating and storing the mapping relationship between the node attributes and the elastic configuration information based on the node attributes and the elastic configuration information.

[0013] Alternatively, in another embodiment, generating the mapping relationship between node attributes and elastic configuration information includes: inputting node attributes into a performance prediction model and outputting resource utilization prediction information corresponding to the node attributes; generating elastic configuration information corresponding to the node attributes based on the resource utilization prediction information; displaying the resource utilization prediction information and the elastic configuration information; receiving verified elastic configuration information after the user corrects or confirms the elastic configuration information; and generating and storing the mapping relationship between the node attributes and the verified elastic configuration information based on the node attributes and the verified elastic configuration information.

[0014] According to embodiments of this disclosure, the above-described cluster resource management method further includes: receiving an update request to update the above-described mapping relationship, wherein the update request carries update information including: adding a new mapping relationship, deleting an existing mapping relationship, or changing the parameter value of existing elastic configuration information in the above-described mapping relationship; updating the above-described mapping relationship according to the update information; and setting the status of the target resource management object corresponding to the node associated with the above-described update information in the generated resource management object to a re-registration status.

[0015] According to embodiments of this disclosure, determining the target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information includes: determining whether the node to be registered is a registered node; if the node to be registered is in its initial registration state, determining the updated target elastic configuration information corresponding to the node in its initial registration state based on the updated mapping relationship; if the node to be registered is a registered node, determining whether the node to be registered is in a re-registration state; if the node to be registered is in a re-registration state, deducting the resource contribution information corresponding to the node in its re-registration state from the resource information of the service cluster; and determining the updated target elastic configuration information corresponding to the node in its re-registration state based on the updated mapping relationship.

[0016] According to embodiments of this disclosure, determining the update target elastic configuration information corresponding to the node to be registered in the initial registration state / re-registration state based on the updated mapping relationship includes: determining whether the registration request carries attribute identification information of the node to be registered; if the registration request carries the attribute identification information, determining whether there is matching elastic configuration information corresponding to the attribute identification information based on the updated mapping relationship; if the matching elastic configuration information exists, determining the matching elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the initial registration state / re-registration state; if the registration request does not carry the attribute identification information or the matching elastic configuration information does not exist, determining the preset default elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the initial registration state / re-registration state.

[0017] According to embodiments of this disclosure, determining the target virtual resource information of the node to be registered based on the aforementioned target elastic configuration information and physical resource information includes: determining the updated target virtual resource information of the node to be registered in the re-registration state based on the aforementioned updated target elastic configuration information and physical resource information. Generating resource contribution information for the resource management object corresponding to the node to be registered based on the aforementioned target virtual resource information and physical resource information, and updating the cluster resource information accordingly, includes: updating the resource information of the resource management object corresponding to the node to be registered in the re-registration state based on the aforementioned updated target virtual resource information and physical resource information, and updating the cluster resource information accordingly.

[0018] Secondly, embodiments of this disclosure provide a method for resource registration. The method includes: obtaining physical resource information of a node to be registered; sending a registration request to a resource management node of a service cluster, the registration request carrying the physical resource information of the node to be registered; and receiving resource contribution information of a resource management object corresponding to the node to be registered, sent by the resource management node, the resource contribution information including the physical resource information and corresponding target virtual resource information. The virtual resource information is generated based on the physical resource information and target elastic configuration information corresponding to the node to be registered, the target elastic configuration information being obtained based on a preset mapping relationship between node attributes and elastic configuration information.

[0019] Thirdly, embodiments of this disclosure provide an apparatus for cluster resource management. The apparatus includes: a registration request receiving module, an elastic configuration information determining module, a virtual resource calculation module, and a resource information generation and updating module. The registration request receiving module receives a registration request sent by a node to be registered in a service cluster, the registration request carrying physical resource information of the node to be registered. The elastic configuration information determining module determines target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information; wherein the elastic configuration information characterizes the functional relationship between physical resources and virtual resources of a node's specific attributes. The virtual resource calculation module determines target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information. The resource information generation and updating module generates resource contribution information for a resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and updates the cluster resource information accordingly.

[0020] Fourthly, embodiments of this disclosure provide a resource registration apparatus. The resource registration apparatus includes: an information acquisition module and a registration request sending module. The information acquisition module is used to acquire physical resource information of a node to be registered. The registration request sending module is used to send a registration request to a resource management node of a service cluster, the registration request carrying the physical resource information of the node to be registered. An information receiving module is used to receive resource contribution information of a resource management object corresponding to the node to be registered, sent by the resource management node. The resource contribution information includes: the physical resource information and corresponding target virtual resource information. The virtual resource information is generated based on the physical resource information and target elastic configuration information corresponding to the node to be registered, the target elastic configuration information being obtained based on a preset mapping relationship between node attributes and elastic configuration information.

[0021] Fifthly, embodiments of this disclosure provide an electronic device. The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, communication interface, and memory communicate with each other via the communication bus; the memory stores computer programs; and the processor, when executing the program stored in the memory, implements the cluster resource management method or resource registration method as described above.

[0022] Sixthly, embodiments of this disclosure provide a computer-readable storage medium. The computer-readable storage medium stores a computer program that, when executed by a processor, implements the cluster resource management method or resource registration method as described above.

[0023] The technical solutions provided in the embodiments of this disclosure have at least some or all of the following advantages:

[0024] The nodes to be registered use physical resource information for registration. Based on the preset mapping relationship, the corresponding target elastic configuration information can be distributed to the physical resource information of the nodes to be registered. That is, the functional relationship between physical resources and virtual resources corresponding to specific attributes of the nodes to be registered is determined, and then the virtual resource information is calculated according to the above functional relationship. Furthermore, by updating the mapping relationship, the expansion and contraction of resources can be flexibly adjusted to improve resource utilization. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0026] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0027] Figure 1 The system architecture of the cluster resource management method and resource registration method applicable to embodiments of this disclosure is illustrated schematically;

[0028] Figure 2 A flowchart illustrating a method for cluster resource management according to an embodiment of the present disclosure is shown schematically;

[0029] Figure 3 A detailed implementation flowchart of operation S202 according to an embodiment of the present disclosure is shown schematically;

[0030] Figure 4 A flowchart illustrating a method for cluster resource management according to another embodiment of the present disclosure is shown.

[0031] Figure 5A A detailed implementation flowchart of operation S401 according to an embodiment of the present disclosure is schematically shown;

[0032] Figure 5B A detailed implementation flowchart of operation S401 according to another embodiment of the present disclosure is shown schematically;

[0033] Figure 5C A detailed implementation flowchart of operation S401 according to yet another embodiment of the present disclosure is shown schematically;

[0034] Figure 6A schematic diagram of a tree structure for storage according to an embodiment of the present disclosure is shown.

[0035] Figure 7 A flowchart illustrating a method for cluster resource management according to yet another embodiment of the present disclosure is shown.

[0036] Figure 8 A detailed implementation flowchart of operation S202 according to another embodiment of the present disclosure is schematically shown;

[0037] Figure 9 A flowchart illustrating a method for resource registration according to an embodiment of the present disclosure is shown schematically.

[0038] Figure 10 A structural block diagram of a cluster resource management apparatus according to an embodiment of the present disclosure is shown schematically.

[0039] Figure 11 A structural block diagram of a resource registration apparatus according to an embodiment of the present disclosure is schematically shown; and

[0040] Figure 12 A schematic block diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation

[0041] The embodiments of this disclosure provide a method, apparatus, electronic device, and medium for cluster resource management and resource registration. The cluster resource management method can be applied to a cluster management node, such as a master node in a service cluster; the resource registration method can be applied to a node to be registered, such as a slave node in a service cluster.

[0042] The aforementioned cluster resource management method includes: receiving a registration request sent by a node to be registered in the service cluster, the registration request carrying the physical resource information of the node to be registered; determining the target elastic configuration information corresponding to the node to be registered based on a preset mapping relationship between node attributes and elastic configuration information; wherein the elastic configuration information is used to characterize the functional relationship between physical resources and virtual resources of a node's specific attributes; determining the target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information; and generating resource contribution information for the resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and updating the cluster resource information accordingly.

[0043] The above-mentioned resource registration method includes: obtaining the physical resource information of the node to be registered; sending a registration request to the resource management node of the service cluster, wherein the registration request carries the physical resource information of the node to be registered.

[0044] Based on the cluster resource management and resource registration methods, apparatuses, electronic devices, and media provided in this disclosure, nodes to be registered use physical resource information for registration. Based on a preset mapping relationship, corresponding target elastic configuration information can be distributed to the physical resource information of the nodes to be registered. That is, the functional relationship between physical and virtual resources corresponding to specific attributes of the nodes to be registered is determined, and virtual resource information is calculated based on this functional relationship. Furthermore, by updating the mapping relationship, flexible adjustments to resource scaling can be achieved to improve resource utilization. In addition, resource management nodes can accurately query physical and virtual resources in the service cluster, which facilitates rapid calculation of cluster resource prices. Compared to existing methods that rely on nodes to report virtual resources, this overcomes the deficiency that nodes to be registered reporting virtual resources prevent resource management nodes from estimating cluster resource prices based on physical core utilization.

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0046] Figure 1 The system architecture of the cluster resource management method and resource registration method applicable to embodiments of this disclosure is illustrated schematically.

[0047] Reference Figure 1 As shown, the system architecture 100 of the cluster resource management method and resource registration method applicable to the embodiments of this disclosure includes: a service cluster, which may be a distributed service cluster, including: a master node 110, one or more slave nodes 120, and a storage system / device 130.

[0048] This distributed service cluster is used to provide computing and / or storage services for application data processing / task processing (development tasks, operation and maintenance tasks, business operation tasks, etc.) scenarios. In other scenarios, it can also provide network service support.

[0049] The aforementioned master node 110 serves as the core node for managing and scheduling cluster resources. In the embodiments of this disclosure, the focus is on describing the resource management function. Therefore, the aforementioned master node can also be described as a resource management node, and the master node 110 may include a resource management module.

[0050] For example, the resource management module could be the RM module in the Apache Hadoop YARN system (a distributed system for cluster scheduling and resource management developed and maintained by the Hadoop community under the Apache Foundation). The RM module is the management node of the YARN system, used for the management of computing nodes, job load management, and cluster resource scheduling.

[0051] The aforementioned slave node 120 serves as a node that actually provides at least one of the following resources: computing resources, storage resources, and network resources. Furthermore, containerized microservices or applications can run internally within the slave node 120. The resources within the slave node 120 are used for registration with the master node 110; therefore, the slave node 120 can be described as a node awaiting registration. Figure 1 The example provided uses a service cluster consisting of one master node and three slave nodes (1-3). Each slave node may include a node management module.

[0052] For example, the node management module could be the NM module in the Apache Hadoop YARN system. The NM module is a compute node in the YARN system, deployed on each compute node host, used to collect and report resources, manage containers running on the local machine, etc.

[0053] The aforementioned storage system / device 130 serves as the storage unit for this service cluster. It can be a storage system / database such as ZooKeeper, etcd, or MySQL; it can be a local storage system or a cloud storage system; it can be a centralized database or a distributed database. ZooKeeper is a highly available, elastic, distributed coordination system under the Apache Software Foundation. etcd is a highly available distributed key-value database that uses the Raft protocol as its consistency algorithm. MySQL is a relational database management system.

[0054] The cluster resource management method provided in this embodiment can be executed by the master node 110 in the system architecture 100 described above, and the resource registration method provided in this embodiment can be executed by each slave node 120 in the system architecture 100 described above.

[0055] The aforementioned master node 110 and slave node 120 are electronic devices capable of providing computing and / or storage resources, such as networked terminal devices or servers (including application servers, cloud servers, etc.) with computing capabilities.

[0056] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0057] The first exemplary embodiment of this disclosure provides a method for cluster resource management. This method can be applied to cluster management nodes.

[0058] Figure 2 A flowchart illustrating a method for cluster resource management according to an embodiment of the present disclosure is shown schematically.

[0059] Reference Figure 2 As shown, the cluster resource management method provided in this embodiment includes the following operations: S201, S202, S203, and S204. Operations S201 to S204 can be executed by a cluster management node in the service cluster, for example... Figure 1 The example uses master node 110 to execute.

[0060] In operation S201, a registration request is received from a node to be registered in the service cluster. The registration request carries the physical resource information of the node to be registered.

[0061] The aforementioned physical resource information includes, but is not limited to, the computing and storage resource information of physical entities such as: central processing unit (CPU), physical memory (e.g., random access memory (RAM), read-only memory (ROM), cache (CACHE), storage space in the hard disk of peripherals in the host, etc.), network, disk, etc.

[0062] In operation S202, the target elastic configuration information corresponding to the node to be registered is determined based on the preset mapping relationship between node attributes and elastic configuration information. The elastic configuration information is used to characterize the functional relationship between the physical and virtual resources of a node's specific attributes.

[0063] Node attributes are used to characterize the resource-related features of a node, including but not limited to: the number of CPU cores, the size of memory, the speed of the network card, and the model of the CPU.

[0064] For example, the mapping relationship between preset node attributes and elastic configuration information can be: the mapping relationship between an attribute group containing one or more attributes and elastic configuration information, such as {attribute A} → the ratio of physical resources to virtual resources (an example of a functional relationship) is 2; {attribute A, attribute B} → the ratio of physical resources to virtual resources is 3; {attribute B} → the ratio of physical resources to virtual resources is 3; {attribute C} → the ratio of physical resources to virtual resources is 4.5; {attribute C, attribute D} → the ratio of physical resources to virtual resources is 3.

[0065] For example, attribute A might be a 2-core CPU, with the corresponding elastic configuration information being a ratio of 2 between physical and virtual resources. For the CPU, a ratio of 2 between physical and virtual resources means that each virtual core corresponds to 0.5 physical cores.

[0066] Attribute B is, for example, memory between a first setting value and a second setting value, such as memory between (128G, 500G).

[0067] Attribute C could be, for example, the network card speed being within a certain range; for example, the network card speed being greater than 5 Mbps.

[0068] Attribute D can be, for example, the CPU model, including Intel, AMD, Loongson, etc.

[0069] In operation S203, the target virtual resource information of the node to be registered is determined based on the target elastic configuration information and the physical resource information mentioned above.

[0070] Based on the physical resource information of the nodes to be registered and the corresponding target elastic configuration information, the target virtual resource information of the nodes to be registered can be obtained by calculating the physical resource information using the functional relationship in the target elastic configuration information.

[0071] In operation S204, based on the aforementioned target virtual resource information and the aforementioned physical resource information, resource contribution information of the resource management object corresponding to the aforementioned node to be registered is generated, and the cluster resource information is updated accordingly.

[0072] The resource contribution information of the resource management object (e.g., an RMNodeImpl object) generated in the cluster management node includes: target virtual resource information and the aforementioned physical resource information. This resource contribution information becomes part of the cluster resource information in the service cluster.

[0073] Based on the aforementioned operations S201–S204, the node to be registered registers using physical resource information. Based on a preset mapping relationship, corresponding target elastic configuration information can be distributed to the physical resource information of the node to be registered. That is, the functional relationship between physical and virtual resources corresponding to specific attributes of the node to be registered is determined, and virtual resource information is calculated based on this functional relationship. Furthermore, by updating the mapping relationship, flexible adjustments to resource scaling can be achieved to improve resource utilization. In addition, the resource management node can accurately query the physical and virtual resources in the service cluster, which facilitates the rapid calculation of cluster resource prices. Compared to the existing method of reporting virtual resources by the node to be registered, this overcomes the deficiency that the resource management node cannot estimate cluster resource prices based on the utilization rate of physical cores when the node to be registered reports virtual resources.

[0074] According to embodiments of this disclosure, while generating resource information for the resource management object corresponding to the aforementioned node to be registered, the method further includes: updating the status of the aforementioned resource management object to a running state.

[0075] In one embodiment, after generating the resource information of the resource management object corresponding to the node to be registered, the method may further include: sending the resource contribution information of the resource management object corresponding to the node to be registered to the node to be registered, wherein the resource contribution information includes the physical resource information and the corresponding target virtual resource information.

[0076] Taking the YARN system as an example of a distributed cluster management system, each NM module registers with the RM module through the ResourceTracker protocol when it starts up. The RM then creates an RMNodeImpl object (corresponding to the resource management object described here). At this time, the state of the RMNodeImpl object is initialized to new. After the RM module calculates the target virtual resource information, it assigns the target virtual resource information and the aforementioned physical resource information to the aforementioned RMNodeImpl object and updates the state of the aforementioned RMNodeImpl object to running.

[0077] Figure 3 A detailed implementation flowchart of operation S202 according to an embodiment of the present disclosure is shown schematically.

[0078] According to embodiments of this disclosure, referring to Figure 3 As shown, in the above operation S202, the target elastic configuration information corresponding to the node to be registered is determined according to the preset mapping relationship between node attributes and elastic configuration information. This includes the following operations: S301, S302a, and S303a, where the branch corresponding to the above scheme with the determination result (judgment result) being "yes". (Refer to...) Figure 3 As shown, the above operation S202 may further include a branch that determines the result as "no", such as operations S302b and S303b.

[0079] In operation S301, determine whether the above registration request carries the attribute identification information of the node to be registered.

[0080] In operation S302a, if the above-mentioned registration request carries the above-mentioned attribute identification information, it is determined whether there is matching elastic configuration information corresponding to the above-mentioned attribute identification information based on the above-mentioned mapping relationship.

[0081] In operation S302b, if the above-mentioned registration request does not carry the above-mentioned attribute identification information, the preset default elastic configuration information is determined as the target elastic configuration information corresponding to the above-mentioned node to be registered.

[0082] In operation S303a, if the aforementioned matching elastic configuration information exists, the aforementioned matching elastic configuration information is determined as the target elastic configuration information corresponding to the aforementioned node to be registered.

[0083] In operation S303b, if the aforementioned matching elastic configuration information does not exist, the preset default elastic configuration information will be determined as the target elastic configuration information corresponding to the node to be registered.

[0084] For example, the preset default elastic configuration information is set to a ratio of 1 between the physical resources and virtual resources of a node by default. Depending on the actual scenario, it can also be preset to other functional relationships.

[0085] Figure 4 A flowchart illustrating a method for cluster resource management according to another embodiment of the present disclosure is shown schematically.

[0086] According to another embodiment of this disclosure, referring to Figure 4 As shown, the above-described cluster resource management method includes not only operations S201 to S204, but also operation S401: generating a mapping relationship between node attributes and elastic configuration information. Operation S401 is executed before operation S202. The mapping relationship generated by operation S401 remains unchanged for a period of time, and can be used to respond to multiple registration requests.

[0087] The following reference Figures 5A to 5C The following describes the specific implementation of the above operation S401.

[0088] Figure 5A A detailed implementation flowchart of operation S401 according to an embodiment of the present disclosure is shown schematically.

[0089] In one embodiment, association relationships are generated by receiving flexible configuration information of the user's node attribute association settings.

[0090] Reference Figure 5A As shown, in the above operation S401, the mapping relationship between node attributes and elastic configuration information is generated, including the following operations: S511 and S512.

[0091] In operation S511, the elastic configuration information of the user's node attribute association settings in the above service cluster is received.

[0092] Users, such as operations and maintenance personnel or administrators of the aforementioned cluster, can input elastic configuration information on the resource management node and associate the elastic configuration information with node attributes. The aforementioned node attributes are resource-related attributes possessed by one or more nodes in the service cluster, such as, but not limited to, the number of CPU cores, the size of memory, the speed of the network card, and the model of the CPU.

[0093] In operation S512, based on the above node attributes and the above elastic configuration information, a mapping relationship between the above node attributes and the above elastic configuration information is generated and stored.

[0094] In one embodiment, the mapping relationship between the node attributes and the flexible configuration information can be stored in the form of key-value pairs, or it can be stored in a tree structure.

[0095] Figure 5B A detailed implementation flowchart of operation S401 according to another embodiment of the present disclosure is shown schematically.

[0096] In another embodiment, elastic configuration information associated with node attributes is generated based on the results of the model output, and a corresponding mapping relationship is obtained.

[0097] Reference Figure 5B As shown, in the above operation S401, the mapping relationship between node attributes and elastic configuration information is generated, including the following operations: S521, S522 and S523.

[0098] In operation S521, the node attributes are input into the performance prediction model, and the resource utilization prediction information corresponding to the above node attributes is output. The above performance prediction model is trained based on the node's operating index data within the historical operating cycle.

[0099] For example, the input samples for a performance prediction model are the host's operating metrics data over the past month (such as the number of instructions processed per unit time, I / O rate, CPU utilization, etc.). The parameters of the model can be trained through time series analysis or machine learning to obtain a trained performance prediction model.

[0100] Given the input node attributes, this performance prediction model can output the corresponding predicted resource utilization information.

[0101] In operation S522, based on the resource utilization prediction information mentioned above, elastic configuration information corresponding to the node attributes is generated.

[0102] For example, if the predicted resource utilization of the 4 CPU cores from node 1 to node 3 is 20%, and the remaining 80% of CPU resources are not being utilized, then the elastic configuration information corresponding to the above 4 CPU cores attribute information can be generated as follows: resource elasticity coefficient is 4. The meaning of this resource elasticity coefficient is: resource elasticity coefficient = virtual resources / physical resources. When the physical resources are CPUs, then for a 4-core CPU (physical cores), there can be 16 virtual cores to run containerized applications.

[0103] In operation S523, based on the above node attributes and the above elastic configuration information, a mapping relationship between the above node attributes and the above elastic configuration information is generated and stored.

[0104] In one embodiment, the mapping relationship between the node attributes and the flexible configuration information can be stored in the form of key-value pairs, or it can be stored in a tree structure.

[0105] Figure 5C A detailed implementation flowchart of operation S401 according to yet another embodiment of the present disclosure is shown schematically.

[0106] In another embodiment, elastic configuration information associated with node attributes is obtained by combining model output results with manual verification results, and a corresponding mapping relationship is obtained.

[0107] Reference Figure 5C As shown, in the above operation S401, the mapping relationship between node attributes and elastic configuration information is generated, including the following operations: S531, S532, S533, S534 and S535.

[0108] In operation S531, the node attributes are input into the performance prediction model, and the resource utilization prediction information corresponding to the above node attributes is output.

[0109] In operation S532, based on the above resource utilization prediction information, elastic configuration information corresponding to the above node attributes is generated.

[0110] In operation S533, the above resource utilization prediction information and the above elastic configuration information are displayed.

[0111] In operation S534, the system receives the verified elastic configuration information after the user corrects or confirms the above elastic configuration information.

[0112] In operation S535, based on the above node attributes and the above verification elastic configuration information, a mapping relationship between the above node attributes and the above verification elastic configuration information is generated and stored.

[0113] In one embodiment, the mapping relationship between the node attributes and the verification elastic configuration information can be stored in the form of key-value pairs, or it can be stored in a tree structure.

[0114] Figure 6 A schematic diagram of a tree structure for storage according to an embodiment of the present disclosure is shown.

[0115] In the above embodiments, the mapping relationship between node attributes and the aforementioned flexible configuration information or verified flexible configuration information is stored in a tree structure, and the tree structure refers to... Figure 6 As shown, there are leaf nodes under the root node. The root node corresponding to root is used to store the identifier of the node attribute (e.g., Label). L1, L2, and L3 represent different node attributes. Node attributes can exist in the form of labels or identifiers. Therefore, the node that stores node attributes can be described as a label node. Each label node (L1, L2, L3, etc.) has two leaf nodes. For example, the two leaf nodes under the L2 attribute are nodes and config. The nodes leaf node is used to store all the nodes that match the L2 attribute (i.e., nodes that contain the L2 attribute); the config leaf node is used to store the elastic configuration information corresponding to the L2 attribute.

[0116] Figure 7 A flowchart illustrating a method for cluster resource management according to yet another embodiment of the present disclosure is shown.

[0117] Based on the above embodiments, the above cluster resource management method, in addition to including operations S201-S204, or operations S201-S204, S401, may also include operations S701, S702, and S703. For simplicity, in... Figure 7 The diagram only illustrates operations S701 to S703 and operations S201 and S202. Operations S701 to S703 can occur after operations S201 to S204 corresponding to one or more registration requests. During the next execution of a received registration request, operations S701 to S703 are executed in parallel. In this case, the updated mapping relationship is reflected in operation S202, which corresponds to the next processing of a registration request.

[0118] In operation S701, an update request is received to update the above mapping relationship. The update request carries update information including: adding a new mapping relationship, deleting an existing mapping relationship, or changing the parameter value of the existing elastic configuration information in the above mapping relationship.

[0119] For example, a newly added mapping relationship could be a mapping relationship between newly added attribute values ​​and newly added flexible configuration information.

[0120] In operation S702, the mapping relationship is updated according to the above update information.

[0121] For example, information in the leaf nodes of a tree structure can be updated, or leaf nodes can be added or deleted.

[0122] In operation S703, the status of the target resource management object corresponding to the node associated with the above update information in the generated resource management object is set to the re-registration status.

[0123] Figure 8 A detailed implementation flowchart of operation S202 according to another embodiment of the present disclosure is shown schematically.

[0124] According to embodiments of this disclosure, referring to Figure 8 As shown, for embodiments including operations S201-S204, S701-S703, or including operations S201-S204, S401, S701-S703, in the above operation S202, the target elastic configuration information corresponding to the above-mentioned node to be registered is determined according to the preset mapping relationship between node attributes and elastic configuration information, including the following pre-judgment logic operation: S801, determining whether the above-mentioned node to be registered is a registered node.

[0125] When the node to be registered is in the initial registration state, operation S802b is executed. When the node to be registered is an already registered node, operations S802a, S803a, and S804a are executed.

[0126] In operation S802b, when the node to be registered is in the initial registration state, the update target elastic configuration information corresponding to the node to be registered in the initial registration state is determined according to the updated mapping relationship.

[0127] In operation S802a, if the node to be registered is already registered, determine whether the status of the node to be registered is a re-registration status.

[0128] In operation S803a, if the status of the aforementioned node to be registered is in the re-registration state, the resource contribution information corresponding to the aforementioned node to be registered in the re-registration state is deducted from the resource information of the aforementioned service cluster.

[0129] In operation S804a, based on the updated mapping relationship, the update target elastic configuration information corresponding to the above-mentioned node to be registered in the re-registration state is determined.

[0130] According to an embodiment of this disclosure, in the above operation S802b, determining the update target elastic configuration information corresponding to the node to be registered in the initial registration state based on the updated mapping relationship includes: determining whether the registration request carries attribute identification information of the node to be registered; if the registration request carries the attribute identification information, determining whether there is matching elastic configuration information corresponding to the attribute identification information based on the updated mapping relationship; if the matching elastic configuration information exists, determining the matching elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the initial registration state; if the registration request does not carry the attribute identification information or the matching elastic configuration information does not exist, determining the preset default elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the initial registration state.

[0131] According to the updated mapping relationship, in the above operation S804a, determining the update target elastic configuration information corresponding to the node to be registered in the re-registration state includes: determining whether the registration request carries the attribute identification information of the node to be registered; if the registration request carries the attribute identification information, determining whether there is matching elastic configuration information corresponding to the attribute identification information according to the updated mapping relationship; if the matching elastic configuration information exists, determining the matching elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the re-registration state; if the registration request does not carry the attribute identification information or the matching elastic configuration information does not exist, determining the preset default elastic configuration information as the update target elastic configuration information corresponding to the node to be registered in the re-registration state.

[0132] Accordingly, for embodiments that include operations S201 to S204, S701 to S703, or operations S201 to S204, S401, S701 to S703, the elastic resource configuration information in operations S203 and S204 includes: updating target elastic configuration information.

[0133] That is, based on the above target elastic configuration information and the above physical resource information, the target virtual resource information of the above-mentioned node to be registered is determined, including: based on the above-mentioned updated target elastic configuration information and the above physical resource information, the updated target virtual resource information of the above-mentioned node to be registered in the re-registration state is determined.

[0134] Based on the aforementioned target virtual resource information and the aforementioned physical resource information, resource contribution information of the resource management object corresponding to the aforementioned node to be registered is generated, and the cluster resource information is updated accordingly, including: based on the aforementioned updated target virtual resource information and the aforementioned physical resource information, the resource information of the resource management object corresponding to the aforementioned node to be registered in the re-registration state is updated, and the cluster resource information is updated accordingly.

[0135] In summary, by setting corresponding elastic resource information based on different node attributes (which can also be described as node tags), the NM registers with the RM using physical resources instead of virtual resources. When adjusting elastic resource information on the RM side, it only needs to request the NM to re-register during the next heartbeat (communication between the RM and NM), without needing to operate the NM node itself to complete the elastic resource change. Operations / management personnel only need to send a single command (e.g., the admin command, used to request an update of elastic resource information) to the cluster management system to complete the scaling up or down of elastic resources, making the operation flexible and simple.

[0136] A second exemplary embodiment of this disclosure provides a method for resource registration. This resource registration method can be applied to slave nodes in a service cluster, where the slave node is the node to be registered.

[0137] Figure 9 A flowchart illustrating a method for resource registration according to an embodiment of the present disclosure is shown schematically.

[0138] Reference Figure 9 As shown, the resource registration method provided in this embodiment includes the following operations: S901 and S902.

[0139] During operation of S901, the physical resource information of the node to be registered is obtained.

[0140] The aforementioned physical resource information includes: central processing unit (CPU), memory (e.g., random access memory (RAM), read-only memory (ROM), cache (CACHE), storage space corresponding to the external hard drive of the host peripheral), network, disk, etc.

[0141] In one embodiment, information such as CPU, memory, network, and disk of the host system can be obtained by reading the proc (a virtual file system) file. The NM module reads the proc file and obtains the corresponding physical resource information by matching the relevant resources using regular expressions. Assuming the goal is to obtain the host's physical CPU resource information, the detailed steps are as follows:

[0142] (a) Create an input stream for the / proc / cpuinfo file and use this input stream to read data.

[0143] (b) Read data line by line and match it according to the regular expression ^processor[\t]:[\t]*([0-9]*). If the match is successful, increment the number of processors by 1.

[0144] (c) Determine if the current line is EOF (EOF is an abbreviation for End-of-file, which is a flag used by the computer operating system to indicate that there is no data to read from a file). If it is, close the input stream; otherwise, repeat step (b).

[0145] In operation S902, a registration request is sent to the resource management node of the service cluster. The registration request carries the physical resource information of the node to be registered.

[0146] In one embodiment, after obtaining the physical resource information in operation S901, it is encapsulated into a resource object. Then, in operation S902, the resource object is serialized and transmitted to the RM module via the TCP protocol. Correspondingly, when performing operation S201 on the master node side, after receiving the registration request, data is read from the TCP protocol and deserialized into a resource object to obtain the physical resource information.

[0147] In operation S903, the resource contribution information of the resource management object corresponding to the above-mentioned registration node is received from the above-mentioned resource management node. The above-mentioned resource contribution information includes: the above-mentioned physical resource information and the corresponding target virtual resource information.

[0148] The aforementioned virtual resource information is generated based on the aforementioned physical resource information and the target elastic configuration information corresponding to the aforementioned node to be processed. The aforementioned target elastic configuration information is obtained based on the preset mapping relationship between node attributes and elastic configuration information.

[0149] In this embodiment, corresponding elastic resource information is set according to different node attributes (which can also be described as node tags). When NM registers with RM, it uses physical resources instead of virtual resources. When adjusting elastic resource information on the RM side, it only needs to request NM to re-register during the next heartbeat (communication between RM and NM), without operating the NM node to complete the change of elastic resources. Operation and maintenance personnel / management personnel only need to send a single command to the management terminal of the cluster management system to complete the scaling up and down of elastic resources, making the operation flexible and simple.

[0150] A third exemplary embodiment of this disclosure provides an apparatus for cluster resource management.

[0151] Figure 10 A structural block diagram of a cluster resource management apparatus according to an embodiment of the present disclosure is shown schematically.

[0152] Reference Figure 10As shown, the cluster resource management apparatus 1000 provided in this embodiment includes: a registration request receiving module 1001, an elastic configuration information determining module 1002, a virtual resource calculation module 1003, and a resource information generation and updating module 1004.

[0153] The aforementioned registration request receiving module 1001 is used to receive registration requests sent by nodes to be registered in the service cluster, the registration requests carrying the physical resource information of the nodes to be registered.

[0154] The aforementioned elastic configuration information determination module 1002 is used to determine the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information; wherein the aforementioned elastic configuration information is used to characterize the functional relationship between physical resources and virtual resources of a node's specific attributes.

[0155] The aforementioned virtual resource calculation module 1003 is used to determine the target virtual resource information of the aforementioned node to be registered based on the aforementioned target elastic configuration information and the aforementioned physical resource information.

[0156] The resource information generation and update module 1004 is used to generate resource contribution information of the resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and update the cluster resource information accordingly.

[0157] According to embodiments of this disclosure, the above-described apparatus 1000 may further include: a mapping relationship generation and storage module, a mapping relationship update module, and a node state setting module.

[0158] The above-mentioned mapping relationship generation and storage module is used to generate and store the mapping relationship between node attributes and elastic configuration information.

[0159] The mapping update module is used to receive update requests for updating the mapping relationships and to update the mapping relationships according to the update information. The update information carried in the update request includes: adding new mapping relationships, deleting existing mapping relationships, or changing parameter values ​​of existing elastic configuration information in the mapping relationships.

[0160] The aforementioned node status setting module is used to set the status of the target resource management object corresponding to the node associated with the aforementioned update information in the generated resource management object to a re-registration status.

[0161] According to embodiments of this disclosure, the above-mentioned flexible configuration information determination module 1002 may include the following sub-modules: a node registration status determination sub-module, a flexible configuration information determination sub-module, and a node resource deduction module.

[0162] The aforementioned node registration status determination submodule is used to determine whether the node to be registered is a registered node; and, if the node to be registered is a registered node, to determine whether the status of the node to be registered is a re-registration status.

[0163] The aforementioned elastic configuration information determination submodule is used to determine the updated target elastic configuration information corresponding to the node to be registered in the initial registration state based on the updated mapping relationship when the node to be registered is in the initial registration state; and is used to determine the updated target elastic configuration information corresponding to the node to be registered in the re-registration state based on the updated mapping relationship.

[0164] The aforementioned node resource deduction module is used to deduct the resource contribution information corresponding to the re-registered node from the resource information of the aforementioned service cluster when the status of the node to be registered is re-registered.

[0165] A fourth exemplary embodiment of this disclosure provides an apparatus for resource registration.

[0166] Figure 11 A structural block diagram of an apparatus for resource registration according to an embodiment of the present disclosure is shown schematically.

[0167] Reference Figure 11 As shown, the resource registration apparatus 1100 provided in this embodiment includes: an information acquisition module 1101, a registration request sending module 1102, and an information receiving module 1103.

[0168] The aforementioned information acquisition module 1101 is used to acquire the physical resource information of the node to be registered.

[0169] The aforementioned registration request sending module 1102 is used to send a registration request to the resource management node of the service cluster. The registration request carries the physical resource information of the node to be registered.

[0170] The aforementioned information receiving module 1103 is used to receive resource contribution information of the resource management object corresponding to the aforementioned registered node, sent by the aforementioned resource management node. The resource contribution information includes the aforementioned physical resource information and the corresponding target virtual resource information. The aforementioned virtual resource information is generated based on the aforementioned physical resource information and the target elastic configuration information corresponding to the aforementioned node to be processed. The aforementioned target elastic configuration information is obtained based on a preset mapping relationship between node attributes and elastic configuration information.

[0171] Any plurality of the modules included in the aforementioned devices 1000 and 1100 may be combined into a single module, or any single module may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in a single module. At least one of the modules included in the aforementioned devices 1000 and 1100 may be at least partially implemented as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-Chip, a System-on-Substrate, a System-on-Package, an Application-Specific Integrated Circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in hardware or firmware, or in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the modules included in the aforementioned devices 1000 and 1100 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0172] The fifth exemplary embodiment of this disclosure provides an electronic device.

[0173] Figure 12 A schematic block diagram of an electronic device provided in an embodiment of the present disclosure is shown.

[0174] Reference Figure 12 As shown, the electronic device 1200 provided in this embodiment includes a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. The processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204. The memory 1203 is used to store computer programs. When the processor 1201 executes the program stored in the memory, it implements the cluster resource management method or resource registration method as described above.

[0175] A sixth exemplary embodiment of this disclosure also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program that, when executed by a processor, implements the cluster resource management method or resource registration method as described above.

[0176] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or it may exist independently and not assembled into the device / apparatus. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0177] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0178] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0179] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily 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 this disclosure. Therefore, this disclosure is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for cluster resource management, characterized in that, include: Receive a registration request sent by a node to be registered in the service cluster, the registration request carrying the physical resource information of the node to be registered; Based on the preset mapping relationship between node attributes and elastic configuration information, the target elastic configuration information corresponding to the node to be registered is determined; wherein the elastic configuration information is used to characterize the functional relationship between physical resources and virtual resources of a node's specific attributes. The mapping relationship is stored in a tree structure. Each tag node in the tree structure includes two leaf nodes: the nodes node is used to store the node information that matches the attribute, and the config node is used to store the elastic configuration information corresponding to the attribute. Based on the target elastic configuration information and the physical resource information, the target virtual resource information of the node to be registered is determined; and Based on the target virtual resource information and the physical resource information, resource contribution information of the resource management object corresponding to the node to be registered is generated, and the cluster resource information is updated accordingly. The step of determining the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information includes: Determine whether the registration request carries the attribute identification information of the node to be registered; If the registration request carries the attribute identification information, determine whether there is matching flexible configuration information corresponding to the attribute identification information based on the mapping relationship; If the matching elastic configuration information exists, the matching elastic configuration information is determined as the target elastic configuration information corresponding to the node to be registered; The step of determining the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information further includes: If the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, the preset default elastic configuration information will be determined as the target elastic configuration information corresponding to the node to be registered. The method further includes: sending a re-registration instruction to the node to be registered to trigger the node to be registered to resend a registration request carrying the physical resource information, thereby completing the dynamic change of resource information without operating the node to be registered.

2. The method according to claim 1, characterized in that, While generating resource information for the resource management object corresponding to the node to be registered, the process also includes updating the status of the resource management object to the running status.

3. The method according to claim 1, characterized in that, It also includes: generating the mapping relationship between node attributes and elastic configuration information; The mapping relationship between the generated node attributes and the elastic configuration information includes: Receive elastic configuration information from the user regarding the association settings of node attributes in the service cluster; generate and store the mapping relationship between the node attributes and the elastic configuration information based on the node attributes and the elastic configuration information; or... Node attributes are input into a performance prediction model, which outputs resource utilization prediction information corresponding to the node attributes. The performance prediction model is trained based on node performance metrics data from historical operating cycles. Based on the resource utilization prediction information, elastic configuration information corresponding to the node attributes is generated. Based on the node attributes and the elastic configuration information, a mapping relationship between the node attributes and the elastic configuration information is generated and stored. Alternatively... The system inputs node attributes into a performance prediction model and outputs resource utilization prediction information corresponding to the node attributes. Based on the resource utilization prediction information, it generates elastic configuration information corresponding to the node attributes. The system displays the resource utilization prediction information and the elastic configuration information. It receives verified elastic configuration information after the user corrects or confirms the elastic configuration information. Based on the node attributes and the verified elastic configuration information, the system generates and stores a mapping relationship between the node attributes and the verified elastic configuration information.

4. The method according to claim 1 or 3, characterized in that, Also includes: Receive an update request to update the mapping relationship. The update request carries update information including: adding a new mapping relationship, deleting an existing mapping relationship, or changing the parameter value of existing elastic configuration information in the mapping relationship. The mapping relationship is updated based on the updated information; and Set the status of the target resource management object corresponding to the node associated with the update information in the generated resource management object to the re-registration status.

5. The method according to claim 4, characterized in that, The step of determining the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information includes: Determine whether the node to be registered is already a registered node; If the node to be registered is a node in the initial registration state, the updated target elastic configuration information corresponding to the node to be registered in the initial registration state is determined according to the updated mapping relationship; If the node to be registered is already registered, determine whether the status of the node to be registered is a re-registration status; If the status of the node to be registered is a re-registration status, the resource contribution information corresponding to the node to be registered in the re-registration status is deducted from the resource information of the service cluster. Based on the updated mapping relationship, determine the update target elastic configuration information corresponding to the node to be registered in the re-registration state.

6. The method according to claim 5, characterized in that, The step of determining the updated target elastic configuration information corresponding to the node to be registered in the initial registration state / re-registration state according to the updated mapping relationship includes: Determine whether the registration request carries the attribute identification information of the node to be registered; If the registration request carries the attribute identification information, determine whether there is matching elastic configuration information corresponding to the attribute identification information based on the updated mapping relationship; If the matching elastic configuration information exists, the matching elastic configuration information is determined as the update target elastic configuration information corresponding to the node to be registered in the initial registration state / re-registration state; If the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, the preset default elastic configuration information will be determined as the update target elastic configuration information corresponding to the node to be registered in the first registration state / re-registration state.

7. The method according to claim 5 or 6, characterized in that, Determining the target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information includes: determining the updated target virtual resource information of the node to be registered in the re-registration state based on the updated target elastic configuration information and the physical resource information; The step of generating resource contribution information for the resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and updating the cluster resource information accordingly, includes: updating the resource information of the resource management object corresponding to the node to be registered in the re-registration state based on the updated target virtual resource information and the physical resource information, and updating the cluster resource information accordingly.

8. A method for resource registration, characterized in that, include: Obtain the physical resource information of the node to be registered; The physical resource information includes the attribute identification information of the node to be registered; Send a registration request to the resource management node of the service cluster. The registration request carries the physical resource information of the node to be registered and the attribute identification information. The system receives resource contribution information of the resource management object corresponding to the node to be registered, sent by the resource management node. The resource contribution information includes: physical resource information and corresponding target virtual resource information. The virtual resource information is generated based on the physical resource information and the target elastic configuration information corresponding to the node to be registered. The target elastic configuration information is obtained based on a preset mapping relationship between node attributes and elastic configuration information. The attribute identification information carried in the registration request is used to trigger the resource management node to perform the following operations: If the registration request carries the attribute identification information, it is determined whether there is matching elastic configuration information corresponding to the attribute identification information based on the preset mapping relationship between node attributes and elastic configuration information. If the matching elastic configuration information exists, the matching elastic configuration information is determined as the target elastic configuration information corresponding to the node to be registered; If the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, the preset default elastic configuration information will be determined as the target elastic configuration information corresponding to the node to be registered. The mapping relationship is stored in a tree structure. Each tag node in the tree structure includes two leaf nodes: the nodes node is used to store the node information that matches the attribute, and the config node is used to store the elastic configuration information corresponding to the attribute. The method further includes: in response to the re-registration instruction sent by the resource management node, resending a registration request carrying the physical resource information to the resource management node, so as to complete the dynamic change of resource information without operating the node to be registered.

9. A device for cluster resource management, characterized in that, include: The registration request receiving module is used to receive registration requests sent by nodes to be registered in the service cluster, wherein the registration request carries the physical resource information of the nodes to be registered. The elastic configuration information determination module is used to determine the target elastic configuration information corresponding to the node to be registered based on the preset mapping relationship between node attributes and elastic configuration information; wherein the elastic configuration information is used to characterize the functional relationship between physical resources and virtual resources of a node's specific attributes. The mapping relationship is stored in a tree structure. Each tag node in the tree structure includes two leaf nodes: the nodes node is used to store the node information that matches the attribute, and the config node is used to store the elastic configuration information corresponding to the attribute. The virtual resource calculation module is used to determine the target virtual resource information of the node to be registered based on the target elastic configuration information and the physical resource information; and The resource information generation and update module is used to generate resource contribution information of the resource management object corresponding to the node to be registered based on the target virtual resource information and the physical resource information, and update the cluster resource information accordingly. The elastic configuration information determination module is specifically used for: Determine whether the registration request carries the attribute identification information of the node to be registered; If the registration request carries the attribute identification information, determine whether there is matching flexible configuration information corresponding to the attribute identification information based on the mapping relationship; If the matching elastic configuration information exists, the matching elastic configuration information is determined as the target elastic configuration information corresponding to the node to be registered; If the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, the preset default elastic configuration information will be determined as the target elastic configuration information corresponding to the node to be registered. The device also includes a mapping update module, which is used to send a re-registration instruction to the node to be registered, so as to trigger the node to be registered to resend the registration request carrying the physical resource information, thereby completing the dynamic change of resource information without operating the node to be registered.

10. A resource registration apparatus, characterized in that, include: The information acquisition module is used to acquire the physical resource information of the node to be registered; The physical resource information includes the attribute identification information of the node to be registered; The registration request sending module is used to send a registration request to the resource management node of the service cluster, wherein the registration request carries the physical resource information of the node to be registered; The information receiving module is used to receive resource contribution information of the resource management object corresponding to the node to be registered, sent by the resource management node. The resource contribution information includes: physical resource information and corresponding target virtual resource information. The virtual resource information is generated based on the physical resource information and the target elastic configuration information corresponding to the node to be registered. The target elastic configuration information is obtained based on the preset mapping relationship between node attributes and elastic configuration information. The attribute identification information carried in the registration request is used to trigger the resource management node to perform the following operations: If the registration request carries the attribute identification information, it is determined whether there is matching elastic configuration information corresponding to the attribute identification information based on the preset mapping relationship between node attributes and elastic configuration information. If the matching elastic configuration information exists, the matching elastic configuration information is determined as the target elastic configuration information corresponding to the node to be registered; If the registration request does not carry the attribute identification information or does not contain the matching elastic configuration information, the preset default elastic configuration information will be determined as the target elastic configuration information corresponding to the node to be registered. The mapping relationship is stored in a tree structure. Each tag node in the tree structure includes two leaf nodes: the nodes node is used to store the node information that matches the attribute, and the config node is used to store the elastic configuration information corresponding to the attribute. The registration request sending module is further configured to: in response to the re-registration instruction sent by the resource management node, resend a registration request carrying the physical resource information to the resource management node, so as to complete the dynamic change of resource information without operating the node to be registered.

11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1-8.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Resource management method and system for cloud computing operating system

    CN102087618A

  • Management method and system for service resources

    CN102984012A

  • Resource allocation method and device

    CN112463376A