Data backup method and device

By creating a reverse proxy and generating target domain names in the Kubernetes cluster, the difficulties in data backup and migration in the cluster are solved, efficient backup and migration are achieved, ensuring the stability of the cluster and data reliability.

CN114661519BActive Publication Date: 2025-03-25GUOXIN JUNHE (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011529114.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2025-03-25
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

In Kubernetes clusters, data backup and migration are difficult, and existing technologies are difficult to effectively backup and migrate deployment resources in clusters.

Method used

By creating a reverse proxy in a Kubernetes cluster, the target domain name is generated, and the image address mapping relationship is generated based on the target domain name and Docker image address, and stored in the local storage space. Based on the preset file storage method, backup Docker images, deployment resources and domain names to the target database.

Benefits of technology

It realizes efficient backup and migration of deployed resources in Kubernetes clusters, ensuring rapid restoration in the event of cluster failure, and improving the efficiency of data migration across clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661519B_ABST
    Figure CN114661519B_ABST
Patent Text Reader

Abstract

The present invention discloses a data backup method and device, and relates to the field of data processing technology. The method of the present invention includes: creating a first reverse proxy in a first cluster, and using the first reverse proxy to generate a target domain name; generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image; storing the first mapping relationship between the domain name corresponding to the first Docker warehouse and the target domain name in the local storage space of the first cluster; backing up multiple target Docker images, multiple groups of target deployment resources and target domain names to a target database based on a preset file storage method, wherein the target deployment resource records the second image address corresponding to the target Docker image that needs to be called. The present invention is applicable to the process of backing up deployment resources stored in a Kubernetes cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a data backup method and device. Background Art

[0002] With the development and widespread popularity of Docker container technology, more and more applications are deployed using Docker containers. In order to make application deployment more convenient, container orchestration technologies represented by Kubernetes have developed rapidly. In a Kubernetes cluster built based on Kubernetes technology, we can create multiple containers and deploy corresponding deployment resources in each container.

[0003] In the actual operation of the Kubernetes cluster, there are scenarios where the deployment resources stored in the Kubernetes cluster need to be restored when the Kubernetes cluster fails, and there are also scenarios where the deployment resources stored in one Kubernetes cluster need to be migrated to another Kubernetes cluster. However, data restoration for the same Kubernetes cluster and data migration between different Kubernetes clusters both involve backing up the deployment resources stored in the Kubernetes cluster. Therefore, it is crucial to effectively back up the deployment resources stored in the Kubernetes cluster. Summary of the invention

[0004] In view of this, the present invention provides a data backup method and device, the main purpose of which is to effectively back up the deployment resources stored in the Kubernetes cluster.

[0005] In order to solve the above problems, the present invention mainly provides the following technical solutions:

[0006] In a first aspect, the present invention provides a data backup method, the method comprising:

[0007] Creating a first reverse proxy in the first cluster, and using the first reverse proxy to generate a target domain name;

[0008] Generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker warehouse;

[0009] Storing a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in the local storage space of the first cluster;

[0010] Based on a preset file storage method, the plurality of target Docker images, the plurality of groups of target deployment resources and the target domain name are backed up to a target database, wherein the target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image that needs to be called.

[0011] Optionally, the method further includes:

[0012] Creating a second reverse proxy in a second cluster, wherein the second cluster is a cluster of the same type as the first cluster;

[0013] Migrating the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster can communicate with the second Docker repository;

[0014] Migrating the multiple groups of the target deployment resources and the target domain names stored in the target database to the second cluster;

[0015] The second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name is stored in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

[0016] Optionally, the method further includes:

[0017] When the first cluster fails, the multiple groups of the target deployment resources and the target domain names stored in the target database are restored to the first cluster.

[0018] Optionally, generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image includes:

[0019] The domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image is replaced with the target domain name to generate a second image address corresponding to the target Docker image.

[0020] Optionally, the first cluster can communicate with the first Docker repository, and the first cluster can call the target Docker image in the first Docker repository according to a first image address corresponding to the target Docker image.

[0021] Optionally, the first cluster can call the target Docker image in the first Docker repository according to the first reverse proxy, the first mapping relationship, and a second image address corresponding to the target Docker image.

[0022] Optionally, the first cluster is specifically a Kubernetes cluster, and the preset file storage method is an S3 object storage method.

[0023] In a second aspect, the present invention further provides a data backup device, the device comprising:

[0024] A first creation unit, configured to create a first reverse proxy in a first cluster;

[0025] A first generating unit, configured to generate a target domain name using the first reverse proxy;

[0026] A second generating unit is used to generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker warehouse;

[0027] A first storage unit, configured to store a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in a local storage space of the first cluster;

[0028] A backup unit is used to back up the multiple target Docker images, multiple groups of target deployment resources and the target domain name to a target database based on a preset file storage method, wherein the target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image that needs to be called.

[0029] Optionally, the device further comprises:

[0030] A second creation unit, configured to create a second reverse proxy in a second cluster, wherein the second cluster is a cluster of the same type as the first cluster;

[0031] A first migration unit, configured to migrate the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster can communicate with the second Docker repository;

[0032] A second migration unit, configured to migrate the plurality of groups of the target deployment resources and the target domain names stored in the target database to the second cluster;

[0033] The second storage unit is used to store a second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

[0034] Optionally, the device further comprises:

[0035] A restoration unit is used to restore the multiple groups of target deployment resources and the target domain names stored in the target database to the first cluster when the first cluster fails.

[0036] Optionally, the second generating unit includes:

[0037] A replacement module is used to replace the domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image with the target domain name to generate a second image address corresponding to the target Docker image.

[0038] Optionally, the first cluster can communicate with the first Docker repository, and the first cluster can call the target Docker image in the first Docker repository according to a first image address corresponding to the target Docker image.

[0039] Optionally, the first cluster can call the target Docker image in the first Docker repository according to the first reverse proxy, the first mapping relationship, and a second image address corresponding to the target Docker image.

[0040] Optionally, the first cluster is specifically a Kubernetes cluster, and the preset file storage method is an S3 object storage method.

[0041] In order to achieve the above object, according to a third aspect of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data backup method described in the first aspect.

[0042] In order to achieve the above-mentioned purpose, according to the fourth aspect of the present invention, an electronic device is provided, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call the program instructions in the memory to execute the data backup method described in the first aspect above.

[0043] By means of the above technical solution, the technical solution provided by the present invention has at least the following advantages:

[0044] The present invention provides a data backup method and device. After successfully building a first cluster, the present invention can create a first reverse proxy in the first cluster, use the first reverse proxy to generate a target domain name, and after generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, store the first mapping relationship between the domain name corresponding to the first Docker warehouse and the target domain name in the local storage space of the first cluster, so that the first cluster can call the target Docker image in the first Docker warehouse according to the first reverse proxy, the first mapping relationship and the second image address corresponding to the target Docker image; when it is necessary to back up multiple groups of target deployment resources stored in the first cluster, the multiple target Docker images stored in the first Docker warehouse, the multiple groups of target deployment resources stored in the first cluster and the target domain name are backed up to the target database based on a preset file storage method, thereby completing the backup of the multiple groups of target deployment resources stored in the first cluster.

[0045] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0047] Figure 1 A flow chart of a data backup method provided by an embodiment of the present invention is shown;

