CN111209118A - Method and device for determining resource allowance, storage medium and electronic equipment - Google Patents

Method and device for determining resource allowance, storage medium and electronic equipment Download PDF

Info

Publication number
CN111209118A
CN111209118A CN202010038054.2A CN202010038054A CN111209118A CN 111209118 A CN111209118 A CN 111209118A CN 202010038054 A CN202010038054 A CN 202010038054A CN 111209118 A CN111209118 A CN 111209118A
Authority
CN
China
Prior art keywords
resource
cluster
target
event
physical machine
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.)
Withdrawn
Application number
CN202010038054.2A
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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202010038054.2A priority Critical patent/CN111209118A/en
Publication of CN111209118A publication Critical patent/CN111209118A/en
Withdrawn 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
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/503Resource availability

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a method, a device, a storage medium and an electronic device for determining resource allowance, which are used for solving the technical problems of batch capture of resource data, long time consumption of resource analysis and lack of real-time property during resource allowance monitoring in the related art, and the method comprises the following steps: monitoring a target management event in a cluster, wherein the target management event is a management event aiming at a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster; and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster. The method and the device can immediately determine the influence of the management event on the resource quantity of the cluster after monitoring the management event of the cluster, further determine the total resource quantity of the cluster, and improve the efficiency and the real-time performance of resource margin monitoring and analysis.

Description

