Movatterモバイル変換


[0]ホーム

URL:


CN109271249A - A kind of online moving method of cloud container pre-copy based on P.haul frame - Google Patents

A kind of online moving method of cloud container pre-copy based on P.haul frame
Download PDF

Info

Publication number
CN109271249A
CN109271249ACN201810840047.7ACN201810840047ACN109271249ACN 109271249 ACN109271249 ACN 109271249ACN 201810840047 ACN201810840047 ACN 201810840047ACN 109271249 ACN109271249 ACN 109271249A
Authority
CN
China
Prior art keywords
container
copy
destination host
file
checkpoint
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.)
Granted
Application number
CN201810840047.7A
Other languages
Chinese (zh)
Other versions
CN109271249B (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.)
Jinan University
Original Assignee
Jinan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan UniversityfiledCriticalJinan University
Priority to CN201810840047.7ApriorityCriticalpatent/CN109271249B/en
Publication of CN109271249ApublicationCriticalpatent/CN109271249A/en
Application grantedgrantedCritical
Publication of CN109271249BpublicationCriticalpatent/CN109271249B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of online moving method of cloud container pre-copy based on P.haul frame; field is migrated online for container; in the case where ensuring to access unbroken situation; container between different physical machine or cloud platform is moved; the working condition of source host can be continued to ensure container after migration, while the vessel shutdown time caused by reducing in transition process using pre-copy and the transmission delay mechanism based on history.More flexible application is provided for container, is also made that element task for the load balancing of container and scheduling of resource.

Description