[0048] Figure 2 Another data backup method flow chart provided by an embodiment of the present invention is shown;

[0049] Figure 3 A block diagram showing a data backup device according to an embodiment of the present invention is shown;

[0050] Figure 4 A block diagram showing another data backup device provided by an embodiment of the present invention is shown;

[0051] Figure 5A structural block diagram of a device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0052] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0053] The embodiment of the present invention provides a data backup method, such as Figure 1 As shown, the method includes:

[0054] 101. Create a first reverse proxy in a first cluster, and use the first reverse proxy to generate a target domain name.

[0055] The first cluster is specifically a Kubernetes cluster.

[0056] In an embodiment of the present invention, after successfully building the first cluster, it is necessary to create a first reverse proxy in the first cluster and use the first reverse proxy to generate a target domain name, wherein the target domain name generated using the first reverse proxy is different from the domain name corresponding to the first Docker repository.

[0057] 102. Generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image.

[0058] Among them, multiple target Docker images are stored in the first Docker warehouse, the first cluster can communicate with the first Docker warehouse, and the first cluster can call the target Docker image in the first Docker warehouse according to the first image address corresponding to the target Docker image.

[0059] In an embodiment of the present invention, after the target domain name is generated using the first reverse proxy, the second image address corresponding to each target Docker image can be generated according to the target domain name and the first image address corresponding to each target Docker image. Specifically, in this step, the second image address corresponding to each target Docker image can be generated according to the target domain name and the first image address corresponding to each target Docker image in the following manner: For any target Docker image, after replacing the domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image with the target domain name, the second image address corresponding to the target Docker image can be obtained, but is not limited to this.

[0060] 103. Store a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in a local storage space of the first cluster.

[0061] In an embodiment of the present invention, after generating the second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, it is also necessary to store the first mapping relationship between the domain name corresponding to the first Docker warehouse and the target domain name in the local storage space of the first cluster, so that the first cluster can call the target Docker image in the first Docker warehouse according to the first reverse proxy, the first mapping relationship and the second image address corresponding to the target Docker image. That is, when the first cluster needs to call a target Docker image, the first cluster first converts the second image address corresponding to the target Docker image into the first image address corresponding to the target Docker image through the first reverse proxy and the first mapping relationship, and then calls the target Docker image in the first Docker warehouse according to the first image address corresponding to the target Docker image.

[0062] 104. Back up multiple target Docker images, multiple sets of target deployment resources, and target domain names to a target database based on a preset file storage method.

[0063] The target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image that needs to be called; and the preset file storage method is specifically an S3 object storage method.

[0064] In an embodiment of the present invention, when deploying deployment resources corresponding to an application in the first cluster, it is necessary to record the second image address corresponding to the target Docker image that needs to be called in the deployment resource; when it is necessary to back up multiple groups of target deployment resources stored in the first cluster, the multiple target Docker images stored in the first Docker repository, the multiple groups of target deployment resources stored in the first cluster and the target domain name can be backed up to the target database based on a preset file storage method.

[0065] A data backup method provided by an embodiment of the present invention can create a first reverse proxy in the first cluster after successfully building a first cluster, and use the first reverse proxy to generate a target domain name, and after generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, store the first mapping relationship between the domain name corresponding to the first Docker warehouse and the target domain name in the local storage space of the first cluster, so that the first cluster can call the target Docker image in the first Docker warehouse according to the first reverse proxy, the first mapping relationship and the second image address corresponding to the target Docker image; when it is necessary to back up multiple groups of target deployment resources stored in the first cluster, the multiple target Docker images stored in the first Docker warehouse, the multiple groups of target deployment resources stored in the first cluster and the target domain name are backed up to the target database based on a preset file storage method, thereby completing the backup of the multiple groups of target deployment resources stored in the first cluster.

[0066] To explain in more detail below, the present invention provides another data backup method. Figure 2 As shown, the method includes:

[0067] 201. Create a first reverse proxy in a first cluster, and use the first reverse proxy to generate a target domain name.

[0068] Regarding step 201, creating a first reverse proxy in the first cluster and using the first reverse proxy to generate a target domain name, please refer to Figure 1 The description of the corresponding parts of the embodiments of the present invention will not be repeated here.

[0069] 202. Generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image.

[0070] In the embodiment of the present invention, after the target domain name is generated by using the first reverse proxy, the second image address corresponding to each target Docker image can be generated according to the target domain name and the first image address corresponding to each target Docker image in the following manner:

[0071] For any target Docker image, after replacing the domain name corresponding to the first Docker warehouse contained in the first image address corresponding to the target Docker image with the target domain name, the second image address corresponding to the target Docker image can be obtained. For example, the domain name corresponding to the first Docker warehouse is: law-harbor.gridsumdissector.com, the target domain name generated by the first reverse proxy is: 127.0.0.1:5000, and the first image address corresponding to the target Docker image is: law-harbor.gridsumdissector.com / velero / velero:v1.3.2. Replace the domain name corresponding to the first Docker warehouse contained in the first image address corresponding to the target Docker image: law-harbor.gridsumdissector.com with the target domain name: 127.0.0.1:5000, and the second image address corresponding to the target Docker image can be obtained: 127.0.0.1:5000 / velero / velero:v1.3.2.

[0072] 203. Store a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in the local storage space of the first cluster.

[0073] Regarding step 203, storing the first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in the local storage space of the first cluster, please refer to Figure 1 The description of the corresponding parts of the embodiments of the present invention will not be repeated here.

[0074] 204. Back up multiple target Docker images, multiple sets of target deployment resources, and target domain names to a target database based on a preset file storage method.

[0075] Among them, regarding step 204, backing up multiple target Docker images, multiple sets of target deployment resources and target domain names to the target database based on the preset file storage method, you can refer to Figure 1 The description of the corresponding parts of the embodiments of the present invention will not be repeated here.

[0076] Furthermore, in an embodiment of the present application, when the first cluster fails and the multiple sets of target deployment resources stored in the first cluster need to be restored, the multiple sets of target deployment resources and target domain names stored in the target database can be restored to the first cluster.

[0077] 205. Migrate multiple groups of target deployment resources stored in the first cluster to the second cluster.

[0078] The second cluster is a cluster of the same type as the first cluster, and the second cluster is specifically a Kubernetes cluster.

[0079] In an embodiment of the present invention, when it is necessary to migrate multiple groups of target deployment resources stored in the first cluster to the second cluster, first, a second reverse proxy needs to be created in the second cluster; then, multiple target Docker images stored in the target database need to be migrated to the second Docker warehouse, wherein the second cluster can communicate with the second Docker warehouse; secondly, multiple groups of target deployment resources and target domain names stored in the target database are migrated to the second cluster; finally, a second mapping relationship between the domain name corresponding to the second Docker warehouse and the target domain name is stored in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker warehouse according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource, that is, when the second cluster needs to call a target When deploying the target Docker image corresponding to the resource, the second cluster first converts the second image address corresponding to the target Docker image into a third image address corresponding to the target Docker image through the second reverse proxy and the second mapping relationship, and then calls the target Docker image in the second Docker repository according to the third image address corresponding to the target Docker image. The specific process of the second cluster converting the second image address corresponding to the target Docker image into the third image address corresponding to the target Docker image through the second reverse proxy and the second mapping relationship is as follows: the second cluster replaces the target domain name contained in the second image address corresponding to the target Docker image with the domain name corresponding to the second Docker repository through the second reverse proxy and the second mapping relationship, thereby obtaining the third image address corresponding to the target Docker image.

[0080] Docker images are stored in the first Docker repository and are then stored in the second Docker repository. The image is migrated to the second Docker warehouse; secondly, multiple groups of target deployment resources and target domain names stored in the target database are migrated to the second cluster; finally, the second mapping relationship between the domain name corresponding to the second Docker warehouse and the target domain name is stored in the local storage space of the second cluster; because the second cluster can call the target Docker image corresponding to the group of target deployment resources in the second Docker warehouse according to the second reverse proxy, the second mapping relationship and the second image address recorded in a group of target deployment resources, therefore, after migrating multiple groups of target deployment resources to the second cluster and multiple target Docker images to the second Docker warehouse, there is no need to change the image address recorded in each group of target deployment resources, the second cluster can call the target Docker image corresponding to any group of target deployment resources, thereby effectively improving the migration efficiency of migrating multiple groups of target deployment resources stored in the first cluster to the second cluster. In addition, when the first cluster fails and the multiple groups of target deployment resources stored in the first cluster need to be restored, the multiple groups of target deployment resources and target domain names stored in the target database can be restored to the first cluster.

[0081] In order to achieve the above purpose, according to another aspect of the present invention, an embodiment of the present invention further provides a storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned data backup method.

[0082] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, an embodiment of the present invention further provides an electronic device, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute the data backup method described above.

[0083] Furthermore, as a response to the above Figure 1 and Figure 2 In order to realize the method shown in the figure, another embodiment of the present invention further provides a data backup device. This device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. This device is used to effectively back up the deployment resources stored in the Kubernetes cluster, specifically as follows Figure 3 As shown, the device comprises:

[0084] A first creation unit 301, configured to create a first reverse proxy in a first cluster;

[0085] A first generating unit 302, configured to generate a target domain name using the first reverse proxy;

