CN117170799A - Container migration method, device, computer equipment and storage medium - Google Patents

Container migration method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117170799A
CN117170799A CN202310827172.5A CN202310827172A CN117170799A CN 117170799 A CN117170799 A CN 117170799A CN 202310827172 A CN202310827172 A CN 202310827172A CN 117170799 A CN117170799 A CN 117170799A
Authority
CN
China
Prior art keywords
container
link
migration
service
target
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
CN202310827172.5A
Other languages
Chinese (zh)
Inventor
朱万意
高深
师春雨
李德恒
任慧蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Technology Innovation Center
China Telecom Corp Ltd
Original Assignee
China Telecom Technology Innovation Center
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Technology Innovation Center, China Telecom Corp Ltd filed Critical China Telecom Technology Innovation Center
Priority to CN202310827172.5A priority Critical patent/CN117170799A/en
Publication of CN117170799A publication Critical patent/CN117170799A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a container migration method, apparatus, computer device, storage medium and computer program product. The method comprises the following steps: acquiring a target migration task; the target migration task is used for carrying out hot migration on the source container in the cloud platform container management system, and service side links are established between the source container and the link container; executing a premigration subtask, and premigration of data between a source container and a target container; after the premigration of the container backup data is completed, a switchover subtask is executed, the service side link is switched between a target container and a link container under the condition that the service link which exists in the source container and is being processed is maintained according to the heartbeat link information of the service side link, and the service intermediate state data of the source container is migrated to the target container. The method can realize the full intermediate state information transfer and intermediate state data utilization of the container, avoid the interruption influence of the container transfer on the service and ensure the continuity of the service.

Description

