CN112445574B - Application container multi-cluster migration method and device - Google Patents

Application container multi-cluster migration method and device Download PDF

Info

Publication number
CN112445574B
CN112445574B CN202011356221.4A CN202011356221A CN112445574B CN 112445574 B CN112445574 B CN 112445574B CN 202011356221 A CN202011356221 A CN 202011356221A CN 112445574 B CN112445574 B CN 112445574B
Authority
CN
China
Prior art keywords
cluster
application container
application
deployment
copies
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.)
Active
Application number
CN202011356221.4A
Other languages
Chinese (zh)
Other versions
CN112445574A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202011356221.4A priority Critical patent/CN112445574B/en
Publication of CN112445574A publication Critical patent/CN112445574A/en
Application granted granted Critical
Publication of CN112445574B publication Critical patent/CN112445574B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application provides a multi-cluster migration method and device for application containers, which can be applied to the field of cloud computing, and the method comprises the following steps: receiving an application container deployment instruction sent by a federal cluster management platform, and executing corresponding application container deployment operation according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling strategy; monitoring whether the state of each member cluster changes, and executing corresponding cluster migration operation according to the change characteristics of the state of each member cluster after monitoring that the state of each member cluster changes; the application container deployment and migration method and device can flexibly realize deployment and migration of the application container in multiple clusters.

Description

