CN117632492A - Resource management method and device, storage medium and electronic equipment - Google Patents

Resource management method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117632492A
CN117632492A CN202311596327.5A CN202311596327A CN117632492A CN 117632492 A CN117632492 A CN 117632492A CN 202311596327 A CN202311596327 A CN 202311596327A CN 117632492 A CN117632492 A CN 117632492A
Authority
CN
China
Prior art keywords
node
containerized
nodes
exited
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311596327.5A
Other languages
Chinese (zh)
Inventor
冯龙
江昕
赵辉
冯春锋
周晓辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202311596327.5A priority Critical patent/CN117632492A/en
Publication of CN117632492A publication Critical patent/CN117632492A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a resource management method, a device, a storage medium and electronic equipment, wherein the method comprises the following steps: receiving a contraction volume instruction; if the container shrinking instruction carries the number of the container node exits, determining a container node set to be selected, determining node indication information of each container node to be selected in the container node set to be selected, and selecting the container nodes with the number equal to the number of the container node exits from the container node set to be selected to obtain the container node set to be exited; and setting each containerization node to be exited in the containerization node set to be exited to a task allocation prohibition state, and closing each containerization node to be exited when each containerization node to be exited meets the containerization node closing condition so as to exit each containerization node to be exited. The embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the elegant capacity reduction of the cluster, thereby maintaining the stability of the cluster.

Description