Container migration method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technology, and in particular, to a container migration method, apparatus, computer device, storage medium, and computer program product.
Background
With development of cloud computing, container technology is developed, and cloud protogenesis is gradually a business mainstream mode of cloud development, deployment and operation based on the development of the container technology. Kubernetes, a leading solution of a distributed architecture for container organization and scheduling, is becoming a mainstream solution using container technology, and therefore, a need for thermally migrating containers on Kubernetes arises.
However, in the conventional technology, a link reestablishment mode is usually adopted, and breaking a link established by a stateful container causes interruption of service, so that service is provided discontinuously, and intermediate state data of a previous service cannot be used after the link reestablishment.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a container migration method, apparatus, computer device, storage medium, and computer program product capable of ensuring service continuity.
In a first aspect, the present application provides a method of container migration, the method comprising:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
Executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the performing the premigration sub-task premigrates data between the source container and the target container includes:
acquiring first migration indication information and incremental migration indication information from the premigration subtask;
according to the first migration indication information, migrating the container backup data of the source container to the target container;
and synchronizing the container increment data of the source container to the target container according to a preset time interval in the increment migration indication information.
In one embodiment, before the step of performing the switching subtask, the method further comprises:
detecting a network connection state between a server corresponding to the source container and a server corresponding to the target container, and judging whether the source container and the target container are in a network connection state or not;
and executing the switching subtask under the condition that the source container and the target container are in a network communication state.
In one embodiment, the switching the service side link between the target container and the link container and migrating the service intermediate state data of the source container to the target container according to the heartbeat link information of the service side link while maintaining the service link existing and being processed in the source container includes:
acquiring heartbeat link period information and heartbeat interval information from the heartbeat link information linked on the service side;
determining triggering time of intermediate state data of the migration service according to the heartbeat link period information, and determining migration time range of the intermediate state data of the migration service according to the heartbeat interval information;
And according to the trigger time and the migration time range, under the condition of maintaining the service link which exists in the source container and is being processed, switching the service link between the target container and the link container, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the determining the triggering time of the migration service intermediate state data according to the heartbeat link cycle information includes:
obtaining the starting time of a new heartbeat link period according to the heartbeat link period information, and taking the starting time as the triggering time of the migration service intermediate state data;
the determining the migration time range of the migration service intermediate state data according to the heartbeat interval information comprises the following steps:
and determining a time interval corresponding to the new heartbeat link period as a migration time range of the migration service intermediate state data according to the heartbeat interval information aiming at the starting time of the new heartbeat link period.
In one embodiment, the switching the service side link between the target container and the link container and migrating the service intermediate state data of the source container to the target container according to the trigger time and the migration time range while maintaining the service link existing and being processed in the source container includes:
Maintaining a service link existing and being processed in the source container at the beginning moment of the new heartbeat link period, and synchronizing network configuration parameters of the source container to the target container;
and in a time interval corresponding to the new heartbeat link period, switching the service side link between the target container and the link container according to the network configuration parameters of the source container, and migrating incremental service intermediate state data in the source container to the target container.
In one embodiment, after the step of migrating the business intermediate data of the source container to the target container, the method further comprises:
and releasing the service link existing and being processed in the source container under the condition that the file catalogue in the source container is checked to be consistent with the file catalogue in the target container.
In a second aspect, the present application also provides a container transfer device, the device comprising:
the target migration task acquisition module is used for acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
The data premigration module is used for executing the premigration subtask and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and the service intermediate state data migration module is used for executing the switching subtask after the premigration of the container backup data is completed, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists in the source container and is being processed, and migrating the service intermediate state data of the source container to the target container.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
Executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
And after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprising a computer program which, when executed by a processor, performs the steps of:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
According to the container migration method, the device, the computer equipment, the storage medium and the computer program product, the target migration task is used for carrying out hot migration on the source container in the cloud platform container management system, a service side link is established between the source container and the link container, the target migration task comprises a premigration subtask and a switching subtask, then the premigration subtask is executed, data premigration is carried out between the source container and the target container, the data premigration comprises migration of container backup data of the source container and migration of incremental data, further after the premigration of the container backup data is completed, the switching subtask is executed, the service side link is switched between the target container and the link container under the condition that the service link existing in the source container and being processed is maintained, the service intermediate state data of the source container is migrated to the target container, the optimization of the thermal migration container in the cloud platform container management system can be realized, the full intermediate state information migration of the container and the intermediate state data migration based on the heartbeat link information are combined, the continuous influence on service continuity is avoided, and the service continuity is guaranteed.
Drawings
FIG. 1 is a flow diagram of a method of container migration in one embodiment;
FIG. 2 is a schematic diagram of a container architecture in one embodiment;
FIG. 3 is a flowchart illustrating a business intermediate data migration step in one embodiment;
FIG. 4 is a schematic diagram of a container migration process flow in one embodiment;
FIG. 5 is a flow chart of a method of migrating a container in another embodiment;
FIG. 6 is a block diagram of a container transfer device in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
With development of cloud computing and application of virtualization technology, the virtualization hot migration technology is one of key technologies of cloud service, and the cloud hot migration technology is also an important technology for guaranteeing flexible deployment of communication services and high availability of services. The virtual machine thermal migration can completely preserve the running state of the whole virtual machine, simultaneously can quickly restore to different hardware platforms, and after the virtual machine is restored, the virtual machine still operates smoothly, and a user can not perceive any difference.
The container technology is developed and developed, so that cloud primary is gradually a main stream mode of a service for cloud development, deployment and operation, kubernetes is used as a distributed architecture leading scheme for container arrangement and scheduling, and is gradually widely applied as a main stream scheme using the container technology, so that the need of thermally migrating containers on the Kubernetes is met, but a better implementation scheme still does not exist in a thermally migrating mode.
In the traditional method, the original link of the stateful container is required to be disconnected, then the link is re-established based on the migrated container, and the session is restarted, and after the link is established by the stateful container, the disconnection of the stateful link can cause interruption of service, so that service provision is discontinuous; and after the stateful link is rebuilt, intermediate state data of the previous service cannot be used, but the generated intermediate state data has value for the service of the service, so that the resource waste is caused to a certain extent.
In one embodiment, as shown in fig. 1, a container migration method is provided, where the method is applied to a terminal to illustrate the method, it is understood that the method may also be applied to a server, and may also be applied to a system including the terminal and the server, such as a cloud platform container management system, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
Step 101, obtaining a target migration task;
the target migration task may be used for performing hot migration on the source container in the cloud platform container management system, and may include a premigration subtask and a handover subtask.
As an example, the source container may be a stateful container, i.e., a service-side link, such as a stateful link, has been established between the source container and the link container.
In practical application, the target migration task for the source container can be obtained in response to a user request or under the condition of triggering a preset migration condition in the cloud platform container management system, so that the source container with a state link can be subjected to the thermal migration.
Specifically, as the communication network element gradually carries out cloud primary biochemistry, in a cloud primary scene, the cloud data center internally carries containers of different types of cloud services, and all the containers can be uniformly scheduled based on a cloud platform container management system Kubernetes, for example, the network element containers can be managed by the Kubernetes. By acquiring the target migration task, a stateful container (i.e., a source container) may be thermally migrated in a Kubernetes environment.
Step 102, executing the premigration sub-task, and premigration data between the source container and the target container;
The target container may be a container newly built for the target migration task, which may be used for hot migration of the source container.
As an example, the data premigration may include migration of container backup data of the source container and migration of delta data.
In a specific implementation, the first migration instruction information and the incremental migration instruction information may be obtained from the premigration subtask, then the container backup data of the source container may be migrated to the target container according to the first migration instruction information, for example, the full-scale backup of the link, storage and content information may be performed for the first time, and further the container incremental data of the source container may be synchronized to the target container according to a preset time interval in the incremental migration instruction information, for example, the incremental backup may be performed at each preset time interval.
Step 103, after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition that the service link existing in the source container and being processed is maintained, and migrating the service intermediate state data of the source container to the target container.
The heartbeat link information may include heartbeat link period information and heartbeat interval information, such as a start time of a heartbeat link period and a heartbeat interval time.
After the premigration of the container backup data is completed, the triggering time of migrating the service intermediate state data can be determined based on the heartbeat link period information according to the heartbeat link information of the service side link, and the migration time range of migrating the service intermediate state data can be determined based on the heartbeat interval information, so that the service side link can be switched between the target container and the link container under the condition that the service link existing in the source container and being processed is maintained according to the triggering time and the migration time range, and the service intermediate state data of the source container can be migrated to the target container.
In one example, as shown in fig. 2, the migration may be triggered at the beginning of a new heartbeat link cycle, by maintaining an existing and processing link in a source container (such as container a in fig. 2), synchronizing network related configuration parameters of the source container to a target container (such as container a 'in fig. 2), which may include an IP address, and further completing service-side link switching (such as a stateful link between container B and container a' in fig. 2) within a heartbeat interval time, and migrating files of the source container to incrementally migrate source files (i.e., service intermediate data) to the target container.
In a further example, in a Kubernetes environment, the container migration method is adopted to thermally migrate the stateful container (namely the source container), so that the thermal migration of the communication network element cloud primary container under the condition that the service is not affected can be realized, the high availability of the cloud primary network element and the flexibility of resource scheduling are effectively enhanced, the service high reliability of the network element container can be ensured, the service requirements of online upgrade of the underlying infrastructure and the like are met, and the interruption influence of container migration and copy management on the service is avoided.
Compared with the traditional method, the technical scheme of the embodiment ensures the availability of data by premigrating or backing up the key containers in advance by adopting a full-scale and subsequent incremental migration mode, and completes the transfer of the data within one heartbeat interval time, thereby realizing the full-scale intermediate state information transfer of the containers and the utilization of intermediate state data and ensuring the continuity of service.
According to the container migration method, the target migration task is obtained, then the premigration subtask is executed, the data premigration is carried out between the source container and the target container, then the switching subtask is executed after the premigration of the container backup data is completed, the service side link is switched to be between the target container and the link container according to the heartbeat link information of the service side link under the condition that the service link existing in the source container and being processed is kept, and the service intermediate state data of the source container is migrated to the target container, so that the optimization of the thermal migration container in the cloud platform container management system is realized, the data premigration mode and the intermediate state data transfer based on the heartbeat link information can be combined, the purposes of full intermediate state information transfer and intermediate state data utilization of the container are achieved, the interrupt influence of the container migration on the service is avoided, and the continuity of the service is ensured.
In one embodiment, the performing the premigration sub-task to premigration data between the source container and the target container may include the steps of:
acquiring first migration indication information and incremental migration indication information from the premigration subtask; according to the first migration indication information, migrating the container backup data of the source container to the target container; and synchronizing the container increment data of the source container to the target container according to a preset time interval in the increment migration indication information.
In practical application, a mode of synchronizing the copy timing synchronization information of the source container (i.e. the source container) to the server side where the target container is located may be adopted, by performing full-scale backup of linking, storing and content information for the first time, i.e. migrating the container backup data of the source container to the target container according to the first migration indication information, and performing incremental backup at each interval T1, i.e. synchronizing the container incremental data of the source container to the target container according to a preset time interval in the incremental migration indication information.
In this embodiment, the first migration instruction information and the incremental migration instruction information are obtained from the premigration subtask, then the container backup data of the source container is migrated to the target container according to the first migration instruction information, and then the container incremental data of the source container is synchronized to the target container according to the preset time interval in the incremental migration instruction information, so that premigration or backup can be performed on the key container in advance based on the full-scale and subsequent incremental migration modes, the availability of the data is ensured, and the container migration efficiency is improved.
In one embodiment, before the step of performing the switching subtask, the method may further include the steps of:
detecting a network connection state between a server corresponding to the source container and a server corresponding to the target container, and judging whether the source container and the target container are in a network connection state or not; and executing the switching subtask under the condition that the source container and the target container are in a network communication state.
In a specific implementation, by detecting network connectivity between the target server and the source server (i.e., detecting a network connection state between the server corresponding to the source container and the server corresponding to the target container), for example, a ping command/Telnet command mode may be used for detection, and further, a switching subtask may be executed under the condition that it is determined that network connectivity is guaranteed, for example, migration is triggered at a start time of a new heartbeat link cycle.
In this embodiment, by detecting the network connection state between the server corresponding to the source container and the server corresponding to the target container, it is determined whether the source container and the target container are in a network connection state, and then, when the source container and the target container are in the network connection state, the step of switching the subtasks is performed, so that migration can be triggered when network connectivity of a newly-built container is ensured in advance, and the container migration efficiency is improved.
In one embodiment, as shown in fig. 3, the step of switching the service side link between the target container and the link container and migrating the service intermediate state data of the source container to the target container according to the heartbeat link information of the service side link while maintaining the service link existing and being processed in the source container may include the following steps:
step 301, obtaining heartbeat link period information and heartbeat interval information from heartbeat link information linked at the service side;
step 302, determining triggering time of intermediate state data of the migration service according to the heartbeat link period information, and determining migration time range of intermediate state data of the migration service according to the heartbeat interval information;
and step 303, switching the service side link between the target container and the link container under the condition of maintaining the service link which exists in the source container and is being processed according to the trigger time and the migration time range, and migrating the service intermediate state data of the source container to the target container.
As shown in fig. 4, in the container migration method of the present application, migration may be triggered at a new heartbeat link period starting time (i.e., a trigger time for migrating service intermediate state data) mainly based on a source container (i.e., a source container), a target container (i.e., a target container), and a server where the target container is located, by maintaining a service request of the source container (i.e., maintaining a service link existing and being processed in the source container) and updating an IP address, for example, synchronizing a network related configuration parameter of the source container to the target container, then, the link between the source container and the link container may be disconnected, and service side link switching may be completed within a heartbeat interval time (i.e., a migration time range for migrating service intermediate state data), that is, a service side link may be switched between the target container and the link container, and migration may be performed on a source copy file and an increment layer file of the source container, for example, including link related information, storage related information, memory related information, and so on, and service may be restored after migration of a latest increment layer is completed.
In this embodiment, the heartbeat link period information and the heartbeat interval information are obtained from the heartbeat link information linked from the service side, then the trigger time of migrating the service intermediate state data is determined according to the heartbeat link period information, and the migration time range of migrating the service intermediate state data is determined according to the heartbeat interval information, so that the service side is switched between the target container and the link container according to the trigger time and the migration time range under the condition that the service link existing in the source container and being processed is maintained, and the service intermediate state data of the source container is migrated to the target container, so that the data transfer can be completed within one heartbeat interval time, the full intermediate state information transfer of the container and the utilization of the intermediate state data are realized, and the continuity of the service is ensured.
In one embodiment, the determining the triggering time of the migration service intermediate state data according to the heartbeat link cycle information may include the following steps:
obtaining the starting time of a new heartbeat link period according to the heartbeat link period information, and taking the starting time as the triggering time of the migration service intermediate state data;
the determining the migration time range of the migration service intermediate state data according to the heartbeat interval information comprises the following steps:
And determining a time interval corresponding to the new heartbeat link period as a migration time range of the migration service intermediate state data according to the heartbeat interval information aiming at the starting time of the new heartbeat link period.
In an example, a start time of a new heartbeat link period can be determined according to heartbeat link period information of a service side link for a current time as a trigger time for migrating service intermediate state data, so as to trigger migration at the start time of a new heartbeat link period; the time interval corresponding to the new heartbeat link period can be determined based on the starting time of the new heartbeat link period according to the heartbeat interval information of the service side link, and the time interval is used as the migration time range of migration service intermediate state data, so that data transfer can be completed within one heartbeat interval time.
In this embodiment, by obtaining the start time of the new heartbeat link period according to the heartbeat link period information, and determining the time interval corresponding to the new heartbeat link period according to the heartbeat interval information for the start time of the new heartbeat link period, as the migration time range of the migration service intermediate state data, the container migration processing can be accurately executed, and the container migration efficiency is improved.
In one embodiment, the switching the service side link between the target container and the link container and the migration of the service intermediate state data of the source container to the target container according to the trigger time and the migration time range while maintaining the service link existing and being processed in the source container may include the following steps:
maintaining a service link existing and being processed in the source container at the beginning moment of the new heartbeat link period, and synchronizing network configuration parameters of the source container to the target container; and in a time interval corresponding to the new heartbeat link period, switching the service side link between the target container and the link container according to the network configuration parameters of the source container, and migrating incremental service intermediate state data in the source container to the target container.
In practical application, the migration can be triggered at the beginning of a new heartbeat link period under the condition of ensuring the network connectivity of a newly built container in advance, and the network configuration parameters (such as including the IP address) of the source container (i.e., the source container) are synchronized to the target container by maintaining the existing and processing links (i.e., the service links existing and being processed in the source container), so that the data transfer can be completed within a heartbeat interval time (i.e., a time interval), thereby ensuring the consistency of the IP address and ensuring the continuity of the service.
For example, the migration may be triggered at the beginning of a new heartbeat link period, where the heartbeat link period may be T2, and by maintaining the existing links being processed, synchronizing the source container network related configuration (including the IP address) to the target container, completing the service-side link switching in the heartbeat interval time, and performing file migration of the source container, and incrementally migrating the source file.
In this embodiment, by maintaining the service link existing and being processed in the source container at the beginning time of the new heartbeat link period, synchronizing the network configuration parameters of the source container to the target container, further switching the service link between the target container and the link container according to the network configuration parameters of the source container in the time interval corresponding to the new heartbeat link period, and migrating the incremental service intermediate state data in the source container to the target container, the consistency of the IP address can be ensured, and the continuity of the service can be ensured.
In one embodiment, after the step of migrating the business intermediate state data of the source container to the target container, the method may further include the steps of:
and releasing the service link existing and being processed in the source container under the condition that the file catalogue in the source container is checked to be consistent with the file catalogue in the target container.
In an example, after the migration of the latest increment layer is completed, checking whether the file catalogue of the target container is consistent with the source container, if so, finishing the migration, and releasing the hold link, namely releasing the service link existing and being processed in the source container under the condition that the file catalogue in the check source container is consistent with the file catalogue in the target container.
In order that those skilled in the art may better understand the above steps, an embodiment of the present application will be exemplarily described below by way of example with reference to fig. 4, but it should be understood that the embodiment of the present application is not limited thereto.
Step 1: the copy timing synchronization information of the source container is sent to the server side where the target container is located, so that full-scale backup of link, storage and content information can be performed for the first time, and then incremental backup is performed every interval T1 time;
step 2: the network connectivity between the target server and the source server can be detected (such as by adopting a ping/Telnet mode), and the step 3 is only carried out when the connectivity of the step 2 is ensured;
step 3: the migration may be triggered at the beginning of a new heartbeat link period (e.g., the heartbeat link duration may be T2), hold the existing link being processed, and synchronize the source container network-related configuration (e.g., may include an IP address) to the target container;
Step 4: service side link switching can be completed within the time of the heartbeat interval, and source container files are migrated to incrementally migrate source files;
step 5: after the migration of the latest increment layer is completed, whether the file catalogue of the target container is consistent with the source container or not can be checked, if so, the migration is finished, and the link of hold is released.
In an optional embodiment, the container migration method of the application can be applied to communication network element cloud protogenesis deployment, and can relate to cloud protogenesis service gateway, cloud protogenesis base management and control and operation and maintenance technology research and verification, and the influence caused by insufficient manual experience can be eliminated as far as possible because the communication network element cloud protogenesis deployment is carried out on the basis of the technical scheme of the embodiment without carrying out load prediction by means of manual experience; the method can predict the load change of the service container in real time based on the load monitoring data, dynamically adjust the resource scheduling and distribution in real time based on the cloud platform container management system, fully consider the influence factors such as the periodicity, the seasonality and the like of the service by decomposing the predicted value into a trend component, a periodic component and a data mutation item component, and effectively improve the prediction accuracy; the influence of accidental abnormality possibly existing in the system on load prediction can be eliminated as much as possible by combining a data cleaning function and a training model; and a step-by-step double-threshold adjustment can be designed between a migration container and a migration virtual machine by combining a hybrid scheduling method so as to quickly and efficiently realize migration judgment of the load of the container or the virtual machine.
In this embodiment, in the case of checking that the file directory in the source container is consistent with the file directory in the target container, the service link existing and being processed in the source container is released, so that the integrity of the container data migration can be ensured.
In one embodiment, as shown in FIG. 5, a flow diagram of another container migration method is provided. In this embodiment, the method includes the steps of:
in step 501, a target migration task is acquired; the target migration task is used for performing hot migration on the source container in the cloud platform container management system, and a service side link is established between the source container and the link container. In step 502, first migration instruction information and incremental migration instruction information are acquired, according to the first migration instruction information, container backup data of a source container is migrated to a target container, and according to a preset time interval in the incremental migration instruction information, container incremental data of the source container is synchronized to the target container. In step 503, after the premigration of the container backup data is completed, the network connection state between the server corresponding to the source container and the server corresponding to the target container is detected, and whether the source container and the target container are in the network connection state is determined. In step 504, in the case where the source container and the target container are in the network connection state, heartbeat link cycle information and heartbeat interval information are acquired from the heartbeat link information linked from the service side. In step 505, the trigger time of the intermediate state data of the migration service is determined according to the heartbeat link period information, and the migration time range of the intermediate state data of the migration service is determined according to the heartbeat interval information. In step 506, the service side link is switched between the target container and the link container, and the service intermediate state data of the source container is migrated to the target container, according to the trigger time and the migration time range, while maintaining the service link existing and being processed in the source container. In step 507, in the case of checking that the file directory in the source container is consistent with the file directory in the target container, the service link existing and being processed in the source container is released. It should be noted that, the specific limitation of the above steps may be referred to the specific limitation of a container migration method, which is not described herein.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a container migration device for realizing the container migration method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation of one or more embodiments of the container migration device provided below may be referred to above for the limitation of the container migration method, which is not repeated here.
In one embodiment, as shown in fig. 6, there is provided a container transfer device comprising:
the target migration task obtaining module 601 is configured to obtain a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
a data premigration module 602, configured to perform the premigration subtask, and perform data premigration between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and a service intermediate state data migration module 603, configured to execute the switching subtask after the premigration of the container backup data is completed, switch the service side link between the target container and the link container according to heartbeat link information of the service side link, and migrate the service intermediate state data of the source container to the target container under the condition that the service link existing in the source container and being processed is maintained.
In one embodiment, the data premigration module 602 includes:
the migration instruction information acquisition sub-module is used for acquiring first migration instruction information and increment migration instruction information from the premigration sub-task;
the first migration submodule is used for migrating the container backup data of the source container to the target container according to the first migration indication information;
and the increment migration submodule is used for synchronizing the container increment data of the source container to the target container according to a preset time interval in the increment migration indication information.
In one embodiment, the apparatus further comprises:
the network connection state judging module is used for detecting the network connection state between the server corresponding to the source container and the server corresponding to the target container and judging whether the source container and the target container are in the network connection state or not;
and the switching execution module is used for executing the step of switching subtasks under the condition that the source container and the target container are in a network communication state.
In one embodiment, the service intermediate state data migration module 603 includes:
the period information and interval information acquisition sub-module is used for acquiring heartbeat link period information and heartbeat interval information from the heartbeat link information linked on the service side;
The triggering time and migration time range determining submodule is used for determining the triggering time of migration service intermediate state data according to the heartbeat link period information and determining the migration time range of the migration service intermediate state data according to the heartbeat interval information;
and the migration processing sub-module is used for switching the service side link between the target container and the link container under the condition of keeping the service link which exists in the source container and is being processed according to the trigger time and the migration time range, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the trigger time and migration time range determination submodule includes:
a start time obtaining unit, configured to obtain a start time of a new heartbeat link period according to the heartbeat link period information, as a trigger time of the migration service intermediate state data;
the triggering time and migration time range determining submodule comprises:
and the time interval obtaining unit is used for determining a time interval corresponding to the new heartbeat link period according to the heartbeat interval information aiming at the starting time of the new heartbeat link period, and taking the time interval as the migration time range of the migration service intermediate state data.
In one embodiment, the migration processing submodule includes:
a network configuration parameter synchronization unit, configured to keep a service link existing and being processed in the source container at a beginning time of the new heartbeat link period, and synchronize a network configuration parameter of the source container to the target container;
and the time interval migration unit is used for switching the service side link between the target container and the link container according to the network configuration parameters of the source container in the time interval corresponding to the new heartbeat link period, and migrating incremental service intermediate state data in the source container to the target container.
In one embodiment, the apparatus further comprises:
and the checking module is used for releasing the service links existing in the source container and being processed under the condition that the file catalogue in the source container is checked to be consistent with the file catalogue in the target container.
The various modules in the container migration apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a container migration method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the 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 stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the steps of the container migration method in the other embodiments described above are also implemented when the processor executes the computer program.
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 migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the computer program, when executed by the processor, further implements the steps of the container migration method in the other embodiments described above.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
and after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
In one embodiment, the computer program, when executed by the processor, further implements the steps of the container migration method in the other embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (11)

