CN115794492A - Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery - Google Patents

Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery Download PDF

Info

Publication number
CN115794492A
CN115794492A CN202211551001.6A CN202211551001A CN115794492A CN 115794492 A CN115794492 A CN 115794492A CN 202211551001 A CN202211551001 A CN 202211551001A CN 115794492 A CN115794492 A CN 115794492A
Authority
CN
China
Prior art keywords
data
backup
cluster
migrated
external storage
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
CN202211551001.6A
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.)
Beijing Sinonet Science and Technology Co Ltd
Original Assignee
Beijing Sinonet Science and Technology Co 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 Beijing Sinonet Science and Technology Co Ltd filed Critical Beijing Sinonet Science and Technology Co Ltd
Priority to CN202211551001.6A priority Critical patent/CN115794492A/en
Publication of CN115794492A publication Critical patent/CN115794492A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method and a system for realizing heterogeneous kubernets cluster data migration based on backup and recovery, and relates to the field of data processing. So as to ensure the smooth migration of data in the K8s cluster across platforms. The method comprises the following steps: establishing connection between at least one source cluster with a migration data requirement and external storage; monitoring the source cluster to obtain at least one backup instruction; acquiring data to be migrated corresponding to the backup instruction; the data to be migrated is backed up and stored to the external storage; reading the backup of the data to be migrated from the external storage, recovering the data to be migrated from at least one pre-obtained target cluster, completing data migration between the source cluster and the target cluster, and establishing connection between the target cluster and the external storage at least before restoring the data to be migrated. The technical scheme of the invention ensures the stable cross-platform migration of data in the K8s cluster.