Method and device for determining resource allowance, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of network operation and maintenance, and in particular, to a method and an apparatus for determining a resource margin, a storage medium, and an electronic device.
Background
In a network cloud platform, a cluster generally composed of a plurality of network devices (or physical machines) provides services for a plurality of services in the cloud platform. Specifically, the container technology may be used to isolate the above-mentioned cluster into a plurality of servers, and each server may provide services such as data exchange, data storage, and data processing for different services. In a specific cluster isolation process, a life cycle of a container (or a server isolated on a physical machine) may be managed through a cluster management platform, for example, a HULK scheduling platform, for example, when a service is needed, applying for resources from a cluster to create a new container, or when the service is stopped, releasing resources occupied by the container.
Disclosure of Invention
The main purpose of the present disclosure is to provide a method, an apparatus, a storage medium, and an electronic device for determining a resource allowance, so as to solve the technical problems of batch capturing of resource data, long time consumption for resource analysis, and lack of real-time performance during resource allowance monitoring in the related art.
In order to achieve the above object, a first aspect of the present disclosure provides a method for determining a resource margin, the method including:
monitoring a target management event in a cluster, wherein the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster;
and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster.
Optionally, the monitoring a target management event in the cluster includes:
listening for an event message for the target physical machine or the container;
determining whether an event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container;
and under the condition that the management event corresponding to the event message is determined to be the executable event, determining the management event corresponding to the event message as the target management event.
Optionally, the determining, according to the monitored target management event and the historical resource margin of the cluster, the target resource margin of the cluster after the management event is executed includes:
determining whether the target management event is a resource management event, wherein the resource management event is a first management event for adding, modifying or deleting the target physical machine in the cluster, or a second management event for creating, modifying or deleting a container on the target physical machine;
and if the target management event is determined to be the resource management event, determining the target resource allowance according to the target management event and the historical resource allowance of the cluster.
Optionally, the determining the target resource margin according to the target management event and the historical resource margin of the cluster includes:
determining a resource variation of the cluster after the target management event is executed, wherein the resource variation is a resource increase amount or a resource decrease amount;
and determining the target resource allowance according to the historical resource allowance and the resource variation.
Optionally, after the target management event in the listening cluster, the method further includes:
and updating the state information of the target physical machine or the state information of the container under the condition that the management event corresponding to the event message is determined to be the executable event.
Optionally, after determining, according to the target management event and the historical resource margin of the cluster, a target resource margin of the cluster after executing the target management event, the method further includes:
and updating the historical resource allowance record of the cluster before the target management event is executed by the resource allowance record generated according to the target resource allowance, and determining the change trend of the resource allowance of the cluster according to the updated historical resource allowance record.
A second aspect of the present disclosure provides an apparatus for determining a resource margin, the apparatus comprising:
the system comprises an event monitoring module, a processing module and a processing module, wherein the event monitoring module is used for monitoring a target management event in a cluster, the target management event is a management event aiming at a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster;
and the resource allowance determining module is used for determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster.
Optionally, the event monitoring module is configured to:
listening for an event message for the target physical machine or the container;
determining whether an event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container;
and under the condition that the management event corresponding to the event message is determined to be the executable event, determining the management event corresponding to the event message as the target management event.
Optionally, the resource margin determining module is configured to:
determining whether the target management event is a resource management event, wherein the resource management event is a first management event for adding, modifying or deleting the target physical machine in the cluster, or a second management event for creating, modifying or deleting a container on the target physical machine;
and if the target management event is determined to be the resource management event, determining the target resource allowance according to the target management event and the historical resource allowance of the cluster.
Optionally, the resource margin determining module is configured to:
determining a resource variation of the cluster after the target management event is executed, wherein the resource variation is a resource increase amount or a resource decrease amount;
and determining the target resource allowance according to the historical resource allowance and the resource variation.
Optionally, the apparatus further comprises:
and the state updating module is used for updating the state information of the target physical machine or the state information of the container under the condition that the management event corresponding to the event message is determined to be the executable event.
Optionally, the apparatus further comprises:
and the record updating module is used for updating the historical resource allowance record of the cluster before the target management event is executed through the resource allowance record generated according to the target resource allowance, so as to determine the change trend of the resource allowance of the cluster according to the updated historical resource allowance record.
A third aspect of the present disclosure provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of determining a resource margin of the first aspect.
A fourth aspect of the present disclosure provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to perform the steps of the method of determining a resource margin of the first aspect.
By adopting the technical scheme provided by the disclosure, the following technical effects can be at least achieved:
monitoring a target management event in a cluster, wherein the target management event is a management event aiming at a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster; and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster. The method and the device can immediately determine the influence of the management event on the resource quantity of the cluster after monitoring the management event of the cluster, further determine the total resource quantity of the cluster, and improve the efficiency and the real-time performance of resource margin monitoring and analysis.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram illustrating a method of determining resource margins in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram of a method of listening for management events according to the method shown in FIG. 1;
FIG. 3 is a flow diagram of a method of determining cluster resource headroom according to the illustration of FIG. 2;
FIG. 4 is a flow chart of another method of determining resource margins according to that shown in FIG. 1;
FIG. 5 is a flow chart of yet another method of determining resource margins shown in FIG. 4;
FIG. 6 is a block diagram illustrating an apparatus for determining resource headroom in accordance with an example embodiment;
fig. 7 is a block diagram of another apparatus for determining a resource margin according to fig. 6;
fig. 8 is a block diagram of still another apparatus for determining a resource margin shown in fig. 6;
fig. 9 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In the related art, when applying for resources to a service in a cluster management platform to create a new container, monitoring and managing the resource margin of the entire cluster is first required to ensure that there are enough resources in the appropriate physical machine to complete the creation of the new container. Taking the HULK scheduling platform as an example, the resources in the cluster are generally managed uniformly by a kubernets application (abbreviated as K8s, which is an open source and is used for managing containerized applications on multiple physical machines in the cloud platform). During cluster operation, the K8s application monitors the resource margins of the cluster. The total amount of the monitored resource data within the preset time can be pulled every preset time (for example, one hour), and the resource surplus of the cluster is calculated according to the pulled resource data and stored in the database. When resource allowance query is carried out, the stored resource allowance data can be checked from the database. However, the above-mentioned method of pulling the cluster data in full amount consumes a long time, and the calculation of the resource margin is performed once every a period of time, and lacks real-time performance, so that the success rate of capacity expansion of the whole cluster is poor, and the commitment to the service and the stability of the system are affected.
The inventor has noticed this problem and proposed a method for determining the resource margin, which is as follows:
an execution main body of the cluster resource management method provided by the embodiment of the disclosure may be a functional module and/or a functional entity capable of implementing the cluster resource management method in a cluster management device or a certain physical machine in the cluster management device or the cluster. The specific method can be determined according to actual use requirements, and the embodiment of the disclosure is not limited.
The following takes a cluster management device as an execution subject of the cluster resource management method as an example, and exemplarily describes the cluster resource management method provided by the embodiment of the present disclosure. In the embodiment of the disclosure, the cluster resource management method can be applied to the field of cluster scheduling, and particularly can be applied to various cloud products of public clouds and private clouds in the field of cluster scheduling in a scene related to cluster resource scheduling.
Fig. 1 is a flowchart illustrating a method for determining resource headroom, which is applied to a cluster management device, as shown in fig. 1, and is used for managing a cluster composed of a plurality of physical machines, and the method includes the following steps:
in step 101, a target management event in the cluster is snooped.
The target management event is a management event for a target physical machine or a container in the target physical machine, the cluster includes at least one physical machine, and the target physical machine is any one physical machine in the cluster.
For example, a management event for a physical machine or a container in a physical machine typically results in an increase or decrease in resources for the entire cluster. For example, management events for physical machines may include: adding events, deleting events, modifying events, error events and the like of the physical machine; events for a container in a physical machine may include: creation of container event, waiting for event, modification event, deletion time and error event, etc. Generally, the resources in the cluster can be uniformly managed by a kubernets (short: K8s) platform. The K8s platform is an open source for managing containerized applications on multiple physical machines in a cloud platform. In the embodiment of the present disclosure, the cluster management device may monitor all events in the K8s platform.
In step 102, a target resource allowance of the cluster after the management event is executed is determined according to the monitored target management event and the historical resource allowance of the cluster.
For example, in this embodiment of the present disclosure, the resource allowance of each physical machine in the cluster may be obtained through the historical resource allowance of the cluster, and when it is monitored that one physical machine is operating on the cluster and scheduling of the cluster is added, the total amount of resources, added to the cluster, of a Central Processing Unit (CPU), a memory, a data disk, and a mirror disk of the physical machine may be obtained, so as to obtain the target resource allowance. And if the container is dispatched to a certain physical machine in the cluster under the condition that the creation event of the container is monitored, subtracting the resource amount occupied by the container from the resource amount of the physical machine to obtain the residual resource amount of the physical machine. Correspondingly, if the deletion event of the container is monitored, the resource allowance of the physical machine where the container is located is added to the resource amount occupied by the container, and then the target resource allowance is calculated.
Taking HLUK as an example, the cluster management manner may include: the cluster management device may set the k8s subscription forwarding center to listen to all events of k8s to learn all events of the cluster. And sending the monitored events to a resource allowance service for uniform processing in a message form of a message queue. After receiving the event, the resource balance service may compute the resource balance of the cluster according to the event of the cluster monitored by the subscription forwarding center of k8s and the current state of the cluster stored in the cache, and store the computed result (i.e., the target resource balance in the above embodiment) in the database. The external call may obtain the resource margin by directly obtaining data in the database. After receiving the event, the resource balance service may save the information (which may be an identifier) and the current state of the physical machine and the container to a cache (which may be referred to as cell in k8s) through a management module (which may be referred to as cart-manager).
For example, the management module in the resource allowance service may further obtain the state information of the cluster from the obtaining, update the state information of the cluster according to the state of the cluster and an event of the cluster monitored by the subscription forwarding center k8s, and store the updated state information in the cache. The management module in the resource allowance service can also store the target resource allowance in the historical database after calculating the target resource allowance each time so as to analyze the change trend of the resource allowance subsequently. The service module in the resource margin service is mainly used for providing the resource margin of the cluster for the service module when the external needs to call the resource of the cluster.
For example, for a physical machine, the physical machine performs on-machine join scheduling, and the resource allowance management platform senses the change and determines whether the data of the CPU, the memory, the data disk, and the mirror disk of the physical machine can be added to the total amount of resources of the cluster. If the physical machine has a modification event, the resource allowance management platform senses the change, compares whether the data of the CPU, the memory, the data disk and the mirror image disk of the physical machine are changed or not, and further determines the changed resource allowance. And if the physical machine has a deletion event, removing the resources of the deleted physical machine from the total amount of the resources. Similarly, for any container, after the service request applies for the container, the container creation phase is entered, and when the container is created, the resource headroom service senses the change (i.e. receives an event that the k8s subscribes to the forwarding center to create the container), and determines whether the container is scheduled on one physical machine. If the scheduling is already done, the resources occupied by the container are subtracted from the resources of the physical machine. If not, saving the state, waiting for the container modification event, and subtracting the resource occupied by the container from the resource of the physical machine once the physical machine where the container is located in the received event is not empty. Correspondingly, the resources of the physical machine are added with the resources occupied by the container once the deletion event is received.
In summary, in the technical solution provided in the embodiments of the present disclosure, a target management event in a cluster is monitored, where the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster includes at least one physical machine, and the target physical machine is any physical machine in the cluster; and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster. The method and the device can immediately determine the influence of the management event on the resource quantity of the cluster after monitoring the management event of the cluster, further determine the total resource quantity of the cluster, and improve the efficiency and the real-time performance of resource margin monitoring and analysis.
Fig. 2 is a flow chart of a method of listening for management events according to fig. 1, as shown in fig. 2, the step 101 comprising:
in step 1011, an event message directed to the target physical machine or the container is listened to.
In step 1012, it is determined whether the event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container.
For example, in step 1012, the finite state machine may ensure the correctness of the state flow of the cluster, that is, it may be determined whether to execute a received event according to the received message for executing the event and the state information of the cluster. For example, if a physical machine does not exist but a delete event is received, the delete event is considered to have been received prior to the create event. The retransmission of this message is denied until the creation message is received before the deletion is processed. Specifically, when a physical machine does not exist in the cluster, if a message to delete an event of the physical machine is received, and it can be considered that a delete event is received prior to a create event, the message to delete the physical machine may be rejected, and the event to delete the physical machine may not be executed until the message to create the physical machine is received, the event to create the physical machine is executed, and the message to delete the event of the physical machine is received again.
For example, generally, the state information of the cluster is stored in the cache, and in the embodiment of the present disclosure, the cluster management device may obtain the state information of the cluster from the cache. In K8s, the state information of the physical machine is generally represented by a node state, and the state of the container is represented by a pod state. Wherein, both the node and the pod are components in K8 s. Wherein a pod is an abstract concept that includes a set of one or more containers and resources shared by the containers, the resources including: shared storage, using unique cluster IP addresses, configuration information on how to run the container, such as mirror version and container port. The pod model is similar to a logical host with specific applications, which may contain relatively tightly coupled containers of different applications, where the containers in the same pod share an Internet Protocol (IP) address and port segment, work and schedule together, and operate in a shared environment on the same node. Where the pod must run on the node. The node is a working machine in the K8s, may be an entity machine, may be a virtual machine, and may run multiple pods, and according to the resource situation of each node, the pods may be allocated on the nodes in the cluster.
In step 1013, in the case that the management event corresponding to the event message is determined to be the executable event, it is determined that the management event corresponding to the event message is the target management event.
Fig. 3 is a flow chart of a method for determining cluster resource headroom according to fig. 2, wherein step 102, shown in fig. 3, comprises:
in step 1021, it is determined whether the target management event is a resource management event.
The resource management event is a first management event for adding, modifying or deleting the target physical machine in the cluster, or a second management event for creating, modifying or deleting a container on the target physical machine.
Illustratively, after the received resource management event is executed, the finite state machine is used to control the increase or decrease of the cluster resource margin to obtain the target resource margin, so that the resource margin can be accurately obtained in real time.
In step 1022, if it is determined that the target management event is the resource management event, the target resource margin is determined according to the target management event and the historical resource margin of the cluster.
Illustratively, this step 1022 includes: determining the resource variation of the cluster after the target management event is executed, wherein the resource variation is a resource increase amount or a resource decrease amount; and determining the target resource allowance according to the historical resource allowance and the resource variation.
Optionally, in the embodiment of the present disclosure, an optional implementation is provided by taking a creation event of a container as an example, where the implementation includes the following steps:
a. the cluster management device receives the first service request.
Wherein the first service request is used for requesting to create a first container;
b. the cluster management equipment acquires the historical resource allowance of the cluster.
c. And the cluster management equipment allocates resources for the first container on a target physical machine in the cluster according to the historical resource allowance of the cluster.
d. Events of the cluster are monitored.
e. After an event that a first container is created on a target physical machine is monitored, calculating the target resource allowance of the cluster according to the historical resource allowance of the cluster and the resource amount of the target physical machine occupied by the first container.
In the above embodiment, the target resource allowance of the cluster may be calculated according to the historical resource allowance of the cluster and the resource amount of the target physical machine occupied by the first container when the first container is monitored to be created on the target physical machine, so that the resource allowance of the cluster may be calculated in real time and accurately each time a cluster event is monitored, and the resource allowance of the cluster may be efficiently, real-time, and accurately acquired.
Fig. 4 is a flow chart of another method of determining a resource margin according to fig. 1, as shown in fig. 4, after step 101, the method further comprising:
in step 103, if it is determined that the management event corresponding to the event message is the executable event, the state information of the target physical machine or the state information of the container is updated.
For example, in this embodiment of the present disclosure, according to the state information of the original cluster (which may be the state information of the cluster obtained last time, that is, the state information of the cluster obtained before the event of the cluster is monitored this time), the state information of the original cluster may be updated in combination with the monitored management event of the cluster to obtain the state information of the cluster at the current time point, and then the updated state information is stored in the cache. The cluster management device may store the current state information of the cluster in a cache, so that the state information of the cluster is updated after monitoring the management event of the cluster next time.
Fig. 5 is a flow chart of yet another method of determining a resource margin, as shown in fig. 4, after step 102, the method further comprising:
in step 104, the historical resource surplus record of the cluster before the target management event is executed is updated through the resource surplus record generated according to the target resource surplus record, so that the change trend of the resource surplus of the cluster is determined according to the updated historical resource surplus record.
For example, the historical resource balance records are stored in a historical database of the cluster, the historical database and the resource balance database may be different databases, wherein a database with lower cost than the resource balance database may be used as the historical database, and the historical resource balance records are saved to facilitate subsequent analysis using the historical resource balance records. As an optional implementation manner, or after the cluster management device stores the target resource allowance in the history database, in the cluster resource management method provided in the embodiment of the present disclosure, the cluster management device may further analyze a change trend of the resource allowance of the cluster according to a plurality of history resource allowance records of the cluster before the current time point, so as to manage the physical machines in the cluster, for example, when the change trend of the resource allowance is more and more abundant, the number of the physical machines in the cluster may be reduced; under the condition that the change trend of the resource allowance is increasingly lacking, the number of physical machines in the cluster can be increased, so that cluster resources can be managed according to the change trend of the resource allowance in the cluster through data analysis, and the architecture of the cluster can be adjusted more reasonably.
In summary, the technical solution provided in the embodiments of the present disclosure can monitor a target management event in a cluster, where the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster includes at least one physical machine, and the target physical machine is any physical machine in the cluster; and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster. The method and the device can determine the influence of the management event on the resource quantity of the cluster under the condition of ensuring the correctness of the event after monitoring the management event of the cluster, further determine the resource allowance of the cluster, and improve the efficiency, the real-time performance and the accuracy of monitoring the resource allowance.
Fig. 6 is a block diagram illustrating an apparatus for determining a resource margin according to an example embodiment, where the apparatus 600 includes:
an event monitoring module 610, configured to monitor a target management event in a cluster, where the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster includes at least one physical machine, and the target physical machine is any physical machine in the cluster;
and a resource allowance determination module 620, configured to determine, according to the monitored target management event and the historical resource allowance of the cluster, a target resource allowance of the cluster after the management event is executed.
Optionally, the event listening module 610 is configured to:
monitoring an event message for the target physical machine or the container;
determining whether the event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container;
and under the condition that the management event corresponding to the event message is determined to be the executable event, determining the management event corresponding to the event message as the target management event.
Optionally, the resource margin determining module 620 is configured to:
determining whether the target management event is a resource management event, wherein the resource management event is a first management event for adding, modifying or deleting the target physical machine in the cluster, or a second management event for creating, modifying or deleting a container on the target physical machine;
and if the target management event is determined to be the resource management event, determining the target resource allowance according to the target management event and the historical resource allowance of the cluster.
Optionally, the resource margin determining module 620 is configured to:
determining the resource variation of the cluster after the target management event is executed, wherein the resource variation is a resource increase amount or a resource decrease amount;
and determining the target resource allowance according to the historical resource allowance and the resource variation.
Fig. 7 is a block diagram of another apparatus for determining a resource margin according to fig. 6, as shown in fig. 7, the apparatus 600 further includes:
a state updating module 630, configured to update the state information of the target physical machine or the state information of the container when it is determined that the management event corresponding to the event message is the executable event.
Fig. 8 is a block diagram of still another apparatus for determining a resource margin according to fig. 7, and as shown in fig. 8, the apparatus 600 further includes:
and a record updating module 640, configured to update the historical resource margin record of the cluster before the target management event is executed according to the resource margin record generated according to the target resource margin, so as to determine a change trend of the resource margin of the cluster according to the updated historical resource margin record.
In summary, the technical solution provided in the embodiments of the present disclosure can monitor a target management event in a cluster, where the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster includes at least one physical machine, and the target physical machine is any physical machine in the cluster; and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster. The method and the device can determine the influence of the management event on the resource quantity of the cluster under the condition of ensuring the correctness of the event after monitoring the management event of the cluster, further determine the resource allowance of the cluster, and improve the efficiency, the real-time performance and the accuracy of monitoring the resource allowance.
Illustratively, FIG. 9 is a block diagram illustrating an electronic device 900 in accordance with an exemplary embodiment. For example, the electronic device 900 may be provided as a server. Referring to fig. 9, the server 900 comprises a processor 901, which may be one or more in number, and a memory 902 for storing computer programs executable by the processor 901. The computer program stored in memory 902 may include one or more modules that each correspond to a set of instructions. Further, the processor 901 may be configured to execute the computer program to perform the above-described method of determining a resource margin.
Additionally, the server 900 may also include a power component 903 and a communication component 904, the power component 903 may be configured to perform power management of the server 900, and the communication component 904 may be configured to enable communication, e.g., wired or wireless communication, of the server 900. The server 900 may also include input/output (I/O) interfaces 905. The server 900 may operate based on an operating system stored in memory 902, such as Windows Server, Mac OS XTM, UnixTM, Linux, etc.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described method of determining a resource margin is also provided. For example, the computer readable storage medium may be the memory 902 described above comprising program instructions executable by the processor 901 of the server 900 to perform the method of determining resource margins described above.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.

Claims (10)

1. A method of determining resource headroom, the method comprising:
monitoring a target management event in a cluster, wherein the target management event is a management event for a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster;
and determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster.
2. The method of claim 1, wherein listening for a target management event in a cluster comprises:
listening for an event message for the target physical machine or the container;
determining whether an event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container;
and under the condition that the management event corresponding to the event message is determined to be the executable event, determining the management event corresponding to the event message as the target management event.
3. The method of claim 1, wherein determining the target resource margin of the cluster after executing the management event according to the monitored target management event and the historical resource margin of the cluster comprises:
determining whether the target management event is a resource management event, wherein the resource management event is a first management event for adding, modifying or deleting the target physical machine in the cluster, or a second management event for creating, modifying or deleting a container on the target physical machine;
and if the target management event is determined to be the resource management event, determining the target resource allowance according to the target management event and the historical resource allowance of the cluster.
4. The method of claim 3, wherein determining the target resource margin based on the target management event and historical resource margins of the clusters comprises:
determining a resource variation of the cluster after the target management event is executed, wherein the resource variation is a resource increase amount or a resource decrease amount;
and determining the target resource allowance according to the historical resource allowance and the resource variation.
5. The method of claim 2, wherein after a target management event in the listening cluster, the method further comprises:
and updating the state information of the target physical machine or the state information of the container under the condition that the management event corresponding to the event message is determined to be the executable event.
6. The method of claim 1, wherein after determining the target resource headroom of the cluster after executing the target management event based on the target management event and the historical resource headroom of the cluster, the method further comprises:
and updating the historical resource allowance record of the cluster before the target management event is executed by the resource allowance record generated according to the target resource allowance, and determining the change trend of the resource allowance of the cluster according to the updated historical resource allowance record.
7. An apparatus for determining resource headroom, the apparatus comprising:
the system comprises an event monitoring module, a processing module and a processing module, wherein the event monitoring module is used for monitoring a target management event in a cluster, the target management event is a management event aiming at a target physical machine or a container in the target physical machine, the cluster comprises at least one physical machine, and the target physical machine is any one physical machine in the cluster;
and the resource allowance determining module is used for determining the target resource allowance of the cluster after the management event is executed according to the monitored target management event and the historical resource allowance of the cluster.
8. The apparatus of claim 7, wherein the event listening module is configured to:
listening for an event message for the target physical machine or the container;
determining whether an event corresponding to the event message is an executable event capable of changing the state of the target physical machine or the state of the container according to the state information of the target physical machine or the state information of the container;
and under the condition that the management event corresponding to the event message is determined to be the executable event, determining the management event corresponding to the event message as the target management event.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of determining a resource margin of any one of claims 1 to 6.
10. A cluster management device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of determining a resource margin of any of claims 1 to 6.
CN202010038054.2A 2020-01-14 2020-01-14 Method and device for determining resource allowance, storage medium and electronic equipment Withdrawn CN111209118A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010038054.2A CN111209118A (en) 2020-01-14 2020-01-14 Method and device for determining resource allowance, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010038054.2A CN111209118A (en) 2020-01-14 2020-01-14 Method and device for determining resource allowance, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111209118A true CN111209118A (en) 2020-05-29