A kind of online moving method of cloud container pre-copy based on P.haul frame
Technical field
It is the present invention relates to the online migrating technology field of cloud computing container, in particular to a kind of based on P.haul frameThe online moving method of Docker container pre-copy.
Background technique
Container technique provides increasingly wide application environment for cloud computing, in order to provide more for container life cycleAdd flexible application, adapt to richer usage scenario, it is necessary to use the online migrating technology of container.Container moves onlineThermophoresis is also named in shifting, and referring to is ensuring in the case where accessing unbroken situation, to the appearance between different physical machines or cloud platformDevice carries out mobile process.In transition process, need to connect on source host upper container run-time memory, file system and networkIt the status informations such as connects to migrate to destination host, while ensuring container after migration to continue the working condition of source host.
The ongoing work of source host in transition process can be transferred to purpose master by this online migrating technology in real timeOn machine, migrated so that user is even imperceptible.Nowadays the scheme much migrated online all has on a virtual machineVery mature application, and the online migration field of container are based especially on the online migration of Docker, and there is presently no a set of non-Often mature solution.
In recent years, academia copies the thinking of virtual machine (vm) migration, proposes " stopping-copy " and " pre-copy " of containerMigration strategy is realized and is migrated online to the container of Docker.Also research attempts to have used logging-and-replay'sMigration strategy, but dependent on the record to container event to be migrated, and have many restrictions, so logging-and-replayStrategy is also immature in container migration.
Summary of the invention
The purpose of the present invention is to overcome the shortcomings of the existing technology and deficiency, provides a kind of cloud appearance based on P.haul frameThe online moving method of device pre-copy may be implemented online migration of the Docker container between source host and destination host, and lead toThe volume of transmitted data in transition process can be effectively reduced and migrate total by crossing pre-copy and the transmission delay mechanism based on historyTime.
The purpose of the present invention is realized by the following technical solution: a kind of cloud container pre-copy based on P.haul frame existsLine moving method, comprising:
T1, container configuration are obtained and migration network establishment step: obtaining the configuration file of container to be migrated, it is established that source masterGenerator terminal to destination host end network connection, in order in container migration step carry out associated migratory work;
T2, container migration step, comprising:
Container assemblies migrate sub-step: for sending container assemblies associated documents and job status document to destination host;
Internal memory migration sub-step: for sending container current working status file and memory to be migrated to destination host iterationInitial data;
T3, container is rebuild and cleanup step: status file for being transmitted in destination host according to step T2 andInternal storage data rebuilds new container, and clears up the container in source host and configuration file.
Preferably, the step T1 obtains the configuration information of container to be migrated, and generates checkpoint catalogue, toolBody includes:
Step T1.1, according to the id of container to be migrated, current container Tty feelings are read using docker inspect orderCondition, if it find that the container opens Tty, then the container can not migrate, and return to error message;
Step T1.2, the network linking between source host and destination host is established;Network linking needs to set up two netsNetwork link: order transmissions links and data transmission link;Order transmissions links use RPC far call mode, i.e., in source hostMiddle transmission order is run in destination host;Data link uses Rsync data synch command, and related data is passed from source hostTransport to destination host;
Step T1.3, using docker checkpoint create--checkpoint-dir={ checkpoint mesh{ container id } { checkpoint serial number } order, the status file of container to be migrated is obtained, and be stored in checkpointIn catalogue, for being migrated to destination host.
Further, the status file for the container to be migrated obtained being needed described in step T1.3 includes: that container is retouchedMessage file, the filec descriptor message file of opening, CPU information file and memory mapping table are stated, these information are with JSONData format is stored in respective file;Page initial data when container operation should be also obtained, simultaneously with 4KByte sizeIt is stored in binary file for unit.
Further, two network linkings described in step T1.2 are constructed in P.haul frame based on C/S structure,It is logical by establishing two between the two to guarantee the transmission that can carry out data between source host and destination host and control operationLetter socket is transmitted respectively for control command and data;Control command socket uses RPC remote process control mode, by sourceHost sends relevant control command to destination host;Data socket then uses Transmission Control Protocol, for that will obtain from source hostTo operating status file be sent in destination host.
Preferably, container assemblies described in T2 migrate sub-step, for transmitting the associated component of container in source hostTo destination host, need to migrate 3 catalogues: root file system, container config directory and container in the transition process of DockerMetadata catalog when operation, specifically includes:
Step 1, the image file using in Rsync order respectively general/var/lib/docker/image catalogue ,/var/Container configuration file and/var/run/docke-r/execdriver/native in lib/docker/containers catalogueContainer operation when metadata be transferred in destination host;
Step 2 sends RPC order from source host to destination host, carries out three kinds of corresponding mesh in step 1 at destination host endThe reconstruction of record.
Preferably, internal memory migration sub-step described in T2, for by the memory initial data of container to be migrated with iterationMode is transmitted in destination host, to reduce downtime when container migration, is specifically included:
Step 1, setting iteration pre-copy stop condition determine to need according to internal storage data size derived from container to be migratedTo use different one of stop conditions;
-- fdrpc<fd>-- fdmem<fd>-- pre-dump is used for step 2, input order p.haul docker<id>P.haul frame, the pre-copy for opening Docker container migrate online;
Newly generated memory containing dirty pages can be transmitted to destination host in each iteration with incremental form by step 3, p.haul.
Specifically, setting iteration pre-copy stop condition determines to need according to internal storage data size derived from container to be migratedIt will be using one of three kinds of stop conditions: when migrating internal storage data size less than 128M, using condition (1) in the pre- of last timeIn copy, generates and be no more than 64 memory containing dirty pages;When migration internal storage data size is greater than 128M and is less than 512M, using condition(2) the page copy quantity of last time preexamination shellfish increases less than 10%;The 512M when migrating internal storage data size and being greater than, using itemPart (3) iteration number is no more than 8 times.
Further, the memory containing dirty pages incremental transmission uses the transmission delay mechanism based on history, specifically includes:
Memory containing dirty pages bitmap values dirtymap when (n-1)th step 1, preservation iterationn-1
Step 2, the bitmap values proceeded in nth iteration be dirtymapn
Step 3, the occurrence that position is corresponded to by comparing the two bitmaps, to determine whether this is exported.
Specifically, the memory containing dirty pages incremental transmission uses the transmission delay mechanism based on history:
(1) work as dirtymapnAnd dirtymapn-1It when being all 0, indicates that the page is never modified, does not have to copy;
(2) work as dirtymapnIt is 1, dirtymapn-1Indicated when being 0 the page be it is newly generated, need to be copied;
(3) work as dirtymapnIt is 0, dirtymapn-1Indicate that the page was once modified when being 1, it may be possible to continuousThe page modified and do not copied, and will not may still modify next time, so needing exist for being copied;
(4) work as dirtymapnAnd dirtymapn-1When being all 1, indicate that the page was modified continuously, this indicates that the page has very muchIt may can also be modified next time, therefore this does not copy the page.
Preferably, container reconstruction and cleanup step T3, for container-like according to getting on destination hostState file and memory initial data rebuild new container, and delete the container of having moved in source host, while deleting correspondingCheckpoint catalogue, specifically includes:
Step T3.1, the container of having moved deleted in source host is ordered using docker rm<id>;
Step T3.2, the docker system of destination host is restarted, so that newly migrating past container configuration information and root textPart system comes into force;
Step T3.3, using docker start--checkpoint-dir=<checkpoint catalogue>--Checkpoint=<checkpoint serial number><container id>rebuilds new container in destination host.
Compared with the prior art, the invention has the following advantages and beneficial effects:
(1) online migration of the Docker container between source host and destination host may be implemented in the present invention.
(2) the present invention is based on more mature P.haul frame, there are good stability and scalability.
(3) present invention can be effectively reduced in transition process by pre-copy and the transmission delay mechanism based on historyVolume of transmitted data and migration total time.
Detailed description of the invention
Fig. 1 is the online migration system architecture figure of embodiment container.
Fig. 2 is embodiment migratory system network linking topological diagram.
Fig. 3 is embodiment container migration flow chart.
Fig. 4 is embodiment iteration pre-copy schematic diagram.
Specific embodiment
Present invention will now be described in further detail with reference to the embodiments and the accompanying drawings, but embodiments of the present invention are unlimitedIn this.
Embodiment 1
The present invention is a kind of online moving method of cloud container pre-copy based on P.haul frame, is mainly used in DockerOnline migration of the container between different hosts is the basic work that container payload equilibrium and container scheduling of resource are realized in cloud environmentMake.
Below in conjunction with the online migration system architecture figure (Fig. 1) of container, migratory system network linking topological diagram (Fig. 2), containerMigration flow chart (Fig. 3) and the transmission delay mechanism description table (table 1) based on history illustrate.
A kind of online moving method of cloud container pre-copy based on P.haul frame, using system structure as shown in Figure 1Figure, its implementation specifically include following step, and flow chart is as shown in Figure 3:
T1, container configuration are obtained and migration network establishment step:
Obtain the configuration file of container to be migrated, it is established that the network connection at source host end to destination host end, in order toAssociated migratory work is carried out in container migration step, specific steps include:
Step T1.1, according to the id of container to be migrated, current container Tty feelings are read using docker inspect orderCondition, if it find that the container opens Tty, then the container can not migrate, and return to error message.
Step T1.2, the network linking between source host and destination host is established.In the present system, it needs to set up twoNetwork linking: order transmissions links and data transmission link.Order transmissions links use RPC far call mode, i.e., in source masterOrder is sent in machine to run in destination host;Data link uses Rsync data synch command, by related data from source hostIt is transmitted to destination host.
Step T1.3, using docker checkpoint create--checkpoint-dir=< checkp-oint mesh><container id><checkpoint serial number>order, the status file of container to be migrated is obtained, and be stored in checkpointIn catalogue, for being migrated to destination host.
T2, container migration step, for moving associated component, status file and memory initial data needed for migration containerShifting is migrated by source host to destination host, and specific steps include:
Step T2.1, using in Rsync order respectively general/var/lib/docker/image catalogue image file ,/Container configuration file and/var/run/doc-ker/execdriver/ in var/lib/docker/containers catalogueMetadata is transferred in destination host when the container operation of native.
Step T2.2, using docker checkpoint create--checkpoint-dir={ check-point mesh{ container id } { checkpoint serial number } order, the status file of container to be migrated is obtained, and be stored in checkpointIn catalogue, for being migrated to destination host.And RPC order is sent from source host to destination host, three are carried out at destination host endThe reconstruction of the corresponding catalogue of kind.
Step T2.3, -- pre-dump makes fdrpc<fd>-- fdmem<fd>-- for input order p.haul docker<id>With p.haul frame, the pre-copy for opening Docker container migrates online, according to pre-copy stop condition and based on the biography of historyDefeated delay mechanism is migrated.
T3, container is rebuild and cleanup step, for the container state file and memory that basis is got on destination hostInitial data rebuilds new container, and deletes the container of having moved in source host, while deleting corresponding checkpoint catalogue, hasBody includes:
Step T3.1, the container of having moved deleted in source host is ordered using docker rm<id>.
Step T3.2, the docker system of destination host is restarted, so that newly migrating past container configuration information and root textPart system comes into force.
Step T3.3, using docker start--checkpoint-dir=<checkpoint catalogue>--Checkpoint=<checkpoint serial number><container id>rebuilds new container in destination host.
Tty terminal refers to the terminal interacted with container, and P.haul can not be migrated with interactive terminal at presentContainer then returns to error message, while exiting entire transition process once detecting that container opens Tty in step T1.
Checkpoint status file catalogue, the filec descriptor of these status file container descriptor files, openingMessage file, CPU information file and memory mapping table, these information are stored in respective file with JSON data format.TogetherWhen should also obtain container operation when page initial data, be stored in binary file as unit of 4KByte size.
Source host and destination host network linking, figure it is seen that P.haul frame is based on C/S structure, in order to guaranteeThe transmission and control operation that data can be carried out between source host and destination host, between the two by establishing two communicationsSocket is transmitted respectively for control command and data.Control command socket mainly uses RPC remote process control mode, bySource host sends relevant control command to destination host.Data socket then uses Transmission Control Protocol, and being mainly used for will be from source masterThe operating status file got on machine is sent in destination host.
Pre-copy iteration stopping condition, because the more more then last time transmission downtimes of the number of iterations can be smaller, but mistakeIt is excessively high that more the number of iterations will cause migration total time, it is therefore desirable to be set according to the memory size occupied to container different pre-Copy the iteration stopping time: migrate internal storage data size be less than 128M when, using condition (1) last time pre-copyIn, it generates and is no more than 64 memory containing dirty pages (256K);When migration internal storage data size is greater than 128M and is less than 512M, using itemThe page copy quantity of part (2) last time preexamination shellfish increases less than 10%;The 512M when migrating internal storage data size and being greater than, usesCondition (3) iteration number is no more than 8 times.
Transmission delay mechanism based on history is by comparing memory containing dirty pages bitmap twice in succession, to determine that this changesWhether generation transmits corresponding page.As can be seen from Table 1:
(1) work as dirtymapnAnd dirtymapn-1It when being all 0, indicates that the page is never modified, does not have to copy;
(2) work as dirtymapnIt is 1, dirtymapn-1Indicated when being 0 the page be it is newly generated, need to be copied;
(3) work as dirtymapnIt is 0, dirtymapn-1Indicate that the page was once modified when being 1, it may be possible to continuousThe page modified and do not copied, and will not may still modify next time, so needing exist for being copied;
(4) work as dirtymapnAnd dirtymapn-1When being all 1, indicate that the page was modified continuously, this indicates that the page has very muchIt may can also be modified next time, therefore this does not copy the page.
Transmission delay mechanism description table of the table 1 based on history
dirtymapn-10011
dirtymapn0101
Whether copyIt is noIt isIt isIt is no
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodimentLimitation, other any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present invention,It should be equivalent substitute mode, be included within the scope of the present invention.

Claims (10)

7. the cloud container pre-copy online moving method according to claim 6 based on P.haul frame, which is characterized in thatIteration pre-copy stop condition is set, according to internal storage data size derived from container to be migrated, decision is needed using three kinds of stoppingsOne of condition: it when migrating internal storage data size less than 128M, using condition (1) in the pre-copy of last time, generates notMore than 64 memory containing dirty pages;It is pre- using condition (2) last time when migration internal storage data size is greater than 128M and is less than 512MThe page copy quantity for examining shellfish increases less than 10%;The 512M when migrating internal storage data size and being greater than, using condition (3) iteration numberNo more than 8 times.
CN201810840047.7A2018-07-272018-07-27 An online migration method of cloud container pre-copy based on P.haul frameworkActiveCN109271249B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201810840047.7ACN109271249B (en)2018-07-272018-07-27 An online migration method of cloud container pre-copy based on P.haul framework

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201810840047.7ACN109271249B (en)2018-07-272018-07-27 An online migration method of cloud container pre-copy based on P.haul framework

Publications (2)

Publication NumberPublication Date
CN109271249Atrue CN109271249A (en)2019-01-25
CN109271249B CN109271249B (en)2022-02-08

Family

ID=65153302

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201810840047.7AActiveCN109271249B (en)2018-07-272018-07-27 An online migration method of cloud container pre-copy based on P.haul framework

Country Status (1)

CountryLink
CN (1)CN109271249B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110119377A (en)*2019-04-242019-08-13华中科技大学Online migratory system towards Docker container is realized and optimization method
CN110321198A (en)*2019-07-042019-10-11广东石油化工学院A kind of container cloud platform computing resource and Internet resources coordinated dispatching method and system
CN111190702A (en)*2020-01-142020-05-22山东超越数控电子股份有限公司Cross-node hot migration method for Docker
WO2023115836A1 (en)*2021-12-242023-06-29北京百度网讯科技有限公司Method and apparatus for controlling distributed operation system, and device, medium and program product
US11748153B2 (en)2020-11-252023-09-05International Business Machines CorporationAnticipated containerized infrastructure used in performing cloud migration
WO2024174904A1 (en)*2023-02-212024-08-29杭州阿里云飞天信息技术有限公司Management migration method and apparatus for container instance, and electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170083541A1 (en)*2015-09-232017-03-23International Business Machines CorporationContainer Storage Migration
CN107526626A (en)*2017-08-242017-12-29武汉大学A kind of Docker containers thermomigration process and system based on CRIU
CN107992353A (en)*2017-07-312018-05-04南京邮电大学A kind of container dynamic migration method and system based on minimum transition amount
CN108182105A (en)*2017-12-122018-06-19苏州大学Local dynamic station moving method and control system based on Docker container techniques
CN108279969A (en)*2018-02-262018-07-13中科边缘智慧信息科技(苏州)有限公司Stateful service container thermomigration process based on memory compression transmission

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170083541A1 (en)*2015-09-232017-03-23International Business Machines CorporationContainer Storage Migration
CN107992353A (en)*2017-07-312018-05-04南京邮电大学A kind of container dynamic migration method and system based on minimum transition amount
CN107526626A (en)*2017-08-242017-12-29武汉大学A kind of Docker containers thermomigration process and system based on CRIU
CN108182105A (en)*2017-12-122018-06-19苏州大学Local dynamic station moving method and control system based on Docker container techniques
CN108279969A (en)*2018-02-262018-07-13中科边缘智慧信息科技(苏州)有限公司Stateful service container thermomigration process based on memory compression transmission

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHRIPAD NADGOWDA ET AL: "Voyager: Complete Container State Migration", 《2017 IEEE 37TH INTERNATIONAL CONFERENCE ON DISTRIBUTED COMPUTING SYSTEMS (ICDCS)》*
姜渠: "一种基于Linux容器的动态迁移方法", 《信息技术与信息化》*

Cited By (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110119377A (en)*2019-04-242019-08-13华中科技大学Online migratory system towards Docker container is realized and optimization method
CN110321198A (en)*2019-07-042019-10-11广东石油化工学院A kind of container cloud platform computing resource and Internet resources coordinated dispatching method and system
CN110321198B (en)*2019-07-042020-08-25广东石油化工学院Container cloud platform computing resource and network resource cooperative scheduling method and system
CN111190702A (en)*2020-01-142020-05-22山东超越数控电子股份有限公司Cross-node hot migration method for Docker
US11748153B2 (en)2020-11-252023-09-05International Business Machines CorporationAnticipated containerized infrastructure used in performing cloud migration
WO2023115836A1 (en)*2021-12-242023-06-29北京百度网讯科技有限公司Method and apparatus for controlling distributed operation system, and device, medium and program product
US12298839B2 (en)2021-12-242025-05-13Beijing Baidu Netcom Science Technology Co., Ltd.Method for controlling distributed operation system, device, and medium
WO2024174904A1 (en)*2023-02-212024-08-29杭州阿里云飞天信息技术有限公司Management migration method and apparatus for container instance, and electronic device and storage medium

Also Published As

Publication numberPublication date
CN109271249B (en)2022-02-08

Similar Documents

PublicationPublication DateTitle
CN109271249A (en)A kind of online moving method of cloud container pre-copy based on P.haul frame
CN104965757B (en)Method, virtual machine (vm) migration managing device and the system of live migration of virtual machine
CN106164866B (en)Efficient migration of client-side WEB state
CN103955399B (en)A kind of virtual machine migration method and device and physical host
CN105260376B (en)Method, apparatus and system for clustered node reducing and expansion
US20170300247A1 (en)Intelligent snapshot tree replication
CN111860835A (en) A neural network model training method and device
CN107295030B (en)Data writing method and device, data processing method, device and system
CN111736762B (en)Synchronous updating method, device, equipment and storage medium of data storage network
CN104281484B (en)A kind of virtual machine migration method and device
CN111984370B (en) A method and device for online migration of multi-disk virtual machines to different storage pools
CN109814978A (en)Across cluster moving method and system based on more OpenStack platforms
CN112882726B (en)Hadoop and Docker-based deployment method of environment system
CN113742290B (en)Data storage method and device, storage medium and electronic device
CN110351336A (en)A kind of edge service moving method based on docker container
US7996511B1 (en)Enterprise-scalable scanning using grid-based architecture with remote agents
WO2021057759A1 (en)Memory migration method, device, and computing apparatus
CN116909490A (en)Data processing method, device, storage system and computer readable storage medium
CN109101323A (en)Snapshot implementing method based on qcow2 format under virtual machine operating status
CN112511633B (en)Method, system, equipment and medium for block transmission of massive small files
CN101178665A (en) Method and device for realizing configuration transaction
Zhang et al.An optimal container update method for edge‐cloud collaboration
CN110119388A (en)File read/write method, device, system, equipment and computer readable storage medium
CN104793955A (en)Distributed vector computing frame
CN114465877A (en)Edge cloud migration method and system suitable for wireless self-organizing network environment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp