An improved method for cluster mirror synchronization based on shared storage

By using shared storage and trigger controllers in a cluster environment, mirror synchronization between docker warehouses is achieved, and the problem of low image synchronization efficiency in the prior art is solved, which improves synchronization efficiency and saves storage.

CN116339910BActive Publication Date: 2025-05-16XIAN LEIFENG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310122331.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2025-05-16
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

In the prior art, when synchronizing images between different docker warehouses in a cluster environment, two push uploads and multiple pull downloads are required, which is less efficient.

Method used

By mounting shared storage on each node of the cluster and installing the mirror warehouse and trigger controller on the first node of the cluster, using the trigger controller to manage the synchronization of mirrors in the cluster, you only need to upload the mirror to any node of the cluster and update the mirror index of the docker warehouse to achieve mirror synchronization.

Benefits of technology

This method does not require back-to-back uploads and downloads between images, but only needs to update the index, which is more efficient, and only one copy of the image file needs to exist, saving storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339910B_ABST
    Figure CN116339910B_ABST
Patent Text Reader

Abstract

The invention discloses an improved cluster image synchronization method based on shared storage, comprising the following steps: step 1, mounting shared storage, installing an image warehouse and triggering a controller at each node of the cluster; step 2, uploading an image to an image warehouse A in the cluster through a client, and after the push is successful, the file corresponding to the image is saved in the shared storage; step 3, after receiving the push message of the image warehouse A, the triggering controller determines whether an image warehouse B and an image warehouse C in the cluster need to be synchronized, and if necessary, the triggering controller verifies whether the image files in the shared storage of the image warehouse B and the image warehouse C are complete, and if complete, updates the indexes of the image warehouse B and the image warehouse C, otherwise, the task ends; step 4, when the triggering controller completes the image synchronization task; when the client accesses the image warehouse B and the image warehouse C in the cluster, the uploaded image can be retrieved in both the image warehouse B and the image warehouse C; the invention has the characteristics of saving storage and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of mirror synchronization, and in particular relates to an improved cluster mirror synchronization method based on shared storage. Background Art

[0002] In order to solve the image synchronization problem between different docker repositories in a cluster environment, the existing technologies basically introduce a new warehouse address, referred to as a cloud warehouse; then when uploading the image, first upload the image to the cluster single node warehouse, and when the upload is completed, trigger the task to upload the image to the cloud warehouse again, and then distribute the docker image through the cloud warehouse, so as to achieve image synchronization between different register nodes in the cluster. The obvious disadvantage of this technology is that the image file needs to go through two push uploads and multiple pull downloads. The efficiency is low. Summary of the invention

[0003] In order to overcome the above-mentioned deficiencies of the prior art, the object of the present invention is to provide an improved cluster mirror synchronization method based on shared storage, which has the characteristics of saving storage and high efficiency.

[0004] To achieve the above object, the technical solution adopted by the present invention is: a cluster mirror synchronization improvement method based on shared storage, comprising the following steps:

[0005] Step 1: Mount shared storage on each node in the cluster, and then install the image repository and trigger controller through the cluster head node; the trigger controller manages the synchronization of images in the cluster; upload and download images through the client;

[0006] Step 2: Upload the image to the image repository A in the cluster through the client. After the push is successful, the image repository A contains the uploaded image, and the file corresponding to the image is saved in the shared storage. At the same time, the controller is triggered to receive a push message, which is sent by the image repository A.

[0007] Step 3: After receiving the push message from image repository A, the trigger controller determines whether image repository B and image repository C in the cluster need to be synchronized. If necessary, the trigger controller verifies whether the image files in the shared storage of image repository B and image repository C are complete. If complete, the indexes of image repository B and image repository C are updated.

[0008] Step 4: If the trigger controller receives the push message from image repository A and determines that other image repositories B and C in the cluster do not need to be synchronized, the task ends; if image repositories B and C need to be synchronized, but the file verification in the shared storage fails, the task also ends;

[0009] Step 5: When the controller is triggered to complete the task, if the task is successful, it means that the image synchronization is completed; at this time, when the client accesses the image warehouse B and the image warehouse C in the cluster again, the uploaded image can be retrieved from both the image warehouse B and the image warehouse C.

[0010] The beneficial effects of the present invention are:

[0011] The method of the present invention realizes image file synchronization by sharing storage in a cluster environment. When it is necessary to upload an image to each node of the cluster, it is only necessary to upload the image to any node of the cluster, and then after the image upload is completed, trigger a task to update the image index of the docker warehouse. This technology does not require uploading and downloading back and forth between images, and only needs to update its index. Compared with uploading and downloading image files, updating the index is more efficient. In addition, this technology only requires one copy of the image file, which saves more storage.

[0012] By sharing storage, the image synchronization between the docker registers of each node in the cluster can be achieved. This technology can avoid synchronization between different registers by uploading and downloading, thereby increasing synchronization efficiency and avoiding storing multiple copies of the same image file.

[0013] 1) Mirror synchronization between registers is achieved by sharing storage and updating indexes.

[0014] 2) Increase synchronization efficiency, avoid multiple storage of the same image, and reduce server pressure. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of docker repository image retrieval of the present invention.

[0016] Figure 2 This is a cluster mirror synchronization flow chart of the present invention. DETAILED DESCRIPTION

[0017] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.

[0018] See also Figure 1 , an improved cluster mirror synchronization method based on shared storage, comprising the following steps:

[0019] Step 1: Mount shared storage on each node in the cluster, then install the image repository and trigger controller through the cluster head node, and let the trigger controller manage the synchronization of images in the cluster; upload and download images through the client;

[0020] Step 2: Upload the image to the image repository A in the cluster through the client. After the push is successful, the image repository A will contain the uploaded image, and the file corresponding to the image will be saved in the shared storage. At the same time, the controller is triggered to receive a push message.

[0021] Step 3: After receiving the push message from image repository A, the trigger controller determines whether other image repositories B and C in the cluster need to synchronize images. If necessary, the trigger controller verifies whether the image files in the shared storage of image repository B and image repository C are complete. If complete, the indexes of image repository B and image repository C are updated.

[0022] Step 4: If the trigger controller receives the push message from image repository A and determines that other image repositories B and C in the cluster do not need to be synchronized, the task ends; if image repositories B and C need to be synchronized, but the file verification in the shared storage fails, the task also ends;

[0023] Step 5: When the controller is triggered to complete the task, if the task is successful, it means that the image synchronization is completed; at this time, when the client accesses the image warehouse B and the image warehouse C in the cluster again, the uploaded image can be retrieved from both the image warehouse B and the image warehouse C.

[0024] illustrate:

[0025] a) A Index and A Registry together form the A mirror repository, and the same is true for B and C.

[0026] b) Mirror repositories A, B, and C are three different warehouse addresses, but they can access shared storage together.

[0027] c) After the client initiates the image upload, the image repository will place the image file in the shared storage and update the Aindex at the same time.

[0028] d) Mirror warehouse B and mirror warehouse C can access shared storage at the same time, and update B Index and C Index through trigger events. Then mirror synchronization can be achieved.

Claims

1. A cluster mirror synchronization improvement method based on shared storage, characterized in that: The following steps are involved: Step 1: Mount shared storage on each node in the cluster, and then install the image repository and trigger controller through the first node of the cluster; The trigger controller manages the synchronization of images within the cluster; images are uploaded and downloaded through the client; Step 2: Upload the image to the image repository A in the cluster through the client. After the push is successful, the image repository A contains the uploaded image, and the file corresponding to the image is saved in the shared storage. At the same time, the controller is triggered to receive a push message, which is sent by the image repository A. Step 3: After receiving the push message from image repository A, the trigger controller determines whether image repository B and image repository C in the cluster need to be synchronized. If necessary, the trigger controller verifies whether the image files in the shared storage of image repository B and image repository C are complete. If complete, the indexes of image repository B and image repository C are updated. Step 4: If the trigger controller receives the push message from image repository A and determines that other image repositories B and C in the cluster do not need to be synchronized, the task ends. If image repository B and image repository C need to be synchronized, but the file verification in the shared storage fails, the task ends; Step 5: When the trigger controller completes the task, it means that the mirror synchronization is completed; At this time, when the client accesses the image warehouse B and image warehouse C in the cluster again, the uploaded image can be retrieved in both image warehouse B and image warehouse C.

Citation Information

Patent Citations

  • Mirror image synchronization method and mirror image synchronization system of Docker mirror image warehouse

    CN108200155A

  • Docker-based mirror image distribution method, system and device in cluster environment

    CN110928641A