CN111190719A - Method, device, medium and electronic equipment for optimizing cluster resource allocation - Google Patents

Method, device, medium and electronic equipment for optimizing cluster resource allocation Download PDF

Info

Publication number
CN111190719A
CN111190719A CN201811354570.5A CN201811354570A CN111190719A CN 111190719 A CN111190719 A CN 111190719A CN 201811354570 A CN201811354570 A CN 201811354570A CN 111190719 A CN111190719 A CN 111190719A
Authority
CN
China
Prior art keywords
container
physical machine
computing node
local configuration
information
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
CN201811354570.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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811354570.5A priority Critical patent/CN111190719A/en
Publication of CN111190719A publication Critical patent/CN111190719A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Abstract

The embodiment of the invention provides a method for optimizing cluster resource allocation, a device for optimizing cluster resource allocation, a computer readable medium and electronic equipment, wherein the method for optimizing cluster resource allocation comprises the following steps: acquiring updating information of the container specification; and modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the updating information so as to enable the modified local configuration occupied by the container to meet the requirement of the updating information, wherein the modified local configuration of the physical machine is used for further distribution of the cluster resources. The technical scheme of the embodiment of the invention has the advantages that the effect of dynamically changing the local configuration of the user container can meet the dynamic requirement of the container on the configuration size in the service operation process, so that the requirement of the user on the container specification is met; meanwhile, scheduling is influenced by dynamically changing the local configuration of the container, so that cluster resources are fully and reasonably utilized, and the effect of optimizing cluster resource allocation is achieved.

Description