Family

ID=70785667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010038054.2A Withdrawn CN111209118A (en) 2020-01-14 2020-01-14 Method and device for determining resource allowance, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111209118A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897625A (en) * 2020-06-23 2020-11-06 新浪网技术(中国)有限公司 Kubernetes cluster-based resource event backtracking method and system and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140344810A1 (en) * 2012-12-26 2014-11-20 Huawei Technologies Co.,Ltd. Resource management method and apparatus for virtual machine system, and virtual machine system
US20170060609A1 (en) * 2015-08-28 2017-03-02 International Business Machines Corporation Managing a shared pool of configurable computing resources which has a set of containers
WO2017045424A1 (en) * 2015-09-18 2017-03-23 乐视控股(北京)有限公司 Application program deployment system and deployment method
CN107832143A (en) * 2017-10-17 2018-03-23 北京京东尚科信息技术有限公司 A kind for the treatment of method and apparatus of physical machine resource
CN108365985A (en) * 2018-02-07 2018-08-03 深圳壹账通智能科技有限公司 A kind of cluster management method, device, terminal device and storage medium
CN108829509A (en) * 2018-05-03 2018-11-16 山东汇贸电子口岸有限公司 Distributed container cluster framework resources management method based on domestic CPU and operating system
KR101987661B1 (en) * 2018-07-19 2019-06-11 나무기술 주식회사 Cluster resource allocating and managing method on cloud platform
US20190235907A1 (en) * 2018-01-30 2019-08-01 Fujitsu Limited Efficient distributed arrangement of virtual machines on plural host machines
CN110287003A (en) * 2019-06-28 2019-09-27 北京九章云极科技有限公司 The management method and management system of resource

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140344810A1 (en) * 2012-12-26 2014-11-20 Huawei Technologies Co.,Ltd. Resource management method and apparatus for virtual machine system, and virtual machine system
US20170060609A1 (en) * 2015-08-28 2017-03-02 International Business Machines Corporation Managing a shared pool of configurable computing resources which has a set of containers
WO2017045424A1 (en) * 2015-09-18 2017-03-23 乐视控股(北京)有限公司 Application program deployment system and deployment method
CN107832143A (en) * 2017-10-17 2018-03-23 北京京东尚科信息技术有限公司 A kind for the treatment of method and apparatus of physical machine resource
US20190235907A1 (en) * 2018-01-30 2019-08-01 Fujitsu Limited Efficient distributed arrangement of virtual machines on plural host machines
CN108365985A (en) * 2018-02-07 2018-08-03 深圳壹账通智能科技有限公司 A kind of cluster management method, device, terminal device and storage medium
CN108829509A (en) * 2018-05-03 2018-11-16 山东汇贸电子口岸有限公司 Distributed container cluster framework resources management method based on domestic CPU and operating system
KR101987661B1 (en) * 2018-07-19 2019-06-11 나무기술 주식회사 Cluster resource allocating and managing method on cloud platform
CN110287003A (en) * 2019-06-28 2019-09-27 北京九章云极科技有限公司 The management method and management system of resource

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897625A (en) * 2020-06-23 2020-11-06 新浪网技术(中国)有限公司 Kubernetes cluster-based resource event backtracking method and system and electronic equipment
CN111897625B (en) * 2020-06-23 2023-10-20 新浪技术(中国)有限公司 Resource event backtracking method, system and electronic equipment based on Kubernetes cluster