Application container multi-cluster migration method and device
Technical Field
The application relates to the field of cloud computing, in particular to a multi-cluster migration method and device for application containers.
Background
As applications on the cloud increase, application service scales become larger, application containers become larger, and host resources required increase. The host computer node scale on the cluster can cause greater and greater pressure on the performance of the cluster management component, and when the node reaches a certain scale, the cluster management component can run abnormally, so that the host computer node scale which can be managed by the cluster on each cloud is limited. Because of the performance bottleneck of cluster management software, single cluster host nodes have upper limit, and one cluster can manage 1000 host nodes at maximum. After the cluster reaches the upper limit of the scale, a new cluster needs to be built to meet the demands on host resources. After a new cluster is built, the part of the containers that need to be applied are migrated from the old cluster to the new cluster. Since the cluster management component version upgrades, the old cluster version cannot meet the application requirements, the application container needs to use the new version cluster, and at this time, the application container needs to be migrated from the old cluster to the new cluster.
Because cloud computing technology updates and iterates very fast, the version of the cluster management component is updated frequently, so that old clusters need to be offline, and new clusters are added. For cloud application and business rapid expansion of large companies, the cluster scale rapidly expands. Cluster management technology updates and cluster scale expansion are two main factors that lead to application container migration, and two factors lead to frequent migration of cloud-up application containers to meet the demands. For the cloud computing cluster management platform, the old clusters can be disconnected after all the containers deployed on the clusters are stopped, the process depends on the migration speed of the application containers, cluster resources cannot be recovered in time, and the process consumes time and server resources.
The inventors have found that prior art container deployment approaches require a user to specify the deployment cluster and the number of container copies. When an application performs container migration, new cluster information needs to be acquired, a container deployed cluster is modified to be a new cluster, then a previously deployed container is killed on an old cluster, and then the container is started on the new cluster. The scheme is opaque to the application, so that the application needs to frequently modify the cluster and restart the container in the process of frequently migrating the cluster, the operation flow is complex, and the user experience is not friendly. After all containers deployed on the old cluster are stopped, the cluster management platform can be used for offline of the old cluster, so that the cluster management platform and the application are mutually dependent, and decoupling of the cluster management and application deployment container modules cannot be achieved.
Therefore, how to provide a new solution to the above technical problems is a technical problem to be solved in the art.
Disclosure of Invention
Aiming at the problems in the prior art, the application container multi-cluster migration method and device can flexibly realize deployment and migration of application containers in multiple clusters.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides an application container multi-cluster migration method, including:
receiving an application container deployment instruction sent by a federal cluster management platform, and executing corresponding application container deployment operation according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling strategy;
and monitoring whether the state of each member cluster changes, and executing corresponding cluster migration operation according to the change characteristics of the state of each member cluster after monitoring that the state of each member cluster changes.
Further, the executing the corresponding application container deployment operation according to the total copy number of the application deployment and the cluster scheduling policy in the application container deployment instruction includes:
determining the deployment number of the application container copies of each member cluster corresponding to the main cluster by the main cluster according to the total number of the application deployment copies in the application container deployment instruction and the cluster scheduling strategy;
and the master cluster issues the deployment quantity of the application container copies to the corresponding member clusters, and the member clusters execute corresponding application container deployment operations according to the deployment quantity of the application container copies.
Further, the monitoring whether the status of each member cluster changes, and after monitoring that the status of each member cluster changes, executing corresponding cluster migration operation according to the status change characteristics of each member cluster, includes:
monitoring whether a member cluster to be online exists or not through a federal cluster management control component, if so, adding the member cluster to be online into the federal cluster through the federal cluster management control component, deploying application container copies on the member cluster, and stopping deploying the application container copies on the member cluster on which the application container copies are deployed, wherein the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped from being deployed on the member cluster on which the application container copies are stopped.
Further, the monitoring whether the status of each member cluster changes, and after monitoring that the status of each member cluster changes, executing corresponding cluster migration operation according to the status change characteristics of each member cluster, includes:
and monitoring whether a member cluster to be offline exists or not through a federal cluster management control component, if so, removing the federal cluster from the member cluster to be offline through the federal cluster management control component, and increasing the number of application container copies deployed on other member clusters, wherein the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
In a second aspect, the present application provides an application container multi-cluster migration apparatus, including:
the application container deployment module is used for receiving an application container deployment instruction sent by the federal cluster management platform and executing corresponding application container deployment operation according to the total application deployment copy number and the cluster scheduling policy in the application container deployment instruction;
and the cluster migration module is used for monitoring whether the state of each member cluster changes or not, and executing corresponding cluster migration operation according to the change characteristics of the state of the member cluster after the change of the state of the member cluster is monitored.
Further, the application container deployment module includes:
the container copy deployment number determining unit is used for determining the deployment number of the application container copies of each member cluster corresponding to the main cluster by the main cluster according to the total number of the application deployment copies in the application container deployment instruction and the cluster scheduling strategy.
And the container copy deployment instruction issuing unit is used for issuing the application container copy deployment quantity to each corresponding member cluster by the main cluster, and executing corresponding application container deployment operation by the member clusters according to the application container copy deployment quantity.
Further, the cluster migration module includes:
the newly added cluster migration unit is used for monitoring whether a member cluster to be online exists or not through the federal cluster management control component, if so, adding the member cluster to be online into the federal cluster through the federal cluster management control component, deploying application container copies on the member cluster, and stopping deploying the application container copies on the member cluster with the application container copies deployed, wherein the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped to be deployed on the member cluster with the application container copies stopped to be deployed.
Further, the cluster migration module includes:
the cluster removal migration unit is used for monitoring whether a member cluster to be offline exists or not through the federal cluster management control component, if so, removing the member cluster to be offline from the federal cluster through the federal cluster management control component, and increasing the number of application container copies deployed on other member clusters, wherein the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the application container multi-cluster migration method when the program is executed.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the application container multi-cluster migration method.
As can be seen from the above technical solution, the present application provides a method and an apparatus for multi-cluster migration of an application container, by receiving an application container deployment instruction sent by a federal cluster management platform, and executing a corresponding application container deployment operation according to a total number of application deployment copies and a cluster scheduling policy in the application container deployment instruction; and monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an application container multi-cluster migration method according to an embodiment of the present application;
FIG. 2 is a second flow chart of a multi-cluster migration method of an application container according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of an application container multi-cluster migration apparatus according to an embodiment of the present application;
FIG. 4 is a second block diagram of an application container multi-cluster migration apparatus according to an embodiment of the present application;
FIG. 5 is a third block diagram of an application container multi-cluster migration apparatus according to an embodiment of the present application;
FIG. 6 is a fourth block diagram of an application container multi-cluster migration apparatus in an embodiment of the present application;
FIG. 7 is a diagram of a federated cluster application container deployment diagram in an embodiment of the present application;
FIG. 8 is a diagram illustrating a change in state of a member of a federal cluster in accordance with one embodiment of the present application;
FIG. 9 is a second diagram illustrating a change in state of a member of a federal cluster in accordance with one embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Considering that the container deployment approach in the prior art requires a user to specify the deployment cluster and the number of container copies. When an application performs container migration, new cluster information needs to be acquired, a container deployed cluster is modified to be a new cluster, then a previously deployed container is killed on an old cluster, and then the container is started on the new cluster. The scheme is opaque to the application, so that the application needs to frequently modify the cluster and restart the container in the process of frequently migrating the cluster, the operation flow is complex, and the user experience is not friendly. After all containers deployed on an old cluster are stopped, the cluster management platform can be used for downloading the old cluster, so that the problem that cluster management platform and application are mutually dependent and decoupling of cluster management and application deployment container modules cannot be achieved is solved. And monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
In order to flexibly implement deployment and migration of application containers in multiple clusters, the application provides an embodiment of an application container multiple cluster migration method, referring to fig. 1, where the application container multiple cluster migration method specifically includes the following contents:
step S101: and receiving an application container deployment instruction sent by the federal cluster management platform, and executing corresponding application container deployment operation according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling strategy.
It may be understood that, the execution body of the technical solution of the present application may be a federal cluster, specifically, a cluster federal management control component kubuffed is installed and deployed on a certain cluster, the component is used to manage a federal cluster, a join command of a control panel of the federal cluster is used to add the cluster to the federal cluster, when the cluster exits, the cluster may be deleted from the federal cluster by an unjoin command, a control panel kubuffed of the federal cluster is installed, and the objective of the cluster of the component is to implement a mechanism that a single cluster manages multiple clusters uniformly, and multiple clusters may be deployed and operated simultaneously by the federal cluster.
It can be appreciated that the cluster needing to deploy the container is added to the federation cluster, one cluster is designated as a main cluster of the federation cluster, the rest clusters are member clusters, preferably, only one cluster in one federation cluster is the main cluster, and the main clusters can be switched at will.
Optionally, when receiving an application container deployment instruction sent by the federation cluster management platform and executing the application deployment container to work, the deployment policy is connected to the main cluster, and then issued to each member cluster of the federation cluster by the main cluster.
Optionally, when the application deploys the container through the federal cluster management platform (e.g., a PAAS management platform), it is unnecessary to specify the deployed cluster, and only the number of copies to be deployed under the template is specified, and the deployment policy selects the balanced scheduling policy. After the main cluster is calculated, the calculated result is issued to member clusters of each federal cluster, and finally containers required by application are deployed in the whole federal cluster in a balanced mode, so that the number of the containers is ensured to be the number of the copies deployed by the application.
Step S102: and monitoring whether the state of each member cluster changes, and executing corresponding cluster migration operation according to the change characteristics of the state of each member cluster after monitoring that the state of each member cluster changes.
Alternatively, when a new cluster joins the federation, the federation cluster perceives the joining of the new cluster and recalculates the number of containers each cluster needs to deploy. And starting the application container on the new cluster according to the strategy, and stopping the container on the old cluster, so that the total number of the application deployment containers in the whole federal cluster is ensured to be unchanged. The deployment strategy is completed through an algorithm, and the aim of container migration is achieved under the condition that the restarting quantity of the application container is minimum.
Alternatively, when an old cluster comes down, the cluster is removed from the federal cluster. The federal cluster perceives the cluster removal, and additionally the containers started on the cluster are unchanged, and a corresponding number of containers will be started on the other clusters, keeping the total number of application containers unchanged. The deployment algorithm keeps the containers started on other federal clusters unchanged, and simultaneously, the containers started on the offline clusters are uniformly scheduled on other clusters, so that the total number of the deployed containers applied is unchanged under the condition that the number of the restarted containers is minimum.
As can be seen from the above description, the application container multi-cluster migration method provided by the embodiment of the present application can execute corresponding application container deployment operations by receiving an application container deployment instruction sent by a federal cluster management platform, and according to the total application deployment copy number and the cluster scheduling policy in the application container deployment instruction; and monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
In order to accurately and automatically perform the application container deployment operation according to the application container deployment instruction, in an embodiment of the application container multi-cluster migration method of the present application, referring to fig. 2, the step S101 may further specifically include the following:
step S201: and determining the deployment number of the application container copies of each member cluster corresponding to the main cluster by the main cluster according to the total number of the application deployment copies in the application container deployment instruction and the cluster scheduling strategy.
Step S202: and the master cluster issues the deployment quantity of the application container copies to the corresponding member clusters, and the member clusters execute corresponding application container deployment operations according to the deployment quantity of the application container copies.
Specifically, when an application container deployment instruction sent by the federation cluster management platform is received and an application deployment container is executed, a deployment policy is connected to a main cluster, and then the main cluster issues the deployment policy to each member cluster of the federation cluster. When the application deploys the container through the federal cluster management platform (for example, a PAAS management platform), the deployed cluster is not required to be specified, only the number of copies to be deployed under the template is required to be specified, and the deployment strategy selects the balanced scheduling strategy. After the main cluster is calculated, the calculated result is issued to member clusters of each federal cluster, and finally containers required by application are deployed in the whole federal cluster in a balanced mode, so that the number of the containers is ensured to be the number of the copies deployed by the application.
In order to automatically and accurately perform the cluster migration operation according to the change of the member cluster state in the federal cluster, in an embodiment of the application container multi-cluster migration method of the present application, the step S102 may further specifically include the following:
monitoring whether a member cluster to be online exists or not through a federal cluster management control component, if so, adding the member cluster to be online into the federal cluster through the federal cluster management control component, deploying application container copies on the member cluster, and stopping deploying the application container copies on the member cluster on which the application container copies are deployed, wherein the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped from being deployed on the member cluster on which the application container copies are stopped.
Specifically, when a new cluster joins the federation, the federation cluster senses the joining of the new cluster and recalculates the number of containers that each cluster needs to deploy. And starting the application container on the new cluster according to the strategy, and stopping the container on the old cluster, so that the total number of the application deployment containers in the whole federal cluster is ensured to be unchanged. The deployment strategy is completed through an algorithm, and the aim of container migration is achieved under the condition that the restarting quantity of the application container is minimum.
In order to automatically and accurately perform the cluster migration operation according to the change of the member cluster state in the federal cluster, in an embodiment of the application container multi-cluster migration method of the present application, the step S102 may further specifically include the following:
and monitoring whether a member cluster to be offline exists or not through a federal cluster management control component, if so, removing the federal cluster from the member cluster to be offline through the federal cluster management control component, and increasing the number of application container copies deployed on other member clusters, wherein the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
Specifically, when an old cluster comes down, the cluster is removed from the federal cluster. The federal cluster perceives the cluster removal, and additionally the containers started on the cluster are unchanged, and a corresponding number of containers will be started on the other clusters, keeping the total number of application containers unchanged. The deployment algorithm keeps the containers started on other federal clusters unchanged, and simultaneously, the containers started on the offline clusters are uniformly scheduled on other clusters, so that the total number of the deployed containers applied is unchanged under the condition that the number of the restarted containers is minimum.
In order to flexibly implement deployment and migration of application containers in multiple clusters, the present application provides an embodiment of an application container multiple cluster migration apparatus for implementing all or part of contents of the application container multiple cluster migration method, referring to fig. 3, the application container multiple cluster migration apparatus specifically includes the following contents:
the application container deployment module 10 is configured to receive an application container deployment instruction sent by the federal cluster management platform, and execute a corresponding application container deployment operation according to the total application deployment copy number and the cluster scheduling policy in the application container deployment instruction.
The cluster migration module 20 is configured to monitor whether the status of each member cluster changes, and execute a corresponding cluster migration operation according to the status change feature of the member cluster after the status of each member cluster is monitored to change.
As can be seen from the above description, the application container multi-cluster migration device provided in the embodiments of the present application may execute a corresponding application container deployment operation by receiving an application container deployment instruction sent by a federal cluster management platform, and according to the total application deployment copy number and the cluster scheduling policy in the application container deployment instruction; and monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
In order to accurately and automatically perform the application container deployment operation according to the application container deployment instruction, in an embodiment of the application container multi-cluster migration apparatus of the present application, referring to fig. 4, the application container deployment module 10 includes:
the container copy deployment number determining unit 11 is configured to determine, by a master cluster, an application container copy deployment number of each member cluster corresponding to the master cluster according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling policy.
And the container copy deployment instruction issuing unit 12 is configured to issue, by the master cluster, the application container copy deployment number to each corresponding member cluster, and execute, by the member cluster, a corresponding application container deployment operation according to the application container copy deployment number.
In order to automatically and accurately perform the cluster migration operation according to the change of the status of the member clusters in the federal cluster, in an embodiment of the application container multi-cluster migration apparatus of the present application, referring to fig. 5, the cluster migration module 20 includes:
a newly added cluster migration unit 21, configured to monitor, by using a federal cluster management control component, whether there is a member cluster to be online, and if so, add the member cluster to be online to the federal cluster by using the federal cluster management control component, deploy an application container copy on the member cluster, and stop deploying the application container copy on the member cluster already deployed with the application container copy, where the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped to be deployed on the member cluster stopped from deploying the application container copy.
In order to automatically and accurately perform the cluster migration operation according to the change of the status of the member clusters in the federal cluster, in an embodiment of the application container multi-cluster migration apparatus of the present application, referring to fig. 6, the cluster migration module 20 includes:
the removal cluster migration unit 22 is configured to monitor, by using a federal cluster management control component, whether a member cluster to be offline exists, and if so, remove, by using the federal cluster management control component, the member cluster to be offline, and increase the number of application container copies deployed on other member clusters, where the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
In order to further explain the scheme, the application also provides a specific application example for implementing the application container multi-cluster migration method by applying the application container multi-cluster migration device, which specifically comprises the following contents:
referring to fig. 7, the whole system is constructed. The application deploys a number of containers through a federal cluster management platform (e.g., a PAAS management platform) that distributes the deployment policy to federal cluster management nodes. The federation management node calculates the number of containers to be started on each cluster according to the balanced scheduling strategy, so that the containers are uniformly deployed on each cluster in the federation clusters, and the number of the containers applied on the clusters is ensured to be added up to the number of the containers to be deployed by the application.
Referring to fig. 8, a cluster federation module schematic is shown. Firstly, a management control component of a federation cluster is installed on a master node of a certain cluster, and the certain cluster is selected as a main cluster of the federation cluster. The management control component of the federal cluster controls the addition and deletion of clusters. The primary cluster is responsible for receiving container deployment instructions and distributing to the sub-clusters. When a new cluster is built, after delivery is used, a join command of the management component is called, and the cluster is added into the federal cluster. When an old cluster is offline and an application container is not deployed any more, an unioin command of the management component is called, and the cluster is removed from the federal cluster. The process does not need the participation of an application, and the application does not need to acquire cluster information.
Referring to fig. 9, a schematic diagram is deployed for a federal cluster container. Assuming that there are currently 3 clusters in the federal cluster, 6 containers need to be deployed under one template of an application. The federal cluster will launch 2 containers of applications on each cluster according to the balanced scheduling policy. After the addition of the fourth cluster No.4, a container will start on top of the new cluster No.4 and stop on the old cluster. After the old cluster No.1 goes offline, the federal cluster stops containers previously started on No.1 and automatically dispatches to other clusters to start on top of one another. The total number of containers is unchanged, whether clusters are added or deleted, and the containers are serviced normally. The application does not need to select clusters to be deployed, only needs to specify the total number of clusters to be deployed, and the application does not sense the change of the underlying clusters, so that the transparent use effect of the application is achieved.
From the above, the present application can at least achieve the following technical effects:
by performing federation management on the clusters, the method can automatically deploy the container in the whole federally managed clusters without designating the deployed clusters when the application is deployed. For the platform, cluster reclamation can be performed without waiting for all applications deployed on the cluster to delete their respective containers. The method has the specific advantages that:
1. and in the migration process of the clusters, the application is transparent, and the clusters at the application side are not perceptively migrated.
2. The cluster management and application container deployment relationships are decoupled from each other and not previously dependent.
3. The cluster management platform can timely log off the old cluster, the time consuming time is short, the computing nodes of the old cluster are timely recovered, and resources are saved.
In order to flexibly implement deployment and migration of application containers in multiple clusters from a hardware level, the application provides an embodiment of an electronic device for implementing all or part of contents in the application container multiple cluster migration method, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the application container multi-cluster migration device and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may refer to the embodiment of the application container multi-cluster migration method and the embodiment of the application container multi-cluster migration device in the embodiment, and the contents thereof are incorporated herein, and the repetition is omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the application container multi-cluster migration method may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The present application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 10 is a schematic block diagram of a system configuration of an electronic device 9600 of an embodiment of the present application. As shown in fig. 10, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 10 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the application container multi-cluster migration method functionality may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
step S101: and receiving an application container deployment instruction sent by the federal cluster management platform, and executing corresponding application container deployment operation according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling strategy.
Step S102: and monitoring whether the state of each member cluster changes, and executing corresponding cluster migration operation according to the change characteristics of the state of each member cluster after monitoring that the state of each member cluster changes.
As can be seen from the above description, the electronic device provided in the embodiment of the present application executes a corresponding application container deployment operation according to the total number of application deployment copies and the cluster scheduling policy in the application container deployment instruction by receiving the application container deployment instruction sent by the federal cluster management platform; and monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
In another embodiment, the application container multi-cluster migration apparatus may be configured separately from the central processor 9100, for example, the application container multi-cluster migration apparatus may be configured as a chip connected to the central processor 9100, and the application container multi-cluster migration method function is implemented under the control of the central processor.
As shown in fig. 10, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 10; in addition, the electronic device 9600 may further include components not shown in fig. 10, and reference may be made to the related art.
As shown in fig. 10, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application further provide a computer readable storage medium capable of implementing all the steps in the application container multi-cluster migration method in which the execution subject is a server or a client in the above embodiments, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the application container multi-cluster migration method in which the execution subject is a server or a client in the above embodiments, for example, the processor implements the following steps when executing the computer program:
step S101: and receiving an application container deployment instruction sent by the federal cluster management platform, and executing corresponding application container deployment operation according to the total number of application deployment copies in the application container deployment instruction and a cluster scheduling strategy.
Step S102: and monitoring whether the state of each member cluster changes, and executing corresponding cluster migration operation according to the change characteristics of the state of each member cluster after monitoring that the state of each member cluster changes.
As can be seen from the above description, the computer readable storage medium provided in the embodiments of the present application executes corresponding application container deployment operations according to the total number of applications deployment copies and the cluster scheduling policy in the application container deployment instruction by receiving the application container deployment instruction sent by the federal cluster management platform; and monitoring whether the states of all member clusters change, and executing corresponding cluster migration operation according to the change characteristics of the states of the member clusters after the states of the member clusters are monitored, so that when the clusters are deployed by application, the clusters needing to be deployed are not required to be designated, the cluster information needing to be deployed is not required to be acquired, and meanwhile, when a new cluster is online or an old cluster is offline, the deployment and migration work of an application container in multiple clusters can be accurately, automatically and unintelligly completed.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (3)

