CN113315795A - Synchronization method and device of cloud host mirror image and storage medium - Google Patents

Synchronization method and device of cloud host mirror image and storage medium Download PDF

Info

Publication number
CN113315795A
CN113315795A CN202010118395.0A CN202010118395A CN113315795A CN 113315795 A CN113315795 A CN 113315795A CN 202010118395 A CN202010118395 A CN 202010118395A CN 113315795 A CN113315795 A CN 113315795A
Authority
CN
China
Prior art keywords
cloud host
file server
synchronization instruction
mirror image
synchronization
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.)
Granted
Application number
CN202010118395.0A
Other languages
Chinese (zh)
Other versions
CN113315795B (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.)
SF Technology Co Ltd
Original Assignee
SF 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 SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202010118395.0A priority Critical patent/CN113315795B/en
Publication of CN113315795A publication Critical patent/CN113315795A/en
Application granted granted Critical
Publication of CN113315795B publication Critical patent/CN113315795B/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/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

Abstract

The application relates to a synchronization method and device for cloud host mirror images and a storage medium. The method comprises the following steps: receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image; sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from a second file server and store the cloud host image, wherein the second file server is a file server of an available region where a sending end of the image synchronization instruction is located; according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image. By the embodiment of the invention, time and labor can be saved.

Description