1. A method of container migration, the method comprising:
acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
executing the premigration subtask, and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
And after the premigration of the container backup data is completed, executing the switching subtask, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container.
2. The method of claim 1, wherein the performing the premigration sub-task premigrates data between the source container and target container, comprising:
acquiring first migration indication information and incremental migration indication information from the premigration subtask;
according to the first migration indication information, migrating the container backup data of the source container to the target container;
and synchronizing the container increment data of the source container to the target container according to a preset time interval in the increment migration indication information.
3. The method of claim 1, wherein prior to the step of performing the handoff subtask, the method further comprises:
detecting a network connection state between a server corresponding to the source container and a server corresponding to the target container, and judging whether the source container and the target container are in a network connection state or not;
And executing the switching subtask under the condition that the source container and the target container are in a network communication state.
4. The method according to claim 1, wherein the switching the service side link between the target container and the link container and migrating service intermediate state data of the source container to the target container while maintaining the service link existing and being processed in the source container according to heartbeat link information of the service side link comprises:
acquiring heartbeat link period information and heartbeat interval information from the heartbeat link information linked on the service side;
determining triggering time of intermediate state data of the migration service according to the heartbeat link period information, and determining migration time range of the intermediate state data of the migration service according to the heartbeat interval information;
and according to the trigger time and the migration time range, under the condition of maintaining the service link which exists in the source container and is being processed, switching the service link between the target container and the link container, and migrating the service intermediate state data of the source container to the target container.
5. The method of claim 4, wherein determining the trigger time for migrating business intermediate state data according to the heartbeat link cycle information comprises:
obtaining the starting time of a new heartbeat link period according to the heartbeat link period information, and taking the starting time as the triggering time of the migration service intermediate state data;
the determining the migration time range of the migration service intermediate state data according to the heartbeat interval information comprises the following steps:
and determining a time interval corresponding to the new heartbeat link period as a migration time range of the migration service intermediate state data according to the heartbeat interval information aiming at the starting time of the new heartbeat link period.
6. The method of claim 5, wherein said switching the traffic side link between the target container and the link container and migrating the traffic intermediate state data of the source container to the target container while maintaining the traffic link existing and being processed in the source container according to the trigger time and the migration time range comprises:
maintaining a service link existing and being processed in the source container at the beginning moment of the new heartbeat link period, and synchronizing network configuration parameters of the source container to the target container;
And in a time interval corresponding to the new heartbeat link period, switching the service side link between the target container and the link container according to the network configuration parameters of the source container, and migrating incremental service intermediate state data in the source container to the target container.
7. The method of any of claims 1 to 6, wherein after the step of migrating the business intermediate data of the source container to the target container, the method further comprises:
and releasing the service link existing and being processed in the source container under the condition that the file catalogue in the source container is checked to be consistent with the file catalogue in the target container.
8. A container transfer device, the device comprising:
the target migration task acquisition module is used for acquiring a target migration task; the target migration task is used for carrying out hot migration on a source container in the cloud platform container management system, a service side link is established between the source container and a link container, and the target migration task comprises a premigration subtask and a switching subtask;
the data premigration module is used for executing the premigration subtask and premigration data between the source container and the target container; the data premigration includes migration of container backup data and migration of incremental data of the source container;
And the service intermediate state data migration module is used for executing the switching subtask after the premigration of the container backup data is completed, switching the service side link between the target container and the link container according to the heartbeat link information of the service side link under the condition of keeping the service link which exists in the source container and is being processed, and migrating the service intermediate state data of the source container to the target container.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310827172.5A 2023-07-06 2023-07-06 Container migration method, device, computer equipment and storage medium Pending CN117170799A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310827172.5A CN117170799A (en) 2023-07-06 2023-07-06 Container migration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310827172.5A CN117170799A (en) 2023-07-06 2023-07-06 Container migration method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117170799A true CN117170799A (en) 2023-12-05