[0086] A second generating unit 303 is used to generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker repository;

[0087] A first storage unit 304 is used to store a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in a local storage space of the first cluster;

[0088] The backup unit 305 is used to back up the multiple target Docker images, multiple groups of target deployment resources and the target domain name to the target database based on a preset file storage method, wherein the target deployment resources are deployment resources deployed in the first cluster, and the target deployment resources record the second image address corresponding to the target Docker image that needs to be called.

[0089] Further, such as Figure 4 As shown, the device also includes:

[0090] A second creation unit 306, configured to create a second reverse proxy in a second cluster;

[0091] A first migration unit 307 is configured to migrate the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster is a cluster of the same type as the first cluster;

[0092] A second migration unit 308, configured to migrate the plurality of groups of the target deployment resources and the target domain names stored in the target database to the second cluster;

[0093] The second storage unit 309 is used to store the second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

[0094] Further, such as Figure 4 As shown, the device also includes:

[0095] The restoration unit 310 is configured to restore the plurality of groups of the target deployment resources and the target domain names stored in the target database to the first cluster when a failure occurs in the first cluster.

[0096] Further, such as Figure 4 As shown, the second generating unit 303 includes:

[0097] The replacement module 3031 is used to replace the domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image with the target domain name to generate a second image address corresponding to the target Docker image.

[0098] Further, such as Figure 4 As shown, the first cluster can communicate with the first Docker repository, and the first cluster can call the target Docker image in the first Docker repository according to the first image address corresponding to the target Docker image.

[0099] Further, such as Figure 4 As shown, the first cluster can call the target Docker image in the first Docker repository according to the first reverse proxy, the first mapping relationship, and the second image address corresponding to the target Docker image.

[0100] Further, such as Figure 4 As shown, the first cluster is specifically a Kubernetes cluster, and the preset file storage method is an S3 object storage method.

[0101] An embodiment of the present invention provides a data backup method and device. After successfully building a first cluster, the embodiment of the present invention can create a first reverse proxy in the first cluster, use the first reverse proxy to generate a target domain name, and after generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, store the first mapping relationship between the domain name corresponding to the first Docker warehouse and the target domain name in the local storage space of the first cluster, so that the first cluster can call the target Docker image in the first Docker warehouse according to the first reverse proxy, the first mapping relationship and the second image address corresponding to the target Docker image; when it is necessary to back up multiple groups of target deployment resources stored in the first cluster, the multiple target Docker images stored in the first Docker warehouse, the multiple groups of target deployment resources stored in the first cluster and the target domain name are backed up to the target database based on a preset file storage method, thereby completing the backup of the multiple groups of target deployment resources stored in the first cluster.

[0102] The data backup device includes a processor and a memory. The above-mentioned first creation unit, first generation unit, second generation unit, first storage unit and backup unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0103] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the deployment resources stored in the Kubernetes cluster can be effectively backed up by adjusting the kernel parameters.

[0104] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the data backup method is implemented.

[0105] An embodiment of the present invention provides an electronic device 40, such as Figure 5 As shown, the electronic device 40 includes at least one processor 401, and at least one memory 402 and a bus 403 connected to the processor; wherein the processor 401 and the memory 402 communicate with each other via the bus 403; the processor 401 is used to call the program instructions in the memory 402 to execute the above-mentioned data backup method.

[0106] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:

[0107] Creating a first reverse proxy in the first cluster, and using the first reverse proxy to generate a target domain name;

[0108] Generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker warehouse;

[0109] Storing a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in the local storage space of the first cluster;

[0110] Based on a preset file storage method, the plurality of target Docker images, the plurality of groups of target deployment resources and the target domain name are backed up to a target database, wherein the target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image that needs to be called.

[0111] Furthermore, the method further comprises:

[0112] Creating a second reverse proxy in a second cluster, wherein the second cluster is a cluster of the same type as the first cluster;

[0113] Migrating the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster can communicate with the second Docker repository;

[0114] Migrating the multiple groups of the target deployment resources and the target domain names stored in the target database to the second cluster;

[0115] The second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name is stored in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

[0116] Furthermore, the method further comprises:

[0117] When the first cluster fails, the multiple groups of the target deployment resources and the target domain names stored in the target database are restored to the first cluster.

[0118] Further, generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image includes:

[0119] The domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image is replaced with the target domain name to generate a second image address corresponding to the target Docker image.

[0120] Furthermore, the first cluster can communicate with the first Docker repository, and the first cluster can call the target Docker image in the first Docker repository according to a first image address corresponding to the target Docker image.

[0121] Furthermore, the first cluster can call the target Docker image in the first Docker repository according to the first reverse proxy, the first mapping relationship, and the second image address corresponding to the target Docker image.

[0122] Furthermore, the first cluster is specifically a Kubernetes cluster, and the preset file storage method is an S3 object storage method.

[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0124] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.

[0125] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.

[0126] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0127] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0129] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A data backup method, characterized in that: include: Creating a first reverse proxy in the first cluster, and using the first reverse proxy to generate a target domain name; Generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker warehouse; Storing a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in the local storage space of the first cluster; Backing up the multiple target Docker images, multiple groups of target deployment resources and the target domain name to a target database based on a preset file storage method, wherein the target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image that needs to be called; The method further comprises: Creating a second reverse proxy in a second cluster, wherein the second cluster is a cluster of the same type as the first cluster; Migrating the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster can communicate with the second Docker repository; Migrating the multiple groups of the target deployment resources and the target domain names stored in the target database to the second cluster; The second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name is stored in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

2. The method according to claim 1, characterized in that The method further comprises: When the first cluster fails, the multiple groups of the target deployment resources and the target domain names stored in the target database are restored to the first cluster.

3. The method according to claim 1, characterized in that The step of generating a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image includes: The domain name corresponding to the first Docker repository contained in the first image address corresponding to the target Docker image is replaced with the target domain name to generate a second image address corresponding to the target Docker image.

4. The method according to any one of claims 1 to 3, characterized in that The first cluster can communicate with the first Docker repository, and the first cluster can call the target Docker image in the first Docker repository according to a first image address corresponding to the target Docker image.

5. The method according to any one of claims 1 to 3, characterized in that: The first cluster can call the target Docker image in the first Docker repository according to the first reverse proxy, the first mapping relationship, and a second image address corresponding to the target Docker image.

6. The method according to any one of claims 1 to 3, characterized in that The first cluster is specifically a Kubernetes cluster, and the preset file storage method is an S3 object storage method.

7. A data backup device, characterized in that: include: A first creation unit, used to create a first reverse proxy in a first cluster; A first generating unit, configured to generate a target domain name using the first reverse proxy; A second generating unit is used to generate a second image address corresponding to each target Docker image according to the target domain name and the first image address corresponding to each target Docker image, wherein the plurality of target Docker images are stored in the first Docker warehouse; A first storage unit, configured to store a first mapping relationship between the domain name corresponding to the first Docker repository and the target domain name in a local storage space of the first cluster; A backup unit, configured to back up the plurality of target Docker images, the plurality of groups of target deployment resources and the target domain name to a target database based on a preset file storage method, wherein the target deployment resource is a deployment resource deployed in the first cluster, and the target deployment resource records a second image address corresponding to the target Docker image to be called; The device also includes: A second creation unit, configured to create a second reverse proxy in a second cluster, wherein the second cluster is a cluster of the same type as the first cluster; A first migration unit, configured to migrate the plurality of target Docker images stored in the target database to a second Docker repository, wherein the second cluster can communicate with the second Docker repository; A second migration unit, configured to migrate the plurality of groups of the target deployment resources and the target domain names stored in the target database to the second cluster; The second storage unit is used to store a second mapping relationship between the domain name corresponding to the second Docker repository and the target domain name in the local storage space of the second cluster, so that the second cluster calls the target Docker image corresponding to the target deployment resource in the second Docker repository according to the second reverse proxy, the second mapping relationship and the second image address recorded in the target deployment resource.

8. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the data backup method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: The device includes at least one processor, and at least one memory and a bus connected to the processor; Wherein, the processor and the memory communicate with each other through the bus; The processor is used to call the program instructions in the memory to execute the data backup method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Deployment method and device realizing distributing type storage system

    CN106790660A

  • A coandor task mapping method of a remote sensing image processing Docker cluster

    CN109614219A