Method, device, medium and electronic equipment for optimizing cluster resource allocation
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a computer readable medium, and an electronic device for optimizing cluster resource allocation.
Background
With the advent of container technology, more and more software systems are beginning to be distributed and deployed in the form of containers.
The existing container management method comprises the following steps: and the management node scheduler reasonably allocates the components of the node nodes to the newly added container of the cluster according to the resource condition of the nodes in the cluster and the configuration condition of the created container. The container configuration is the size of resources specified for the container when the container is created, and mainly includes a CPU, a memory, a disk, and the like. And evaluating the reasonability of cluster resource allocation through indexes such as the overall utilization rate of the cluster resources and the resource dispersion degree of the same application.
However, the existing container management method has the problem of low utilization rate of cluster resources.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a computer-readable medium, and an electronic device for optimizing cluster resource allocation, so as to overcome, at least to a certain extent, a problem of low cluster resource utilization rate caused by an existing container management method.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a method for optimizing cluster resource allocation, including:
acquiring updating information of the container specification;
and modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the updating information so as to enable the modified local configuration occupied by the container to meet the requirement of the updating information, wherein the modified local configuration of the physical machine is used for further distribution of the cluster resources.
In some embodiments of the present invention, modifying, according to the update information, a local configuration currently occupied by the container in a physical machine corresponding to a computing node that created the container includes:
acquiring the specification type to be updated according to the updating information;
and calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine based on the specification type.
In some embodiments of the invention, the specification types include memory; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling the relevant configuration of the memory in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the memory currently occupied by the container in the physical machine.
In some embodiments of the invention, the specification types include CPU; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling the related configuration of the CPU in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the CPU currently occupied by the container in the physical machine.
In some embodiments of the invention, the specification types include disks; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling a logical volume management mechanism of the bottom layer of the physical machine corresponding to the computing node, and modifying the logical volume currently corresponding to the container in the physical machine.
In some embodiments of the invention, obtaining updated information for the container specification comprises:
and monitoring the container specification information in the modified cache by the application programming interface server in the cluster through the capacity expansion and contraction module to obtain the updating information of the container specification in the computing node.
In some embodiments of the present invention, after modifying, according to the update information, a local configuration currently occupied by the container in a physical machine corresponding to a computing node that created the container, the method further includes:
and acquiring and sending the current local configuration information of the physical machine corresponding to the computing node to a scheduler, wherein the scheduler determines the resource information of the computing node according to the current local configuration of the physical machine corresponding to the computing node so as to perform scheduling according to the resource information.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for optimizing cluster resource allocation, including:
the acquisition module is used for acquiring specification updating information of the container;
and the modification module is used for modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the updating information so as to enable the modified local configuration occupied by the container to meet the requirement of the updating information, and the modified local configuration of the physical machine is used for further distribution of the cluster resources.
According to a third aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method of optimizing cluster resource allocation as described in the first aspect of the embodiments above.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of optimizing cluster resource allocation as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical solutions provided in some embodiments of the present invention, by obtaining update information of a container specification, and modifying a local configuration currently occupied by the container in a physical machine corresponding to a computing node that creates the container according to the update information, the modified local configuration occupied by the container meets the requirement of the update information, and the modified local configuration of the physical machine is used for further allocation of the cluster resources. On one hand, the method has the function of dynamically changing the local configuration of the user container, so that the dynamic requirement of the container on the configuration size in the service operation process can be met, and the requirement of the user on the container specification can be further met; on the other hand, the scheduling is influenced by dynamically changing the local configuration of the container, so that the cluster resources are fully and reasonably utilized, and the effect of optimizing the distribution of the cluster resources is achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically illustrates a flow diagram of a method of optimizing cluster resource allocation according to an embodiment of the invention;
FIG. 2 schematically illustrates a flow diagram of a method of optimizing cluster resource allocation according to another embodiment of the invention;
FIG. 3 is a block diagram that schematically illustrates an apparatus for optimizing allocation of cluster resources, in accordance with an embodiment of the present invention;
FIG. 4 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
In the operation of a large-scale container cluster, the requirements on the size of specifications (such as a CPU, a memory, a disk and the like) are dynamically changed according to different processing tasks during the service operation process of container creation. Thus, the specification size initially set when creating a container often fails to meet the dynamic requirements of the container on the configuration size during service operation. If the initial set ground specification is smaller when the container is created, the service of the container creation to the user in the service operation process is influenced; if the initial set ground specification is large when creating the container, the cluster resources are wasted. Thus, the cluster resources are not optimally configured.
Fig. 1 schematically illustrates a flowchart of a method for optimizing cluster resource allocation according to an embodiment of the present invention, which overcomes, at least to some extent, the problem of low cluster resource utilization caused by using the existing container management method. Referring to fig. 1, the method for optimizing cluster resource allocation includes:
step S101, obtaining the updating information of the container specification in the computing node; and the number of the first and second groups,
step S102, according to the update information, modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container, so that the modified local configuration occupied by the container meets the requirement of the update information, and the modified local configuration of the physical machine is used for further distribution of the cluster resources.
In the technical solution provided in the embodiment shown in fig. 1, by obtaining update information of a container specification, and modifying a local configuration currently occupied by the container in a physical machine corresponding to a computing node that creates the container according to the update information, the modified local configuration occupied by the container meets the requirement of the update information, and the modified local configuration of the physical machine is used for further allocating the cluster resources. On one hand, the method has the function of dynamically changing the local configuration of the user container, so that the dynamic requirement of the container on the configuration size in the service operation process can be met, and the requirement of the user on the container specification can be further met; on the other hand, the scheduling is influenced by dynamically changing the local configuration of the container, so that the cluster resources are fully and reasonably utilized, and the effect of optimizing the distribution of the cluster resources is achieved.
In an exemplary embodiment, FIG. 2 schematically illustrates a flow diagram of a method of optimizing cluster resource allocation according to another embodiment of the invention. The specific implementation of each step of the embodiment shown in fig. 1 will be described in detail below with reference to fig. 2, and with reference to fig. 2, the implementation includes steps S201 to S206.
In steps S101/S201, update information to the container specification in the compute node is obtained. For example, when a Manufacturing Data Collection and Status Management system (MDC) monitors that a container has a change in a demand for configuration size during a service operation process, a request for updating a container specification is sent to an Application Program Interface server (api) in a cluster, so that the api modifies specification information of the container in a database and its cache after receiving the request. At this time, a capacity expansion module (e.g., Scaler) arranged in the computing node acquires update information of the container specification in the computing node by monitoring the container specification information in the apiserver modification cache.
In an exemplary embodiment, the user may alter the container specifications based on actual needs. Namely Apiserver receives a request for changing the specification of the container input by a user, and modifies the specification information of the container in the database and the self cache. Meanwhile, a capacity expansion module (such as Scaler) arranged on the computing node acquires the updating information of the container specification in the computing node by monitoring Apiser modification cache container specification information.
In an exemplary embodiment, the acquired update information on the container specification in the compute node includes: information on increase of the container specification or information on decrease of the container specification. For example, when the MDC monitors that the usage rate of a certain type of container specification (for example, a CPU, a memory, or a disk) exceeds a preset threshold in the service operation process of the container, a request for updating the container specification is sent to the Apiserver as a request for increasing the container specification of the type; when the MDC monitors that the utilization rate of a certain type of container specification (such as a CPU, a memory or a disk) is always maintained at a lower level in the service operation process of the container, namely the utilization rate is far smaller than a preset threshold value, a request for updating the container specification is sent to the Apiser, and the request is used for reducing the container specification of the type. Therefore, cluster scheduling is influenced, and the purpose of optimizing cluster resource allocation is achieved.
In an exemplary embodiment, obtaining update information for container specifications in a compute node includes obtaining update information for different specification types. In a specific implementation of step S102, based on the update information of different specification types, the physical machine bottom layer configuration information corresponding to the computing node is called to modify the local configuration currently occupied by the container in the physical machine. The following describes a specific implementation of step S102 in detail with reference to steps S202 to S204 shown in fig. 2 for updating information of different specification types:
in step S202, the specification type to be updated is obtained according to the update information.
In step S203, the specification type is determined. If the specification type is a disk (disk), executing step S204; if the specification type is CPU/memory (memory), step S205 is executed.
In an exemplary embodiment, different monitoring parameters are set for different specification types, and when a certain monitoring parameter is changed, the specification type to be updated can be determined according to the corresponding relationship between the monitoring parameter and the specification type. Illustratively, the yaml samples of the containers are as follows:
Figure BDA0001865754640000071
Figure BDA0001865754640000081
the nodehello2resource Hash is a Hash value calculated by a current spec- > contacts- > resources module, and when the nodehello2resource Hash changes, the change of the specification type corresponding to the CPU or the memory is explained; and judging whether the specification type corresponding to the disk is updated according to whether spec- > associates- > volumes- > flexVolume- > options- > size is changed.
In step S204, a Logical Volume Manager (LVM) mechanism of the bottom layer of the physical machine corresponding to the computing node is called, and a logical volume currently corresponding to the container in the physical machine is modified.
Illustratively, when the specification type of the container to be modified is a disk, the container is extended/contracted by using a lvextend command of an Lvm mechanism:
Lvextend-L 1G/dev/docker/2ae08ea8_a5f5_11e8_a68a_6cae8b608652。
the logical volume identifier corresponding to the disk is,/dev/docker/2 ae08ea8_ a5f5_11e8_ a68a _6cae8b 608652.
In step S205, if the specification type is CPU, a CPU-related configuration in a Control group (Cgroup) of the bottom layer of the physical machine corresponding to the computing node is called, so as to modify the size of the CPU currently occupied by the container in the physical machine. Or if the specification type is the memory, calling related configuration of the memory in the Cgrop at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the memory currently occupied by the container in the physical machine.
For example, when the specification type to be modified of the container is CPU, the configuration in the following file is modified by using the cgset command of cggroup:
/sys/fs/cgroup/cpu/docker/8bf3da35a65c28374cedbe8d2bdb8e1044b49bafb7806d1a55870b7f08942072/cpu.cfs_quota_us。
wherein, the container occupies 1 CPU before modification, and the corresponding value of the content of the file is 100000; after the modification, the container occupies 2 CPUs, and the value corresponding to the content of the file is updated to 200000.
For example, when the specification type to be modified of the container is memory, the configuration in the following file is modified by using a cgset command of cggroup:
/sys/fs/cgroup/memory/docker/8bf3da35a65c28374cedbe8d2bdb8e1044b49bafb7806d1a55870b7f08942072/memory.limit_in_bytes。
wherein the occupied memory of the container before modification is 1G, and the corresponding value of the content of the file is 1073741824; the modified container occupies 2G, and the value corresponding to the content of this file is updated to 2147483648. "8 bf3da35a65c28374cedbe8d2bdb8e1044b49bafb7806d1a55870b7f 08942072" is a container identifier.
The Cgroup may modify the memory of the physical machine by limiting, recording, and isolating physical resources (e.g., CPU, memory, IO, etc.) used by process groups (processes). The LVM provides a mechanism for managing the disk partition, and the disk of the physical machine is modified by managing the disk partition.
For the different modifications performed on the local configuration of the physical machine corresponding to the computing node for creating the container in step S204 and step S205, in step S206, the current local configuration information of the physical machine corresponding to the computing node is obtained and sent to a Scheduler (e.g., Scheduler), and the Scheduler determines the resource information of the computing node according to the current local configuration of the physical machine corresponding to the computing node, so as to perform scheduling according to the resource information.
In an exemplary embodiment, the scheduler may further directly monitor the container specification information in the apiserver modification cache to obtain update information of the container specification in the compute node, so that the scheduler determines resource information of the compute node according to the updated local configuration of the physical machine corresponding to the compute node, and performs scheduling according to the resource information.
In an exemplary embodiment, the technical solution provided by the embodiment shown in fig. 2 is implemented by a container management platform. Wherein, the container management platform includes: a compute node and a management node. The computing node is used for creating a container and providing resources for the service operation of the created container; the management node provides core control. Wherein the Apiserve and scheduler in the steps shown in FIG. 2 are arranged in a management node; the scale and shrink capacity modules are arranged in the computing nodes.
The technical solution provided in the embodiment shown in fig. 2 realizes dynamic smooth adjustment of the physical local configuration corresponding to the computing node that creates the container according to the dynamic requirement of the container on the configuration size in the service operation process, so that the local configuration of the user container is dynamically increased without affecting the normal operation of the container, and the requirement of the user on expanding the container specification is met. Meanwhile, under the condition of not influencing user service and container operation, the system suggests the user to smoothly reduce the local configuration of the user container according to the monitoring data. Further, the technical solution provided by the embodiment shown in fig. 2 also realizes that the local configuration of the physical machine is modified correspondingly according to the specification type of the container update, thereby effectively ensuring the normal operation of the container and further meeting the requirements of users.
The following describes an embodiment of an apparatus of the present invention, which may be used to execute the above-mentioned method for optimizing cluster resource allocation of the present invention.
Fig. 3 is a block diagram schematically illustrating an apparatus for optimizing cluster resource allocation according to an embodiment of the present invention, and referring to fig. 3, an apparatus 300 for optimizing cluster resource allocation includes: an acquisition module 301 and a modification module 302.
The obtaining module 301 is configured to obtain specification update information of a container; and the modifying module 302 is configured to modify, according to the update information, a local configuration currently occupied by the container in the physical machine corresponding to the computing node that created the container, so that the modified local configuration occupied by the container meets the requirement of the update information, and the modified local configuration of the physical machine is used for further allocation of the cluster resources.
In the exemplary embodiment, modification module 302 includes: the device comprises an acquisition submodule and a calling submodule.
The acquisition submodule acquires the specification type to be updated according to the updating information; and the calling submodule is used for calling the bottom layer configuration information currently occupied by the container in the physical machine corresponding to the computing node to modify the local configuration of the physical machine based on the specification type.
In an exemplary embodiment, the specification types include memory; wherein the content of the first and second substances,
the calling submodule is specifically configured to: and calling the relevant configuration of the memory in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the memory currently occupied by the container in the physical machine.
In an exemplary embodiment, the specification types include a CPU; wherein the content of the first and second substances,
the calling submodule is specifically configured to: and calling the related configuration of the CPU in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the CPU currently occupied by the container in the physical machine.
In an exemplary embodiment, the specification types include disks; wherein the content of the first and second substances,
the calling submodule is specifically configured to: and calling a logical volume management mechanism of the bottom layer of the physical machine corresponding to the computing node, and modifying the logical volume currently corresponding to the container in the physical machine.
In an exemplary embodiment, the obtaining module 301 is specifically configured to: and monitoring the container specification information in the modified cache by the application programming interface server in the cluster through the capacity expansion and contraction module to obtain the updating information of the container specification in the computing node.
In an exemplary embodiment, the apparatus 300 for optimizing cluster resource allocation further comprises: and a sending module. After the modification module 302 modifies the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the update information, the sending module is configured to obtain and send the current local configuration information of the physical machine corresponding to the computing node to a scheduler, and the scheduler determines the resource information of the computing node according to the current local configuration of the physical machine corresponding to the computing node, so as to perform scheduling according to the resource information.
For details that are not disclosed in the embodiment of the apparatus of the present invention, please refer to the above-mentioned embodiment of the method for optimizing cluster resource allocation of the present invention for the details that are not disclosed in the embodiment of the apparatus of the present invention.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use with the electronic device implementing an embodiment of the invention is shown. The computer system 400 of the electronic device shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for system operation are also stored. The CPU401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method for optimizing cluster resource allocation as described in the above embodiments.
For example, the electronic device may implement the following as shown in fig. 1: step S101, obtaining the updating information of the container specification; step S102, according to the update information, modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container, so that the modified local configuration occupied by the container meets the requirement of the update information, and the modified local configuration of the physical machine is used for further distribution of the cluster resources.
As another example, the electronic device may implement the steps shown in FIG. 2.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for optimizing cluster resource allocation, comprising:
acquiring updating information of the container specification;
and modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the updating information so as to enable the modified local configuration occupied by the container to meet the requirement of the updating information, wherein the modified local configuration of the physical machine is used for further distribution of the cluster resources.
2. The method of claim 1, wherein modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node that created the container according to the update information comprises:
acquiring the specification type to be updated according to the updating information;
and calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine based on the specification type.
3. The method of claim 2, wherein the specification types include memory; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling the relevant configuration of the memory in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the memory currently occupied by the container in the physical machine.
4. The method of claim 2, wherein the specification types include CPU; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling the related configuration of the CPU in the control group at the bottom layer of the physical machine corresponding to the computing node, and modifying the size of the CPU currently occupied by the container in the physical machine.
5. The method of claim 2, wherein the specification types include disks; wherein the content of the first and second substances,
based on the specification type, calling physical machine bottom layer configuration information corresponding to the computing node to modify the local configuration currently occupied by the container in the physical machine, wherein the modification comprises the following steps:
and calling a logical volume management mechanism of the bottom layer of the physical machine corresponding to the computing node, and modifying the logical volume currently corresponding to the container in the physical machine.
6. The method of any of claims 1 to 5, wherein obtaining updated information about the container specification comprises:
and monitoring the container specification information in the modified cache by the application programming interface server in the cluster through the capacity expansion and contraction module to obtain the updating information of the container specification in the computing node.
7. The method of claim 6, further comprising, after modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node that created the container according to the update information:
and acquiring and sending the current local configuration information of the physical machine corresponding to the computing node to a scheduler, wherein the scheduler determines the resource information of the computing node according to the current local configuration of the physical machine corresponding to the computing node so as to perform scheduling according to the resource information.
8. An apparatus that optimizes cluster resource allocation, comprising:
the acquisition module is used for acquiring specification updating information of the container;
and the modification module is used for modifying the local configuration currently occupied by the container in the physical machine corresponding to the computing node for creating the container according to the updating information so as to enable the modified local configuration occupied by the container to meet the requirement of the updating information, and the modified local configuration of the physical machine is used for further distribution of the cluster resources.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method of optimizing allocation of cluster resources according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of optimizing cluster resource allocation according to any one of claims 1 to 7.
CN201811354570.5A 2018-11-14 2018-11-14 Method, device, medium and electronic equipment for optimizing cluster resource allocation Pending CN111190719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811354570.5A CN111190719A (en) 2018-11-14 2018-11-14 Method, device, medium and electronic equipment for optimizing cluster resource allocation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811354570.5A CN111190719A (en) 2018-11-14 2018-11-14 Method, device, medium and electronic equipment for optimizing cluster resource allocation

