Device for quickly migrating container based on network storage

Through the fast migration of container devices based on network storage, using API interfaces and shared directory technology, the problems of traditional container migration time-consuming and complex Kubernetes management are solved, and the synchronization of second-level container migration and resource mirroring is achieved, which improves work efficiency and containers ease of management.

CN119172399APending Publication Date: 2024-12-20HANGZHOU XINGMI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411182911.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional Docker technology consumes a large bandwidth during container migration, resulting in wasted time and business interruption. The Kubernetes management platform is complex and costly, and has poor troubleshooting capabilities, resulting in cluster abnormalities.

Method used

Design a fast migration container device based on network storage, including the web terminal, node manager and cluster controller, realize real-time communication through the API interface, use locking and recovery instructions to achieve second-level container migration, and synchronize mirror data through shared directories. Reduce resource mirroring time.

Benefits of technology

It realizes rapid container migration, breaks through the underlying environment and logical limitations, reduces migration time and cost, and improves work efficiency and simplicity of container management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172399A_ABST
    Figure CN119172399A_ABST
Patent Text Reader

Abstract

The invention provides a device for quickly migrating a container based on network storage, which comprises a Web end used for acquiring and issuing a container migration instruction; the node manager comprises a plurality of nm nodes and is used for reporting resources of each nm node and completing container migration according to the obtained control instruction; the cluster controller receives the resource data uploaded by the node manager, calculates the resource data of each nm node, determines an initial nm node according to a resource standard, and determines a target nm node according to a migration receiving instruction; when the container is migrated, the cluster controller issues a locking instruction to control the initial nm node to lock the container in operation, and issues a recovery instruction to control the container of the target nm node to operate to complete migration; the resource memory is used for storing mirror image data of an original container in an nm node migration process; according to the method, the container of the initial nm node is controlled to rapidly migrate to the target nm node through the locking instruction and the recovery instruction output by the cluster controller, and the multiple nm nodes are rapidly and synchronously mirrored by accessing the resource memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a device for rapidly migrating containers based on network storage. Background Art

[0002] Docker and Kubernetes (K8s) are two very important technologies in today's cloud computing and microservice architecture. They play a core role in the field of containerization and container orchestration, greatly changing the way software is developed, deployed, and maintained. Docker and Kubernetes have become important cornerstones of modern software development and deployment. Their combination provides powerful tools and frameworks for building and managing complex application systems. With the continuous development of technology and the maturity of the ecosystem, Docker and Kubernetes will continue to drive innovation in cloud computing and microservice architecture, helping enterprises succeed on the road to digital transformation.

[0003] Traditional Docker technology often consumes a large amount of bandwidth storage capacity when migrating containers, which wastes a lot of time, resulting in long interruptions to related services and reducing the work efficiency of enterprises. In addition, Kubernetes technology is a platform for managing containers. The current Kubernetes management platform is more complex and costly to maintain containers. When the platform is abnormal, the ability to troubleshoot the problem is poor. Usually, when a component fails, one or more clusters will fail and services cannot be provided. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, the present invention provides a device for rapidly migrating containers based on network storage.

[0005] In order to achieve the above-mentioned object, the present invention provides a device for rapidly migrating containers based on network storage, comprising: a Web terminal, a node manager, a cluster controller and a resource storage device;

[0006] Web end, used to obtain and issue container migration instructions;

[0007] The node manager includes multiple nm nodes, which are used to report the resources of each nm node and complete the container migration according to the obtained control instructions;

[0008] The cluster controller receives the resource data uploaded by the node manager, calculates the resource data of each nm node, selects the initial nm node according to the set resource standard, and determines the target nm node according to the received migration instruction; when the container migrates, the cluster controller controls and sends the lock instruction to control the initial nm node to lock the running container, and sends the recovery instruction to control the container operation of the target nm node to complete the migration;

[0009] Resource storage is used to store the image data of the original container during the nm node migration process.

[0010] Preferably, after the initial nm node locks the container, the image data of the container is stored in the resource storage to generate a lock file. After the storage is completed, the initial nm node reports the current state to the cluster controller.

[0011] Preferably, when the target nm node is restored, the cluster controller monitors the operating status of the target nm node. If it is normal, the initial nm node is controlled to delete the locked image and feedback the migration success mark to the Web end; if it is abnormal, a regression operation is performed, and the migration failure mark is fed back to the Web end, and the container migration is attempted again.

[0012] Preferably, when the target nm node is selected, after querying the resource standards in sequence, the nm node with the lowest load is used as the initial node.

[0013] Preferably, the set resource standards include: GPU, CPU, memory, hard disk and network.

