CN109688232B - Mirror image backtracking method, mirror image backtracking system and proxy server - Google Patents

Mirror image backtracking method, mirror image backtracking system and proxy server Download PDF

Info

Publication number
CN109688232B
CN109688232B CN201910081413.XA CN201910081413A CN109688232B CN 109688232 B CN109688232 B CN 109688232B CN 201910081413 A CN201910081413 A CN 201910081413A CN 109688232 B CN109688232 B CN 109688232B
Authority
CN
China
Prior art keywords
mirror image
pulled
warehouse
target
source
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.)
Active
Application number
CN201910081413.XA
Other languages
Chinese (zh)
Other versions
CN109688232A (en
Inventor
叶瑞森
彭玉剑
柯都敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information 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 Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN201910081413.XA priority Critical patent/CN109688232B/en
Publication of CN109688232A publication Critical patent/CN109688232A/en
Application granted granted Critical
Publication of CN109688232B publication Critical patent/CN109688232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Facsimiles In General (AREA)

Abstract

The application discloses mirror image backtracking method, mirror image backtracking system and proxy server, wherein the mirror image backtracking method is applied to the proxy server, and comprises the following steps: receiving a mirror image pulling request sent by an example, and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request; detecting whether the mirror image to be pulled exists in the target warehouse or not; if the target warehouse does not have the mirror image to be pulled, forwarding the mirror image pulling request to a source warehouse so that the source warehouse copies the mirror image to be pulled to the target warehouse; and pulling the mirror image to be pulled from the target warehouse, and transmitting the mirror image to be pulled to the instance. By the aid of the method and the device, when the mirror image copy fails, success of mirror image deployment can be guaranteed in a mirror image backtracking mode.

Description

Mirror image backtracking method, mirror image backtracking system and proxy server
Technical Field
The application belongs to the technical field of mirror image processing, and particularly relates to a mirror image backtracking method, a mirror image backtracking system and a proxy server.
Background
When cross-region Docker mirror image deployment is used, in order to guarantee application consistency, a plurality of mirror image warehouses are often built, then mirror image replication functions are used, and the mirror image of one region is replicated to the mirror image warehouses of other regions, so that all the regions can be deployed by adopting the same mirror image. However, when cross-region mirror image replication is performed, reasons such as network instability and system internal failure are easily encountered, so that when deployment needs to be performed in a new region, a mirror image warehouse in the region is not yet completed in synchronization with a source mirror image warehouse, that is, cross-region mirror image replication is not successfully implemented, which may cause failure in mirror image deployment of the new region.
Currently, in order to solve the problem of copy failure that may occur during cross-domain mirror copy, a retry copy task or a dedicated line copy method is often used to increase the success rate of mirror copy. However, the above solution is often costly and inefficient in replication, and it is difficult to completely solve the problem caused by the failure of the thorough mirroring replication.
Disclosure of Invention
In view of this, the present application provides a mirror image backtracking method, a mirror image backtracking system, and a proxy server, which can still ensure the success of mirror image deployment when the mirror image copy fails.
A first aspect of the present application provides a mirror image backtracking method, which is applied to a proxy server, and the mirror image backtracking method includes:
receiving a mirror image pulling request sent by an example, and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
detecting whether the mirror image to be pulled exists in the target warehouse or not;
if the target warehouse does not have the mirror image to be pulled, forwarding the mirror image pulling request to a source warehouse so that the source warehouse copies the mirror image to be pulled to the target warehouse;
and pulling the mirror image to be pulled from the target warehouse, and transmitting the mirror image to be pulled to the example.
A second aspect of the present application provides a mirror image backtracking method, which is applied to a source warehouse, and the mirror image backtracking method includes:
monitoring the proxy server;
when a mirror image pulling request forwarded by the proxy server is monitored, determining a target warehouse pointed by the mirror image pulling request and a mirror image to be pulled;
and copying the mirror image to be pulled to the target warehouse based on the mirror image pulling request.
A third aspect of the present application provides a proxy server comprising:
the system comprises a request receiving unit, a storage unit and a processing unit, wherein the request receiving unit is used for receiving a mirror image pulling request sent by an example and determining a target warehouse pointed by the mirror image pulling request and a mirror image to be pulled;
the mirror image detection unit is used for detecting whether the mirror image to be pulled exists in the target warehouse or not;
a request forwarding unit, configured to forward, if there is no mirror image to be pulled in the target warehouse, the mirror image pulling request to a source warehouse, so that the source warehouse copies the mirror image to be pulled to the target warehouse;
and the mirror image pulling unit is used for pulling the mirror image to be pulled from the target warehouse and transmitting the mirror image to be pulled to the example.
A fourth aspect of the present application provides a proxy server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
A fifth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect as described above.
A sixth aspect of the application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
A seventh aspect of the present application provides a mirror image backtracking system, which is characterized in that the mirror image backtracking system includes a source repository, a target repository, and a proxy server, where the proxy server includes:
the system comprises a request receiving unit, a storage unit and a processing unit, wherein the request receiving unit is used for receiving a mirror image pulling request sent by an example and determining a target warehouse pointed by the mirror image pulling request and a mirror image to be pulled;
the mirror image detection unit is used for detecting whether the mirror image to be pulled exists in the target warehouse or not;
a request forwarding unit, configured to forward, if there is no mirror image to be pulled in the target warehouse, the mirror image pulling request to a source warehouse, so that the source warehouse copies the mirror image to be pulled to the target warehouse;
and the mirror image pulling unit is used for pulling the mirror image to be pulled from the target warehouse and transmitting the mirror image to be pulled to the example.
The source warehouse includes:
the monitoring unit is used for monitoring the proxy server;
a determining unit, configured to determine, when a mirror image pull request forwarded by the proxy server is monitored, a target warehouse to which the mirror image pull request is directed and a mirror image to be pulled;
and the copying unit is used for copying the mirror image to be pulled to the target warehouse based on the mirror image pulling request.
As can be seen from the above, in the present application, firstly, a proxy server receives a mirror image pull request sent by an instance, determines a target warehouse and a mirror image to be pulled to which the mirror image pull request points, then detects whether the mirror image to be pulled exists in the target warehouse, if the mirror image to be pulled does not exist in the target warehouse, forwards the mirror image pull request to a source warehouse, so that the source warehouse copies the mirror image to be pulled to the target warehouse, finally pulls the mirror image to be pulled from the target warehouse, and transmits the mirror image to be pulled to the instance. Through the embodiment of the application, when the mirror image is deployed, the proxy server is added, the mirror image is pulled from the target warehouse through the proxy server, if the mirror image to be pulled cannot be found in the target warehouse, the source warehouse is traced back to perform the copying operation again, the mirror image of the source warehouse can be successfully copied to the target warehouse, and then the mirror image pulling operation is executed, so that the success of mirror image deployment is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a mirror image backtracking method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of another mirror image backtracking method according to an embodiment of the present application;
fig. 3 is a schematic working diagram of a mirror image backtracking method provided in an embodiment of the present application;
fig. 4 is a block diagram of a proxy server according to an embodiment of the present disclosure;
fig. 5 is a schematic system structure diagram of a mirror image backtracking system provided in an embodiment of the present application;
fig. 6 is a schematic diagram of a proxy server provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution of the present application, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, the mirror image backtracking method in the embodiment of the present application is applied to a proxy server, and the mirror image backtracking method includes:
in step 101, receiving a mirror image pull request sent by an instance, and determining a target warehouse and a mirror image to be pulled to which the mirror image pull request points;
in an embodiment of the present application, a proxy server receives an image pull request sent by an instance. In particular, in each zone, a proxy server is configured, which may be in particular a nginx server. The proxy server in the area uniformly processes the mirror image pulling request sent by each instance in the area. After receiving the mirror image pulling request sent by the instance, it may determine the target warehouse and the mirror image to be pulled to which the mirror image pulling request points, that is, determine where the proxy server should obtain the mirror image requested by the instance.
In step 102, detecting whether the mirror image to be pulled exists in the target warehouse;
in the embodiment of the application, after receiving the mirror image pulling request sent by the instance, the proxy server detects whether the mirror image to be pulled exists in the target warehouse. Specifically, an upstream module (that is, a data forwarding module) may be configured for the nginx server, and the detection is performed by forwarding the mirror image pull request to a target warehouse through the upstream module, and if the mirror image to be pulled is pulled from the target warehouse, it is determined that the mirror image to be pulled exists in the target warehouse, and if the mirror image to be pulled cannot be pulled from the target warehouse, it is determined that the mirror image to be pulled does not exist in the target warehouse. Specifically, when the mirror to be pulled does not exist in the target repository, the target repository returns proxy _ next _ upstream http _404 to the proxy server to prompt the proxy server that the requested data does not exist.
In step 103, if there is no mirror image to be pulled in the target warehouse, forwarding the mirror image pulling request to a source warehouse, so that the source warehouse copies the mirror image to be pulled to the target warehouse;
in this embodiment of the application, when it is detected that the mirror image to be pulled does not exist in the target repository, the proxy server traces the source to the source repository, and forwards the mirror image pulling request to the source repository through the configured upstream module. Specifically, if the target repository does not have the mirror image to be pulled, the proxy server may first obtain a source repository address including the mirror image to be pulled from the target repository, and then forward the mirror image pulling request to the source repository based on the source repository address. It can be considered that, in the upstream module of the proxy server, forwarding priorities are set for the target warehouse and the source warehouse, where the forwarding priority of the target warehouse is higher, that is, the proxy server will preferentially forward the mirror image pull request to the target warehouse, and only when the mirror image to be pulled cannot be pulled from the target warehouse, the mirror image pull request will be forwarded to the source warehouse. When the source warehouse receives the mirror image pulling request forwarded by the proxy server, the source warehouse knows that the mirror image to be pulled does not exist in the current target warehouse, and therefore the source warehouse executes mirror image copying operation again, so that the source warehouse copies the mirror image to be pulled to the target warehouse.
In step 104, the mirror image to be pulled is pulled from the target repository and transmitted to the instance.
In this embodiment of the present application, after the proxy server forwards the preset time of the mirror image pulling request to the source repository, it may try to pull the mirror image to be pulled from the target repository again, and after the mirror image to be pulled is pulled, transmit the mirror image to be pulled to the example. Specifically, since it takes a certain time for the source warehouse to copy the mirror image to be pulled to the target warehouse, and the larger the mirror image to be pulled is, the longer the time taken for copying is often, the preset time may be set according to the size of the mirror image to be pulled, specifically, the preset time and the size of the mirror image to be pulled present a proportional relationship, that is, the larger the mirror image to be pulled is, the longer the preset time is set, so as to ensure that the mirror image copying operation is completed when the proxy server pulls the mirror image to be pulled from the target warehouse again.
Certainly, when the proxy server detects that the mirror image to be pulled does not exist in the target warehouse and forwards the mirror image pulling request to the source warehouse, the proxy server can directly pull the mirror image to be pulled from the source warehouse without waiting for the mirror image to be pulled from the target warehouse after being copied, so that the success rate and the efficiency of mirror image pulling are further ensured.
Therefore, according to the embodiment of the application, when mirror image deployment is carried out and mirror images need to be pulled, the proxy server tries to pull the mirror images from the target warehouse in the area, if the mirror images to be pulled do not exist in the target warehouse, the proxy server traces the source to the source warehouse to prompt the source warehouse to execute mirror image replication warehouse again, and the mirror images are replicated to the target warehouse in the area, so that the success rate of mirror image pulling is guaranteed, and the mirror images can be successfully deployed.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two
Referring to fig. 2, another mirror image backtracking method provided in the embodiment of the present application is described below, where the mirror image backtracking method in the embodiment of the present application includes:
in step 201, monitoring a proxy server;
in the embodiment of the present application, since each region is equipped with a proxy server, the source repository will continuously monitor each proxy server to detect whether there is an operation that the repository of the region fails to mirror copy. Specifically, the proxy server is an nginx server.
In step 202, when the mirror image pull request forwarded by the proxy server is monitored, determining a target warehouse and a mirror image to be pulled, to which the mirror image pull request points;
in this embodiment of the present application, when the source repository monitors the mirror image pull request forwarded by a certain proxy server, the target repository and the mirror image to be pulled, which are pointed by the source repository, may be determined based on the mirror image pull request. Since the proxy server should generally preferentially forward the mirror image pull request to the target warehouse, and only when the target warehouse does not have the mirror image to be pulled, the mirror image pull request is forwarded to the source warehouse, when the source warehouse receives the mirror image pull request, that is, when the warehouse in a certain area fails to be synchronized with the source warehouse, based on this, the information of the target warehouse to be synchronized and the mirror image to be pulled needs to be determined.
In step 203, the mirror to be pulled is copied to the target repository based on the mirror pull request.
In this embodiment of the present application, because the target warehouse and the to-be-pulled mirror image to which the mirror image pull request points are already determined based on the mirror image pull request, and the source warehouse can determine that the to-be-pulled mirror image is absent in the target warehouse when receiving the mirror image pull request, at this time, a copy operation needs to be performed to copy the to-be-pulled mirror image to the target warehouse, so as to implement synchronization between the target warehouse and the source warehouse.
Optionally, when the mirror image pulling request forwarded by the proxy server is monitored, the mirror image to be pulled, which is pointed by the mirror image pulling request, may be sent to the proxy server, and the proxy server is allowed to obtain the mirror image from the target warehouse after synchronization between the target warehouse and the source warehouse is completed, so as to further ensure the success rate and efficiency of mirror image pulling.
Optionally, before step 203, the mirror image tracing method includes:
detecting whether a copy process based on the mirror image to be pulled and the target warehouse exists at present;
correspondingly, the copying the mirror image to be pulled to the target warehouse based on the mirror image pulling request includes:
and if the copy process does not exist, copying the mirror image to be pulled to the target warehouse based on the mirror image pull request.
In the embodiments of the present application, there may be a case where: when the instance requests the mirror image from the target warehouse through the proxy server, the source warehouse copies the mirror image to the target warehouse, however, at this time, the proxy server cannot request the mirror image because the copy is not completed yet, and then the mirror image pull request is forwarded to the target warehouse. In fact, after the current copy operation is successfully completed, the proxy server can directly pull the image from the target repository. Therefore, in order to avoid the mirror image being copied for multiple times, the source repository detects whether a copy process based on the mirror image to be pulled and the target repository exists currently, that is, whether an operation of copying the repository to be pulled to the target repository is being performed, if such a copy process exists, a retry message is returned to the proxy server, so that the proxy server requests the mirror image to be pulled from the target repository again based on the retry message, and if such a copy process does not exist, the mirror image to be pulled is copied to the target repository based on the mirror image pull request.
Therefore, according to the embodiment of the application, after monitoring the mirror image pulling request sent by the proxy server, the source warehouse checks whether the related copying operation based on the target warehouse and the mirror image to be pulled exists at present, if not, the source warehouse executes the copying operation of the mirror image to be pulled again, and copies the mirror image to be pulled to the target warehouse, so that the success rate of mirror image pulling is guaranteed, and the mirror image can be deployed successfully.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
To illustrate the solutions of the first and second embodiments, the following explanation and explanation are made by using specific examples, please refer to fig. 3:
after creating the mirror image, pushing the mirror image to a warehouse A of the area 1; the warehouse A copies the mirror image to warehouses (namely, warehouse B and warehouse C) in other areas (namely, area 2 and area 3), and based on the process, the warehouse A is a source warehouse of the mirror image; however, a copy error occurs during the copying to the C repository, resulting in a failure to copy successfully, so that the mirror does not exist in the C repository; at this time, the instance in the area 3 sends a mirror image pulling request to the nginx server; the nginx server detects whether the mirror image exists in a C warehouse (namely a target warehouse) or not based on the mirror image pulling request, and when the mirror image exists in the C warehouse, the nginx server directly pulls the mirror image from the C warehouse; when the C warehouse does not have the mirror image, the nginx server forwards the mirror image pull request to the a warehouse (namely, the source warehouse) to prompt the a warehouse to execute mirror image copy operation to the C warehouse again, and the proxy server can directly pull the mirror image from the a warehouse or pull the mirror image from the C warehouse again after the mirror image copy operation is completed.
EXAMPLE III
A third embodiment of the present application provides a proxy server, as shown in fig. 4, a proxy server 400 in the third embodiment of the present application includes:
a request receiving unit 401, configured to receive a mirror image pull request sent by an instance, and determine a target warehouse to which the mirror image pull request is directed and a mirror image to be pulled;
a mirror image detection unit 402, configured to detect whether the mirror image to be pulled exists in the target warehouse;
a request forwarding unit 403, configured to forward, if there is no mirror image to be pulled in the target warehouse, the mirror image pulling request to a source warehouse, so that the source warehouse copies the mirror image to be pulled to the target warehouse;
a mirror image pulling unit 404, configured to pull the mirror image to be pulled from the target warehouse, and transmit the mirror image to be pulled to the example.
Optionally, the mirror image detecting unit 402 is specifically configured to forward the mirror image pulling request to the target warehouse, determine that a mirror image to be pulled exists in the target warehouse if the mirror image to be pulled is pulled from the target warehouse, and determine that a mirror image to be pulled does not exist in the target warehouse if the mirror image to be pulled cannot be pulled from the target warehouse.
Optionally, the request forwarding unit 403 includes:
the source warehouse address acquisition subunit is configured to acquire, if the target warehouse does not have the mirror image to be pulled, a source warehouse address including the mirror image to be pulled from the target warehouse;
and the source warehouse request forwarding subunit is used for forwarding the mirror image pulling request to the source warehouse based on the source warehouse address.
Therefore, according to the embodiment of the application, when mirror image deployment is carried out and mirror images need to be pulled, the proxy server tries to pull the mirror images from the target warehouse in the area, if the mirror images to be pulled do not exist in the target warehouse, the proxy server traces the source to the source warehouse to prompt the source warehouse to execute mirror image replication warehouse again, and the mirror images are replicated to the target warehouse in the area, so that the success rate of mirror image pulling is guaranteed, and the mirror images can be successfully deployed.
Example four
A fourth embodiment of the present application provides a mirror image tracing system, as shown in fig. 5, the mirror image tracing system in the embodiment of the present application includes a source warehouse 51, a target warehouse 52, and a proxy server 53, where the proxy server 53 includes:
a request receiving unit 531, configured to receive a mirror image pull request sent by an instance, and determine a target warehouse to which the mirror image pull request is directed and a mirror image to be pulled;
a mirror image detection unit 532, configured to detect whether the mirror image to be pulled exists in the target warehouse;
a request forwarding unit 533, configured to forward, if there is no mirror image to be pulled in the target repository, the mirror image pulling request to a source repository, so that the source repository copies the mirror image to be pulled to the target repository;
the mirror image pulling unit 534 is configured to pull the mirror image to be pulled from the target warehouse, and transmit the mirror image to be pulled to the example.
The source warehouse 51 described above includes:
a monitoring unit 511, configured to monitor the proxy server;
a determining unit 512, configured to determine, when the mirror image pull request forwarded by the proxy server is monitored, a target warehouse to which the mirror image pull request is directed and a mirror image to be pulled;
a copying unit 513, configured to copy the mirror to be pulled to the target repository based on the mirror pull request.
Optionally, the mirror image detection unit 532 is specifically configured to forward the mirror image pull request to the target warehouse, determine that a mirror image to be pulled exists in the target warehouse if the mirror image to be pulled is pulled from the target warehouse, and determine that a mirror image to be pulled does not exist in the target warehouse if the mirror image to be pulled cannot be pulled from the target warehouse.
Optionally, the request forwarding unit 533 includes:
the source warehouse address acquisition subunit is configured to acquire, if the target warehouse does not have the mirror image to be pulled, a source warehouse address including the mirror image to be pulled from the target warehouse;
and the source warehouse request forwarding subunit is used for forwarding the mirror image pulling request to the source warehouse based on the source warehouse address.
Optionally, the source warehouse 51 further includes:
the detection unit is used for detecting whether a copy process based on the mirror image to be pulled and the target warehouse exists at present;
accordingly, the copying unit 513 is specifically configured to copy the to-be-pulled mirror to the target repository based on the mirror pull request if the copy process does not exist.
Therefore, according to the embodiment of the application, when mirror image deployment is carried out and mirror images need to be pulled, the proxy server tries to pull the mirror images from the target warehouse in the area, if the mirror images to be pulled do not exist in the target warehouse, the proxy server traces the source to the source warehouse to prompt the source warehouse to execute mirror image replication warehouse again, and the mirror images are replicated to the target warehouse in the area, so that the success rate of mirror image pulling is guaranteed, and the mirror images can be successfully deployed.
EXAMPLE five
An embodiment of the present application provides a proxy server, please refer to fig. 6, where the proxy server in the embodiment of the present application includes: a memory 601, one or more processors 602 (only one shown in fig. 6), and computer programs stored on the memory 601 and executable on the processors. Wherein: the memory 601 is used for storing software programs and modules, and the processor 602 executes various functional applications and data processing by running the software programs and units stored in the memory 601, so as to acquire resources corresponding to the preset events. Specifically, the processor 602 implements the following steps by running the above-mentioned computer program stored in the memory 601:
receiving a mirror image pulling request sent by an example, and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
detecting whether the mirror image to be pulled exists in the target warehouse or not;
if the target warehouse does not have the mirror image to be pulled, forwarding the mirror image pulling request to a source warehouse so that the source warehouse copies the mirror image to be pulled to the target warehouse;
and pulling the mirror image to be pulled from the target warehouse, and transmitting the mirror image to be pulled to the example.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the detecting whether the mirror image to be pulled exists in the target warehouse includes:
forwarding the mirror image pulling request to the target warehouse;
if the mirror image to be pulled is pulled from the target warehouse, determining that the mirror image to be pulled exists in the target warehouse;
and if the mirror image to be pulled cannot be pulled from the target warehouse, determining that the mirror image to be pulled does not exist in the target warehouse.
In a third possible implementation manner provided on the basis of the first possible implementation manner, the forwarding the mirror pull request to the source repository if the mirror to be pulled does not exist in the target repository includes:
if the target warehouse does not have the mirror image to be pulled, acquiring a source warehouse address containing the mirror image to be pulled from the target warehouse;
and forwarding the mirror image pulling request to a source warehouse based on the source warehouse address.
Further, as shown in fig. 6, the proxy server may further include: one or more input devices 603 (only one shown in fig. 6) and one or more output devices 604 (only one shown in fig. 3). The memory 601, processor 602, input device 603, and output device 604 are connected by a bus 605.
It should be understood that in the embodiments of the present Application, the Processor 602 may be a Central Processing Unit (CPU), and the Processor may be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Input devices 603 may include keys, touch pads, etc., and output devices 604 may include displays, speakers, etc.
Memory 601 may include both read-only memory and random-access memory, and provides instructions and data to processor 602. Some or all of memory 601 may also include non-volatile random access memory. For example, the memory 601 may also store device type information.
When mirror image deployment is carried out and mirror images need to be pulled, the proxy server tries to pull the mirror images from a target warehouse in the area, if the mirror images to be pulled do not exist in the target warehouse, the proxy server traces the source to a source warehouse to prompt the source warehouse to execute mirror image replication of the warehouse again, and the mirror images are replicated to the target warehouse in the area, so that the success rate of mirror image pulling is guaranteed, and the success of mirror image deployment is guaranteed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple 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.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A mirror image backtracking method is applied to a proxy server, and comprises the following steps:
receiving a mirror image pulling request sent by an example, and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
detecting whether the mirror image to be pulled exists in the target warehouse or not;
if the target warehouse does not have the mirror image to be pulled, forwarding the mirror image pulling request to a source warehouse so that the source warehouse copies the mirror image to be pulled to the target warehouse;
pulling the mirror image to be pulled from the target warehouse, and transmitting the mirror image to be pulled to the instance;
when the proxy server requests the mirror image from the target warehouse, the source warehouse copies the mirror image to the target warehouse, and if the copy is not completed, the source warehouse detects whether a copy process based on the mirror image to be pulled to the target warehouse exists at present.
2. The mirror image backtracking method of claim 1, wherein the detecting whether the mirror image to be pulled exists in the target repository comprises:
forwarding the mirror pull request to the target repository;
if the mirror image to be pulled is pulled from the target warehouse, determining that the mirror image to be pulled exists in the target warehouse;
and if the mirror image to be pulled cannot be pulled from the target warehouse, determining that the mirror image to be pulled does not exist in the target warehouse.
3. The image backtracking method of claim 1, wherein forwarding the image pull request to a source repository if there is no image to be pulled in the target repository comprises:
if the target warehouse does not have the mirror image to be pulled, acquiring a source warehouse address containing the mirror image to be pulled from the target warehouse;
and forwarding the mirror image pulling request to a source warehouse based on the source warehouse address.
4. A mirror image backtracking method is applied to a source warehouse, and comprises the following steps:
monitoring the proxy server;
when a mirror image pulling request forwarded by the proxy server is monitored, determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
copying the mirror image to be pulled to the target warehouse based on the mirror image pulling request;
when the proxy server requests the mirror image from the target warehouse, the source warehouse copies the mirror image to the target warehouse, and if the copy is not completed, the source warehouse detects whether a copy process based on the mirror image to be pulled to the target warehouse exists at present.
5. The mirror image backtracking method of claim 4, wherein prior to said copying the mirror image to be pulled to the target repository based on the mirror image pull request, the mirror image backtracking method further comprises:
detecting whether a copy process based on the mirror image to be pulled and a target warehouse exists at present;
correspondingly, the copying the mirror to be pulled to the target warehouse based on the mirror pulling request includes:
and if the copy process does not exist, copying the mirror image to be pulled to the target warehouse based on the mirror image pull request.
6. A proxy server, characterized in that the proxy server comprises:
the device comprises a request receiving unit, a storage unit and a processing unit, wherein the request receiving unit is used for receiving a mirror image pulling request sent by an example and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
the mirror image detection unit is used for detecting whether the mirror image to be pulled exists in the target warehouse or not;
a request forwarding unit, configured to forward, if there is no mirror image to be pulled in the target repository, the mirror image pulling request to a source repository, so that the source repository copies the mirror image to be pulled to the target repository;
the mirror image pulling unit is used for pulling the mirror image to be pulled from the target warehouse and transmitting the mirror image to be pulled to the example;
when the proxy server requests the mirror image from the target warehouse, the source warehouse copies the mirror image to the target warehouse, and if the copy is not completed, the source warehouse detects whether a copy process based on the mirror image to be pulled to the target warehouse exists at present.
7. The proxy server according to claim 6, wherein the image detection unit is specifically configured to forward the image pull request to the target repository, determine that the image to be pulled exists in the target repository if the image to be pulled is pulled from the target repository, and determine that the image to be pulled does not exist in the target repository if the image to be pulled cannot be pulled from the target repository.
8. The proxy server of claim 6, wherein the request forwarding unit comprises:
the source warehouse address acquisition subunit is configured to acquire, if the target warehouse does not have the mirror image to be pulled, a source warehouse address including the mirror image to be pulled from the target warehouse;
and the source warehouse request forwarding subunit is used for forwarding the mirror image pulling request to the source warehouse based on the source warehouse address.
9. A proxy server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.
10. A mirror image backtracking system, comprising a source repository, a target repository, and a proxy server, wherein the proxy server comprises:
the device comprises a request receiving unit, a storage unit and a processing unit, wherein the request receiving unit is used for receiving a mirror image pulling request sent by an example and determining a target warehouse and a mirror image to be pulled, which are pointed by the mirror image pulling request;
the mirror image detection unit is used for detecting whether the mirror image to be pulled exists in the target warehouse or not;
a request forwarding unit, configured to forward, if there is no mirror image to be pulled in the target repository, the mirror image pulling request to a source repository, so that the source repository copies the mirror image to be pulled to the target repository;
the mirror image pulling unit is used for pulling the mirror image to be pulled from the target warehouse and transmitting the mirror image to be pulled to the example;
the source repository includes:
the monitoring unit is used for monitoring the proxy server;
the determining unit is used for determining a target warehouse and a mirror to be pulled, to which the mirror pulling request points, when the mirror pulling request forwarded by the proxy server is monitored;
when the proxy server requests a mirror image from a target warehouse, a source warehouse copies the mirror image to the target warehouse, and if the copy is not completed, the source warehouse detects whether a copy process based on the mirror image to be pulled to the target warehouse exists at present;
and the copying unit is used for copying the mirror image to be pulled to the target warehouse based on the mirror image pulling request.
CN201910081413.XA 2019-01-28 2019-01-28 Mirror image backtracking method, mirror image backtracking system and proxy server Active CN109688232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910081413.XA CN109688232B (en) 2019-01-28 2019-01-28 Mirror image backtracking method, mirror image backtracking system and proxy server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910081413.XA CN109688232B (en) 2019-01-28 2019-01-28 Mirror image backtracking method, mirror image backtracking system and proxy server

Publications (2)

Publication Number Publication Date
CN109688232A CN109688232A (en) 2019-04-26
CN109688232B true CN109688232B (en) 2021-09-21

Family

ID=66194106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910081413.XA Active CN109688232B (en) 2019-01-28 2019-01-28 Mirror image backtracking method, mirror image backtracking system and proxy server

Country Status (1)

Country Link
CN (1) CN109688232B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275717B (en) * 2019-05-17 2024-03-22 平安科技(深圳)有限公司 Private image cloning method, private image cloning device, computer equipment and storage medium
CN110826248B (en) * 2019-11-18 2023-10-20 杭州涂鸦信息技术有限公司 Method and system for simulating infrared camera dark angle based on light source database

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200155A (en) * 2017-12-29 2018-06-22 平安科技(深圳)有限公司 The mirror image synchronization method in Docker mirror images warehouse and mirror image synchronization system
CN109104451A (en) * 2017-06-21 2018-12-28 阿里巴巴集团控股有限公司 The pre-heating mean and node of the method for down loading and node of Docker mirror image, Docker mirror image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10812582B2 (en) * 2016-03-10 2020-10-20 Vmware, Inc. Management of applications across nodes using exo-clones
CN107247793B (en) * 2017-06-21 2020-03-17 平安科技(深圳)有限公司 Mirror image synchronization method and mirror image synchronization system of Docker mirror image warehouse

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109104451A (en) * 2017-06-21 2018-12-28 阿里巴巴集团控股有限公司 The pre-heating mean and node of the method for down loading and node of Docker mirror image, Docker mirror image
CN108200155A (en) * 2017-12-29 2018-06-22 平安科技(深圳)有限公司 The mirror image synchronization method in Docker mirror images warehouse and mirror image synchronization system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"数据中心环境下Docker镜像分发技术研究与实现";梁明远;《中国优秀硕士学位论文全文数据库》;20190115;I137-50 *

Also Published As

Publication number Publication date
CN109688232A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN108446947B (en) Real estate transaction method and device
US9961129B2 (en) Business transaction correlation with client request monitoring data
US20190158626A1 (en) Method, apparatus and computer readable storage medium for processing service
US10122598B2 (en) Subscription watch lists for event handling
US20150281035A1 (en) Monitoring of Node.JS Applications
CN108733720B (en) On-line checking method and checking system for SQL (structured query language) query of multiple database types
CN103577757A (en) Virus defending method and device
CN109688232B (en) Mirror image backtracking method, mirror image backtracking system and proxy server
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN114827280A (en) Request processing method, device, equipment and medium
CN113346973B (en) Event prompting method and device, electronic equipment and computer readable storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN112825525B (en) Method and apparatus for processing transactions
CN109218338B (en) Information processing system, method and device
CN111639086B (en) Data reconciliation method, device, equipment and storage medium
US20160321173A1 (en) Automatic garbage collection thrashing monitoring
CN110930253B (en) Method and device for generating main key inside intelligent contract, computer equipment and storage medium
CN111049883A (en) Data reading method, device and system of distributed table system
WO2020037607A1 (en) Data transmission method and apparatus
CN112445860A (en) Method and device for processing distributed transaction
CN110727537B (en) Method, device, computer equipment and storage medium for uniformly processing response message
JP5499484B2 (en) Program correction system, terminal device, server device, program correction method, error detection program, and management program
CN114051024A (en) File background continuous transmission method and device, storage medium and electronic equipment
CN110221854B (en) Multi-process data updating method, device, medium and electronic equipment
CN110912720B (en) Information generation method and device

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
GR01 Patent grant
GR01 Patent grant