Resource management method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for resource management, a storage medium, and an electronic device.
Background
Currently, big data clusters are widely applied to various scenes, such as a data query scene, a data analysis scene and the like; a large data cluster may include master nodes (coordinators, also referred to as Coordinator nodes) and worker nodes (worker) (e.g., containerized nodes and physical nodes); the coordinator node is responsible for receiving a query request of a user, distributing the query task to the working node, managing the execution process of the query, managing metadata, returning a result to the user and the like; accordingly, a work node is the actual computing unit that performs a task. When a cluster needs to be subjected to resource management to exit from a containerized node, the related art generally directly stops designating containers in the containerized node to exit from the containerized node, which results in abnormal tasks. Based on this, how to implement resource management to maintain cluster stability without reducing the impact on tasks has not yet proposed a better solution.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a resource management method, apparatus, storage medium, and electronic device, so as to solve the problem that the related technology exits from the designated containerized node, resulting in abnormal tasks; that is, the embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the graceful capacity reduction of the cluster, thereby maintaining the stability of the cluster.
According to an aspect of the present invention, there is provided a resource management method, the method including:
receiving a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task;
if the capacitor shrinking instruction carries the number of the containerized nodes to exit, determining a containerized node set to be selected, and determining node indication information of each containerized node to be selected in the containerized node set to be selected;
based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exit number of the containerized nodes from the containerized node set to be selected so as to obtain a containerized node set to be exited, wherein the containerized node set to be exited comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set;
Setting each to-be-exited containerized node in the to-be-exited containerized node set to be in a task allocation prohibition state, and closing each to-be-exited containerized node when each to-be-exited containerized node meets a containerized node closing condition so as to exit each to-be-exited containerized node; the task allocation prohibition state is used for preventing new tasks from being allocated to the to-be-exited containerized nodes.
According to another aspect of the present invention, there is provided a resource management apparatus including:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a contraction command, the contraction command carries the number of the container node exits and/or the container node exit indication identifier, at least one container is supported to run in one container node, and one container is supported to execute at least one task;
the processing unit is used for determining a to-be-selected containerized node set if the volume shrinking instruction carries the number of the containerized nodes to be exited, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set;
the processing unit is further configured to select, from the set of to-be-selected containerized nodes, a number of containerized nodes equal to the number of the containerized nodes to be exited, based on node indication information of each to-be-selected containerized node, so as to obtain a set of to-be-exited containerized nodes, where the set of to-be-exited containerized nodes includes the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set;
The processing unit is further configured to set each to-be-exited containerized node in the to-be-exited containerized node set to a task allocation prohibition state, and close each to-be-exited containerized node when the each to-be-exited containerized node meets a containerized node closing condition, so as to exit the each to-be-exited containerized node; the task allocation prohibition state is used for preventing new tasks from being allocated to the to-be-exited containerized nodes.
According to another aspect of the invention there is provided an electronic device comprising a processor, and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the above mentioned method.
According to another aspect of the present invention there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above mentioned method.
The embodiment of the invention can receive a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task; if the container shrinking instruction carries the exiting number of the containerized nodes, determining a to-be-selected containerized node set, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set. Correspondingly, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exiting number of the containerized nodes from the containerized node set to be extracted so as to obtain a containerized node set to be extracted, wherein the containerized node set to be extracted comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set, so that the containerized node more suitable for exiting can be selected. Further, each of the containerized nodes to be exited in the containerized node set to be exited can be set to be in a task allocation prohibition state, and each containerized node to be exited is closed when each of the containerized nodes to be exited meets the containerized node closing condition so as to exit each containerized node to be exited; the task allocation prohibition state is used for preventing new tasks from being allocated to each node to be exited from the containerization, so that smooth transition of the nodes can be realized. Therefore, the embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the graceful capacity reduction of the cluster, thereby maintaining the stability of the cluster.
Drawings
Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments with reference to the following drawings, in which:
FIG. 1 illustrates a flow diagram of a resource management method according to an exemplary embodiment of the present invention;
FIG. 2 shows a schematic diagram of a coordinator node and worker node interaction, according to an exemplary embodiment of the present invention;
FIG. 3 illustrates a flow diagram of another resource management method according to an exemplary embodiment of the present invention;
FIG. 4 illustrates a flow diagram of yet another resource management method according to an exemplary embodiment of the present invention;
FIG. 5 shows a schematic block diagram of a resource management device according to an exemplary embodiment of the present invention;
fig. 6 shows a block diagram of an exemplary electronic device that can be used to implement an embodiment of the invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While the invention is susceptible of embodiment in the drawings, it is to be understood that the invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the invention. It should be understood that the drawings and embodiments of the invention are for illustration purposes only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below. It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It should be noted that, the execution body of the resource management method provided by the embodiment of the present invention may be one or more electronic devices, which is not limited in this aspect of the present invention; the electronic device may be a terminal (i.e. a client) or a server, and when the execution body includes a plurality of electronic devices and the plurality of electronic devices include at least one terminal and at least one server, the resource management method provided by the embodiment of the present invention may be executed jointly by the terminal and the server; specifically, the execution body of the resource management method provided by the embodiment of the present invention may be a coordinator node in a big data cluster, that is, the coordinator node may be composed of one or more electronic devices. Accordingly, the terminals referred to herein may include, but are not limited to: smart phones, tablet computers, notebook computers, desktop computers, smart watches, smart voice interaction devices, smart appliances, vehicle terminals, aircraft, and so on. The server mentioned herein may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing (cloud computing), cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network ), and basic cloud computing services such as big data and artificial intelligence platforms, and so on.
Based on the above description, the embodiments of the present invention propose a resource management method that can be performed by the above-mentioned coordinator node, i.e., that can be performed by an electronic device as a coordinator node; as shown in fig. 1, the resource management method may include the following steps S101 to S104:
s101, receiving a capacity reduction instruction, wherein the capacity reduction instruction carries the number of the container node exits and/or the container node exit indication identification, and one container supports at least one container to be operated in one container node and one container supports at least one task to be executed.
Wherein, the containerized node may be a virtualized node that builds a virtual machine in the electronic device to implement.
In the embodiment of the present invention, a user (i.e., a target object, such as a manager) may perform a shrinking operation through a client, and then the coordinator node may receive a shrinking instruction sent by the client, where information carried by the shrinking instruction includes information indicated by the shrinking operation, that is, when information indicated by the shrinking operation includes the number of containerized node exits, information carried by the shrinking instruction may include the number of containerized node exits (i.e., the shrinking instruction may carry the number of containerized node exits); when the information indicated by the scaling operation includes a containerized node exit indication identifier, the information carried by the scaling instruction may include the containerized node exit indication identifier, and so on.
Alternatively, one containerized node exit indication identifier may include an IP (Internet Protocol, protocol interconnected between networks) and a port corresponding to the respective containerized node, in which case the respective containerized node may be determined by the IP and the port; alternatively, one containerized node exit indication identifier may include the IP and containerized node number corresponding to the respective containerized node, in which case the respective containerized node may be determined by the IP and containerized node number, and so on; the embodiment of the present invention is not limited thereto.
Optionally, the coordinator node may further receive a capacity expansion instruction sent by the client, where the capacity expansion instruction may carry a capacity expansion number; in this case, the coordinator node may newly add a large number of containerized nodes in a large data cluster (i.e., cluster).
S102, if the capacitor shrinking instruction carries the exiting number of the containerized nodes, determining a containerized node set to be selected, and determining node indication information of each containerized node to be selected in the containerized node set to be selected.
Alternatively, all the containerized nodes in the cluster may be used as the containerized nodes to be selected, in which case the set of containerized nodes to be selected may include all the containerized nodes in the cluster; alternatively, the non-closed containerized nodes (which may also be referred to as active containerized nodes) in the cluster may all be considered as candidate containerized nodes, in which case the candidate containerized node set may include all non-closed containerized nodes in the cluster, and so on; the embodiment of the present invention is not limited thereto.
S103, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exiting number of containerized nodes from the containerized node set to be extracted, so as to obtain a containerized node set to be extracted, wherein the containerized node set to be extracted comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set.
Optionally, the coordinator node may sequentially select one containerized node with the minimum node indication information from the unselected containerized nodes included in the to-be-selected containerized node set until the selected containerized node exits from the plurality of containerized nodes, so as to obtain the selected containerized node.
Optionally, the coordinator node may sort the respective containerized nodes to be selected according to the order of the node indication information of the respective containerized nodes to be selected from small to large, obtain a sorting result, select the previous containerized node from the sorting result, withdraw the number of containerized nodes, and so on.
S104, setting each containerization node to be exited in the containerization node set to be in a task allocation prohibition state, and closing each containerization node to be exited when each containerization node to be exited meets the containerization node closing condition so as to exit each containerization node to be exited; wherein the task allocation prohibition state is used for preventing new tasks from being allocated to each node to be exited from the containerization.
The new task may refer to a task whose generation time is later than the task allocation prohibition state setting time, or may refer to a task whose allocation time is later than the task allocation prohibition state setting time, or the like.
Optionally, when each of the to-be-exited containerized nodes in the to-be-exited containerized node set is set to the task allocation prohibition state, the coordinator node may send an update status instruction to any of the to-be-exited containerized nodes for each of the to-be-exited containerized nodes to update the task allocation status of any of the to-be-exited containerized nodes to the task allocation prohibition state, i.e., update the task allocation permission status to the task allocation prohibition state, so as to set any of the to-be-exited containerized nodes to the task allocation prohibition state, as shown in fig. 2.
Optionally, the coordinator node may also use a task allocation prohibition state label as a task allocation state label of any node to be logged out of the containerization, one task allocation state label may be used to indicate a task allocation state of the corresponding containerization node, and one task allocation prohibition state label may be used to indicate that the task allocation state of the corresponding containerization node is the task allocation prohibition state, so that any node to be logged out of the containerization node may be set to be the task allocation prohibition state, and so on. Specifically, the coordinator node may store the node identifier and the task allocation prohibition state label of any node to be logged out of the containerization node, so as to implement that the task allocation prohibition state label is used as the task allocation state label of any node to be logged out of the containerization node. Optionally, the node identifier may include a node IP and a port, may also include a node IP and a node number, and so on; the embodiment of the present invention is not limited thereto. Alternatively, the task allocation prohibition tag may be 0 or 1, which is not limited in the embodiment of the present invention.
The embodiment of the invention can receive a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task; if the container shrinking instruction carries the exiting number of the containerized nodes, determining a to-be-selected containerized node set, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set. Correspondingly, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exiting number of the containerized nodes from the containerized node set to be extracted so as to obtain a containerized node set to be extracted, wherein the containerized node set to be extracted comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set, so that the containerized node more suitable for exiting can be selected. Further, each of the containerized nodes to be exited in the containerized node set to be exited can be set to be in a task allocation prohibition state, and each containerized node to be exited is closed when each of the containerized nodes to be exited meets the containerized node closing condition so as to exit each containerized node to be exited; the task allocation prohibition state is used for preventing new tasks from being allocated to each node to be exited from the containerization, so that smooth transition of the nodes can be realized. Therefore, the embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the graceful capacity reduction of the cluster, thereby maintaining the stability of the cluster.
Based on the above description, the embodiment of the invention also provides a more specific resource management method. Accordingly, the resource management method may be performed by the above-mentioned coordinator node, i.e., may be performed by an electronic device as a coordinator node; referring to fig. 3, the resource management method may include the following steps S301 to S306:
s301, receiving a capacity reduction instruction, wherein the capacity reduction instruction carries the number of the container node exits and/or the container node exit indication identifier, and one container supports at least one container to be operated in one container node and one container supports at least one task to be executed.
In the embodiment of the invention, one containerized node can be a working node in a prest cluster, the prest cluster can be realized through a Kubernetes environment, and the one containerized node is a deployment unit in the prest cluster; that is, the big data cluster mentioned in the embodiment of the present invention may be a prest cluster, and the execution subject of the method mentioned in the embodiment of the present invention may be a coordinator node in the prest cluster. Wherein prest is a multi-functional open source distributed SQL (Structured Query Language ) query engine, kubernetes is an open source container orchestration and management platform.
Based on this, a containerized node may refer to Pod, which is the smallest deployable unit in Kubernetes, that is used to combine one or more containers (Docker (an open-source application container engine) or other container runtime) with associated storage resources, network configuration, and some shared context, etc. Pod is an abstract concept in the Kubernetes cluster, intended to support the deployment and expansion of containers. It should be noted that, after receiving the contraction command, the coordinator node may trigger the containerized node to exit the service, i.e. may trigger the Pod exit service (exitServicePod); alternatively, the coordinator node may comprise a server information resource (also denoted ServerInfoResource), in which case the coordinator node may trigger an exit service through the server information resource, that is, may trigger an exit service when the server information resource receives the number of containerized node exits and/or the containerized node exit indication identifier. Optionally, the coordinator node may further include a discovery node manager (also denoted as discovery node manager), in which case an exit service instruction may be sent to the discovery node manager, and the coordinator node may acquire the number of tasks of each of the containerized nodes to be selected through the discovery node manager.
Further, the working nodes in the prest cluster may include M physical nodes and N containerized nodes, where M and N are non-negative integers, and one physical node may be a single node, that is, may refer to an electronic device that is not virtualized; accordingly, the electronic device in which the containerized node resides may support being partitioned into at least one containerized node. The prest cluster may store a configuration file, where the configuration file supports configuration of physical node labels of each physical node in the M physical nodes and container labels of each container node in the N container nodes, one physical node label is used to indicate that the corresponding working node is a physical node, and one container label is used to indicate that the corresponding working node is a container node.
Alternatively, the physical node label may be 0 and the containerized label may be 1; alternatively, the physical node label may be a, the containerized label may be b, etc.; the embodiment of the present invention is not limited thereto.
Therefore, when hybrid deployment of prest clusters is realized, the embodiment of the invention can distinguish the physical nodes and the containerized nodes by marking the working nodes, so that the containerized nodes can be more conveniently and more conveniently added or removed. This labeled policy not only helps to better manage the different types of nodes, but also can improve the flexibility and maintainability of the system, thereby more efficiently managing the hybrid deployment.
In other embodiments, the big data cluster may also be a Hadoop cluster in a Kubernetes environment, which is not limited in the present invention. Optionally, the Presto cluster in the Kubernetes environment is preferred as the big data cluster in the embodiment of the invention; for ease of explanation, the following description will take prest cluster in Kubernetes environment as big data cluster as an example.
S302, if the capacitor shrinking instruction carries the exiting number of the containerized nodes, determining a containerized node set to be selected, and determining node indication information of each containerized node to be selected in the containerized node set to be selected.
In one embodiment, for any one of the set of containerized nodes to be selected, the coordinator node may determine the number of tasks of the any one of the containerized nodes to be selected, and use the number of tasks of the any one of the containerized nodes to be selected as the node indication information of the any one of the containerized nodes to be selected. The task number of one containerized node may refer to the number of active tasks of the corresponding containerized node, that is, the number of tasks to be completed in the corresponding containerized node; alternatively, the number of tasks of one containerized node may be: the sum of the number of tasks in each container in the corresponding containerized node can be the sum of the number of tasks to be completed in each container in the corresponding containerized node.
Specifically, the coordinator node may request the number of tasks of any one of the containerized nodes to any one of the containerized nodes, and accordingly, may receive the number of tasks returned by any one of the containerized nodes, as shown in fig. 2; the task number of any one of the containerized nodes may be obtained by the coordinator node from task resources (also may be denoted as task resource) of any one of the containerized nodes.
In another embodiment, the coordinator node may determine the resource occupancy information of any one of the containerized nodes, and determine the node indication information of any one of the containerized nodes using the resource occupancy information of any one of the containerized nodes. The resource occupation information of one containerized node can be the memory usage of the corresponding containerized node, the CPU (Central Processing Unit ) usage of the corresponding containerized node, the sum of the memory usage and the CPU usage, and the like; the embodiment of the present invention is not limited thereto. Specifically, the resource occupation information of any one of the containerized nodes to be selected can be used as the node indication information of any one of the containerized nodes to be selected; alternatively, the reciprocal of the resource occupation information of any one of the containerized nodes to be selected may be used as the node indication information of any one of the containerized nodes to be selected. Alternatively, the resource occupancy information of one containerized node may be the sum of the resource occupancy information of each container in the corresponding containerized node.
In yet another embodiment, the coordinator node may determine the task number and the resource occupancy information of any one of the containerized nodes to be selected, and determine the node indication information of any one of the containerized nodes to be selected based on the task number and the resource occupancy information of any one of the containerized nodes to be selected. Specifically, the task number and the resource occupation information of any one of the containerized nodes to be selected can be weighted and summed, and the weighted and summed result is used as node indication information of any one of the containerized nodes to be selected; alternatively, the number of tasks and the weight of the resource occupation information may be set empirically, or may be set according to actual requirements, which is not limited in the embodiment of the present invention. Alternatively, multiplication may be performed on the number of tasks and the reciprocal of the resource occupation information of any one of the containerized nodes to be selected, and the multiplication result may be used as node indication information of any one of the containerized nodes to be selected, and so on.
S303, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exit number of the containerized nodes from the containerized node set to be selected so as to obtain a containerized node set to be exited, wherein the containerized node set to be exited comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set.
Optionally, when the number of the to-be-selected containerized nodes in the to-be-selected containerized node set is greater than the exit number of the containerized nodes, triggering and executing to select containerized nodes with the exit number of the containerized nodes from the to-be-selected containerized node set so as to determine each to-be-exited containerized node; when the number of the to-be-selected containerized nodes in the to-be-selected containerized node set is smaller than or equal to the number of the to-be-selected containerized nodes, each to-be-selected containerized node can be used as the to-be-selected containerized node.
In the embodiment of the invention, if the capacitor shrinking instruction carries the containerized node exit indication identifier, the coordinator node can determine to appoint to exit from the containerized node based on the containerized node exit indication identifier; based on this, the designated out-of-containerized node may be regarded as the out-of-containerized node such that the set of out-of-containerized nodes includes the designated out-of-containerized node.
It should be understood that the number of containerized node exit indication identifiers that may be carried by the shrink instruction may be one or more; when the number of the containerization node exit indication identifiers carried by the contraction instruction is multiple, the number of the appointed exit containerization nodes can be multiple, and then each appointed exit containerization node in the multiple appointed exit containerization nodes can be used as a containerization node to be exited, so that the containerization node set to be exited can comprise the multiple appointed exit containerization nodes.
In the embodiment of the invention, if the container shrinking instruction carries the number of the container node exits and the container node exit indication identifier, the node set to be exited can comprise the selected container node and the appointed exit container node.
It can be seen that the embodiments of the present invention can provide two different strategies to meet different needs and situations; on the one hand, according to the number of the container nodes to be withdrawn, the node which can be withdrawn (i.e. the container nodes to be withdrawn) can be intelligently selected according to the current state (such as any state or active state) of each container node and node indication information (such as load condition, i.e. the number of tasks, etc.), so as to ensure that the stability and performance of the cluster are not affected. On the other hand, the capacity reduction can be performed by containerizing the node exit indication mark, and the method is more visual and accurate and is suitable for the situation needing finer control or the situation needing the exit of a specific node. Based on the two strategies, the prest service can be provided with greater flexibility to meet different business requirements, so that the prest cluster can be managed more conveniently and customizable.
S304, setting each containerization node to be exited in the containerization node set to be in a task allocation prohibition state, and closing each containerization node to be exited when each containerization node to be exited meets the containerization node closing condition; wherein the task allocation prohibition state is used for preventing new tasks from being allocated to each node to be exited from the containerization.
In one embodiment, for any of the to-be-exited containerized nodes in the to-be-exited containerized node set, the coordinator node may determine a task state of each of the allocated tasks in any of the to-be-exited containerized nodes, and if the task state of each of the allocated tasks is a task completion state, may determine that any of the to-be-exited containerized nodes satisfies the containerized node shutdown condition, that is, if all of the tasks in any of the to-be-exited containerized nodes have been completed, may determine that any of the to-be-exited containerized nodes satisfies the containerized node shutdown condition. Wherein an assigned task to be exited from the containerized node may include: and in the corresponding to-be-exited containerized node, the corresponding to-be-exited containerized node is forbidden to allocate tasks which are allocated before the setting time of the task allocation prohibition state.
Optionally, the coordinator node may acquire a task state of each allocated task from any node to be logged out of the containerization node, so as to determine a task state of each allocated task. Optionally, the state of any node to be recycled may be changed to a closed state, so as to close any node to be recycled. Based on the method, when the Pod capacity reduction scene is faced, 99.9% of tasks on the prest service can be ensured to be successfully completed, and the stability and usability of the prest cluster are ensured.
In another embodiment, the coordinator node may determine a preset waiting duration threshold, and determine that any node to be logged out satisfies the containerized node closing condition if the waiting closing duration of any node to be logged out reaches the preset waiting duration threshold; the waiting closing time length is the difference value between the current system time and the determined closing starting time of any node to be exited from the containerization; optionally, the determining the closing start time may be set for the task allocation prohibition state of any node to be logged out, or may refer to the determining time of any node to be logged out, which is not limited in the embodiment of the present invention. Optionally, the preset waiting duration threshold may be set empirically, or may be set according to actual requirements, which is not limited in the embodiment of the present invention.
Optionally, when any node to be logged out satisfies the container node closing condition, the coordinator node may send a request closing instruction to any node to be logged out, so as to change any node to be logged out into a closing state (i.e. change the node state of any node to be logged out into a closing state), thereby implementing closing of any node to be logged out. In other embodiments, the determining whether any node to be logged out satisfies the container node closing condition, and the closing process when the container node closing condition is satisfied may also be performed by any node to be logged out, which is not limited in the present invention. Alternatively, a worker node may include a graceful shutdown handler (also referred to as graceful shutdown handler), in which case the graceful shutdown handler in a containerized node may perform the shutdown operation upon receiving a request shutdown instruction sent by the coordinator node.
In the embodiment of the invention, the coordinator node can consider the state and the resource utilization condition of each working node when the tasks are distributed, namely, the tasks can be distributed to the active working nodes, and the tasks are preferably distributed to the working nodes with less occupied resources, so as to ensure the balance and the high efficiency of the task distribution. Accordingly, when a node needs to be exited, the containerized node to be exited can be subjected to state modification (i.e. set to a task allocation prohibition state), and temporarily shielded to prevent new tasks from being allocated to the node, which not only helps to ensure smooth transition when the node exits, but also ensures that other nodes can continue to effectively execute tasks without being affected by the exiting node. Therefore, the embodiment of the invention is beneficial to minimizing system interruption and ensuring continuity and availability of data query and processing through task allocation state modification, thereby improving the reliability of the whole prest cluster and avoiding unnecessary impact on system performance. Based on the method, the embodiment of the invention can improve the discovery sensing capability of Presto service by prohibiting the task allocation state, actively shield the containerized node to be exited, and eliminate the problems of failure in exiting the containerized node or failure in task caused by inaccurate service discovery.
And S305, performing health check on each containerized node to be exited at intervals of a preset check time period to determine whether each containerized node to be exited is closed.
Optionally, the preset checking duration may be set empirically, or may be set according to actual requirements, which is not limited in the embodiment of the present invention. Optionally, the above health check on each node to be logged out may refer to a check on the closed state of each node to be logged out, in which case, when any node to be logged out is checked to be in the closed state, it may be determined that any node to be logged out is closed, so that the closed node to be logged out is detected.
Specifically, for any node to be ejected from the set of containerized nodes to be ejected, the coordinator node may acquire closing instruction information of any node to be ejected from any containerized node to be ejected, so as to determine whether any node to be ejected is closed according to the closing instruction information of any node to be ejected, so as to implement health check on any node to be ejected. Optionally, the shutdown instruction information may be shutdown instruction information or non-shutdown instruction information, where the shutdown instruction information may be used to indicate that any node to be exited is shutdown, and the non-shutdown instruction information may be used to indicate that any node to be exited is not shutdown; alternatively, the closed indication information and the non-closed indication information may be empirically set, or may be set according to actual requirements, which is not limited in the embodiment of the present invention; for example, the closed instruction information may be True, and the non-closed instruction information may be False; alternatively, the closed indication information may be "yes", the non-closed indication information may be "no", and so on.
Optionally, the coordinator node may include a remote node state (also may be denoted as RemoteNodeState), and accordingly, the coordinator node may request closure indication information from any node to be logged out of the container, so as to obtain a node state of any node to be logged out of the container, that is, the coordinator node may synchronize a node state (such as a closed state or an unoccluded state) of any node to be logged out of the container. Alternatively, one working node may include a server information resource, and then the coordinator node may acquire the shutdown instruction information from the server information resource included in any node to be exited from the containerization.
And S306, if the closed node to be ejected is detected, releasing resources of the closed node to be ejected, and ejecting the closed node to be ejected to realize ejection of each node to be ejected.
The closed node to be ejected refers to the node to be ejected in the closed state. It should be appreciated that when each of the to-be-retired containerized nodes is determined to be a closed to-be-retired containerized node and is retired, the retiring of each to-be-retired containerized node may be accomplished.
Optionally, when the resource release is performed on the closed node to be logged out, the memory release and the CPU release may be performed on the closed node to be logged out, so as to implement the resource release on the closed node to be logged out.
In the embodiment of the invention, after releasing the resources of the closed node to be logged out, the coordinator node can destroy the closed node to be logged out immediately so as to complete the logging-out process of the closed node to be logged out.
As can be seen from the above, the embodiment of the present invention may wait for any node to be logged out to meet the condition of the container node closing (e.g. the task execution on any node to be logged out is finished), and then close any node to be logged out (e.g. change any node to be logged out to be closed state), so as to determine the closing instruction information of any node to be logged out from any node to be logged out, so as to determine whether any node to be logged out is in the closed state (i.e. determine whether any node to be logged out is closed), that is, the coordinator node may synchronize the closed state of any node to be logged out, based on which the coordinator node may log out any node to be logged out, as shown in fig. 4.
The embodiment of the invention can receive a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task; if the container shrinking instruction carries the exiting number of the containerized nodes, determining a to-be-selected containerized node set, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set. Correspondingly, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exiting number of the containerized nodes from the containerized node set to be extracted so as to obtain a containerized node set to be extracted, wherein the containerized node set to be extracted comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set; then, each containerization node to be exited in the containerization node set to be exited can be set to be in a task allocation prohibition state, and each containerization node to be exited is closed when each containerization node to be exited meets the containerization node closing condition; the task allocation prohibition state is used for preventing new tasks from being allocated to the various nodes to be exited from the containerization. Further, health inspection can be performed on each containerized node to be exited at intervals of a preset inspection time period to determine whether each containerized node to be exited is closed or not; and if the closed node to be exited is detected, releasing resources of the closed node to be exited, and exiting the closed node to be exited to realize exiting of each node to be exited. Therefore, the embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the graceful capacity reduction of the cluster, thereby keeping the stability of the cluster; in this case, when the Pod of prest exits, the prest working node Pod can be terminated gracefully and stably on the premise of ensuring the task and the data integrity, so that the negative influence of the expansion and contraction of the Pod on the prest cluster is effectively avoided, the availability and controllability of prest service are improved, and the prest is more powerful and stable in the Kubernetes environment, thereby better adapting to the continuously changing requirements and environment.
Based on the description of the related embodiments of the resource management method, the embodiments of the present invention also provide a resource management device, which may be a computer program (including program code) running in an electronic device; as shown in fig. 5, the resource management device may include a receiving unit 501 and a processing unit 502. The resource management device may perform the resource management method shown in fig. 1 or fig. 3, i.e. the resource management device may operate the above units:
a receiving unit 501, configured to receive a shrink tolerance instruction, where the shrink tolerance instruction carries a containerized node exit number and/or a containerized node exit indication identifier, and one containerized node supports running at least one container, and one container supports executing at least one task;
the processing unit 502 is configured to determine a set of containerized nodes to be selected if the container shrinking instruction carries the number of the containerized nodes to be exited, and determine node indication information of each containerized node to be selected in the set of containerized nodes to be selected;
the processing unit 502 is further configured to select, from the set of to-be-selected containerized nodes, a number of containerized nodes equal to the number of exits of the containerized nodes based on node indication information of each to-be-selected containerized node, so as to obtain a set of to-be-exited containerized nodes, where the set of to-be-exited containerized nodes includes the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set;
The processing unit 502 is further configured to set each of the to-be-exited containerized nodes in the to-be-exited containerized node set to a task allocation prohibition state, and close each of the to-be-exited containerized nodes to exit each of the to-be-exited containerized nodes when each of the to-be-exited containerized nodes satisfies a containerized node closing condition; the task allocation prohibition state is used for preventing new tasks from being allocated to the to-be-exited containerized nodes.
In one embodiment, when determining the node indication information of each of the candidate containerized nodes in the candidate containerized node set, the processing unit 502 may be specifically configured to:
determining the task number of any one of the containerized nodes to be selected aiming at any one of the containerized nodes to be selected, and taking the task number of the any one of the containerized nodes to be selected as node indication information of the any one of the containerized nodes to be selected; or,
determining the resource occupation information of any one of the containerized nodes, and determining the node indication information of any one of the containerized nodes by adopting the resource occupation information of any one of the containerized nodes; or,
And determining the task number and the resource occupation information of any one of the containerized nodes, and determining the node indication information of any one of the containerized nodes based on the task number and the resource occupation information of any one of the containerized nodes.
In another embodiment, the processing unit 502 may be further configured to:
if the capacitor shrinking instruction carries the containerized node exit indication identifier, determining to specify exiting containerized nodes based on the containerized node exit indication identifier;
and taking the appointed ejection containerized node as an ejection containerized node to be ejected, so that the ejection containerized node set comprises the appointed ejection containerized node.
In another embodiment, the processing unit 502 may be further configured to:
determining the task state of each allocated task in any one of the to-be-exited containerized nodes aiming at any one of the to-be-exited containerized nodes in the to-be-exited containerized node set, and determining that the any one of the to-be-exited containerized nodes meets the containerized node closing condition if the task state of each allocated task is a task completion state; or,
determining a preset waiting time threshold, and if the waiting closing time of any one of the nodes to be exited reaches the preset waiting time threshold, determining that any one of the nodes to be exited meets the closing condition of the containerized node; the waiting closing time length is the difference between the current system time and the determined closing starting time of any node to be exited from the containerization.
In another embodiment, the processing unit 502, when exiting the respective nodes to be exited from the container, may be specifically configured to:
health inspection is carried out on each containerized node to be exited at intervals of preset inspection time length to determine whether each containerized node to be exited is closed or not;
and if the closed node to be exited is detected, releasing resources of the closed node to be exited and exiting the closed node to be exited to realize the exiting of each node to be exited.
In another embodiment, one containerized node is a working node in a prest cluster, the prest cluster is implemented through a Kubernetes environment, and one containerized node is a deployment unit in the prest cluster.
In another embodiment, the working nodes in the prest cluster include M physical nodes and N containerized nodes, where M and N are non-negative integers;
the prest cluster stores a configuration file, and the configuration file supports configuration of physical node labels of all physical nodes in the M physical nodes and container labels of all container nodes in the N container nodes, wherein one physical node label is used for indicating that a corresponding working node is a physical node, and one container label is used for indicating that the corresponding working node is a container node.
According to one embodiment of the invention, the steps involved in the method shown in fig. 1 or 3 may be performed by the units in the resource management device shown in fig. 5. For example, step S101 shown in fig. 1 may be performed by the receiving unit 501 shown in fig. 5, and steps S102 to S104 may each be performed by the processing unit 502 shown in fig. 5. As another example, step S301 shown in fig. 3 may be performed by the receiving unit 501 shown in fig. 5, steps S302-S306 may each be performed by the processing unit 502 shown in fig. 5, and so on.
According to another embodiment of the present invention, each unit in the resource management device shown in fig. 5 may be separately or completely combined into one or several other units, or some unit(s) thereof may be further split into a plurality of units with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present invention. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present invention, any resource management device may also include other units, and in practical applications, these functions may also be implemented with assistance from other units, and may be implemented by cooperation of multiple units.
According to another embodiment of the present invention, a resource management device as shown in fig. 5 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods as shown in fig. 1 or 3 on a general-purpose electronic device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and implementing the resource management method of the embodiment of the present invention. The computer program may be recorded on, for example, a computer storage medium, and loaded into and run in the above-described electronic device through the computer storage medium.
The embodiment of the invention can receive a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task; if the container shrinking instruction carries the exiting number of the containerized nodes, determining a to-be-selected containerized node set, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set. Correspondingly, based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exiting number of the containerized nodes from the containerized node set to be extracted so as to obtain a containerized node set to be extracted, wherein the containerized node set to be extracted comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set, so that the containerized node more suitable for exiting can be selected. Further, each of the containerized nodes to be exited in the containerized node set to be exited can be set to be in a task allocation prohibition state, and each containerized node to be exited is closed when each of the containerized nodes to be exited meets the containerized node closing condition so as to exit each containerized node to be exited; the task allocation prohibition state is used for preventing new tasks from being allocated to each node to be exited from the containerization, so that smooth transition of the nodes can be realized. Therefore, the embodiment of the invention can realize resource management under the condition of reducing the influence on the task so as to realize the graceful capacity reduction of the cluster, thereby maintaining the stability of the cluster.
Based on the description of the method embodiment and the apparatus embodiment, the exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to an embodiment of the invention when executed by the at least one processor.
The exemplary embodiments of the present invention also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present invention.
The exemplary embodiments of the invention also provide a computer program product comprising a computer program, wherein the computer program, when being executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the invention.
Referring to fig. 6, a block diagram of an electronic device 600 that may be a server or a client of the present invention will now be described, which is an example of a hardware device that may be applied to aspects of the present invention. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the electronic device 600 are connected to the I/O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 may be any type of device capable of inputting information to the electronic device 600, and the input unit 606 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. The output unit 607 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 608 may include, but is not limited to, magnetic disks, optical disks. The communication unit 609 allows the electronic device 600 to exchange information/data with other devices through a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the resource management method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 600 via the ROM 602 and/or the communication unit 609. In some embodiments, the computing unit 601 may be configured to perform the resource management method by any other suitable means (e.g., by means of firmware).
Program code for carrying out methods of the present invention may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It is also to be understood that the foregoing is merely illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (10)