[0014] Preferably, a shared directory is configured on the resource storage device, and the container, shared data and container original image data of any nm node are obtained through the shared directory.

[0015] Preferably, when acquiring the mirror data of the nm node, any nm node executes the download instruction, and then all nm nodes are mirrored synchronously.

[0016] The device for rapidly migrating containers based on network storage provided by the present invention has the advantages of:

[0017] 1. Each nm node of the cluster controller (ADC) and the node manager is configured with an API interface. The Web end realizes the interaction between the front-end (web end) and the back-end (nm node) by calling the API interface of the cluster controller. The cluster manager connects to each nm node (server) through websockter, realizing real-time communication between the Web end and each nm node, and between nodes.

[0018] 2. The present invention can achieve second-level migration of containers between the initial nm node and the target nm node through locking instructions and recovery instructions, and the migration process breaks through the underlying environment and logic limitations.

[0019] 3. The present invention configures a resource storage device with a shared directory, so when any nm node downloads mirror data, other nm nodes can synchronize resources, thereby reducing the time for resource mirroring. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1A flowchart of migrating a container based on network storage rapid migration is provided by the present invention. DETAILED DESCRIPTION

[0021] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0022] Existing containers usually complete migration manually, and it is impossible to determine whether the resource status of the target server to be migrated meets the requirements. The migrated server needs to spend a lot of time to export its image data and then import it into the target server. The migration process is troublesome and time-consuming. In order to solve this problem, the present invention provides a device that can quickly realize container migration and synchronize image data of multiple servers.

[0023] like Figure 1 As shown, a device for quickly migrating containers based on network storage includes: a Web end, a node manager, a cluster controller and a resource storage. The Web end is used to obtain and issue container migration instructions. The node manager includes multiple nm nodes, which are used to report the resources of each nm node and complete the container migration according to the acquired control instructions. The cluster controller is used to receive the resource data uploaded by the node manager, calculate the resource data of each nm node, filter out the initial nm node according to the set resource standard, and determine the target nm node according to the received migration instruction; when the container migrates, the cluster controller issues a lock instruction to control the initial nm node to lock the running container, and issues a recovery instruction to control the container operation of the target nm node to complete the migration. The resource storage is used to store the mirror data of the original container during the nm node migration process.

[0024] Specifically, in the present invention, each nm node of the cluster controller (ADC) and the node manager is configured with an API interface. The Web end realizes the interaction between the front end (web end) and the back end (nm node) by calling the API interface of the cluster controller. The cluster manager is connected to each nm node (server) through the websockter, realizing real-time communication between the Web end and each nm node, and between nodes. The present invention uses the Web end to obtain the container migration instruction, that is, the "instance migration" instruction. The cluster manager calculates the resource data reported by each nm node according to the instruction, and determines the initial nm node and the target nm node that need to migrate the container. When the container migrates, the initial nm node locks the container so that the container is in a "frozen" state. After the resource locking of the initial nm node is completed, the state is fed back to the cluster manager. The cluster manager outputs the recovery instruction to control the target nm node to resume the operation of the container to complete the container migration. The present invention can realize the second-level migration of the container between the initial nm node and the target nm node through the locking instruction and the recovery instruction, and the migration process breaks through the underlying environment and logical limitations. In addition, by configuring a resource storage device with a shared directory, when any nm node downloads the mirror data, other nm nodes can synchronize resources, reducing the time of resource mirroring.

[0025] In this embodiment, after the initial nm node locks the container, the image data of the container is stored in the resource storage to generate a lock file. After the storage is completed, the initial nm node reports the current state to the cluster controller.

[0026] Specifically, when a container is migrated, a lock file is generated in the initial nm node resource storage to form a shared resource for other nm node servers to download and use. By sharing the directory, the reusability of the container feature level and the storage utilization rate are improved.

[0027] In this embodiment, after the target nm node container is restored, the cluster controller monitors the running status of the target nm node. If it is normal, the initial nm node is controlled to delete the locked image and feedback the migration success mark to the Web end; if it is abnormal, a regression operation is performed, and the migration failure mark is fed back to the Web end, and the container migration is attempted again.

[0028] Specifically, during the container migration process, the cluster controller monitors the initial nm node and the target nm node in real time. The target nm node monitors its recovery status in real time during the process of restoring the container. If it has been fully restored, it means that the migration is complete. At this time, the cluster controller controls the initial nm node to delete the locked container image data to avoid conflicts with the container image running on the target nm node. The cluster controller feeds back the successful migration mark to the Web end to prompt the user that the container migration is successful. On the contrary, if the target nm node container runs abnormally, the cluster controller feeds back the migration failure mark to the Web end, prompting the user to try to migrate the container again. Among them, the regression operation means that the original container remains unchanged and runs normally.