Description

Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery
Technical Field
The invention relates to the field of data processing, in particular to a method and a system for realizing heterogeneous kubernets cluster data migration based on backup and recovery.
Background
Kubernets, K8s for short, is an abbreviation formed by replacing 8 characters 'ubernet' in the middle of the name with 8, is an open-source container arrangement engine, supports automatic deployment, realizes large-scale scalability and realizes application containerization management. In K8s, a plurality of containers can be created, each container runs an application instance, and then management, discovery and access to the group of application instances are achieved through a built-in load balancing strategy, and the details do not need to be configured and processed by complex manual operation and maintenance personnel, so that K8s is concerned and used by many enterprises.
At present, K8s clusters are mostly constructed based on x86 platforms, and with the technical development, K8s clusters are successfully constructed by adopting other platforms except the x86 platform, wherein the other platforms comprise ARM64, mips64 and the like. When an old user wants to use a K8s cluster constructed based on other platforms, the problem of data migration of the K8s cluster is faced, namely how to migrate data in the K8s cluster constructed based on the x86 platform into the K8s cluster constructed based on other platforms. However, in the prior art, no method can ensure stable cross-platform migration of data in the K8s cluster.
Disclosure of Invention
The invention aims to provide a method and a system for realizing heterogeneous kubernets cluster data migration based on backup and recovery so as to ensure cross-platform stable migration of data in a K8s cluster.
The first aspect of the present invention provides a method for implementing heterogeneous kubernets cluster data migration based on backup and recovery, which is used for a control terminal, and includes:
s1, establishing connection between at least one source cluster with a migration data requirement and external storage;
s2, monitoring the source cluster to obtain at least one backup instruction; acquiring data to be migrated corresponding to the backup instruction;
s3, the data to be migrated is backed up and stored in the external storage;
and S4, reading the backup of the data to be migrated from the external storage, restoring the data to be migrated in at least one pre-obtained target cluster, completing data migration between the source cluster and the target cluster, and establishing connection between the target cluster and the external storage at least before restoring the data to be migrated.
In the above embodiment of the present invention, optionally, S3 specifically includes the following steps:
s301, analyzing whether the data to be migrated is a persistent volume with a state application, and if so, executing S302; if not, executing S303;
s302, marking the pod corresponding to the stateful application, identifying the mark, obtaining the data volume to be migrated mounted by the pod, storing the backup of the data volume to be migrated to the external storage, and finishing the storage of the backup of the data to be migrated to the external storage;
s303, creating backup resources corresponding to the data to be migrated, backing up and storing the backup resources to the external storage, and finishing the backup and storage of the data to be migrated to the external storage.
In the above embodiment of the present invention, optionally, in S303, when a backup resource corresponding to the data to be migrated is created, and when the data to be migrated includes a data volume, a daemon process of a workload node is called in a process of backing up the data of the data volume to an external storage.
In the above embodiment of the present invention, optionally, S4 specifically includes the following steps:
s401, establishing connection between at least one target cluster waiting for the data to be migrated and external storage;
s402, monitoring at least one reduction resource instance created by the target cluster;
s403, based on the backup name in the at least one restored resource instance, obtaining backup data matched with the backup name from the external storage;
s404, judging whether the backup data contains the volume, if so, entering S405; if not, creating a resource matched with the data to be migrated in the backup data in the target cluster, and completing data recovery of the target cluster;
s405, invoking restic to generate a sidecar type container, and after the pod is created and is hung on a new volume, restoring the volume data in the backup data to the new volume to complete the data migration of the target cluster.
In the foregoing embodiment of the present invention, optionally, at least before S402, creating a restore resource instance matching the data to be migrated in advance in the target cluster.
A second aspect of the present invention provides a system for implementing heterogeneous kubernets cluster data migration based on backup and recovery, including: the system comprises a verelo server module, a client module, a controller module, a storage module, a persistent volume data processing module and an external storage module;
the verelo server module is used for providing a connection interface between the system and the kubernets cluster, receiving a request sent by a user, verifying the validity of the request, and persisting a chemical combination request and storing the chemical combination request in a persisted database;
the client module is used for user authentication and sending out a user request; the request comprises addition, deletion, modification and check;
the controller module is responsible for controlling a plurality of controllers, each controller monitors the state of each resource object in a cluster connected with the system in real time, and processes and ensures that the associated resources of the monitored resource objects meet preset requirements based on the state change of the monitored resource objects;
the storage module is responsible for storing all resource data to be migrated in the source cluster;
and the persistent volume data processing module is used for providing backup and recovery capability for the persistent volume data of all the pods on the workload node and is responsible for backing up the volume data to the storage module or reading the data from the storage module and recovering the data to a container to be recovered.
A third aspect of the present invention provides a terminal, including: one or more processors; memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method of implementing heterogeneous kubernets cluster data migration based on backup and restore as described.
A fourth aspect of the present invention provides a computer-readable medium, on which a computer program is stored, which, when being executed by a processor, implements the method for implementing heterogeneous kubernets cluster data migration based on backup and recovery.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
the technical scheme of the invention provides a cross-platform cluster data migration method for the container running in the kubernets cluster, can migrate cluster data across a bottom operating system architecture, supports the migration of most applications from X86 platform cluster data to a cluster constructed by an ARM64/Mips64 platform, helps enterprises migrate the existing cluster data to a localization platform, and promotes a localization substitution process.
1) The technical scheme of the invention realizes data migration among heterogeneous kubernets clusters of cross-platform, provides convenience for migrating data in kubernets clusters of the existing X86 platform to localized mips64 or kubernets clusters constructed by arm64 platforms, and is beneficial to promoting localization of data center infrastructure.
2) The technical scheme of the invention supports flexible screening of the objects to be backed up during backup and realizes migration of the persistent volume with state application.
3) The technical scheme of the invention can support the simultaneous configuration of a plurality of external storages and can back up the backup data to different external storages in different backup tasks.
4) According to the technical scheme, the target application images of different platforms are manufactured before migration, and the application data in the same source cluster are migrated to different target clusters.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is an architecture diagram illustrating a method for implementing heterogeneous kubernets cluster data migration based on backup and restore, according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating backup actions in a method for implementing heterogeneous kubernets cluster data migration based on backup and restore according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a recovery action in a method for implementing heterogeneous kubernets cluster data migration based on backup and recovery according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
The principle of the application is as follows: the method for achieving heterogeneous kubernets cluster data migration based on backup and recovery is a method for migrating an application state and a persistent data volume in an existing kubernets cluster from an X86 platform to other platforms such as an ARM64 platform and a Mips64 platform, the method comprises the steps of connecting kubernets clusters of different platforms to external storage independent of two K8s clusters of the two platforms, backing up data to be migrated of the kubernets cluster based on the X86 platform to the external storage, obtaining the data to be migrated in the external storage through recovery operation of the kubernets clusters of the other platforms, and achieving cross-platform migration of the data in the kubernets cluster.
Here, referring to fig. 1, a basic architecture for implementing heterogeneous kubernets cluster data migration based on backup and recovery is described, specifically:
1) And the Kubernets API externally provides RESTful service, manages the resources related to the data migration system in a plurality of kubernets self-defined resource forms, can operate through a uniform entrance, and runs on the main nodes of the source cluster and the target cluster.
2) And the Backup controller monitors Backup resources, is responsible for adjusting the current state of the Backup resource instance to a desired state, and completes a Backup task in the process, wherein the Backup controller operates on the main nodes of the source cluster and the target cluster.
3) And the RestoreController monitors the Restore resources and is responsible for adjusting the current state of the Restore resource instances to a desired state, and completes the restoration task in the process, wherein the RestoreController runs on the main nodes of the source cluster and the target cluster.
4) When the data volume migration of the stateful application is involved, backing controller and RestoreController need to backup and restore the data volume through Restic, and the Restic runs on the working nodes of a source cluster and a target cluster;
5) The StorageService provides data transfer service for a method for realizing heterogeneous kubernets cluster data migration based on backup and recovery, is responsible for persistently storing data backed up by a source cluster, reads data of the source cluster from the StorageService and recovers the data to a target cluster in the recovery process, and operates independently of the kubernets cluster;
6) ETCD, a core component of Kubernetes, is responsible for storing data of the whole cluster and is indispensable in both a source cluster and a target cluster.
Embodiment 1 this embodiment provides a method for implementing heterogeneous kubernets cluster data migration based on backup and recovery, where the method is used for a control terminal and includes:
s1, establishing connection between at least one source cluster with a migration data requirement and external storage; s2, monitoring the source cluster to obtain at least one backup instruction; acquiring data to be migrated corresponding to the backup instruction;
s3, the data to be migrated is backed up and stored in the external storage;
s301, analyzing whether the data to be migrated is a persistent volume with state application, and if so, executing S302; if not, executing S303;
s302, marking the pod corresponding to the stateful application, identifying the mark, obtaining the data volume to be migrated mounted by the pod, storing the backup of the data volume to be migrated to the external storage, and finishing the storage of the backup of the data to be migrated to the external storage;
and S303, creating backup resources corresponding to the data to be migrated, backing up and storing the backup resources in the external storage, and completing the backup storage of the data to be migrated in the external storage.
S4, in the target cluster, creating a reduction resource object: reading the backup of the data to be migrated from the external storage, restoring the data to be migrated in at least one pre-obtained target cluster, and completing data migration between the source cluster and the target cluster; the target cluster is a kubernets cluster which waits for recovery of the data to be migrated and establishes connection with the external storage.
S401, establishing connection between at least one target cluster waiting for the data to be migrated and external storage;
s402, monitoring the target cluster to create at least one recovery resource instance; at least before S402, the method includes creating a restoring resource instance matched with the data to be migrated in advance in the target cluster.
S403, based on the backup name in the at least one recovery resource instance, obtaining backup data matched with the backup name from the external storage;
s404, judging whether the backup data contains the volume, if so, entering S405; if not, creating a resource matched with the data to be migrated in the backup data in the target cluster, and completing data recovery of the target cluster;
s405, invoking restic to generate a sidecar type container, and after the pod is created and is hung on a new volume, restoring the volume data in the backup data to the new volume to complete the data migration of the target cluster.
In the above embodiment of the present application, in S1, a connection between at least one source cluster with a requirement for migrating data and an external storage is established; s401, establishing connection between at least one target cluster waiting for the data to be migrated and an external storage; the method specifically comprises the following steps: verelo is installed on a source cluster with a migration data requirement and a target cluster waiting for recovering data to be migrated, minio external storage is installed outside the source cluster and the target cluster, and data storage modules of the source cluster and the target cluster are connected to the same minio external storage in a butt joint mode.
In the embodiment of the application, when there is a request for migrating one container data of a source cluster to a destination cluster, an application image capable of running on a platform where a target cluster is located is constructed based on an application image corresponding to data to be migrated already existing in the source cluster. Here, the kubernets cluster includes built-in resources, but most of the kubernets cluster is generated when the cluster is deployed, but the application image is customized by the user, is a carrier of the application deployed by the user, and needs to prepare the application image capable of normally running on the platform where the target cluster is located in advance before the migration operation is performed.
In the above embodiment of the present application, at S302, the pod indicates a minimum unit of application load scheduling in kubernets, and marking of at least one data volume mounted by the pod is supported in the step again. In a default situation, the backup and recovery method of this embodiment does not backup the data volume to which the load is applied, but adds a tag of a specific key value to the pod, gives the id of the volume mounted by the pod as a value to the key value, and backs up the data volume mounted in the pod to which the key value tag is added when the backup operation is performed again.
In the above embodiment of the present application, in S303, the creating of the backup resource corresponding to the data to be migrated specifically includes: and creating backup resources in the source cluster through a client or directly by calling a kubernets cluster API.
The backup resource is a customizable resource, when an instance of a new backup resource is created, the backup controller executes backup operation according to conditions during creation, if the instance contains a data volume, a daemon process of the workload node is called to perform corresponding operation, data of the data volume is backed up to the storage service, and the backup time length is determined according to the actual use condition of the data volume of the selected Pod.
Here, when creating a backup resource instance, it is possible to screen resources that need to be backed up, that is, resources that meet the condition, and perform backup when performing backup operation, which mainly supports four ways: namespace name, resource type name, whether cluster resources are included, and by tag selection. Meanwhile, the exclusion mode filtering is also supported, namely, the resources meeting the conditions are excluded during backup, the backup operation is not executed, and the exclusion mode is mainly supported: namespace name, resource type, and add a specified tag.
In the above embodiment of the present application, in S4, the restore resource is also a customizable resource, and after the restore resource object instance is created, the corresponding restore controller reads the data to be restored included in the associated backup data from the external storage, and creates the corresponding resource in the target cluster according to the backup data. If there is a data volume to be restored when the Pod is restored, an empty data volume is created through the CSI plug-in when the Pod is restored, and after the Pod completes creation and mounting of a new volume, the backed-up data in the source volume is read and restored to the new volume.
In the above embodiment of the present application, when the restore controller completes the recovery processing of the restored resource, the state of the restored resource is updated to be completed.
The method for implementing heterogeneous kubernets cluster data migration based on backup and recovery in the above embodiment of the present application mainly includes two actions of backup of a source cluster and recovery of a target cluster, and the two actions are respectively described in more detail below.
Referring to fig. 2, description of backup operation: and creating a Backup resource instance in the source cluster through a kubernets cluster API, wherein the Backup resource instance comprises a Backup object and a Backup storage position, and when the storage position is not provided, the Backup resource instance stores a default position specified during installation.
1) And the Backup controller monitors the newly created examples and screens out the resources needing to be backed up according to the specified rule during creation.
2) And the Backup controller reads resource information except the non-workload data volume, generates Backup data and uploads the Backup data to a storage service.
3) And screening the volume information contained in the Backup object by the Backup controller, calling the static, and backing up the data in the volume.
4) restic mounts the workload volume to its own container, reads the data in the volume, and uploads it to the storage service.
Referring to fig. 3, description of the recovery operation: and creating a Restore resource instance through an API of the kubernets cluster, wherein the Restore resource instance comprises specified backup data, and the restoration is realized through the specified backup data.
1) The Restore controller monitors the newly created instance, and can screen the resource information which needs to be restored and does not need to be restored according to the parameters during creation.
2) The backed-up data is read from the storage service according to the backup name specified at the time of creation.
3) Resources included in the backup data that meet the restore conditions are created in the target cluster.
4) If the workload contains a data volume that needs to be recovered, the controller will call restic, generating a container in the form of a sidecar.
5) The sidecar will be in the same pod as the workload being restored and, after the workload volume creation is complete, the backup data in the volume is restored.
Example 2
The embodiment provides a system for realizing heterogeneous kubernets cluster data migration based on backup and recovery, which comprises: the system comprises a verelo server module, a client module, a controller module, a storage module, a persistent volume data processing module and an external storage module;
1. and the verelo server side module is used for providing a connection interface between the system and the kubernets cluster, receiving a request sent by a user, verifying the legality of the request, and storing the request in a persistent database.
Here, the verelo server module is responsible for exposing and providing services to the outside in a RESTful style the resources required by the migration system. The kube-api server component embedded in the verelo server module in the kubernets cluster belongs to self-defined resources, when backup/recovery and other operations are established, the verelo server module is used as an entrance to provide an adding and deleting modification and check interface for corresponding resources, is directly connected with the persistent database etcd, and is responsible for receiving a user request, analyzing request parameters, checking whether the parameters are legal and persistently changing and persisting legal request data into the persistent database etcd.
2. The client module is used for user authentication and sending out a user request; the request includes addition, deletion, modification and check. The client module is not only used for user authentication, but also used for authenticating various resources when operating, and judging whether the authority requirements are met.
The client module provides a simple installation mode for a user, the whole system can be deployed by one key of the client, and meanwhile, a command line for operating corresponding resources is packaged for the user, and specific resource objects can be operated interactively.
3. And the controller module is responsible for controlling the plurality of controllers, each controller monitors the state of each resource object in the cluster connected with the system in real time, and processes and ensures that the associated resources of the monitored resource objects meet preset requirements based on the state change of the monitored resource objects.
The controller module provides a corresponding controller for each user-defined resource required by system operation, each controller monitors the current state of each resource object of the whole cluster in real time through an interface provided by the kube-apiserver component, and when the state of the resource object changes due to the addition, deletion, modification and check of a user, corresponding response is made, and the resource-related resource is processed to reach a preset 'expected state'.
4. And the storage module is responsible for storing all resource data to be migrated in the source cluster, including stateless applications and data volumes of stateful applications.
Here, the storage module provides data storage capability for the entire system, and is mainly responsible for storing all resource data to be migrated in the source cluster, including stateless applications and data volumes of stateful applications.
5. And the persistent volume data processing module is used for providing backup and recovery capability for the persistent volume data of all the pod on the workload node, and is responsible for backing up the volume data to the storage module or reading the data from the storage module and recovering the data to a container to be recovered.
Here, the persistent volume data processing module is a daemon process on the workload node, and exists on each workload node. The persistent volume data processing module provides backup and recovery capability for the persistent volume data of all the pod on the workload node, and is responsible for backing up the volume data to the storage module or reading the data from the storage module and recovering the data to a container to be recovered.
Example 3
The present embodiment provides a terminal, including: one or more processors; memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method of implementing heterogeneous kubernets cluster data migration based on backup and restore as described.
Example 4
The present embodiments provide a computer readable medium having stored thereon a computer program, which when executed by a processor, implements the method for implementing heterogeneous kubernets cluster data migration based on backup and recovery.
By adopting the technical scheme disclosed by the invention, the following beneficial effects are obtained: the technical scheme of the invention provides a cross-platform cluster data migration method for the container running in the kubernets cluster, can migrate cluster data across a bottom operating system architecture, supports the migration of most applications from X86 platform cluster data to a cluster constructed by an ARM64/Mips64 platform, helps enterprises migrate the existing cluster data to a localization platform, and promotes a localization substitution process.
1) The technical scheme of the invention realizes data migration among heterogeneous kubernets clusters of cross-platform, provides convenience for migrating data in kubernets clusters of the existing X86 platform to localized mips64 or kubernets clusters constructed by arm64 platforms, and is beneficial to promoting localization of data center infrastructure.
2) The technical scheme of the invention supports flexible screening of the objects to be backed up during backup and realizes migration of the persistent volume with state application.
3) The technical scheme of the invention can support the simultaneous configuration of a plurality of external storages and can back up the backup data to different external storages in different backup tasks.
4) According to the technical scheme, the target application images of different platforms are manufactured before migration, and the application data in the same source cluster can be migrated to different target clusters.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection," depending on context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer-readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (8)

