CN113608838A - Deployment method and device of application image file, computer equipment and storage medium - Google Patents

Deployment method and device of application image file, computer equipment and storage medium Download PDF

Info

Publication number
CN113608838A
CN113608838A CN202110907009.0A CN202110907009A CN113608838A CN 113608838 A CN113608838 A CN 113608838A CN 202110907009 A CN202110907009 A CN 202110907009A CN 113608838 A CN113608838 A CN 113608838A
Authority
CN
China
Prior art keywords
slave node
slave
target
resource
node
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
CN202110907009.0A
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.)
Jishou University
Original Assignee
Jishou University
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 Jishou University filed Critical Jishou University
Priority to CN202110907009.0A priority Critical patent/CN113608838A/en
Publication of CN113608838A publication Critical patent/CN113608838A/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/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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/5072Grid computing
    • 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/45562Creating, deleting, cloning virtual machine instances
    • 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
    • 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/45591Monitoring or debugging support
    • 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/45595Network integration; Enabling network access in virtual machine instances
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a deployment method and device of an application image file, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining a target application image file, obtaining the resource use condition of each slave node according to stored time sequence data of each slave node, determining a target slave node from each slave node according to the resource use condition of each slave node, and sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, wherein the container set is used for deploying the target application image file. The time sequence data of each slave node is locally stored in the master node, so that the problem of resource waste of the slave nodes with more available resources can be avoided, and the resources of each slave node can be reasonably utilized.

Description