Publications (1)

Publication Number Publication Date
CN111190719A true CN111190719A (en) 2020-05-22

Family

ID=70710471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811354570.5A Pending CN111190719A (en) 2018-11-14 2018-11-14 Method, device, medium and electronic equipment for optimizing cluster resource allocation

Country Status (1)

Country Link
CN (1) CN111190719A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181597A (en) * 2020-10-12 2021-01-05 成都精灵云科技有限公司 Dynamic updating method for use limit of container resource
CN113110918A (en) * 2021-05-13 2021-07-13 广州虎牙科技有限公司 Read-write rate control method and device, node equipment and storage medium
CN115145690A (en) * 2022-06-30 2022-10-04 小米汽车科技有限公司 Cluster resource expansion method and device and container cluster management system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
US20130145364A1 (en) * 2011-12-01 2013-06-06 Tunghai University Method of dynamic resource allocation for a virtual machine cluster
CN105119952A (en) * 2015-07-07 2015-12-02 北京京东尚科信息技术有限公司 Method and system for automatically and flexibly assigning resource under cloud platform
WO2016197994A1 (en) * 2015-12-03 2016-12-15 中兴通讯股份有限公司 Capacity expansion method and device
CN106533713A (en) * 2015-09-09 2017-03-22 阿里巴巴集团控股有限公司 Application deployment method and device
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN107656807A (en) * 2016-07-26 2018-02-02 华为技术有限公司 The automatic elastic telescopic method and device of a kind of virtual resource
CN107688322A (en) * 2017-08-31 2018-02-13 天津中新智冠信息技术有限公司 A kind of containerization management system
CN108023742A (en) * 2016-10-31 2018-05-11 阿里巴巴集团控股有限公司 A kind of expansion method of application, device and system
CN108255497A (en) * 2018-01-12 2018-07-06 新华三大数据技术有限公司 The dispositions method and device of a kind of application

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
US20130145364A1 (en) * 2011-12-01 2013-06-06 Tunghai University Method of dynamic resource allocation for a virtual machine cluster
CN105119952A (en) * 2015-07-07 2015-12-02 北京京东尚科信息技术有限公司 Method and system for automatically and flexibly assigning resource under cloud platform
CN106533713A (en) * 2015-09-09 2017-03-22 阿里巴巴集团控股有限公司 Application deployment method and device
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
WO2016197994A1 (en) * 2015-12-03 2016-12-15 中兴通讯股份有限公司 Capacity expansion method and device
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN107656807A (en) * 2016-07-26 2018-02-02 华为技术有限公司 The automatic elastic telescopic method and device of a kind of virtual resource
CN108023742A (en) * 2016-10-31 2018-05-11 阿里巴巴集团控股有限公司 A kind of expansion method of application, device and system
CN107688322A (en) * 2017-08-31 2018-02-13 天津中新智冠信息技术有限公司 A kind of containerization management system
CN108255497A (en) * 2018-01-12 2018-07-06 新华三大数据技术有限公司 The dispositions method and device of a kind of application

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181597A (en) * 2020-10-12 2021-01-05 成都精灵云科技有限公司 Dynamic updating method for use limit of container resource
CN112181597B (en) * 2020-10-12 2024-01-19 成都精灵云科技有限公司 Dynamic updating method for container resource use limit
CN113110918A (en) * 2021-05-13 2021-07-13 广州虎牙科技有限公司 Read-write rate control method and device, node equipment and storage medium
CN115145690A (en) * 2022-06-30 2022-10-04 小米汽车科技有限公司 Cluster resource expansion method and device and container cluster management system
CN115145690B (en) * 2022-06-30 2023-08-04 小米汽车科技有限公司 Cluster resource expansion method and device and container cluster management system