1. A method of resource management, comprising:
receiving a shrink volume instruction, wherein the shrink volume instruction carries the exit number of containerized nodes and/or the exit indication mark of the containerized nodes, at least one container is supported to run in one containerized node, and one container is supported to execute at least one task;
if the capacitor shrinking instruction carries the number of the containerized nodes to exit, determining a containerized node set to be selected, and determining node indication information of each containerized node to be selected in the containerized node set to be selected;
based on node indication information of each containerized node to be selected, selecting containerized nodes with the number equal to the exit number of the containerized nodes from the containerized node set to be selected so as to obtain a containerized node set to be exited, wherein the containerized node set to be exited comprises the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set;
Setting each to-be-exited containerized node in the to-be-exited containerized node set to be in a task allocation prohibition state, and closing each to-be-exited containerized node when each to-be-exited containerized node meets a containerized node closing condition so as to exit each to-be-exited containerized node; the task allocation prohibition state is used for preventing new tasks from being allocated to the to-be-exited containerized nodes.
2. The method of claim 1, wherein the determining node indication information for each of the candidate containerized nodes in the set of candidate containerized nodes comprises:
determining the task number of any one of the containerized nodes to be selected aiming at any one of the containerized nodes to be selected, and taking the task number of the any one of the containerized nodes to be selected as node indication information of the any one of the containerized nodes to be selected; or,
determining the resource occupation information of any one of the containerized nodes, and determining the node indication information of any one of the containerized nodes by adopting the resource occupation information of any one of the containerized nodes; or,
And determining the task number and the resource occupation information of any one of the containerized nodes, and determining the node indication information of any one of the containerized nodes based on the task number and the resource occupation information of any one of the containerized nodes.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
if the capacitor shrinking instruction carries the containerized node exit indication identifier, determining to specify exiting containerized nodes based on the containerized node exit indication identifier;
and taking the appointed ejection containerized node as an ejection containerized node to be ejected, so that the ejection containerized node set comprises the appointed ejection containerized node.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
determining the task state of each allocated task in any one of the to-be-exited containerized nodes aiming at any one of the to-be-exited containerized nodes in the to-be-exited containerized node set, and determining that the any one of the to-be-exited containerized nodes meets the containerized node closing condition if the task state of each allocated task is a task completion state; or,
Determining a preset waiting time threshold, and if the waiting closing time of any one of the nodes to be exited reaches the preset waiting time threshold, determining that any one of the nodes to be exited meets the closing condition of the containerized node; the waiting closing time length is the difference between the current system time and the determined closing starting time of any node to be exited from the containerization.
5. The method according to claim 1 or 2, wherein said exiting said respective to-be-exited containerized node comprises:
health inspection is carried out on each containerized node to be exited at intervals of preset inspection time length to determine whether each containerized node to be exited is closed or not;
and if the closed node to be exited is detected, releasing resources of the closed node to be exited and exiting the closed node to be exited to realize the exiting of each node to be exited.
6. The method of claim 1 or 2, wherein one containerized node is a working node in a prest cluster, the prest cluster being implemented by a Kubernetes environment, and one containerized node is a deployment unit in the prest cluster.
7. The method of claim 6, wherein the working nodes in the prest cluster comprise M physical nodes and N containerized nodes, M and N each being a non-negative integer;
the prest cluster stores a configuration file, and the configuration file supports configuration of physical node labels of all physical nodes in the M physical nodes and container labels of all container nodes in the N container nodes, wherein one physical node label is used for indicating that a corresponding working node is a physical node, and one container label is used for indicating that the corresponding working node is a container node.
8. A resource management apparatus, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a contraction command, the contraction command carries the number of the container node exits and/or the container node exit indication identifier, at least one container is supported to run in one container node, and one container is supported to execute at least one task;
the processing unit is used for determining a to-be-selected containerized node set if the volume shrinking instruction carries the number of the containerized nodes to be exited, and determining node indication information of each to-be-selected containerized node in the to-be-selected containerized node set;
The processing unit is further configured to select, from the set of to-be-selected containerized nodes, a number of containerized nodes equal to the number of the containerized nodes to be exited, based on node indication information of each to-be-selected containerized node, so as to obtain a set of to-be-exited containerized nodes, where the set of to-be-exited containerized nodes includes the selected containerized nodes; the node indication information of each containerized node in the selected containerized nodes is smaller than or equal to the node indication information of each containerized node except the selected containerized node in the to-be-selected containerized node set;
the processing unit is further configured to set each to-be-exited containerized node in the to-be-exited containerized node set to a task allocation prohibition state, and close each to-be-exited containerized node when the each to-be-exited containerized node meets a containerized node closing condition, so as to exit the each to-be-exited containerized node; the task allocation prohibition state is used for preventing new tasks from being allocated to the to-be-exited containerized nodes.
9. An electronic device, comprising:
A processor; and
a memory in which a program is stored,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-7.
CN202311596327.5A 2023-11-27 2023-11-27 Resource management method and device, storage medium and electronic equipment Pending CN117632492A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311596327.5A CN117632492A (en) 2023-11-27 2023-11-27 Resource management method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311596327.5A CN117632492A (en) 2023-11-27 2023-11-27 Resource management method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117632492A true CN117632492A (en) 2024-03-01