Deployment method and device of application image file, computer equipment and storage medium
Technical Field
The present application relates to the field of container cloud technologies, and in particular, to a method and an apparatus for deploying an application image file, a computer device, and a storage medium.
Background
Cloud computing provides services such as data storage, data processing, network bandwidth and the like for users in a metering mode. Through the cloud, a user can acquire unlimited resources only through network connection without the limitation of time and space, wherein the container technology is the core technology of cloud computing.
At present, if a certain enterprise needs to rent a cloud host with distributed cloud computing to deploy its own application program, a Kubernetes (hereinafter referred to as K8s) container technology is mostly adopted to deploy an application image file on the cloud host, that is, on a slave node in a K8s system. The process of deploying the application image file through the K8s container technology comprises the following steps: the master node in the K8s system needs to determine a target slave node randomly from a plurality of slave nodes, and the master node notifies the target slave node to generate a container set, so as to deploy the image file onto the container set.
However, because the current container cloud technology randomly determines a target node from a plurality of nodes to instruct the target node to generate a pod for deploying an application image file, there are problems that more application image files are deployed on the same slave node, and few application image files are not deployed or deployed on other slave nodes, which causes resource waste of other slave nodes.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for deploying an application image file, which can make reasonable use of resources of each slave node, in view of the above technical problems.
A deployment method of an application image file, the method comprising:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
In one embodiment, the method further comprises the following steps: periodically acquiring the time sequence data from each slave node; the time sequence data is data obtained after the slave node actively acquires the resource use condition of the slave node.
In one embodiment, the determining a target slave node from the slave nodes according to the resource usage of the slave nodes includes:
and selecting the slave node with the largest residual available resource from the various slave nodes according to the resource use condition of the various slave nodes, and determining the slave node with the largest available resource as the target slave node.
In one embodiment, the determining a target slave node from the slave nodes according to the resource usage of the slave nodes includes:
determining the residual available resources of each slave node according to the resource use condition of each slave node;
judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes;
and determining the candidate slave node with the largest remaining available resources as the target slave node.
In one embodiment, the time-series data includes resource usage of each slave node at each time within a last preset time period, and resource usage of each existing container set on each slave node.
In one embodiment, the method further comprises the following steps:
determining slave nodes to be migrated and adaptive slave nodes according to the resource use condition of each slave node;
and migrating the contents of part or all of the container sets on the slave nodes to be migrated to the adaptive slave nodes.
In one embodiment, the method further comprises the following steps:
determining an adaptive slave node according to the resource use condition of each slave node;
determining a container set to be migrated according to the resource use condition of each existing container set on the slave node;
and migrating the content of the container set to be migrated to the adaptation slave node.
An apparatus for deploying an application image file, the apparatus comprising:
the first acquisition module is used for acquiring a target application image file;
the second acquisition module is used for acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time length;
a first determining module, configured to determine a target slave node from the slave nodes according to resource usage of the slave nodes;
a sending module, configured to send a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, where the container set is used to deploy the target application image file.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
The deployment method, the deployment device, the computer equipment and the storage medium of the application image file acquire the target application image file, acquire the resource use condition of each slave node according to the stored time sequence data of each slave node, determine the target slave node from each slave node according to the resource use condition of each slave node, and send a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, wherein the container set is used for deploying the target application image file. The time sequence data of each slave node is locally stored in the master node, so that the resource use condition of each slave node can be obtained according to the time sequence data of each slave node, and the target slave node is further determined according to the resource use condition of each slave node, so that the target mirror image file is deployed to the slave node with more available resources, the problem of resource waste of the slave node with more available resources is solved, and the resources of each slave node are reasonably utilized.
Drawings
FIG. 1 is one of the system architecture diagrams of the deployment method of an application image file in one embodiment;
FIG. 2 is a flowchart illustrating a method for deploying an application image file according to an embodiment;
FIG. 3 is a flow diagram that illustrates a method for target slave node determination in one embodiment;
FIG. 4 is a flowchart illustrating a method for scheduling resources according to one embodiment;
FIG. 5 is a second flowchart illustrating a resource scheduling method according to an embodiment;
FIG. 6 is an architectural diagram of a mirror repository in one embodiment;
FIG. 7 is a second diagram illustrating the system architecture of the deployment method for application image files in one embodiment;
FIG. 8 is a diagram of a process for a scheduler to determine a target slave node in one embodiment;
FIG. 9 is a block diagram of CSP architecture in one embodiment;
FIG. 10 is a block diagram of an apparatus for deploying an application image file according to an embodiment;
FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a system architecture diagram of a deployment method of an application image file in one embodiment. The system comprises a master node and slave nodes, wherein the slave nodes shown in fig. 1 comprise a slave node 1 and a slave node 2, and the master node and the slave nodes can be servers. The method comprises the steps that the slave nodes actively acquire and store the resource use conditions of the slave nodes at different moments in real time, the master node periodically acquires the resource use conditions of the slave nodes from each slave node and stores the resource use conditions of each slave node, wherein the resource use conditions of the slave nodes in the master node are stored according to the sequence of the acquisition moments of the resource use conditions, namely, the master node stores time sequence data about the resource use conditions of the slave nodes. When the master node needs to deploy the target application program image file to the slave nodes, the master node may obtain resource usage of each slave node according to the stored time sequence data of each slave node, determine the target slave node from each slave node according to the resource usage of each slave node, and further send a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, where the container set is used for deploying the target application program image file.
Based on the system shown in fig. 1, for example, the present embodiment provides a deployment method of an application image file. As shown in fig. 2, fig. 2 is a schematic flowchart of a deployment method of an application image file in an embodiment, where an execution subject of the method is a master node, and the method includes the following steps:
s201, acquiring a target application image file.
The target application image file refers to an image file which can be operated by any computer equipment and is formed by packaging an executable file and a configuration file of a target application program by a user. The application may be some highly concurrent shopping websites that we visit daily or big data analysis websites, and the application in this embodiment is not limited to this.
In this embodiment, the target application image file may be acquired from an image repository, or may be acquired from an application image file stored in a cloud. The mirror image warehouse can be deployed on a main node or can be separately deployed on a database server.
S202, acquiring the resource use condition of each slave node according to the stored time series data of each slave node, wherein the time series data are used for representing the resource use condition of each slave node in the latest preset time.
In this embodiment, the master node stores time-series data of each slave node, and therefore, the master node can acquire the resource usage of each slave node according to the stored time-series data of each slave node. The resource usage of the slave node may include usage of resources such as a Central Processing Unit (CPU), a memory, and a hard disk of the slave node.
The resource usage may be the used resource amount of the slave node, or may be the ratio of the used resource amount to the total resource amount of the slave node. The master node may obtain resource usage within a preset duration of the slave node, for example, obtain resource usage of the slave node for the last half hour.
S203, according to the resource use condition of each slave node, determining a target slave node from each slave node.
Optionally, determining the target slave node from the slave nodes according to the resource usage of each slave node may be implemented as follows:
determining the priority of each slave node according to the resource use condition of each slave node; and taking the slave node with the highest priority as a target slave node.
In this embodiment, if the used resource amount of a slave node is larger or the ratio of the used resource amount to the total resource amount of the slave node is larger, it is determined that the priority given to the slave node is lower. A higher priority slave node means that more resources are available for that slave node.
And S204, sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, wherein the container set is used for deploying the target application image file.
In this embodiment, the target node may generate a container set (pod) according to the container set generation instruction, where the container set includes one or more containers.
In the deployment method of the application image file provided in this embodiment, by acquiring the target application image file, according to the stored time series data of each slave node, the resource usage of each slave node is acquired, according to the resource usage of each slave node, a target slave node is determined from each slave node, and a container set generation instruction is sent to the target slave node to instruct the target slave node to generate a container set, where the container set is used to deploy the target application image file. The time sequence data of each slave node is locally stored in the master node, so that the resource use condition of each slave node can be obtained according to the time sequence data of each slave node, and the target slave node is further determined according to the resource use condition of each slave node, so that the target mirror image file is deployed to the slave node with more available resources, the problem of resource waste of the slave node with more available resources is solved, and the resources of each slave node are reasonably utilized.
Optionally, on the basis of the above embodiment, the method may further include the following steps:
periodically acquiring time series data from each slave node; the time sequence data are data obtained after the nodes actively acquire the resource use conditions of the nodes.
In this embodiment, the master node periodically acquires time-series data from each slave node and stores the acquired time-series data, and further, when the target application image file needs to be deployed, the target slave node can be determined directly according to the stored time-series data. Therefore, a request does not need to be sent to the slave node to acquire the resource use condition of the slave node, so that the efficiency of the master node for determining the target slave node can be improved, and the deployment efficiency of the target application image file is accelerated.
Optionally, the above S203 may be implemented as follows:
and according to the resource use condition of each slave node, selecting the slave node with the largest residual available resource from each slave node, and determining the slave node with the largest available resource as the target slave node.
In this embodiment, the slave node with the largest remaining available resource may be used as the target slave node. If a plurality of slave nodes with the largest remaining available resources exist at the same time, any one of the plurality of slave nodes with the largest remaining available resources can be used as the target slave node.
For example, if the slave nodes include slave node a, slave node B, and slave node C, the total amount of resources of the slave node a, the slave node B, and the slave node C is the same, and an application image file has been deployed on the slave node a, and the remaining available resources of the slave node B and the slave node C are the same, the slave node B or the slave node C may be the target slave node.
In this embodiment, the slave node with the largest remaining available resource is selected from the slave nodes according to the resource usage of each slave node, and the slave node with the largest available resource is determined as the target slave node, so that the problem of resource waste of the slave node with a large number of available resources is solved, and the resources of each slave node are reasonably utilized.
Referring to fig. 3, fig. 3 is a flow diagram illustrating a method for target slave node determination in one embodiment. The embodiment relates to an optional implementation manner of how to determine a target slave node from each slave node according to the resource use condition of each slave node. On the basis of the above embodiment, the above S203 may be implemented as follows:
s301, determining the residual available resources of each slave node according to the resource use condition of each slave node.
S302, judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes.
And judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes, namely filtering the slave nodes of which the residual available resources are smaller than the preset resource limit value, so that the target slave nodes can be determined from fewer candidate slave nodes, and the determination efficiency of the target slave nodes is improved.
S303, determining the candidate slave node with the largest residual available resource as a target slave node.
In this embodiment, by filtering out a part of the slave nodes with less remaining available resources, in S303, the candidate slave node with the largest remaining available resource may be selected from the fewer candidate slave nodes, and the candidate slave node with the largest remaining available resource is taken as the target slave node, so that the selection efficiency of the target slave node is improved.
Optionally, the time-series data includes resource usage of each slave node at each time within a last preset time period, and resource usage of each existing container set on each slave node.
In this embodiment, one node may include one or more container sets, one container set may include one or more containers, the master node stores resource usage of the existing container sets of the respective slave nodes, therefore, whether the resource usage of the existing container set on the slave node reaches the preset peak value condition can be judged according to the resource usage of the existing container set of each slave node, if the resource usage of the container set is not less than the preset peak value, the container set can be used as a container set to be migrated, the content of the container set to be migrated is migrated to the adapted slave node with the most available resources in other slave nodes, wherein the other slave nodes comprise slave nodes except the slave node where the container set to be migrated is located in all the slave nodes of the master node, therefore, the capacity expansion of the container set is realized, and the problem that the operation of the container set is influenced by less available resources of the container set to be migrated is avoided.
Optionally, if the resource usage amount of a certain container set on the slave node is not less than the preset peak value, the master node may also send a container set generation instruction to the slave node to instruct the slave node to generate a new container set, where the new container set is used to deploy the application image file of the container set, so as to implement capacity expansion of the container set, and avoid a problem that the container set to be migrated affects operation of the container set due to less available resources.
For example, the order flow of the shopping mall business orders on each large network shows very obvious time-saving performance, the business order flow is not much in normal times, but the business flow is increased dramatically when the online merchants discount the business orders, the business flow is calculated in seconds, and the high concurrency problem can be better handled by expanding the container set.
In one embodiment, the following steps may also be included. Referring to fig. 4, fig. 4 is a flowchart illustrating a resource scheduling method according to an embodiment. The embodiment relates to an optional implementation manner of reasonably utilizing the resources of each slave node according to the resource use condition of each slave node. On the basis of the above embodiment, the method comprises the following steps:
s401, according to the resource use condition of each slave node, determining the slave node to be migrated and the adaptive slave node.
In this embodiment, the remaining available resources of each slave node may be determined according to the resource usage of each slave node; judging whether the residual available resources of the slave nodes are smaller than a preset resource limit value or not; and taking the slave node with the residual available resource smaller than the preset resource limit value as the slave node to be migrated, and taking the slave node with the maximum residual available resource as the adaptive slave node.
Optionally, any slave node whose remaining available resource is not less than the preset resource limit may also be used as the adaptive slave node.
S402, migrating the contents of part or all of the container sets on the slave nodes to be migrated to the adaptation slave nodes.
In this embodiment, after the slave node to be migrated is determined, the contents of all container sets of the slave node to be migrated may be directly migrated to the adapted slave node.
According to the method provided by the embodiment, the slave node to be migrated and the adaptation slave node are determined according to the resource use condition of each slave node, and the content of part or all of the containers on the slave node to be migrated is migrated to the adaptation slave node, so that the content of part or all of the container sets on the slave node can be migrated to the adaptation slave node under the condition that the available resource of a certain slave node is less, and the problem that the available resource on the slave node to be migrated affects the operation of the container sets less is avoided.
In one embodiment, the following steps may also be included. Referring to fig. 5, fig. 5 is a second flowchart illustrating a resource scheduling method according to an embodiment. The embodiment relates to an optional implementation mode of how to determine a container set to be migrated according to the resource use condition of an existing container set of a slave node so as to reasonably utilize the resource of each slave node. On the basis of the above embodiment, the method comprises the following steps:
s501, determining adaptive slave nodes according to the resource use condition of each slave node.
In this step, the slave node with the most available resources left in each slave node may be used as the adaptive slave node.
S502, determining a container set to be migrated according to the resource use condition of each existing container set on the slave node.
As the cloud scale is increased continuously with the explosive increase of the user quantity, the corresponding number of containers is also increased sharply, and therefore, how to optimize the scheduling of the container set is called a problem to be solved urgently. In this embodiment, the slave node may monitor the resource usage of the container set in real time, and the master node periodically obtains the resource usage of the container set from each slave node, so that the container set to be migrated may be determined according to the resource usage of each existing container set on the slave node, and scheduling between the container sets may be optimized.
For example, if there are two container sets on the slave node a, where the two container sets include a container set 1 and a container set 2, the remaining available resources of the container set 1 are less than the preset threshold, and the remaining available resources of the container set 2 are not less than the preset threshold, the container set 1 is taken as the container set to be migrated.
It should be noted that the slave node may also determine whether the remaining available resources of its own container set are smaller than a preset threshold, and if so, may send a scheduling request to the master node, so that the master node migrates the contents of the container set whose remaining available resources are smaller than the preset threshold to the adapted slave node. Or the master node judges whether the remaining available resources of the container set of the slave node are smaller than a preset threshold value or not, and actively migrates the contents of the container set of which the remaining available resources are smaller than the preset threshold value to the adaptive slave node.
S503, migrating the content of the container set to be migrated to the adaptation slave node.
In this embodiment, the adaptive slave node is determined according to the resource usage of each slave node, the container set to be migrated is determined according to the resource usage of each existing container set on the slave node, and the content of the container set to be migrated is migrated to the adaptive slave node, so that the problem that the operation of the container set is less affected by available resources on the container set to be migrated can be avoided.
Optionally, the above S201 may be implemented as follows:
and the main node acquires the target application image file from the image warehouse.
The mirror repository may be a Harbor repository, and the architecture of the Harbor repository is as follows fig. 6, and fig. 6 is an architecture diagram of the mirror repository in one embodiment. After the application image file is manufactured by the developer, the application image file can be uploaded to an image warehouse. The mirror repository includes an agent component, a core service, a registration component, a task service component, a database component, and a log collection component. The system comprises a Proxy component, a registration component, a Database component, a task service component and a Log collector component, wherein the Proxy component proxies a request from a Browser (Browser) and forwards the request to a core service, the registration component processes an uploading, pulling and storage mirror image request, the Database component stores warehouse user data, a synchronization strategy and mirror image data, the task service component is mainly used for copying an application mirror image file, and the Log collector component is responsible for collecting Log information. The Core services (cores) are the Core functions of the mirror repository, wherein a User Interface (User Interface) assists a User in managing mirror files in a graphical User Interface mode, Webhook serves as a mechanism, when the application mirror files are changed, the mirror repository is informed to update logs, and a token (token) control issues a token to each command according to User rights.
The application image file is managed through the image warehouse, the application image file is scanned to detect whether a bug exists, if the bug exists, the bug can be repaired, and therefore the safety of the application image file is guaranteed.
Because the mirror repository issues a token for each command according to the user right, the user can access the mirror repository after logging in to a resource Scheduling Platform (CSP) by inputting the token. The user authority is different, and the authority for accessing the mirror image warehouse is different, for example, an administrator can completely control the whole hardor warehouse, a developer can only upload and update the application mirror image file, and a tester can detect the vulnerability of the application mirror image file. By issuing tokens for users with different authorities, the influence on the irrecoverability of the application image file in the image warehouse caused by operations such as modification or deletion of the application image file in the warehouse by different users is avoided, and therefore the integrity and the safety of the application image file can be ensured by issuing the tokens through a digital signature technology.
For a clearer explanation of the above embodiments, the deployment process of the application image file is further described with reference to fig. 7. Referring to fig. 7, fig. 7 is a second system architecture diagram of a deployment method of an Application image file in an embodiment, a master node in the system includes an Application Programming Interface (API) service, a Scheduler (Scheduler), an extension process (Extender), and a proxy Server, a slave node in the system includes a slave node 1 and a slave node 2, each slave node includes a monitoring component (Exporter), and the monitoring component is configured to monitor resource usage of the slave node and resource usage of each existing container set on the slave node.
When the master node needs to deploy the target application image file to the slave nodes, a scheduler on the master node can send a notification message to the extension process to notify the extension process to acquire the resource use condition of each slave node, and the extension process sends a data query request to the Prometous Server. And after receiving the data query request, the Prometheus Server queries the stored time series data of each slave node and returns the time series data of each slave node to the expansion process. And the expansion process acquires the resource use condition of each slave node according to the time sequence data of each slave node, determines the residual available resources of each slave node according to the resource use condition of each slave node and the total resource amount of each slave node, and quantizes the residual available resources of each slave node to obtain the quantized value of each slave node. Wherein, the more the remaining available resources of the slave node are, the higher the quantization value of the slave node is.
After the extension process obtains the quantized value of each slave node, the quantized value of each slave node can be sent to the scheduler, the scheduler can determine the weight of each slave node according to the quantized value of each slave node, and further obtain the final quantized value of each slave node according to the quantized value and the weight of each slave node, and the higher the final quantized value is, the higher the scheduler can take the slave node with the highest final quantized value as the target slave node. After the target slave node is determined, the scheduler sends a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, wherein the container set is used for deploying the target application image file.
It should be noted that, after the extension process determines the remaining available resources of each slave node, the remaining available resources of each slave node may also be sent to the scheduler, the scheduler determines whether the remaining available resources of each slave node are smaller than a preset resource limit, filters out the slave nodes whose remaining available resources are smaller than the preset resource limit, reserves the slave nodes whose remaining available resources are not smaller than the preset resource limit, and uses the reserved slave nodes as candidate slave nodes. Specifically, referring to fig. 8, fig. 8 is a diagram illustrating a process for a scheduler to determine a target slave node in one embodiment. The process of the dispatcher determining the target slave node comprises a Pre-filter stage at the beginning of a preselection stage, a Post-filter stage at the preselection stage and a Post-scrambling stage at the end of a preference stage, and a self-defined dispatching algorithm can be developed in the expansion stages to realize self-defined dispatching.
As shown in fig. 7 and 8, the extension process may send node list information to the scheduler, the node list information including the size of the remaining available resources corresponding to each slave node, and send the resource usage of the container set (pod) of each slave node to the scheduler. The extension process may sort the container sets of the slave nodes according to the resource usage of the container sets of the slave nodes, and send the sorting result to the scheduler. In the Pre-selection (Pre-filter) stage, the slave nodes with the remaining available resources smaller than the preset resource limit value can be filtered, the remaining slave nodes are filtered again in the filter stage, the remaining slave nodes after being filtered again are submitted to the quantization (screening) stage in the Post-filter (Post-filter) stage, the remaining slave nodes after being filtered again are quantized in the screening stage, the quantized values are submitted to the Post-quantizer (Post-screening) stage, and the slave nodes corresponding to the highest quantized values are taken as target slave nodes in the Post-screening stage.
It should be noted that, the scheduler may also determine the remaining available resources of the existing container set according to the resource usage of the existing container set (pod) of each slave node sent by the extension process, use the container set whose remaining available resources are smaller than the preset threshold as the container set to be scheduled, determine an adapted slave node from other slave nodes according to the resource usage of other slave nodes, and schedule the content of the container set to be scheduled to the adapted slave node, where the other slave nodes are the remaining slave nodes except for the slave node where the container set to be scheduled is located in all the slave nodes.
Optionally, the scheduler may further determine a resource usage rate of the existing container set according to a resource usage condition of the existing container set of each slave node, and reduce the resource allocated to the existing container set if the resource usage rate is lower than a preset resource usage rate. If the resource utilization rate of the existing container set is lower than 30%, the resources allocated to the container set are appropriately reduced, for example, resources such as a disk, a CPU, and a memory of the existing container set are reduced, so that the saved resources can be allocated to other container sets for use, and the resources of each slave node are utilized to the maximum extent.
According to the deployment method of the application image file, resources of all slave nodes are reasonably utilized through the CSP platform, and the utilization rate of the resources is improved. Referring to fig. 9, fig. 9 is a CSP structural block diagram in an embodiment, and a CSP structural framework in this embodiment is shown in fig. 9.
The core Engine (Container Engine) is a core Engine of a Container running environment and a standard unified Container environment, and various operations (starting, stopping, etc.), network and storage configurations of the Container can be realized without being referred to as a configuration file of an application image again in different devices. The programs of the CSP directly use the hardware resources of the physical machine. Therefore, the CSP system can increase the usage of the disk, CPU, and memory.
Wherein, App A/App B refers to application process, Bins/Libs refers to box container, Host OS refers to Host operating system, and infrastructure refers to infrastructure.
And the CSP system divides an integral application into independent small parts to be stored in different containers, simultaneously a plurality of containers share the same set of operating system resources, the application management and control deployment is directly carried out in the CSP through a main node, namely a Master node, and a related operating environment is automatically generated. Because the CSP deploys the application to different operating systems through the container technology, the configuration file of the application image file does not need to be changed, and the deployment environments of the application in the container are consistent, the consistency of the execution environment is ensured, and the application migration is easier.
It should be understood that although the various steps in the flow charts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 10, fig. 10 is a block diagram of a deployment apparatus for applying an image file in one embodiment. The apparatus 1000 of the present embodiment includes:
a first obtaining module 1001, configured to obtain a target application image file;
a second obtaining module 1002, configured to obtain resource usage of each slave node according to stored time series data of each slave node, where the time series data is used to represent resource usage of each slave node within a latest preset time;
a first determining module 1003, configured to determine a target slave node from the slave nodes according to resource usage of the slave nodes;
a sending module 1004, configured to send a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, where the container set is used to deploy the target application image file.
The deployment device for the application image file according to this embodiment obtains the target application image file, obtains the resource usage of each slave node according to the stored time series data of each slave node, determines a target slave node from each slave node according to the resource usage of each slave node, and sends a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, where the container set is used for deploying the target application image file. The time sequence data of each slave node is locally stored in the master node, so that the resource use condition of each slave node can be obtained according to the time sequence data of each slave node, and the target slave node is further determined according to the resource use condition of each slave node, so that the target mirror image file is deployed to the slave node with more available resources, the problem of resource waste of the slave node with more available resources is solved, and the resources of each slave node are reasonably utilized.
In one embodiment, the method may further include: periodically acquiring the time sequence data from each slave node; the time sequence data is data obtained after the slave node actively acquires the resource use condition of the slave node.
In one embodiment, the first determining module 1003 is specifically configured to select, according to the resource usage of each slave node, a slave node with the largest remaining available resource from the slave nodes, and determine the slave node with the largest available resource as the target slave node.
In one embodiment, the first determining module 1003 is specifically configured to determine, according to the resource usage of each slave node, the remaining available resources of each slave node; judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes; and determining the candidate slave node with the largest remaining available resources as the target slave node.
In one embodiment, the time-series data includes resource usage of each slave node at each time within a last preset time period, and resource usage of each existing container set on each slave node.
In one embodiment, the method may further include: a second determining module, configured to determine a slave node to be migrated and an adapted slave node according to resource usage of each slave node; a first migration module, configured to migrate contents of part or all of the container sets on the slave node to be migrated to the adapted slave node.
In one embodiment, the method may further include: a third determining module, configured to determine an adapted slave node according to the resource usage of each slave node; a fourth determining module, configured to determine a container set to be migrated according to resource usage of each existing container set on the slave node; and the second migration module is used for migrating the content of the container set to be migrated to the adaptation slave node.
For specific limitations of the deployment apparatus of the application image file, reference may be made to the above limitations on the deployment method of the application image file, which are not described herein again. The modules in the deployment apparatus of the application image file may be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the time series data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a deployment method for an application image file.
Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
periodically acquiring the time sequence data from each slave node; the time sequence data is data obtained after the slave node actively acquires the resource use condition of the slave node.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and selecting the slave node with the largest residual available resource from the various slave nodes according to the resource use condition of the various slave nodes, and determining the slave node with the largest available resource as the target slave node.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining the residual available resources of each slave node according to the resource use condition of each slave node; judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes; and determining the candidate slave node with the largest remaining available resources as the target slave node.
In one embodiment, the time series data includes resource usage of each slave node at each time within a last preset time period, and resource usage of each existing container set on each slave node.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining slave nodes to be migrated and adaptive slave nodes according to the resource use condition of each slave node; and migrating the contents of part or all of the container sets on the slave nodes to be migrated to the adaptive slave nodes.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining an adaptive slave node according to the resource use condition of each slave node; determining a container set to be migrated according to the resource use condition of each existing container set on the slave node; and migrating the content of the container set to be migrated to the adaptation slave node.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
In one embodiment, the computer program when executed by the processor further performs the steps of:
periodically acquiring the time sequence data from each slave node; the time sequence data is data obtained after the slave node actively acquires the resource use condition of the slave node.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and selecting the slave node with the largest residual available resource from the various slave nodes according to the resource use condition of the various slave nodes, and determining the slave node with the largest available resource as the target slave node.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the residual available resources of each slave node according to the resource use condition of each slave node; judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes; and determining the candidate slave node with the largest remaining available resources as the target slave node.
In one embodiment, the time series data includes resource usage of each slave node at each time within a last preset time period, and resource usage of each existing container set on each slave node.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining slave nodes to be migrated and adaptive slave nodes according to the resource use condition of each slave node; and migrating the contents of part or all of the container sets on the slave nodes to be migrated to the adaptive slave nodes.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining an adaptive slave node according to the resource use condition of each slave node; determining a container set to be migrated according to the resource use condition of each existing container set on the slave node; and migrating the content of the container set to be migrated to the adaptation slave node.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A deployment method of an application image file is characterized by comprising the following steps:
acquiring a target application mirror image file;
acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time;
determining target slave nodes from the slave nodes according to the resource use conditions of the slave nodes;
sending a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, the container set being used for deploying the target application image file.
2. The method of claim 1, further comprising:
periodically acquiring the time sequence data from each slave node; the time sequence data is data obtained after the slave node actively acquires the resource use condition of the slave node.
3. The method according to claim 1 or 2, wherein the determining a target slave node from the slave nodes according to the resource usage of the slave nodes comprises:
and selecting the slave node with the largest residual available resource from the various slave nodes according to the resource use condition of the various slave nodes, and determining the slave node with the largest available resource as the target slave node.
4. The method according to claim 1 or 2, wherein the determining the target slave node from the slave nodes according to the resource usage of the slave nodes comprises:
determining the residual available resources of each slave node according to the resource use condition of each slave node;
judging whether the residual available resources of each slave node are smaller than a preset resource limit value or not, and determining the slave nodes of which the residual available resources are not smaller than the preset resource limit value as candidate slave nodes;
and determining the candidate slave node with the largest remaining available resources as the target slave node.
5. The method of claim 1,
the time series data comprise the resource use condition of each slave node at each moment in the latest preset time length and the resource use condition of each existing container set on each slave node.
6. The method of claim 5, further comprising:
determining slave nodes to be migrated and adaptive slave nodes according to the resource use condition of each slave node;
and migrating the contents of part or all of the container sets on the slave nodes to be migrated to the adaptive slave nodes.
7. The method of claim 5, further comprising:
determining an adaptive slave node according to the resource use condition of each slave node;
determining a container set to be migrated according to the resource use condition of each existing container set on the slave node;
and migrating the content of the container set to be migrated to the adaptation slave node.
8. An apparatus for deploying an application image file, the apparatus comprising:
the first acquisition module is used for acquiring a target application image file;
the second acquisition module is used for acquiring the resource use condition of each slave node according to the stored time sequence data of each slave node, wherein the time sequence data is used for representing the resource use condition of each slave node in the latest preset time length;
a first determining module, configured to determine a target slave node from the slave nodes according to resource usage of the slave nodes;
a sending module, configured to send a container set generation instruction to the target slave node to instruct the target slave node to generate a container set, where the container set is used to deploy the target application image file.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. 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 any one of claims 1 to 7.
CN202110907009.0A 2021-08-09 2021-08-09 Deployment method and device of application image file, computer equipment and storage medium Pending CN113608838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110907009.0A CN113608838A (en) 2021-08-09 2021-08-09 Deployment method and device of application image file, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110907009.0A CN113608838A (en) 2021-08-09 2021-08-09 Deployment method and device of application image file, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113608838A true CN113608838A (en) 2021-11-05

Family

ID=78339913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110907009.0A Pending CN113608838A (en) 2021-08-09 2021-08-09 Deployment method and device of application image file, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113608838A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961314A (en) * 2021-12-16 2022-01-21 苏州浪潮智能科技有限公司 Container application scheduling method and device, electronic equipment and storage medium
CN115562841A (en) * 2022-11-10 2023-01-03 军事科学院系统工程研究院网络信息研究所 Cloud video service self-adaptive resource scheduling system and method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961314A (en) * 2021-12-16 2022-01-21 苏州浪潮智能科技有限公司 Container application scheduling method and device, electronic equipment and storage medium
WO2023109015A1 (en) * 2021-12-16 2023-06-22 苏州浪潮智能科技有限公司 Container application scheduling method and apparatus, electronic device and storage medium
CN115562841A (en) * 2022-11-10 2023-01-03 军事科学院系统工程研究院网络信息研究所 Cloud video service self-adaptive resource scheduling system and method

Similar Documents

Publication Publication Date Title
CN111800282B (en) Network system, instance management and control method, device and storage medium
CN108845884B (en) Physical resource allocation method, device, computer equipment and storage medium
CN111966305A (en) Persistent volume allocation method and device, computer equipment and storage medium
US11188561B2 (en) Prioritizing microservices on a container platform for a restore operation
CN113296792B (en) Storage method, device, equipment, storage medium and system
CN111880936B (en) Resource scheduling method, device, container cluster, computer equipment and storage medium
CN111176818B (en) Distributed prediction method, device, system, electronic equipment and storage medium
CN108572845B (en) Upgrading method of distributed micro-service cluster and related system
CN113608838A (en) Deployment method and device of application image file, computer equipment and storage medium
CN111381928B (en) Virtual machine migration method, cloud computing management platform and storage medium
CN111866045B (en) Information processing method and device, computer system and computer readable medium
CN113051075A (en) Kubernetes intelligent capacity expansion method and device
CN112910937B (en) Object scheduling method and device in container cluster, server and container cluster
CN114090176A (en) Kubernetes-based container scheduling method
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN113204353B (en) Big data platform assembly deployment method and device
CN114528085A (en) Resource scheduling method, device, computer equipment, storage medium and program product
CN114253459A (en) Method and device for creating persistent data volume and server
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN108111559B (en) Application software deployment system and method
CN112965817B (en) Resource management method and device and electronic equipment
CN111352726A (en) Streaming data processing method and device based on containerized micro-service
CN108228272B (en) WEB container generation processing method, equipment and server
CN116881012A (en) Container application vertical capacity expansion method, device, equipment and readable storage medium
CN112306640A (en) Container dispensing method, apparatus, device and medium therefor

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