Synchronization method and device of cloud host mirror image and storage medium
Technical Field
The present application relates to the field of cloud host technologies, and in particular, to a method and an apparatus for synchronizing cloud host images, and a storage medium.
Background
With the rapid development of cloud computing, cloud hosts integrating computing, storage and network resources appear. The cloud host is a part which virtualizes a plurality of similar independent hosts in a server cluster, and each server in the server cluster is provided with a mirror image of the cloud host.
In practical applications, the server cluster is divided into a plurality of available areas according to usage requirements, for example, a test available area, a production available area, a disaster recovery available area, and a fusion available area. And the synchronization of the cloud host images among the available areas is usually completed by manual operation. For example, the cloud host images are copied from the test available area to the ftp server, then enter the springboard machines of the available areas through the bastion machine, then copied from the ftp server to the springboard machines, and finally copied from the springboard machines of the available areas to the servers in the server cluster.
The cloud host mirror image synchronization is carried out manually, so that the whole process is time-consuming and labor-consuming and is easy to make mistakes.
Disclosure of Invention
Therefore, in order to solve the technical problem, it is necessary to provide a synchronization method, an apparatus and a storage medium for cloud host images, which can save the synchronization processing time of the cloud host images and avoid the problem of copy errors.
In a first aspect, an embodiment of the present invention provides a synchronization method for cloud host images, where the method includes:
receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In one embodiment, the receiving the mirror synchronization command includes:
receiving a mirror image synchronization instruction sent by a front-end browser;
or receiving mirror synchronization instructions sent by the control nodes of other available areas.
In one embodiment, after receiving the mirror synchronization instruction sent by the front-end browser, the method further includes:
acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas;
and sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
In a second aspect, an embodiment of the present invention provides a method for synchronizing a cloud host image, where the method includes:
receiving a cross-region synchronization instruction sent by control nodes in the same available region;
downloading cloud host mirror images from file servers of other available areas according to the cross-area synchronization instruction;
and storing the cloud host mirror image into a mirror storage volume which is mounted in advance.
In one embodiment, before the receiving the cross-zone synchronization command sent by the control nodes in the same available zone, the method further includes:
installing a service component in a file server; the service component is used for establishing a transmission channel between the file server and the control node in the same available area and a transmission channel between the file server and the non-file server in the same available area.
In a third aspect, an embodiment of the present invention provides a synchronization method for cloud host images, where the method includes:
receiving a synchronization instruction of the same region sent by control nodes of the same available region;
checking the synchronous instruction of the same region;
and if the verification is passed, downloading the cloud host mirror image from the file server in the same available area, and storing the cloud host mirror image into a preset mirror image storage directory.
In a fourth aspect, an embodiment of the present invention provides a synchronization apparatus for cloud host images, where the apparatus includes:
the mirror image synchronization instruction receiving module is used for receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
the cross-region synchronization instruction sending module is used for sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
the system comprises a same-region synchronization instruction sending module, a same-region synchronization instruction sending module and a same-region synchronization instruction sending module, wherein the same-region synchronization instruction sending module is used for sending a same-region synchronization instruction to a non-file server in the same available region according to a mirror image synchronization instruction; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In one embodiment, the receiving the mirror synchronization command includes:
receiving a mirror image synchronization instruction sent by a front-end browser;
or receiving mirror synchronization instructions sent by the control nodes of other available areas.
In one embodiment, the apparatus further comprises:
the configuration file acquisition module is used for acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas;
and the mirror image synchronization instruction sending module is used for sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
In a fifth aspect, an embodiment of the present invention provides a synchronization apparatus for cloud host images, where the apparatus includes:
the cross-region synchronization instruction receiving module is used for receiving cross-region synchronization instructions sent by control nodes in the same available region;
the first cloud host image downloading module is used for downloading cloud host images from file servers of other available areas according to the cross-area synchronous instruction;
and the cloud host mirror image storage module is used for storing the cloud host mirror image into a mirror image storage volume which is mounted in advance.
In one embodiment, the apparatus further comprises:
the service component installation module is used for installing the service components in the file server; the service component is used for establishing a control channel between the file server and the control node in the same available area, a transmission channel between the file server and a non-file server in the same available area, and a transmission channel between the file server and file servers in other available areas.
In a sixth aspect, an embodiment of the present invention provides a synchronization apparatus for cloud host images, where the apparatus includes:
the system comprises a same-region synchronization instruction receiving module, a synchronization instruction processing module and a synchronization instruction processing module, wherein the same-region synchronization instruction receiving module is used for receiving a same-region synchronization instruction sent by control nodes in the same available region;
the second cloud host image downloading module is used for downloading the cloud host image from the file server in the same available area and storing the cloud host image into a preset image storage directory;
and the mirror image checking module is used for checking the mirror image of the cloud host and feeding back the success of synchronization to the control node when the check is passed.
In a seventh aspect, an embodiment of the present invention provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps in the method as described above when executing the computer program.
In an eighth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the method as described above.
The synchronization method, the synchronization device and the storage medium of the cloud host mirror image receive a mirror image synchronization instruction; sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; and according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region. By the embodiment of the invention, cross-region synchronous processing and same-region synchronous processing of the cloud host mirror image can be realized, manual copying is not needed, time and labor are saved, and the problem of errors in manual copying can be avoided.
Drawings
FIG. 1 is a diagram of an application environment of a synchronization method for cloud host mirroring in one embodiment;
FIG. 2 is a flowchart illustrating a synchronization method for cloud host mirroring in one embodiment;
FIG. 3 is a schematic diagram of data transmission in one embodiment;
FIG. 4 is a flowchart illustrating a synchronization method for cloud host mirroring in another embodiment;
FIG. 5 is a flowchart illustrating a synchronization method for cloud host mirroring in another embodiment;
FIG. 6 is a block diagram of a synchronization apparatus for cloud host mirroring in one embodiment;
FIG. 7 is a block diagram of a synchronization apparatus for cloud host mirroring in one embodiment;
FIG. 8 is a block diagram of a synchronization apparatus for cloud host mirroring in one embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The cloud host mirror image synchronization method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a server cluster divided into a plurality of available zones. And each available area is provided with a control node, a file server and a non-file server. The file server is implemented by using an independent server or a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a synchronization method for cloud host images is provided, which is described by taking the method as an example for being applied to the control node in fig. 1, and includes the following steps:
step 201, receiving a mirror image synchronization instruction; and the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image.
In this embodiment, the control node receives the mirror image synchronization instruction, and then determines a synchronization processing mode of the cloud host mirror image according to a sending end of the mirror image synchronization instruction.
The first method is as follows: and receiving a mirror image synchronization instruction sent by a front-end browser. After receiving the mirror image synchronization instruction sent by the front-end browser, the control node of the available area calls the control nodes of other available areas to perform cross-area synchronization processing, that is, sends the mirror image synchronization instruction to the control nodes of other available areas, as shown in fig. 3. Meanwhile, the non-file servers in the same available area are subjected to the same area synchronization process, that is, step 203 is executed.
For example, the available area includes a test available area, a production available area, and a disaster recovery available area; the control node of the test available area receives a mirror image synchronization instruction sent by a front-end browser, and then the control node of the test available area respectively calls the control node of the production available area and the control node of the disaster recovery available area to perform cross-area synchronization processing; meanwhile, the non-file servers in the test available area are subjected to the same-area synchronization process, which is shown in fig. 3.
The second method comprises the following steps: and receiving mirror image synchronization commands sent by the control nodes of other available areas, and executing the step 202 and the step 203 in sequence by the control nodes of the available areas according to the mirror image synchronization commands.
For example, when the control node of the test available area calls the control node of the generated available area to perform cross-area synchronization processing, the control node of the production available area receives a mirror image synchronization instruction sent by the control node of the test available area. Then, the control node that produces the usable area executes step 202 and step 203 in order.
In one embodiment, after receiving the mirror synchronization instruction sent by the front-end browser, the method further includes: acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas; and sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
Specifically, a configuration file is set in the control node in advance, and network protocol addresses of the control nodes of other available areas are stored in the configuration file. After the control node receives a mirror image synchronization instruction sent by a front-end browser, network protocol addresses of control nodes of other available areas are obtained from a preset configuration file, the control nodes of the other available areas are called according to the obtained network protocol addresses, and the mirror image synchronization instruction is sent according to the obtained network protocol addresses.
For example, after receiving a mirror image synchronization instruction sent by a front-end browser, a control node in the test available area acquires a configuration file preset in the control node, where a network protocol address IP1 of the control node in the production available area and a network protocol address IP2 of the control node in the disaster recovery available area are stored in the configuration file. And then, the control node of the test available area sends a mirror image synchronization instruction to the control node of the production available area according to the network protocol address IP1, and sends a mirror image synchronization instruction to the control node of the disaster recovery available area according to the network protocol address IP 2.
The configuration file may also store an API (Application Programming Interface) of a control node in another available area.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
Specifically, the available area includes a test available area and a plurality of non-test available areas such as a production available area and a disaster recovery available area. The cloud host image testing method comprises the steps that a newly manufactured cloud host image and an updated cloud host image are stored in a testing available area, and a user-defined cloud host image is stored in a non-testing available area.
In practical application, the control node of the test available area may call the control node of the production available area and the control node of the disaster recovery available area, so as to synchronize the cloud host mirror image stored in the test available area to the production available area and the disaster recovery available area. However, in order to avoid affecting the newly manufactured cloud host mirror image and the updated cloud host mirror image, neither the control node of the production available area nor the disaster recovery available area can call the control node of the test available area, that is, neither the production available area nor the disaster recovery available area can synchronize the cloud host mirror image to the test available area. The production available area and the disaster recovery available area are both non-test available areas, the control node of the production available area can call the control node of the disaster recovery available area, and the control node of the disaster recovery available area can also call the control node of the production available area, that is, the production available area can synchronize the cloud host mirror image to the disaster recovery available area, and the disaster recovery available area can also synchronize the cloud host mirror image to the production available area. The non-test available area is not limited in detail in the embodiment of the invention, and can be set according to actual conditions.
Step 202, according to the mirror image synchronization instruction, sending a cross-region synchronization instruction to a first file server in the same available region; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located.
In this embodiment, if the control node receives the mirror synchronization instruction sent by the control node in another available area, the control node sends a cross-area synchronization instruction to the first file server in the same available area. And the first file server determines a second file server of an available area where the mirror image synchronization instruction sending end is located according to the cross-area synchronization instruction, and then downloads the cloud host mirror image from the second file server and stores the cloud host mirror image.
For example, the first file server is a file server that produces usable areas, and the second file server is a file server that tests the usable areas. And after receiving the mirror image synchronization instruction sent by the control node of the test available area, the control node of the production available area sends a cross-area synchronization instruction to the first file server. After receiving the cross-region synchronization instruction, the first file server determines a second server according to the cross-region synchronization instruction, then downloads the cloud host image from the second server, and stores the cloud host image, as shown in fig. 3. The storage position is not limited in detail in the embodiment of the invention, and can be set according to actual conditions.
In one embodiment, after the first file server downloads the cloud host image from the second file server, the control node in the same available area as the first file server feeds back the synchronization processing result to the control node in the same available area as the second file server.
For example, the first file server is a file server for producing the available area, the second file server is a file server for testing the available area, and after the first file server downloads the cloud host image from the second file server, the control node for producing the available area feeds back to the control node for testing the available area that the downloading of the cloud host image is completed.
Step 203, according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In this embodiment, after receiving a mirror image synchronization instruction sent by a front-end browser, a control node calls control nodes in other available areas to perform cross-area synchronization processing, and also performs same-area synchronization processing, that is, a cloud host mirror image stored by a file server in the same available area is distributed to each non-file server in the same available area. Specifically, a synchronization instruction of the same region is sent to the non-file servers of the same available region, and after receiving the synchronization instruction of the same region, the non-file servers of the same available region download the cloud host image from the file servers of the same available region and store the cloud host image.
For example, the first file server is a file server of the test available area, and after receiving the mirror image synchronization instruction sent by the front-end browser, the control node of the test available area sends the mirror image synchronization instruction to the control node of the production available area and the control node of the disaster recovery available area, and also sends the synchronization instruction of the same area to a non-file server in the test available area. After each non-file server of the test available area receives the synchronization instruction of the same area, the cloud host image is downloaded from the first file server, and the cloud host image is stored, which is shown in fig. 3. The non-file server downloads the cloud host mirror image from the file server and can adopt an Http file service mode, namely, the file server transmits the cloud host mirror image to the non-file server through an Http80 port.
Or after the first file server downloads the cloud host mirror image from the second file server and stores the cloud host mirror image, the control node sends a synchronization instruction of the same region to the non-file server in the same available region, and after receiving the synchronization instruction of the same region, the non-file server downloads and stores the cloud host mirror image from the first file server.
For example, the first file server is a file server of a production available area, the second file server is a file server of a test available area, after the first file server downloads a cloud host image from the second file server and stores the cloud host image, the control node of the production available area sends a synchronization instruction of the same area to the non-file server of the production available area, and after the non-file server of the production available area receives the synchronization instruction of the same area, the cloud host image is downloaded from the first file server and stored.
In one embodiment, after the non-file server downloads the cloud host image from the file server, the control node feeds back a synchronization processing result to a front-end browser or a control node in another available area.
For example, the first file server is a file server for testing the available area, and after the non-file server downloads the cloud host image from the file server, the control node for testing the available area feeds back the cloud host image distribution processing of the tested available area to the front-end browser. Or the first file server is a file server for producing the available area, the second file server is a file server for testing the available area, and after the first file server downloads and stores the cloud host mirror image from the second file server, the non-file server for producing the available area downloads and stores the cloud host mirror image from the first file server; and then, the control node of the production available area feeds back the cloud host image distribution processing of the finished production available area to the control node of the test available area.
In the synchronization method of the cloud host mirror image, the control node receives a mirror image synchronization instruction; sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; and according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region. By the embodiment of the invention, cross-region synchronous processing and same-region synchronous processing of the cloud host mirror image can be realized, manual copying is not needed, time and labor are saved, and the problem of errors in manual copying can be avoided. Furthermore, as each available area is provided with a control node and a file server, the control and the cloud host mirror image storage are classified, and the data security is improved.
In an embodiment, as shown in fig. 4, a synchronization method for cloud host images is provided, which is described by taking the method as an example for being applied to the file server in fig. 1, and includes the following steps:
step 301, receiving a cross-region synchronization instruction sent by a control node of the same available region.
In this embodiment, when performing synchronization processing of a cloud host image, a control node sends a cross-region synchronization instruction to a file server in the same available region, and the file server receives the cross-region synchronization instruction sent by the control node. For example, a file server of the test available area receives a cross-area synchronization instruction sent by a control node of the test available area; the file server of the production available area receives the cross-area synchronization command sent by the control node of the production available area, which is shown in fig. 3.
In one embodiment, before receiving the cross-zone synchronization instruction sent by the control nodes of the same available zone, the method further includes: installing a service component in a file server; the service component is used for establishing a control channel between the file server and the control node in the same available area, a transmission channel between the file server and a non-file server in the same available area, and a transmission channel between the file server and file servers in other available areas.
Specifically, the service component is pre-installed in the file server, after installation, the service component may establish a control channel between the control node and the file server in the same available area, and through the control channel, the control node may send a cross-area synchronization instruction to the file server. The service assembly can also establish a transmission channel between the file server and the non-file server in the same available area, and the non-file server can download the cloud host mirror image from the file server in the same available area through the transmission channel; and a transmission channel between the file server and the file servers in other available areas can be established, and the file server can download the cloud host images from the file servers in other available areas through the transmission channel.
For example, a service component is installed in a file server of a production available area in advance, the service component establishes a control channel between a control node and the file server in the production available area, a transmission channel between the file server of the production available area and a non-file server, and a transmission channel between the file server of the production available area and a file server of a test available area.
And 302, downloading the cloud host image from the file servers of other available areas according to the cross-area synchronization instruction.
In this embodiment, after receiving the cross-region synchronization instruction sent by the control node, the file server downloads the cloud host image from the file servers in other available regions. Specifically, the first file server is a server for downloading a cloud host image, and the second server is a file server of other available areas. And after receiving the mirror image synchronization instruction sent by the control nodes in other available areas, the control node in the same available area as the first file server sends a cross-area synchronization instruction to the first file server. After receiving the cross-region synchronization instruction, the first file server can determine an available region where the mirror image synchronization instruction sending end is located according to the cross-region synchronization instruction, so that the second file server is determined, and the cloud host mirror image is downloaded from the second file server.
For example, the file server that produces the usable area is the first file server, and the file server that tests the usable area is the second file server. And after the control node of the production available area receives the mirror image synchronization instruction sent by the control node of the test available area, the control node of the production available area sends a cross-area synchronization instruction to the first file server. After the first file server receives the cross-region synchronization instruction, the control node which sends the mirror image synchronization instruction and is used for testing the available region is determined according to the cross-region synchronization instruction, and then the cloud host mirror image is determined to be downloaded from the second file server which tests the available region.
Step 303, storing the cloud host mirror image into a mirror storage volume mounted in advance.
In this embodiment, the file server may mount the mirror storage volume in advance, that is, mount the hardware storage device in advance. And after the cloud host mirror image is downloaded, storing the cloud host mirror image into a mirror storage volume. After the cloud host mirror image is stored, the control node in the same available area can be fed back that the storage processing of the cloud host mirror image is completed.
In the synchronization method of the cloud host mirror image, a file server receives a cross-region synchronization instruction sent by control nodes in the same available region; downloading cloud host mirror images from file servers of other available areas according to the cross-area synchronization instruction; and storing the cloud host mirror image into a mirror storage volume which is mounted in advance. According to the embodiment of the invention, when the cross-region synchronization processing of the cloud host mirror image is carried out, the file server can automatically download the cloud host mirror image from the file servers of other available regions according to the cross-region synchronization instruction sent by the control node, and store the cloud host mirror image, so that not only is the time and labor saved, but also the problem of errors caused by manual copying can be avoided.
In an embodiment, as shown in fig. 5, a synchronization method for cloud host images is provided, which is described by taking the method as an example for being applied to the non-file server in fig. 1, and includes the following steps:
step 401, receiving a synchronization instruction of the same area sent by a control node of the same available area.
In this embodiment, the non-file server receives a synchronization instruction in the same area sent by the control node in the same available area. For example, the control node of the test available area receives the mirror synchronization command from the front-end browser, and then the control node of the test available area sends the same area synchronization command to the non-file server of the same available area. Or the control node of the production available area receives the mirror image synchronization instruction from the control node of the test available area, and then the control node of the production available area sends the synchronization instruction of the same area to the non-file server; and the non-file server receives the synchronization instruction of the same region sent by the control node.
Step 402, downloading a cloud host mirror image from a file server in the same available area, and storing the cloud host mirror image into a preset mirror image storage directory.
In the embodiment, a non-file server presets a mirror image storage directory, and downloads a cloud host mirror image from a file server in the same available area after receiving a synchronization instruction in the same area, namely downloads the cloud host mirror image from a mirror image storage volume mounted by the file server; and then, storing the cloud host image into an image storage catalog.
For example, the non-file server of the test available area downloads the cloud host image from the file server of the test available area and stores the cloud host image; alternatively, the non-file server of the production availability region downloads the cloud host image from the file server of the production availability region and stores the cloud host image.
And 403, checking the cloud host mirror image, and feeding back successful synchronization to the control node when the check is passed.
In this embodiment, after downloading the cloud host image, the non-file server may perform MD5 verification on the cloud host image. Specifically, performing MD5 operation on the cloud host mirror image, comparing an obtained calculation result with a preset check code, and determining that the check is passed if the calculation result is consistent with the check code; and if the calculation result is inconsistent with the check code, determining that the check fails.
After the verification is passed, the non-file server can feed back the downloading and storage of the cloud host mirror image to the control node in the same available area, namely, the feedback synchronization is successful. For example, the non-file server in the test available area feeds back the completed cloud host image synchronization processing to the control node in the test available area, and the control node in the test available area may feed back the completed cloud host image synchronization processing to the front-end browser.
After the verification fails, the non-file server may feed back the verification failure to the control node in the same available area. For example, the non-file server in the test available area feeds back a check failure to the control node in the test available area, and the control node in the test available area may retransmit the cloud host image, that is, the non-file server downloads the cloud host image again.
In the synchronization method of the cloud host mirror image, the non-file server receives a synchronization instruction of the same region sent by the control node of the same available region; downloading a cloud host mirror image from a file server in the same available area, and storing the cloud host mirror image into a preset mirror image storage directory; and verifying the cloud host mirror image, and feeding back the success of synchronization to the control node when the verification is passed. According to the embodiment of the invention, when the same-region synchronization processing of the cloud host mirror image is carried out, the non-file server can automatically download the cloud host mirror image from the file server in the same available region according to the same-region synchronization instruction sent by the control node, and store the cloud host mirror image, so that not only is the time and labor saved, but also the problem of errors caused by manual copying can be avoided.
It should be understood that although the various steps in the flowcharts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided a synchronization apparatus for cloud host mirroring, including:
a mirror image synchronization instruction receiving module 501, configured to receive a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
a cross-region synchronization instruction sending module 502, configured to send a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
a synchronization instruction sending module 503 for sending synchronization instructions of the same region to non-file servers of the same available region according to the mirror synchronization instruction; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In one embodiment, the receiving the mirror synchronization command includes:
receiving a mirror image synchronization instruction sent by a front-end browser;
or receiving mirror synchronization instructions sent by the control nodes of other available areas.
In one embodiment, the apparatus further comprises:
the configuration file acquisition module is used for acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas;
and the mirror image synchronization instruction sending module is used for sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
In one embodiment, as shown in fig. 7, there is provided a synchronization apparatus for cloud host mirroring, including:
a cross-region synchronization instruction receiving module 601, configured to receive a cross-region synchronization instruction sent by a control node in the same available region;
a first cloud host image downloading module 602, configured to download cloud host images from file servers of other available areas according to a cross-area synchronization instruction;
and a cloud host image storage module 602, configured to store the cloud host image in a pre-mounted image storage volume.
In one embodiment, the apparatus further comprises:
the service component installation module is used for installing the service components in the file server; the service component is used for establishing a control channel between the file server and the control node in the same available area, a transmission channel between the file server and a non-file server in the same available area, and a transmission channel between the file server and file servers in other available areas.
In one embodiment, as shown in fig. 8, there is provided a synchronization apparatus for cloud host mirroring, including:
a synchronization instruction receiving module 701, configured to receive synchronization instructions of the same region sent by control nodes in the same available region;
a second cloud host image downloading module 702, configured to download a cloud host image from a file server in the same available area, and store the cloud host image in a preset image storage directory;
the mirror image checking module 703 is configured to check the cloud host mirror image, and when the check is passed, feed back the synchronization success to the control node.
For specific limitations of the synchronization apparatus of the cloud host image, reference may be made to the above limitations of the synchronization method of the cloud host image, and details are not described herein again. The modules in the synchronization apparatus of the cloud host image may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing synchronous data of the cloud host mirror image. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a synchronization method of cloud host mirroring.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a mirror image synchronization instruction sent by a front-end browser;
or receiving mirror synchronization instructions sent by the control nodes of other available areas.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas;
and sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from the second file server and store the cloud host image, and the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a mirror image synchronization instruction sent by a front-end browser;
or receiving mirror synchronization instructions sent by the control nodes of other available areas.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of other available areas;
and sending mirror image synchronization instructions to the control nodes of other available areas according to the configuration file.
In one embodiment, the available region includes a test available region and a plurality of non-test available regions; the control node of the test available area transmits data to the control nodes of the plurality of non-test available areas in a unidirectional mode; and data is transmitted bidirectionally among the control nodes of the plurality of non-test available areas.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A synchronization method of cloud host images, the method comprising:
receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from a second file server and store the cloud host image, wherein the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
according to the mirror image synchronization instruction, sending a synchronization instruction of the same region to a non-file server of the same available region; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
2. The method of claim 1, wherein receiving the mirror synchronization instruction comprises:
receiving the mirror image synchronization instruction sent by a front-end browser;
or receiving the mirror image synchronization command sent by the control nodes of other available areas.
3. The method of claim 2, wherein after receiving the mirror synchronization instruction sent by the front-end browser, the method further comprises:
acquiring a preset configuration file; the configuration file stores the network protocol addresses of the control nodes of the other available areas;
and sending the mirror image synchronization instruction to the control nodes of the other available areas according to the configuration file.
4. The method of any of claims 1-3, wherein the available regions include a test available region and a plurality of non-test available regions; wherein the control node of the test available area transmits data to the control nodes of a plurality of non-test available areas in a unidirectional way; and data is transmitted bidirectionally among the control nodes of a plurality of the non-test available areas.
5. A synchronization method of cloud host images, the method comprising:
receiving a cross-region synchronization instruction sent by control nodes in the same available region;
downloading cloud host mirror images from file servers of other available areas according to the cross-area synchronization instruction;
and storing the cloud host mirror image into a mirror image storage volume which is mounted in advance.
6. The method according to claim 5, wherein before the receiving the cross-zone synchronization command sent by the control nodes of the same available zone, the method further comprises:
installing a service component in a file server; the service assembly is used for establishing a control channel between the file server and the control node in the same available area, a transmission channel between the file server and a non-file server in the same available area, and a transmission channel between the file server and file servers in other available areas.
7. A synchronization method of cloud host images, the method comprising:
receiving a synchronization instruction of the same region sent by control nodes of the same available region;
downloading a cloud host mirror image from a file server in the same available area, and storing the cloud host mirror image into a preset mirror image storage directory;
and checking the cloud host mirror image, and feeding back the successful synchronization to the control node when the check is passed.
8. A synchronization apparatus of a cloud host image, the apparatus comprising:
the mirror image synchronization instruction receiving module is used for receiving a mirror image synchronization instruction; the mirror image synchronization instruction is used for indicating the control node to perform synchronization processing of the cloud host mirror image;
the cross-region synchronization instruction sending module is used for sending a cross-region synchronization instruction to a first file server in the same available region according to the mirror image synchronization instruction; the cross-region synchronization instruction is used for instructing the first file server to download the cloud host image from a second file server and store the cloud host image, wherein the second file server is a file server of an available region where a sending end of the image synchronization instruction is located;
the same-region synchronization instruction sending module is used for sending the same-region synchronization instruction to the non-file server in the same available region according to the mirror image synchronization instruction; the same-zone synchronization instruction is used for instructing the non-file server to download the cloud host image from the first file server and store the cloud host image.
9. A synchronization apparatus of a cloud host image, the apparatus comprising:
the cross-region synchronization instruction receiving module is used for receiving cross-region synchronization instructions sent by control nodes in the same available region;
the first cloud host image downloading module is used for downloading cloud host images from file servers of other available areas according to the cross-area synchronous instruction;
and the cloud host mirror image storage module is used for storing the cloud host mirror image into a mirror image storage volume which is mounted in advance.
10. A synchronization apparatus of a cloud host image, the apparatus comprising:
the system comprises a same-region synchronization instruction receiving module, a synchronization instruction processing module and a synchronization instruction processing module, wherein the same-region synchronization instruction receiving module is used for receiving a same-region synchronization instruction sent by control nodes in the same available region;
the second cloud host image downloading module is used for downloading cloud host images from the file servers in the same available area and storing the cloud host images into a preset image storage directory;
and the mirror image checking module is used for checking the cloud host mirror image and feeding back the successful synchronization to the control node when the check is passed.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202010118395.0A 2020-02-26 2020-02-26 Cloud host mirror synchronization method, device and storage medium Active CN113315795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010118395.0A CN113315795B (en) 2020-02-26 2020-02-26 Cloud host mirror synchronization method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010118395.0A CN113315795B (en) 2020-02-26 2020-02-26 Cloud host mirror synchronization method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113315795A true CN113315795A (en) 2021-08-27
CN113315795B CN113315795B (en) 2024-03-05