Similar Documents

Publication Publication Date Title
CN111966500B (en) Resource scheduling method and device, electronic equipment and storage medium
CN108549583B (en) Big data processing method and device, server and readable storage medium
CN110753131A (en) Microservice distributed current limiting method and device, storage medium and electronic equipment
CN110166507B (en) Multi-resource scheduling method and device
US11150949B2 (en) Resource release method, resource allocation method, devices, and computer program products
CN111190719A (en) Method, device, medium and electronic equipment for optimizing cluster resource allocation
CN112905342B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN112445857A (en) Resource quota management method and device based on database
CN112749002A (en) Method and device for dynamically managing cluster resources
CN111399977A (en) Virtual machine migration method, device, equipment and medium
CN109428926B (en) Method and device for scheduling task nodes
CN116737080A (en) Distributed storage system data block management method, system, equipment and storage medium
CN115617511A (en) Resource data processing method and device, electronic equipment and storage medium
CN112214288B (en) Pod scheduling method, device, equipment and medium based on Kubernetes cluster
CN114116173A (en) Method, device and system for dynamically adjusting task allocation
JP2023543744A (en) Resource scheduling method, system, electronic device and computer readable storage medium
CN110209466B (en) Resource allocation method, resource allocation device and storage medium
CN115794396A (en) Resource allocation method, system and electronic equipment
CN113127430A (en) Mirror image information processing method and device, computer readable medium and electronic equipment
CN111694670B (en) Resource allocation method, apparatus, device and computer readable medium
CN111813564B (en) Cluster resource management method and device and container cluster management system
CN115378879A (en) Data control method and related device
CN114374657A (en) Data processing method and device
CN114237902A (en) Service deployment method and device, electronic equipment and computer readable medium
CN113918282A (en) Database access method and device, electronic equipment and computer readable 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