[0029] In this embodiment, when selecting the target nm node, after querying the resource standards in sequence, the nm node with the lowest load is used as the initial node.

[0030] Specifically, the server-side adc receives the "instance migration" instruction, calculates the resource data reported by the node manager, and queries in sequence according to the set resource standards, namely GPU, CPU, memory, hard disk and network. When the load of all resource standards is the lowest, the selector is used as the initial nm node, and then notifies the selected initial nm node data container migration. The present invention effectively reduces the container migration time and reduces the migration pressure by selecting the nm node with the lowest load of all resource standards as the initial node.

[0031] In this embodiment, a shared directory is configured on the resource storage device, and the container, shared data, and container original image data of any nm node are obtained through the shared directory.

[0032] Specifically, the resource storage device is installed with the network storage application software NFS, whose installation system is the Linux system, and the specific installation method is as follows:

[0033] Install NFS server apt install nfs-kernel-server;

[0034] Configure the shared directory / nfs, vim / etc / exports, the content is " / nfs*(rw,sync,no_root_squash)"; vim / etc / exports is to modify the nfs configuration file, * is to allow any network segment IP system to access the NFS directory, rw is read and write permissions, sync is to synchronize the hard disk immediately, and no_root_squash is to allow the client root permission;

[0035] Create a shared directory and set its permissions, that is, mkdir / nfs; chmod-R777 / nfs;

[0036] Start the NFS service systemctl nfs-kernel-server start;

[0037] Use the shared directory server NFS Cleint to install apt install nfs-common;

[0038] Mount the shared directory storage mount-t nfs$server IP: / nfs / nfs-o nolock; -t specifies the mount type nfs, -o nolock prohibits locking during mounting;

[0039] Modify the data storage path of the container to the shared directory vim / etc / docker / daemon.json; the content is ""data-root":" / nfs / docker-data"";

[0040] Restart the container systemctl daemon-reload; systemctl restart docker;

[0041] Through the shared directory created above, any nm node in a cluster can obtain the nm node container, shared data and container original image data (image data stored after container migration) stored in the shared directory by accessing the shared directory.

[0042] In this embodiment, when the mirror data of the nm node is obtained, any nm node executes a download instruction, and then all nm nodes are mirrored synchronously.

[0043] Specifically, any nm node executes a download command to download an image from the resource storage, and other nm nodes in the cluster will automatically synchronize the image, so that the image can be used without downloading it again, so that fast mirroring can be achieved between different nm nodes, providing data guarantee for fast container migration. Among them, the way to store data in the resource storage can adopt distributed storage (ceph), regional storage (san), glusterFS (distributed file system), etc.

[0044] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

Claims

1. A device for rapidly migrating containers based on network storage, characterized in that: include: Web end, used to obtain and issue container migration instructions; The node manager includes multiple nm nodes, which are used to report the resources of each nm node and complete the container migration according to the obtained control instructions; The cluster controller receives the resource data uploaded by the node manager, calculates the resource data of each nm node, selects the initial nm node according to the set resource standard, and determines the target nm node according to the received migration instruction; when the container migrates, the cluster controller sends a lock instruction to control the initial nm node to lock the running container, and sends a recovery instruction to control the container operation of the target nm node to complete the migration; Resource storage is used to store the image data of the original container during the nm node migration process.

2. The device for rapidly migrating containers based on network storage according to claim 1, characterized in that: After the initial nm node locks the container, the image data of the container is stored in the resource storage device to generate a lock file. After the storage is completed, the initial nm node reports the current state to the cluster controller.

3. The device for rapidly migrating containers based on network storage according to claim 1, characterized in that: When the target nm node is restored, the cluster controller monitors the running status of the target nm node. If it is normal, the initial nm node is controlled to delete the locked image and feedback the migration success mark to the Web end; if it is abnormal, a regression operation is performed, and the migration failure mark is fed back to the Web end, and the container migration is attempted again.

4. The device for rapidly migrating containers based on network storage according to claim 3, characterized in that: When screening the target nm node, after querying the resource standards in turn, the nm node with the lowest load is used as the initial node.

5. The device for rapidly migrating containers based on network storage according to claim 1, characterized in that: The set resource standards include: GPU, CPU, memory, hard disk and network.

6. The device for rapidly migrating containers based on network storage according to claim 1, characterized in that: The resource storage is configured with a shared directory, through which the container, shared data and original container image data of any nm node are obtained.

7. The device for rapidly migrating containers based on network storage according to claim 1, characterized in that: When obtaining the image data of the nm node, any nm node executes the download instruction, and all nm nodes synchronize the image.