Family

ID=77369946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010118395.0A Active CN113315795B (en) 2020-02-26 2020-02-26 Cloud host mirror synchronization method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113315795B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746924A (en) * 2021-09-06 2021-12-03 南方电网深圳数字电网研究院有限公司 Power grid service data trans-regional transmission method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239505A (en) * 2017-05-10 2017-10-10 广州杰赛科技股份有限公司 Cluster mirror image synchronization method and system
CN107247793A (en) * 2017-06-21 2017-10-13 平安科技(深圳)有限公司 The mirror image synchronization method and mirror image synchronization system in Docker mirror images warehouse
CN110071949A (en) * 2018-01-23 2019-07-30 阿里巴巴集团控股有限公司 A kind of system, the method and apparatus of across geographic area management calculating application
CN110502575A (en) * 2019-08-02 2019-11-26 阿里巴巴集团控股有限公司 A kind of method, apparatus and equipment that data are synchronous

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239505A (en) * 2017-05-10 2017-10-10 广州杰赛科技股份有限公司 Cluster mirror image synchronization method and system
CN107247793A (en) * 2017-06-21 2017-10-13 平安科技(深圳)有限公司 The mirror image synchronization method and mirror image synchronization system in Docker mirror images warehouse
CN110071949A (en) * 2018-01-23 2019-07-30 阿里巴巴集团控股有限公司 A kind of system, the method and apparatus of across geographic area management calculating application
CN110502575A (en) * 2019-08-02 2019-11-26 阿里巴巴集团控股有限公司 A kind of method, apparatus and equipment that data are synchronous

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746924A (en) * 2021-09-06 2021-12-03 南方电网深圳数字电网研究院有限公司 Power grid service data trans-regional transmission method and device

Also Published As

Publication number Publication date
CN113315795B (en) 2024-03-05

Similar Documents

Publication Publication Date Title
CN109788032B (en) Method and device for acquiring mirror image file, computer equipment and storage medium
CN110609732B (en) Application program deployment method and device, computer equipment and storage medium
CN111666081B (en) Git-based project version release method, device, equipment and medium
CN109257254B (en) Network connectivity checking method, device, computer equipment and storage medium
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN111104273A (en) Batch task-based automatic distribution testing method and device and computer equipment
CN110618819B (en) Method, device and computer equipment for automatic batch deployment of WINPE (WINPE) system
CN111866149A (en) Cluster deployment method and device, computer equipment and storage medium
CN111628886A (en) Method and device for building block chain network under private cloud environment, and computer equipment
CN110012082A (en) Embedded device and its upgrade method, controlling terminal
CN110881062A (en) File transmission method, device, equipment and storage medium based on big data
CN105512026A (en) Automatic batch testing method
CN113315795B (en) Cloud host mirror synchronization method, device and storage medium
CN115509756A (en) Multi-cluster computing task submitting method and related device and equipment
CN111159025B (en) Application program interface testing method and device, computer equipment and storage medium
CN111782447A (en) Batch test updating method and device based on SSH service and computer equipment
CN110647439B (en) Method and device for confirming block chain system deployment, computer equipment and storage medium
CN111580927A (en) Communication method and container communication system
CN114579473B (en) Application testing method, device, equipment and storage medium
CN116095064A (en) File downloading method, computer equipment and storage medium
CN114328275A (en) System testing method, device, computer equipment and storage medium
CN111338848B (en) Failure application copy processing method and device, computer equipment and storage medium
CN109783075A (en) Distributed task scheduling construction method based on jenkins, device, computer equipment
CN111198758A (en) SSH-based Windows software starting method and device and computer equipment
CN112181436A (en) Service deployment method, device, server and readable 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
GR01 Patent grant
GR01 Patent grant