1. An application container multi-cluster migration method, the method comprising:
receiving an application container deployment instruction sent by a federal cluster management platform, and determining the deployment number of the application container copies of each member cluster corresponding to a main cluster by the main cluster according to the total number of the application copies deployed in the application container deployment instruction and a cluster scheduling strategy; issuing the deployment quantity of the application container copies to the corresponding member clusters by the master cluster, and executing corresponding application container deployment operations by the member clusters according to the deployment quantity of the application container copies;
monitoring whether a member cluster to be online exists or not through a federal cluster management control component, if so, adding the member cluster to be online into the federal cluster through the federal cluster management control component, deploying application container copies on the member cluster, and stopping deploying the application container copies on the member cluster on which the application container copies are deployed, wherein the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped from being deployed on the member cluster on which the application container copies are stopped;
and monitoring whether a member cluster to be offline exists or not through a federal cluster management control component, if so, removing the federal cluster from the member cluster to be offline through the federal cluster management control component, and increasing the number of application container copies deployed on other member clusters, wherein the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
2. An application container multi-cluster migration apparatus, comprising:
the application container deployment module is used for receiving an application container deployment instruction sent by the federal cluster management platform, and determining the deployment quantity of the application container copies of each member cluster corresponding to the main cluster by the main cluster according to the total copy quantity of the application deployment in the application container deployment instruction and the cluster scheduling strategy; issuing the deployment quantity of the application container copies to the corresponding member clusters by the master cluster, and executing corresponding application container deployment operations by the member clusters according to the deployment quantity of the application container copies;
the cluster migration module is used for:
monitoring whether a member cluster to be online exists or not through a federal cluster management control component, if so, adding the member cluster to be online into the federal cluster through the federal cluster management control component, deploying application container copies on the member cluster, and stopping deploying the application container copies on the member cluster on which the application container copies are deployed, wherein the number of the application container copies deployed on the member cluster to be online is equal to the number of the application container copies stopped from being deployed on the member cluster on which the application container copies are stopped;
and monitoring whether a member cluster to be offline exists or not through a federal cluster management control component, if so, removing the federal cluster from the member cluster to be offline through the federal cluster management control component, and increasing the number of application container copies deployed on other member clusters, wherein the number of application container copies deployed on the other member clusters is equal to the number of application container copies deployed on the member cluster to be offline.
3. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the application container multi-cluster migration method of claim 1.
CN202011356221.4A 2020-11-27 2020-11-27 Application container multi-cluster migration method and device Active CN112445574B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011356221.4A CN112445574B (en) 2020-11-27 2020-11-27 Application container multi-cluster migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011356221.4A CN112445574B (en) 2020-11-27 2020-11-27 Application container multi-cluster migration method and device