1. A method for realizing heterogeneous kubernets cluster data migration based on backup and recovery is used for a control terminal, and is characterized by comprising the following steps:
s1, establishing connection between at least one source cluster with a migration data requirement and external storage;
s2, monitoring the source cluster to obtain at least one backup instruction; acquiring data to be migrated corresponding to the backup instruction;
s3, the data to be migrated is backed up and stored in the external storage;
and S4, reading the backup of the data to be migrated from the external storage, restoring the data to be migrated in at least one pre-obtained target cluster, completing data migration between the source cluster and the target cluster, and establishing connection between the target cluster and the external storage at least before restoring the data to be migrated.
2. The method according to claim 1, wherein S3 comprises in particular the steps of:
s301, analyzing whether the data to be migrated is a persistent volume with a state application, and if so, executing S302; if not, executing S303;
s302, marking the pod corresponding to the stateful application, identifying the mark, obtaining the data volume to be migrated mounted by the pod, storing the backup of the data volume to be migrated to the external storage, and finishing the storage of the backup of the data to be migrated to the external storage;
and S303, creating backup resources corresponding to the data to be migrated, backing up and storing the backup resources in the external storage, and finishing the backing up and storing the data to be migrated in the external storage.
3. The method according to claim 2, wherein in S303, when creating a backup resource corresponding to the data to be migrated and when the data to be migrated includes a data volume, a daemon process of a workload node is invoked during backup of the data volume to an external storage.
4. The method according to claim 1, wherein S4 comprises in particular the steps of:
s401, establishing connection between at least one target cluster waiting for the data to be migrated and external storage;
s402, monitoring at least one reduction resource instance created by the target cluster;
s403, based on the backup name in the at least one restored resource instance, obtaining backup data matched with the backup name from the external storage;
s404, judging whether the backup data contains the volume, if so, entering S405; if not, creating a resource matched with the data to be migrated in the backup data in the target cluster, and completing data recovery of the target cluster;
s405, invoking restic to generate a sidecar type container, and after the pod is created and is hung on a new volume, restoring the volume data in the backup data to the new volume to complete the data migration of the target cluster.
5. The method according to claim 4, comprising, at least before the step S402, pre-creating a restore resource instance matching the data to be migrated in the target cluster.
6. A system for implementing the method for implementing heterogeneous kubernets cluster data migration based on backup and restore according to any one of claims 1 to 5, comprising: the system comprises a verelo server module, a client module, a controller module, a storage module, a persistent volume data processing module and an external storage module;
the verelo server module is used for providing a connection interface between the system and the kubernets cluster, and is responsible for receiving a request sent by a user, verifying the legality of the request, and persisting a combination request and storing the combination request in a persisted database;
the client module is used for user authentication and sending a user request; the request comprises addition, deletion, modification and check;
the controller module is responsible for controlling a plurality of controllers, each controller monitors the state of each resource object in a cluster connected with the system in real time, and processes and ensures that the associated resources of the monitored resource objects meet preset requirements based on the state change of the monitored resource objects;
the storage module is responsible for storing all resource data to be migrated in the source cluster;
and the persistent volume data processing module is used for providing backup and recovery capability for the persistent volume data of all the pod on the workload node, and is responsible for backing up the volume data to the storage module or reading the data from the storage module and recovering the data to a container to be recovered.
7. A terminal, comprising: one or more processors; memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method for heterogeneous kubernets cluster data migration based on backup and restore of any of claims 1-5.
8. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, implements the method for heterogeneous kubernets cluster data migration based on backup and restore according to any one of claims 1 to 5.
CN202211551001.6A 2022-12-05 2022-12-05 Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery Pending CN115794492A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211551001.6A CN115794492A (en) 2022-12-05 2022-12-05 Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211551001.6A CN115794492A (en) 2022-12-05 2022-12-05 Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery

Publications (1)

Publication Number Publication Date
CN115794492A true CN115794492A (en) 2023-03-14

Family

ID=85445797

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211551001.6A Pending CN115794492A (en) 2022-12-05 2022-12-05 Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery

Country Status (1)

Country Link
CN (1) CN115794492A (en)

Similar Documents

Publication Publication Date Title
CN109120678B (en) Method and apparatus for service hosting of distributed storage system
US20230308525A1 (en) Embedded database as a microservice for distributed container cloud platform
CN110784350B (en) Design method of real-time high-availability cluster management system
EP3200073B1 (en) Method, apparatus and system for migrating virtual machine backup information
US8024536B2 (en) Method of constructing replication environment and storage system
CN106528327B (en) A kind of data processing method and backup server
CN112104723B (en) Multi-cluster data processing system and method
JP5444178B2 (en) Backup / restore processing device, backup / restore processing method and program
US10606661B2 (en) On-demand provisioning of customized developer environments
CN107544783B (en) Data updating method, device and system
CN110138577B (en) Cluster creation method, first server and readable storage medium
CN109168328B (en) Virtual machine migration method and device and virtualization system
CN113672350B (en) Application processing method and device and related equipment
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN113656149A (en) Application processing method and device and related equipment
CN112214351A (en) Backup data recovery method and device, electronic equipment and storage medium
CN116089011A (en) Method and device for creating mirror warehouse, storage medium and electronic equipment
CN113419818B (en) Basic component deployment method, device, server and storage medium
CN110737510A (en) Block device management system
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
CN112732412B (en) Service configuration file processing method and device, storage medium and electronic equipment
CN111399999A (en) Computer resource processing method and device, readable storage medium and computer equipment
CN115794492A (en) Method and system for realizing heterogeneous kubernets cluster data migration based on backup and recovery
CN116263694A (en) Warehouse cluster deployment method and device and computing equipment
CN114661420A (en) Application protection method, device and system based on Kubernetes container platform

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