Similar Documents

Publication Publication Date Title
CN105049268A (en) Distributed computing resource allocation system and task processing method
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN109886693B (en) Consensus realization method, device, equipment and medium for block chain system
CN111277432A (en) Configuration information updating method and device, electronic equipment and storage medium
WO2018191849A1 (en) Cloud management platform, virtual machine management method and system thereof
CN111078404B (en) Computing resource determining method and device, electronic equipment and medium
CN112579304A (en) Resource scheduling method, device, equipment and medium based on distributed platform
CN112437129B (en) Cluster management method and cluster management device
CN111400041A (en) Server configuration file management method and device and computer readable storage medium
CN111209118A (en) Method and device for determining resource allowance, storage medium and electronic equipment
CN113658351A (en) Product production method and device, electronic equipment and storage medium
CN109542841A (en) The method and terminal device of data snapshot are created in cluster
CN111756800A (en) Method and system for processing burst flow
US10990385B1 (en) Streaming configuration management
CN115225645B (en) Service updating method, device, system and storage medium
CN107203333A (en) The method that block storage is automatically accessed in OpenStack cloud computing platforms
CN108154343B (en) Emergency processing method and system for enterprise-level information system
CN113312328B (en) Control method, data processing method, data access method and computing device
CN112448833A (en) Multi-management-domain communication method and device
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN115421920A (en) Task management method and device for financial product, electronic equipment and storage medium
CN115291891A (en) Cluster management method and device and electronic equipment
CN114416438A (en) Data export method and device, computer equipment and scheduling service system
WO2023209414A1 (en) Methods and apparatus for computing resource allocation
CN110768855B (en) Method and device for testing linkmzation performance

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200529

WW01 Invention patent application withdrawn after publication