Publications (2)

Publication Number Publication Date
CN112445574A CN112445574A (en) 2021-03-05
CN112445574B true CN112445574B (en) 2024-01-26

Family

ID=74737779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011356221.4A Active CN112445574B (en) 2020-11-27 2020-11-27 Application container multi-cluster migration method and device

Country Status (1)

Country Link
CN (1) CN112445574B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117931302B (en) * 2024-03-20 2024-06-21 苏州元脑智能科技有限公司 Parameter file saving and loading method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857516A (en) * 2018-12-29 2019-06-07 航天信息股份有限公司 Cluster moving method and device based on container

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11323511B2 (en) * 2019-04-09 2022-05-03 T-Mobile Usa, Inc. Migrating a network service to a container-based platform

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857516A (en) * 2018-12-29 2019-06-07 航天信息股份有限公司 Cluster moving method and device based on container

Also Published As

Publication number Publication date
CN112445574A (en) 2021-03-05

Similar Documents

Publication Publication Date Title
CN112463535B (en) Multi-cluster exception handling method and device
CN111813601B (en) Micro-service rollback method and device for stateful distributed cluster
CN108628874B (en) Method and device for migrating data, electronic equipment and readable storage medium
CN112445575B (en) Multi-cluster resource scheduling method, device and system
CN111796838B (en) Automatic deployment method and device for MPP database
CN107656748B (en) Application publishing method and device
CN112953908A (en) Network isolation configuration method, device and system
CN112445574B (en) Application container multi-cluster migration method and device
CN112069154A (en) Automatic operation and maintenance method and related device for etcd distributed database
CN106603125B (en) Method and device for data interaction with Bluetooth equipment
CN111796770A (en) Log routing load balancing implementation method and device
CN111930624B (en) Test link message data processing method and device
CN112835617A (en) Gray scale publishing method, device, server and readable medium
WO2017000586A1 (en) Method and device for upgrading virtual network element, and computer storage medium
CN111338905A (en) Application node data processing method and device
CN113934437B (en) Method and system for installing application on cloud mobile phone and client cloud mobile phone
CN113253938B (en) Data processing method, device, equipment, storage medium and computer program product
CN115378809A (en) Software version upgrading method and device
CN115827771A (en) Cross-platform data heterogeneous scheduling method and device
CN112631716A (en) Database container scheduling method and device, electronic equipment and storage medium
CN111026048B (en) Data processing method, device and storage medium
CN111367552B (en) Automatic upgrading method and device for application system
US11977922B2 (en) Resource reuse for pipeline workloads
CN114637587A (en) Task batch processing method and device under cluster architecture deployment
CN113868679B (en) Cluster encryption method and device

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
GR01 Patent grant
GR01 Patent grant