Family

ID=90022852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311596327.5A Pending CN117632492A (en) 2023-11-27 2023-11-27 Resource management method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117632492A (en)

Similar Documents

Publication Publication Date Title
CN111406250B (en) Provisioning using prefetched data in a serverless computing environment
CN112650576B (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN109840142A (en) Thread control method, device, electronic equipment and storage medium based on cloud monitoring
CN113849312B (en) Data processing task allocation method and device, electronic equipment and storage medium
CN114416352A (en) Computing resource allocation method and device, electronic equipment and storage medium
CN112231108A (en) Task processing method and device, computer readable storage medium and server
EP4060496A2 (en) Method, apparatus, device and storage medium for running inference service platform
CN114911598A (en) Task scheduling method, device, equipment and storage medium
CN113297031A (en) Container group protection method and device in container cluster
CN113032093B (en) Distributed computing method, device and platform
CN113590329A (en) Resource processing method and device
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN117632492A (en) Resource management method and device, storage medium and electronic equipment
CN113032092B (en) Distributed computing method, device and platform
CN113282850A (en) Resource label management method, device, electronic equipment, system and storage medium
CN114968505A (en) Task processing system, method, device, apparatus, storage medium, and program product
CN113722079B (en) Task scheduling distribution method, device, equipment and medium based on target application
CN114546705B (en) Operation response method, operation response device, electronic apparatus, and storage medium
CN111741097B (en) Method for tenant to monopolize node, computer equipment and storage medium
CN116594764A (en) Application program updating method and device, electronic equipment and storage medium
CN115390992A (en) Virtual machine creating method, device, equipment and storage medium
CN109246167B (en) Container scheduling method and device
CN115086335A (en) Container cloud node dynamic adding method and device, electronic equipment and storage medium
CN115617454A (en) Containerization service deployment method, device, equipment and storage medium
CN115827157A (en) Container management method and device based on container arrangement engine and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination