CN117857578A - Multi-scene compatible mirror synchronization method, device, equipment and medium - Google Patents

Multi-scene compatible mirror synchronization method, device, equipment and medium Download PDF

Info

Publication number
CN117857578A
CN117857578A CN202311696876.XA CN202311696876A CN117857578A CN 117857578 A CN117857578 A CN 117857578A CN 202311696876 A CN202311696876 A CN 202311696876A CN 117857578 A CN117857578 A CN 117857578A
Authority
CN
China
Prior art keywords
mirror
synchronization
mirror image
reachable
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311696876.XA
Other languages
Chinese (zh)
Inventor
何健勇
林位宁
蔡岳阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202311696876.XA priority Critical patent/CN117857578A/en
Publication of CN117857578A publication Critical patent/CN117857578A/en
Pending legal-status Critical Current

Links

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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The method monitors mirror image synchronization events of different mirror image resource pools through a central terminal, acquires a current network reachable state between a mirror image source terminal and the mirror image synchronization terminal when the mirror image source terminal triggers the mirror image synchronization events, and determines a mirror image synchronization operation instruction suitable for the mirror image source terminal and the mirror image synchronization terminal to execute mirror image data synchronization operation according to a mirror image synchronization operation table; and then according to the mirror image synchronization operation instruction, the target mirror image data is synchronized from the mirror image source end to the mirror image synchronization end, so that mirror image data synchronization among different mirror image resource pools can be realized, the mirror image synchronization method is suitable for mirror image synchronization schemes of various scenes, different environments can be used for synchronizing mirror images, and even if the synchronous source and the mirror image synchronization end are not communicated with each other, synchronization can be completed as long as the synchronous source and the mirror image synchronization end can be simultaneously communicated with the central end, and the applicability and the reliability of the mirror image resource data synchronization method are improved.

Description

Multi-scene compatible mirror synchronization method, device, equipment and medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for synchronizing images compatible with multiple scenarios.
Background
Today when software application architecture evolves into the cloud native architecture era, containers and images become an integral part of IT operation and development. The Container Image (Container Image) contains a packaged application and its dependencies, as well as the process information it runs at start-up, and contains all the dependencies required by the application.
Each application may be mirrored, or a version of each application may be mirrored, or even each mirrored needs another as a base mirror. Such a large number of images requires an image repository for storage management. One of the simplest and lightest components is the Registry that is officially pushed by the docker. It is a storage and content delivery system that can maintain several named container images, which can have different versions, and which itself supports TLS and Basic authentication for protection of the images.
However, when the mirror images in the Registry are managed, and the users of the project are controlled by more detailed authority, the public and private mirror image warehouse is distinguished, and this time, the Harbor is used. Harbor bottom-level image management encapsulates many scenarios that facilitate enterprise-level applications in terms of upper application layers by means of Registry capabilities, which provide role-based access control mechanisms, and organizes images and controls access rights through items. Particularly in a multi-tenant scenario, management and access control on multi-tenant mirror resources can be realized in a mode of combining tenants, nasspace and projects.
Container product management is still a problem that must be faced in current public, private, or hybrid cloud scenarios. When a development team issues a new version of a container image, it is synchronized relatively quickly to each cloud, or to a blind resource pool of the same cloud. Of course, for some well-known public cloud manufacturers, there is a set of mature and feasible schemes in the cloud environment, but the scheme is only suitable for the cloud environment of the public cloud manufacturers, and for the mixed cloud scene, the cross-cloud manufacturer scene needs to be additionally customized for the interface call. For the Harbor mentioned above, there is also a copy function for synchronizing images of different instances or different types of image warehouse, but network interworking of the synchronized image source end and the image synchronization end is required, and this scheme is limited when network non-interworking between different resource pools is encountered.
Therefore, how to realize mirror image data synchronization between different resource pools is a technical problem to be solved.
Disclosure of Invention
The application provides a multi-scene-compatible mirror image synchronization method, device, equipment and storage medium, and aims to realize mirror image data synchronization among different resource pools.
In a first aspect, the present application provides a multi-scenario compatible mirror synchronization method, the method including:
when the central terminal monitors the mirror image synchronization event, the current network reachable states of the mirror image source terminal and the mirror image synchronization terminal are obtained;
the central terminal determines a mirror synchronous operation instruction corresponding to the current network reachable state according to a preset mirror synchronous operation table;
and synchronously storing the target mirror image data of the mirror image source end to the mirror image synchronous end according to the mirror image synchronous operation corresponding to the mirror image synchronous operation instruction so as to realize mirror image synchronization.
In a second aspect, the present application further provides a multi-scenario-compatible mirror synchronization apparatus, where the multi-scenario-compatible mirror synchronization apparatus includes:
the network reachable state acquisition module is used for acquiring the current network reachable states of the mirror image source end and the mirror image synchronization end when the central end monitors the mirror image synchronization event;
the instruction determining module is used for determining a mirror image synchronous operation instruction corresponding to the current network reachable state according to a preset mirror image synchronous operation table by the central terminal;
and the mirror synchronization module is used for synchronously storing the target mirror data of the mirror source end to the mirror synchronization end according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction so as to realize mirror synchronization.
In a third aspect, the present application further provides a computer device, the computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the multi-scenario compatible mirror synchronization method as described above.
In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the multi-scenario compatible mirror synchronization method as described above.
The application provides a mirror image synchronization method, a device, equipment and a storage medium compatible with multiple scenes, wherein the method comprises the steps that when a central terminal monitors a mirror image synchronization event, the central terminal obtains the current network reachable states of a mirror image source terminal and a mirror image synchronization terminal; the central terminal determines a mirror synchronous operation instruction corresponding to the current network reachable state according to a preset mirror synchronous operation table; and synchronously storing the target mirror image data of the mirror image source end to the mirror image synchronous end according to the mirror image synchronous operation corresponding to the mirror image synchronous operation instruction so as to realize mirror image synchronization. By the method, the mirror synchronization event of different mirror resource pools is monitored through the central terminal, when the mirror source terminal triggers the mirror synchronization event, the current network reachable state between the mirror source terminal and the mirror synchronization terminal is obtained, and a mirror synchronization operation instruction suitable for executing mirror data synchronization operation of the mirror source terminal and the mirror synchronization terminal is determined according to the mirror synchronization operation table; and then according to the mirror image synchronization operation instruction, the target mirror image data is synchronized from the mirror image source end to the mirror image synchronization end, so that mirror image data synchronization among different mirror image resource pools can be realized, the mirror image synchronization method can adapt to mirror image synchronization schemes of various scenes, can synchronize mirror images in different environments, and can complete synchronization even if the synchronous source and the mirror image synchronization end are not communicated with each other as long as the synchronous source and the mirror image synchronization end can be simultaneously communicated with the central end, thereby improving the applicability and the reliability of the mirror image resource data synchronization method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a first embodiment of a multi-scenario compatible mirror synchronization method provided in the present application;
fig. 2 is a schematic diagram of data interaction between components in a multi-scenario-compatible mirror synchronization method according to an embodiment of the present application;
FIG. 3 is a flowchart of a second embodiment of a multi-scenario compatible mirror synchronization method provided in the present application;
FIG. 4 is a schematic structural diagram of a first embodiment of a multi-scenario compatible mirror synchronization apparatus provided in the present application;
fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a multi-scenario compatible mirror synchronization method provided in the present application.
As shown in fig. 1, the multi-scene compatible mirror synchronization method includes steps S101 to S103.
S101, when a central terminal monitors a mirror image synchronization event, acquiring current network reachable states of a mirror image source terminal and a mirror image synchronization terminal;
in an embodiment, when a user pushes a mirror image in one of the resource pools and triggers a mirror image synchronization event, the central end issues different synchronization operation instructions to the mirror image source end and the mirror image synchronization end according to the network reachable state of the mirror image synchronization end of the mirror image source end.
In an embodiment, after the deployment of each mirror resource pool is completed, the mirror resource pools can be managed to a central end, when each mirror resource pool is managed by the central end, network reachability between the mirror resource pool and other mirror resource pools of the central end can be tested, and a reachability topology graph between the mirror resource pools is constructed according to a test result. Network reachability status between each mirror resource pool pair by pair may be included in the reachability topology map.
In an embodiment, when a user uploads a new image at the image source end and triggers an image synchronization event, the central end may obtain current network reachability states of the image source end and the image synchronization end according to the reachability topology.
In one embodiment, the current network reachability status includes storage-side reachability, proxy-side reachability, and network-non-reachability.
The storage end can be a first storage end of the mirror image synchronization end and a second storage end of the mirror image source end which are in communication connection; the proxy server can be used as a first proxy server of the mirror image synchronization end and a second proxy server of the mirror image source end to be in communication connection; the network is not reachable as the mirror synchronization end and the mirror source end have no communication connection.
In an embodiment, when the mirror source and the mirror synchronization end can directly communicate through the data port of the storage end, that is, the mirror synchronization end can directly read mirror data from the storage end of the mirror source, the mirror source and the mirror synchronization end are reachable through the storage end.
In an embodiment, when two storage ends of the mirror source end and the mirror synchronization end cannot directly communicate, but the proxy server ends corresponding to the two storage ends can communicate, the two storage ends can realize data transmission through the proxy server end, and the two storage ends can be reachable through the proxy server end.
In an embodiment, when two storage ends corresponding to the mirror source end and the mirror synchronization end respectively cannot communicate with each other, and the proxy server ends corresponding to the mirror source end and the mirror synchronization end respectively cannot communicate with each other, that is, data transmission cannot be directly performed between the two storage ends, the two storage ends cannot be reachable by the network.
S102, the central terminal determines a mirror synchronous operation instruction corresponding to the current network reachable state according to a preset mirror synchronous operation table;
in an embodiment, when the communication modes between the mirror source end and the mirror synchronization end are different, the data synchronization process of the mirror data is also different, and the mirror synchronization operation instructions issued by the mirror source end and the mirror synchronization end are also different, so that a mirror synchronization operation table can be preconfigured according to the mirror synchronization operation instructions corresponding to different network reachable states, and when the current network reachable state between the mirror source end and the mirror synchronization end is determined, the corresponding mirror synchronization operation instructions can be queried in the mirror synchronization operation table according to the current network reachable state.
S103, according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, synchronously storing the target mirror data of the mirror source end to the mirror synchronization end so as to realize mirror synchronization.
In an embodiment, as shown in fig. 2, the central end issues an image synchronization operation instruction to the image source end and the image synchronization end (the resource pool a and the resource pool B), so that the image source end and the image synchronization end execute corresponding image synchronization operations, thereby copying and transmitting target image data from the image source end to the image synchronization end, and storing the target image data in a database of the image synchronization end to realize data synchronization of the target image data.
Further, when the current network reachable state is that the storage end is reachable, the target mirror image data is synchronously stored to the first storage end based on the communication channels of the first storage end and the second storage end so as to complete mirror image synchronization.
In an embodiment, if the mirror source end and the mirror synchronization end belong to the storage end intercommunication, only the storage end is required to synchronize the information of each layer of the mirror, and after synchronization is completed, the center end records the mirror information of the mirror synchronization end. This approach is among the most rapid and efficient ways.
Further, when the current network reachable state is that the proxy server side is reachable, transmitting the target mirror image data to the first proxy server side based on communication channels of the first proxy server side and the second proxy server side; after the first proxy server receives the target mirror image data, the target mirror image data is stored in the first storage end, so that mirror image synchronization is completed.
In an embodiment, if the mirror source end and the mirror synchronization end only belong to the proxy Agent end, the proxy Agent end of the target needs to pull the mirror from the proxy Agent end of the source and push the mirror back to the storage end of the target. The mode is less effective than the data transmission mode of the storage end because the mode is processed by two proxy ends and has performance loss in the process of pushing and pulling the mirror image again.
Further, when the current network reachable state is that the network is not reachable, transmitting the target mirror image data to the central end based on a communication channel between the central end and the mirror image source end; after the central end receives the target mirror image data, the target mirror image data is transmitted to the mirror image synchronization end based on a communication channel between the central end and the mirror image synchronization end and stored in the first storage end so as to complete mirror image synchronization.
In an embodiment, if the mirror source end and the mirror synchronization end are not in communication, the center end is required to execute a task to pull the mirror from the mirror source end and push the mirror to the mirror synchronization end. The mode has the best compatibility, but the mirror image needs to reach the center end from the mirror image source end and then reach the mirror image synchronous end from the center end, so that the efficiency is lower.
The embodiment provides a mirror synchronization method compatible with multiple scenes, which monitors mirror synchronization events of different mirror resource pools through a central terminal, acquires a current network reachable state between a mirror source terminal and the mirror synchronization terminal when the mirror source terminal triggers the mirror synchronization events, and determines a mirror synchronization operation instruction suitable for executing mirror data synchronization operation of the mirror source terminal and the mirror synchronization terminal according to a mirror synchronization operation table; and then according to the mirror image synchronization operation instruction, the target mirror image data is synchronized from the mirror image source end to the mirror image synchronization end, so that mirror image data synchronization among different mirror image resource pools can be realized, the mirror image synchronization method can adapt to mirror image synchronization schemes of various scenes, can synchronize mirror images in different environments, and can complete synchronization even if the synchronous source and the mirror image synchronization end are not communicated with each other as long as the synchronous source and the mirror image synchronization end can be simultaneously communicated with the central end, thereby improving the applicability and the reliability of the mirror image resource data synchronization method.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of a multi-scenario compatible mirror synchronization method provided in the present application.
In this embodiment, based on the embodiment shown in fig. 1, the step S101 specifically includes:
s201, acquiring a first data port corresponding to the mirror image synchronous end and a second data port corresponding to the mirror image source end, wherein the first data port is a data communication interface of the first storage end, and the second data port is a data communication interface of the second storage end;
in one embodiment, when the network environment of one of the resource pools of the central side nanotube changes or triggers a mirror resource synchronization event, network reachability between the mirror source side and the mirror synchronization side can be retested.
In one embodiment, when testing network reachability between the mirror source and mirror sync ends, the testing may be performed in the order of storage, proxy, and hub.
In an embodiment, the proxy Agent end (i.e., proxy server end) and the storage end corresponding to the mirror source end and the mirror synchronization end both expose the Ping API to the outside, the API (Application Programming Interface ) has no actual service effect, only can be used for reachability test, and the API returns to obtain a Pong string as a response to indicate reachability communication.
S202, constructing communication connection between the first data port and the second data port, and obtaining a first communication connection result;
and S203, when the first communication connection result is that communication is reachable, determining that the current network reachable states of the mirror synchronous end and the mirror source end are reachable by the storage end.
In an embodiment, the central end informs the storage end-to-end of the address of the storage end-to-end through the Agent end, so that the storage end accesses the Ping interface of the opposite end, that is, the first storage end corresponding to the mirror synchronization end accesses the second storage end corresponding to the mirror source end, after the access is completed, the results are returned to the central end respectively, if the access is completed, the access direction is marked as the storage end is reachable, and the accessibility test is ended.
In an embodiment, if the network between the first storage end corresponding to the mirror synchronization end and the second storage end corresponding to the mirror source end is not reachable, that is, communication connection cannot be performed, a network reachability test of the proxy server end is performed.
Further, when the first communication connection result is that communication is not reachable, a third data port corresponding to the mirror synchronization end and a fourth data port corresponding to the mirror source end are obtained, wherein the third data port is a data communication interface of the first proxy server end, and the fourth data port is a data communication interface of the second proxy server end; constructing communication connection of the third data port and the fourth data port to obtain a second communication connection result; when the second communication connection result is that communication is reachable, determining that the current network reachable states of the mirror synchronization end and the mirror source end are reachable by the proxy server end; and when the second communication connection result is that communication is not reachable, determining that the current network reachable state of the mirror image synchronous end and the mirror image source end is that the network is not reachable.
In an embodiment, when the storage network reachability test result between the mirror source end and the mirror synchronization end is unreachable, the network reachability test of the proxy server end can be executed. And the central end respectively transmits the addresses of the proxy Agent ends of the opposite ends to the two proxy Agent ends, so that the proxy Agent ends access the Ping interface of the opposite ends, namely the third data port corresponding to the mirror image synchronous end accesses the fourth data port corresponding to the mirror image source end.
In an embodiment, after the access is completed, the results are respectively returned to the central end, if the access is available, the access direction is marked as the Agent end, if the access is not available, the access direction is marked as the local direction is not available, and the test is ended.
In an embodiment, the central end can issue reachability tests in two directions at a time, so that two reachability records can be generated, and the records are stored as reachability topology graphs according to the addresses of the mirror source end and the mirror synchronization end, wherein the reachability levels (including the reachability of the storage end, the reachability of the Agent end and the non-reachability of the Agent end) are stored in the central end and used as the basis for selecting a synchronization scheme when the central end executes a synchronization task according to a synchronization rule.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a first embodiment of a multi-scenario-compatible mirror synchronization apparatus provided in the present application, where the multi-scenario-compatible mirror synchronization apparatus is configured to execute the aforementioned multi-scenario-compatible mirror synchronization method. The multi-scenario compatible mirror synchronization device may be configured in a server.
As shown in fig. 4, the multi-scenario compatible mirror synchronization apparatus 300 includes: a network reachability status acquisition module 301, an instruction determination module 302, and a mirror synchronization module 303.
The network reachable state obtaining module 301 is configured to obtain current network reachable states of the mirror source end and the mirror synchronization end when the central end monitors the mirror synchronization event;
the instruction determining module 302 is configured to determine, by using the central terminal according to a preset mirror synchronization operation table, a mirror synchronization operation instruction corresponding to the current network reachable state;
and the mirror synchronization module 303 is configured to synchronize and store the target mirror data of the mirror source end to the mirror synchronization end according to a mirror synchronization operation corresponding to the mirror synchronization operation instruction, so as to implement mirror synchronization.
In an embodiment, the current network reachable state includes storage-side reachable, proxy-side reachable, and network unreachable;
the storage end can be a first storage end of the mirror image synchronization end and a second storage end of the mirror image source end which are in communication connection;
the proxy server can be used as a first proxy server of the mirror image synchronization end and a second proxy server of the mirror image source end to be in communication connection;
the network is not reachable as the mirror synchronization end and the mirror source end have no communication connection.
In an embodiment, the mirror synchronization module 303 is further configured to, when the current network reachable state is that the storage terminal is reachable, synchronously store the target mirror data to the first storage terminal based on a communication channel of the first storage terminal and the second storage terminal, so as to complete mirror synchronization.
In an embodiment, the mirror synchronization module 303 is further configured to transmit the target mirror data to the first proxy server based on a communication channel of the first proxy server and the second proxy server when the current network reachable state is that the proxy server is reachable;
after the first proxy server receives the target mirror image data, the target mirror image data is stored in the first storage end, so that mirror image synchronization is completed.
In an embodiment, the mirror synchronization module 303 is further configured to transmit the target mirror data to the central node based on a communication channel between the central node and the mirror source node when the current network reachable state is that the network is not reachable;
after the central end receives the target mirror image data, the target mirror image data is transmitted to the mirror image synchronization end based on a communication channel between the central end and the mirror image synchronization end and stored in the first storage end so as to complete mirror image synchronization.
In an embodiment, the network reachable state obtaining module 301 is further configured to obtain a first data port corresponding to the mirror synchronization end and a second data port corresponding to the mirror source end, where the first data port is a data communication interface of the first storage end, and the second data port is a data communication interface of the second storage end; constructing communication connection between the first data port and the second data port to obtain a first communication connection result; and when the first communication connection result is that communication is reachable, determining that the current network reachable state of the mirror synchronous end and the mirror source end is reachable by the storage end.
In an embodiment, the network reachable state obtaining module 301 is further configured to obtain, when the first communication connection result is that communication is not reachable, a third data port corresponding to the mirror synchronization end and a fourth data port corresponding to the mirror source end, where the third data port is a data communication interface of the first proxy server end, and the fourth data port is a data communication interface of the second proxy server end; constructing communication connection of the third data port and the fourth data port to obtain a second communication connection result; when the second communication connection result is that communication is reachable, determining that the current network reachable states of the mirror synchronization end and the mirror source end are reachable by the proxy server end; and when the second communication connection result is that communication is not reachable, determining that the current network reachable state of the mirror image synchronous end and the mirror image source end is that the network is not reachable.
It should be noted that, for convenience and brevity of description, specific working processes of the above-described apparatus and each module may refer to corresponding processes in the foregoing embodiment of the multi-scenario-compatible mirror synchronization method, which are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 5.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
With reference to FIG. 5, the computer device includes a processor, memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions that, when executed, cause the processor to perform any one of a plurality of scenario-compatible mirror synchronization methods.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by a processor, causes the processor to perform any one of a number of multi-scenario compatible mirror synchronization methods.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (CentralProcessingUnit, CPU), but may also be other general purpose processors, digital signal processors (DigitalSignalProcessor, DSP), application specific integrated circuits (ApplicationSpecificIntegratedCircuit, ASIC), field programmable gate arrays (Field-ProgrammableGateArray, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
when the central terminal monitors the mirror image synchronization event, the current network reachable states of the mirror image source terminal and the mirror image synchronization terminal are obtained;
the central terminal determines a mirror synchronous operation instruction corresponding to the current network reachable state according to a preset mirror synchronous operation table;
and synchronously storing the target mirror image data of the mirror image source end to the mirror image synchronous end according to the mirror image synchronous operation corresponding to the mirror image synchronous operation instruction so as to realize mirror image synchronization.
In one embodiment, the current network reachable state includes storage-side reachable, proxy-side reachable, and network unreachable;
the storage end can be a first storage end of the mirror image synchronization end and a second storage end of the mirror image source end which are in communication connection;
the proxy server can be used as a first proxy server of the mirror image synchronization end and a second proxy server of the mirror image source end to be in communication connection;
the network is not reachable as the mirror synchronization end and the mirror source end have no communication connection.
In one embodiment, when implementing the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the processor is configured to store, to the mirror synchronization end, target mirror data of the mirror source end in synchronization with the mirror synchronization end, so as to implement mirror synchronization:
and synchronously storing the target mirror image data to the first storage end based on the communication channels of the first storage end and the second storage end when the current network reachable state is that the storage end is reachable, so as to complete mirror image synchronization.
In one embodiment, when implementing the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the processor is further configured to implement:
transmitting the target mirror image data to the first proxy server based on the communication channels of the first proxy server and the second proxy server when the current network reachable state is reachable by the proxy server;
after the first proxy server receives the target mirror image data, the target mirror image data is stored in the first storage end, so that mirror image synchronization is completed.
In one embodiment, when implementing the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the processor is further configured to implement:
transmitting the target mirror image data to the central end based on the communication channels of the central end and the mirror image source end when the current network reachable state is that the network is not reachable;
after the central end receives the target mirror image data, the target mirror image data is transmitted to the mirror image synchronization end based on a communication channel between the central end and the mirror image synchronization end and stored in the first storage end so as to complete mirror image synchronization.
In one embodiment, when implementing the current network reachable state of the mirror source and mirror sync, the processor is configured to implement:
acquiring a first data port corresponding to the mirror synchronization end and a second data port corresponding to the mirror source end, wherein the first data port is a data communication interface of the first storage end, and the second data port is a data communication interface of the second storage end;
constructing communication connection between the first data port and the second data port to obtain a first communication connection result;
and when the first communication connection result is that communication is reachable, determining that the current network reachable state of the mirror synchronous end and the mirror source end is reachable by the storage end.
In one embodiment, after implementing the constructing the communication connection between the first data port and the second data port, the processor is further configured to, after obtaining a first communication connection result:
when the first communication connection result is that communication is not available, a third data port corresponding to the mirror image synchronization end and a fourth data port corresponding to the mirror image source end are obtained, wherein the third data port is a data communication interface of the first proxy server end, and the fourth data port is a data communication interface of the second proxy server end;
constructing communication connection of the third data port and the fourth data port to obtain a second communication connection result;
when the second communication connection result is that communication is reachable, determining that the current network reachable states of the mirror synchronization end and the mirror source end are reachable by the proxy server end;
and when the second communication connection result is that communication is not reachable, determining that the current network reachable state of the mirror image synchronous end and the mirror image source end is that the network is not reachable.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any multi-scene compatible mirror synchronization method provided by the embodiment of the application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk provided on the computer device, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash memory card (FlashCard), etc.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A multi-scenario compatible mirror synchronization method, the method comprising:
when the central terminal monitors the mirror image synchronization event, the current network reachable states of the mirror image source terminal and the mirror image synchronization terminal are obtained;
the central terminal determines a mirror synchronous operation instruction corresponding to the current network reachable state according to a preset mirror synchronous operation table;
and synchronously storing the target mirror image data of the mirror image source end to the mirror image synchronous end according to the mirror image synchronous operation corresponding to the mirror image synchronous operation instruction so as to realize mirror image synchronization.
2. The multi-scenario compatible mirror synchronization method of claim 1 wherein the current network reachable state comprises storage-side reachable, proxy-side reachable, and network unreachable;
the storage end can be a first storage end of the mirror image synchronization end and a second storage end of the mirror image source end which are in communication connection;
the proxy server can be used as a first proxy server of the mirror image synchronization end and a second proxy server of the mirror image source end to be in communication connection;
the network is not reachable as the mirror synchronization end and the mirror source end have no communication connection.
3. The multi-scenario compatible mirror synchronization method according to claim 2, wherein the storing the target mirror data synchronization of the mirror source to the mirror synchronization terminal according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, to achieve mirror synchronization, includes:
and synchronously storing the target mirror image data to the first storage end based on the communication channels of the first storage end and the second storage end when the current network reachable state is that the storage end is reachable, so as to complete mirror image synchronization.
4. The multi-scenario compatible mirror synchronization method according to claim 2, wherein the storing the target mirror data synchronization of the mirror source to the mirror synchronization terminal according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, to achieve mirror synchronization, further comprises:
transmitting the target mirror image data to the first proxy server based on the communication channels of the first proxy server and the second proxy server when the current network reachable state is reachable by the proxy server;
after the first proxy server receives the target mirror image data, the target mirror image data is stored in the first storage end, so that mirror image synchronization is completed.
5. The multi-scenario compatible mirror synchronization method according to claim 2, wherein the storing the target mirror data synchronization of the mirror source to the mirror synchronization terminal according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, to achieve mirror synchronization, further comprises:
transmitting the target mirror image data to the central end based on the communication channels of the central end and the mirror image source end when the current network reachable state is that the network is not reachable;
after the central end receives the target mirror image data, the target mirror image data is transmitted to the mirror image synchronization end based on a communication channel between the central end and the mirror image synchronization end and stored in the first storage end so as to complete mirror image synchronization.
6. The multi-scenario compatible mirror synchronization method according to claim 2, wherein the obtaining the current network reachable states of the mirror source and the mirror synchronization includes:
acquiring a first data port corresponding to the mirror synchronization end and a second data port corresponding to the mirror source end, wherein the first data port is a data communication interface of the first storage end, and the second data port is a data communication interface of the second storage end;
constructing communication connection between the first data port and the second data port to obtain a first communication connection result;
and when the first communication connection result is that communication is reachable, determining that the current network reachable state of the mirror synchronous end and the mirror source end is reachable by the storage end.
7. The multi-scenario compatible mirror synchronization method of claim 6, wherein the constructing the communication connection between the first data port and the second data port, after obtaining the first communication connection result, further comprises:
when the first communication connection result is that communication is not available, a third data port corresponding to the mirror image synchronization end and a fourth data port corresponding to the mirror image source end are obtained, wherein the third data port is a data communication interface of the first proxy server end, and the fourth data port is a data communication interface of the second proxy server end;
constructing communication connection of the third data port and the fourth data port to obtain a second communication connection result;
when the second communication connection result is that communication is reachable, determining that the current network reachable states of the mirror synchronization end and the mirror source end are reachable by the proxy server end;
and when the second communication connection result is that communication is not reachable, determining that the current network reachable state of the mirror image synchronous end and the mirror image source end is that the network is not reachable.
8. A multi-scenario compatible mirror synchronization apparatus, the multi-scenario compatible mirror synchronization apparatus comprising:
the network reachable state acquisition module is used for acquiring the current network reachable states of the mirror image source end and the mirror image synchronization end when the central end monitors the mirror image synchronization event;
the instruction determining module is used for determining a mirror image synchronous operation instruction corresponding to the current network reachable state according to a preset mirror image synchronous operation table by the central terminal;
and the mirror synchronization module is used for synchronously storing the target mirror data of the mirror source end to the mirror synchronization end according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction so as to realize mirror synchronization.
9. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor performs the steps of the multi-scenario compatible mirror synchronization method according to any one of claims 1 to 7.
10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, wherein the computer program, when executed by a processor, implements the steps of the multi-scenario compatible mirror synchronization method of any one of claims 1 to 7.
CN202311696876.XA 2023-12-11 2023-12-11 Multi-scene compatible mirror synchronization method, device, equipment and medium Pending CN117857578A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311696876.XA CN117857578A (en) 2023-12-11 2023-12-11 Multi-scene compatible mirror synchronization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311696876.XA CN117857578A (en) 2023-12-11 2023-12-11 Multi-scene compatible mirror synchronization method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117857578A true CN117857578A (en) 2024-04-09

Family

ID=90530065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311696876.XA Pending CN117857578A (en) 2023-12-11 2023-12-11 Multi-scene compatible mirror synchronization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117857578A (en)

Similar Documents

Publication Publication Date Title
CN112119374B (en) Selectively providing mutual transport layer security using alternate server names
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
CN110462589B (en) On-demand code execution in a local device coordinator
CN110752947B (en) K8s cluster deployment method and device, and deployment platform
US9311161B2 (en) Automatically configured management service payloads for cloud IT services delivery
US9274843B2 (en) Multi-redundant switchable process pooling for cloud it services delivery
CN111782232A (en) Cluster deployment method and device, terminal equipment and storage medium
CN110352401B (en) Local device coordinator with on-demand code execution capability
CN107959582B (en) Slice instance management method and device
CN113301116B (en) Cross-network communication method, device, system and equipment for micro-service application
CN110262902B (en) Information processing method and system, medium, and computing device
KR20190082926A (en) Messaging Protocol Communication Management
BR112017000110B1 (en) METHOD IMPLEMENTED BY COMPUTER, COMPUTER SYSTEM AND MEMORY DEVICE FOR SELF-EXPANING CLOUD
CN107741852B (en) Service deployment method based on cluster software
EP3149603B1 (en) Customized configuration of cloud-based applications prior to deployment
CN111064626B (en) Configuration updating method, device, server and readable storage medium
WO2015057188A1 (en) Package dependency maps for distributed computing
CN110764788B (en) Cloud storage deployment method and device, computer equipment and readable storage medium
CN114422618B (en) Cloud-protogenesis-based IOT platform protocol adaptation method, device, equipment and medium
CN112230857B (en) Hybrid cloud system, hybrid cloud disk application method and data storage method
CN115086166B (en) Computing system, container network configuration method, and storage medium
US20170237687A1 (en) Resource trees by management controller
CN113168333A (en) Workflow configuration for a coordinated device environment
CN114328097A (en) File monitoring method and device, electronic equipment and storage medium
CN110083366B (en) Application running environment generation method and device, computing equipment and storage medium

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