Family

ID=88936415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310827172.5A Pending CN117170799A (en) 2023-07-06 2023-07-06 Container migration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117170799A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117376194A (en) * 2023-12-06 2024-01-09 苏州元脑智能科技有限公司 Network detection method, system, electronic device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117376194A (en) * 2023-12-06 2024-01-09 苏州元脑智能科技有限公司 Network detection method, system, electronic device and computer readable storage medium
CN117376194B (en) * 2023-12-06 2024-02-13 苏州元脑智能科技有限公司 Network detection method, system, electronic device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110737442B (en) Edge application management method and system
CN108664496B (en) Data migration method and device
US9876878B2 (en) Seamless cluster servicing
CN102594849B (en) Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device
US9367301B1 (en) Dynamic update of a distributed message processing system
CN104461744A (en) Resource allocation method and device
CN111641515B (en) VNF life cycle management method and device
WO2017041525A1 (en) Virtual network function reconstruction method and device
CN113032085A (en) Management method, device, server, management system and medium of cloud operating system
CN117170799A (en) Container migration method, device, computer equipment and storage medium
US10055307B2 (en) Workflows for series of snapshots
CN106452836B (en) main node setting method and device
CN108075914B (en) Dynamic capacity expansion and reduction method and network equipment
US9804878B2 (en) Using a status indicator for a merge operation for writing data associated with a virtual machine
US10824641B1 (en) Deterministic query-based replication
TW201738781A (en) Method and device for joining tables
CN104468759A (en) Method and device for achieving application migration in PaaS platform
CN115221156A (en) Database cluster capacity expansion method and device, computer equipment and storage medium
WO2017000586A1 (en) Method and device for upgrading virtual network element, and computer storage medium
CN116389233B (en) Container cloud management platform active-standby switching system, method and device and computer equipment
CN107621994A (en) The method and device that a kind of data snapshot creates
WO2023160418A1 (en) Resource processing method and resource scheduling method
US11068192B1 (en) Utilizing mutiple snapshot sources for creating new copy of volume in a networked environment wherein additional snapshot sources are reserved with lower performance levels than a primary snapshot source
US20220229689A1 (en) Virtualization platform control device, virtualization platform control method, and virtualization platform control program
CN116599828A (en) Task execution method and device, storage medium and electronic equipment

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