CN114296874A - Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium - Google Patents

Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114296874A
CN114296874A CN202111621405.3A CN202111621405A CN114296874A CN 114296874 A CN114296874 A CN 114296874A CN 202111621405 A CN202111621405 A CN 202111621405A CN 114296874 A CN114296874 A CN 114296874A
Authority
CN
China
Prior art keywords
machine room
target
room
synchronization
determining
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
CN202111621405.3A
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.)
Shenzhen Weike Software Technology Co ltd
Original Assignee
Shenzhen Weike Software 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 Shenzhen Weike Software Technology Co ltd filed Critical Shenzhen Weike Software Technology Co ltd
Priority to CN202111621405.3A priority Critical patent/CN114296874A/en
Publication of CN114296874A publication Critical patent/CN114296874A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a cross-machine-room mirror image synchronization method, a cross-machine-room mirror image synchronization device, computer equipment and a storage medium. The method comprises the following steps: determining a first number of machines in all the machine rooms, and determining a first target machine room to manufacture target mirror images in all the machine rooms according to the first number; inquiring the second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine rooms to be synchronized according to the second number; inquiring the third number of machines in each synchronous source machine room with the target mirror images, and determining a third target machine room in the synchronous source machine room according to the third number; and taking the third target machine room as a synchronization source to synchronize the target mirror image of the second target machine room, and repeating the machine room determining process and the synchronization process until all the machine rooms are synchronized. Therefore, the influence on the service is reduced, the problem that the synchronization cannot be continued due to the synchronization fault of a certain machine room is solved, and the quick and efficient synchronous mirror image of each machine room is realized.

Description

Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of virtual machines, in particular to a cross-machine-room mirror image synchronization method and device, computer equipment and a storage medium.
Background
Because the traffic demands require a large number of images to boot the virtual machines to provide service, it is necessary to ensure that each room has a full number of images for high availability of the entire system.
The method is realized by firstly limiting a main computer room and manufacturing a mirror image, and then synchronizing the main computer room to other slave computer rooms, wherein the main computer room cannot be replaced at will, a synchronous link is fixed, the main computer room can only be synchronized to other slave computer rooms, and the synchronous mirror image has the problem of large bandwidth occupation, has great influence on the provision of service during the use peak period, and cannot continue the synchronization process when the main computer room is in a synchronous fault.
Disclosure of Invention
Embodiments of the present invention provide a cross-room mirror synchronization method, apparatus, computer device, and storage medium, so as to avoid the problem of fixed synchronization link, thereby reducing the impact on service services, and also avoiding the problem that synchronization cannot be continued due to a synchronization failure of a certain room.
In a first aspect, an embodiment of the present invention provides a cross-machine-room mirror synchronization method, where the method includes:
step A, determining a first number of machines in all machine rooms, and determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number;
b, inquiring a second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine rooms to be synchronized according to the second number;
step C, inquiring a third number of machines in each synchronous source machine room which already has the target mirror image, and determining a third target machine room in the synchronous source machine room according to the third number, wherein the synchronous source machine room comprises the first target machine room;
and D, taking the third target machine room as a synchronization source to synchronize the target mirror image of the second target machine room, and returning to execute the step B until all the machine rooms are synchronized.
Optionally, the determining, according to the first number, a first target machine room in all the machine rooms to manufacture a target mirror image includes:
determining the machine room with the minimum first number in all the machine rooms as the first target machine room;
determining a second target machine room in the machine rooms to be synchronized according to the second number comprises:
determining the machine room with the minimum second number in the machine rooms to be synchronized as the second target machine room;
determining a third target machine room in the synchronization source machine room according to the third number includes:
and determining the machine room with the minimum third number in the synchronous source machine room as the third target machine room.
Optionally, the querying a third number of machines in each synchronization source machine room that already has the target mirror, and determining a third target machine room in the synchronization source machine room according to the third number includes:
determining a target synchronization source machine room which is the same as the cloud manufacturer of the second target machine room in the synchronization source machine room;
and inquiring the fourth quantity of the machines in each target synchronous source machine room, and determining the third target machine room in the target synchronous source machine room according to the fourth quantity.
Optionally, the querying a third number of machines in each synchronization source machine room that already has the target mirror, and determining a third target machine room in the synchronization source machine room according to the third number, further includes:
and if the target synchronous source machine room does not exist in the synchronous source machine room, determining a third target machine room in the synchronous source machine room according to the third quantity.
Optionally, the synchronizing the target mirror image of the second target machine room with the third target machine room as a synchronization source includes:
and sending a synchronization source request to the synchronization service of the second target machine room through the third target machine room.
Optionally, after the sending, by the third target machine room, a synchronization source request to the synchronization service of the second target machine room, the method further includes:
adding the second target machine room into a synchronous task queue information table;
and inquiring the synchronous task queue information table according to a preset period to determine the synchronization condition of the second target machine room until synchronization is completed.
Optionally, after determining, in all the rooms according to the first number, that the first target room is the target mirror, the method further includes:
adding the first target machine room into a synchronous source list;
after the synchronization of the target mirror is performed on the second target machine room by taking the third target machine room as a synchronization source, the method further includes:
and adding the second target machine room into the synchronous source list so as to determine the synchronous source machine room according to the synchronous source list.
In a second aspect, an embodiment of the present invention further provides a cross-machine-room mirror synchronization apparatus, where the apparatus includes:
the first target machine room determining module is used for determining a first number of machines in all machine rooms and determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number;
the second target machine room determining module is used for inquiring the second number of the machines in each machine room to be synchronized and determining a second target machine room in the machine rooms to be synchronized according to the second number;
a third target machine room determining module, configured to query a third number of machines in each synchronization source machine room that already has the target mirror, and determine a third target machine room in the synchronization source machine room according to the third number, where the synchronization source machine room includes the first target machine room;
and the target mirror image synchronization module is used for performing target mirror image synchronization on the second target machine room by taking the third target machine room as a synchronization source and returning the third target machine room to the second target machine room determination module to continue executing the target mirror image synchronization until all machine rooms are synchronized.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the cross-room mirror synchronization method provided by any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for synchronizing images across machine rooms according to any embodiment of the present invention is implemented.
The embodiment of the invention provides a cross-machine-room mirror image synchronization method, which comprises the steps of firstly determining a first number of machines in all machine rooms, determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number, then respectively inquiring a second number of the machines in each machine room to be synchronized and a third number of the machines in each synchronization source machine room, determining a second target machine room in the machine rooms to be synchronized according to the second number, determining a third target machine room in the synchronization source machine rooms according to the third number, further using the third target machine room as a synchronization source to synchronize the target mirror images of the second target machine room, and then repeating the determining process and the synchronizing process of the second target machine room and the third target machine room until all the machine rooms are synchronized. The cross-machine-room mirror image synchronization method provided by the embodiment of the invention cancels the limitation on the main machine room, and avoids the problem of link fixation by determining the number of available servers of each machine room in real time and selecting a proper synchronization source and a proper synchronization object from the servers for synchronization, thereby reducing the influence on business service, avoiding the problem that the synchronization cannot be continued due to the synchronization fault of a certain machine room, and realizing the quick and efficient synchronization mirror image for each machine room.
Drawings
Fig. 1 is a flowchart of a cross-machine-room mirror synchronization method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a cross-machine-room mirror image synchronization device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, a first target room may be referred to as a second target room, and similarly, a second target room may be referred to as a first target room, without departing from the scope of the present application. Both the first target room and the second target room are target rooms, but they are not the same target room. The terms "first", "second", etc. are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
Fig. 1 is a flowchart of a cross-room mirror synchronization method according to an embodiment of the present invention. The embodiment is applicable to the case of performing mirror synchronization on a plurality of computer rooms, and the method may be executed by the device for mirror synchronization across computer rooms provided in the embodiment of the present invention, where the device may be implemented by hardware and/or software, and may be generally integrated in a computer device, and the computer device may specifically be a service center. As shown in fig. 1, the method specifically comprises the following steps:
s11, determining a first number of machines in all the machine rooms, and determining a first target machine room to manufacture target images in all the machine rooms according to the first number.
Specifically, at the beginning of the method, the machine, that is, the server, may first determine a first number of machines providing services in each machine room, then determine to obtain a first target machine room according to the first number, and provide the first target machine room to the administrator to make a target mirror (that is, a required mirror), so that the first target machine room may be used as a first synchronization source. Each machine room may need to provide a large amount of services for users, the provision of the services has network requirements, and the public network bandwidth of the machine room needs to be occupied, meanwhile, because the machine rooms have a cross-cloud condition, the cross-cloud machine rooms are synchronized only to go through the public network, and a high probability also causes that the services provided by the machine rooms are unavailable, and then the machine rooms with a first smaller number may be specifically determined as first target machine rooms, so as to further reduce the influence on the service services. Optionally, the determining, according to the first number, a first target machine room in all the machine rooms to manufacture a target mirror image includes: and determining the machine room with the smallest first number in all the machine rooms as the first target machine room so as to reduce the influence on the business service as much as possible, and specifically, obtaining the first target machine room by sequencing the first number (for example, from a small number to a large number).
S12, inquiring the second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine rooms to be synchronized according to the second number.
Specifically, after the first target machine room is determined and the target mirror image is manufactured or a synchronization process is completed, a second number of machines providing services in each machine room to be synchronized may be queried, and then a second target machine room is determined according to the second number, so that one machine room from the machine rooms to be synchronized may be selected as a synchronization object, where the machine room to be synchronized is a machine room that has not been synchronized in all the machine rooms. As described above, the machine room with the smaller second number may be specifically determined as the second target machine room, so as to further reduce the influence on the business service. Optionally, the determining a second target machine room in the machine rooms to be synchronized according to the second number includes: and determining the machine room with the minimum second number in the machine rooms to be synchronized as the second target machine room so as to reduce the influence on the business service as much as possible, and specifically, sorting the second number (for example, from a small number to a large number) to obtain the second target machine room.
S13, inquiring a third number of machines in each synchronization source machine room which already has the target mirror image, and determining a third target machine room in the synchronization source machine room according to the third number, wherein the synchronization source machine room comprises the first target machine room.
Specifically, after the second target machine room is determined, the third number of machines providing services in each synchronization source machine room may be queried, and then the third target machine room is determined according to the third number, so that one machine room may be selected from the synchronization source machine rooms as a synchronization source, where the synchronization source machine room is a machine room having a target mirror image in all the machine rooms, and specifically may include a first target machine room where the target mirror image is initially made, a second target machine room where synchronization is completed, and the like, and when the third target machine room is initially determined, the third target machine room is the first target machine room. As described above, the third target machine room may be determined as a machine room with a smaller third number, so as to further reduce the influence on the business service. Optionally, the determining a third target machine room in the synchronization source machine room according to the third number includes: and determining the machine room with the minimum third number in the synchronization source machine room as the third target machine room so as to reduce the influence on the service as much as possible, and specifically, obtaining the third target machine room by sorting the third number (for example, from a small number to a large number).
Optionally, the querying a third number of machines in each synchronization source machine room that already has the target mirror, and determining a third target machine room in the synchronization source machine room according to the third number includes: determining a target synchronization source machine room which is the same as the cloud manufacturer of the second target machine room in the synchronization source machine room; and inquiring the fourth quantity of the machines in each target synchronous source machine room, and determining the third target machine room in the target synchronous source machine room according to the fourth quantity. Specifically, when the second target machine room is synchronized, a machine room in the synchronization source machine room, which is the same as the cloud manufacturer of the second target machine room, may be preferentially selected, so as to further reduce the influence on the service. The target synchronization source machine rooms identical to the cloud manufacturer of the second target machine room may be determined in all the synchronization source machine rooms, and then the fourth number of machines providing services in each target synchronization source machine room is queried, so as to determine and obtain the third target machine room according to the fourth number. Specifically, each synchronous source machine room can be firstly grouped according to a cloud manufacturer, each group is sorted according to the number of machines, and then the group which is the same as the cloud manufacturer of the second target machine room is determined as the target group, so that the third target machine room can be determined according to the sorting result in the target group, and meanwhile, when the synchronous source machine room is updated at each subsequent time, a newly added synchronous source machine room can be added into the corresponding group and inserted into the sorting result according to the number of machines, so that the sorting process at each time is saved.
Further optionally, the querying a third number of machines in each synchronization source machine room that already has the target mirror, and determining a third target machine room in the synchronization source machine room according to the third number, further includes: and if the target synchronous source machine room does not exist in the synchronous source machine room, determining a third target machine room in the synchronous source machine room according to the third quantity. Specifically, if there is no target synchronization source room in all synchronization source rooms that is the same as the cloud manufacturer of the second target room, the third target room may be determined directly according to the third number of machines in each synchronization source room, and the specific process is described above and will not be described in detail here.
And S14, performing target mirror synchronization on the second target machine room by taking the third target machine room as a synchronization source, and returning to execute the step S12 until the synchronization of all machine rooms is completed.
Specifically, after the second target machine room and the third target machine room are determined, the third target machine room can be used as a synchronization source to perform target mirror synchronization on the second target machine room. After the synchronization is completed, the second target machine room may be updated from the machine room to be synchronized to the synchronization source machine room, and then the step S12 is executed to re-determine the second target machine room and the third target machine room to perform synchronization until the synchronization of all the machine rooms is completed.
Optionally, the synchronizing the target mirror image of the second target machine room with the third target machine room as a synchronization source includes: and sending a synchronization source request to the synchronization service of the second target machine room through the third target machine room. Further optionally, after the sending, by the third target machine room, a synchronization source request to the synchronization service of the second target machine room, the method further includes: adding the second target machine room into a synchronous task queue information table; and inquiring the synchronous task queue information table according to a preset period to determine the synchronization condition of the second target machine room until synchronization is completed. Specifically, after the second target machine room and the third target machine room are determined, the third target machine room can be used as a synchronization source to send a synchronization source request to a synchronization service of the second target machine room so as to request synchronization, meanwhile, after synchronization is started, the second target machine room can be added into the synchronization task queue information table, then, the synchronization condition of the second target machine room can be checked by continuously inquiring the synchronization task queue information table according to a preset period, such as the stepping degree, whether synchronization is successful or not, and the like, until synchronization is completed, the second target machine room can be updated to be the synchronization source machine room, and can be removed from the synchronization task queue information table.
On the basis of the foregoing technical solution, optionally, after determining, according to the first number, that the first target equipment room is manufactured into the target mirror image in all the equipment rooms, the method further includes: adding the first target machine room into a synchronous source list; after the synchronization of the target mirror is performed on the second target machine room by taking the third target machine room as a synchronization source, the method further includes: and adding the second target machine room into the synchronous source list so as to determine the synchronous source machine room according to the synchronous source list. Specifically, after the first target machine room which can be used as the synchronization source and the second target machine room which is synchronized are obtained, the corresponding machine rooms can be added into the synchronization source list, so that a third target machine room which is newly used as the synchronization source can be determined from the synchronization source list in the following process.
According to the technical scheme provided by the embodiment of the invention, the first number of machines in all the machine rooms is determined, the first target machine room is determined to manufacture the target mirror image in all the machine rooms according to the first number, then the second number of the machines in each machine room to be synchronized and the third number of the machines in each synchronization source machine room are respectively inquired, the second target machine room is determined in the machine rooms to be synchronized according to the second number, the third target machine room is determined in the synchronization source machine room according to the third number, so that the third target machine room is used as a synchronization source to synchronize the target mirror image of the second target machine room, and the determining process and the synchronizing process of the second target machine room and the third target machine room are repeated until the synchronization of all the machine rooms is completed. The technical scheme provided by the embodiment of the invention cancels the limitation to the main computer room, and avoids the problem of fixed link by determining the number of the servers available for each computer room in real time and selecting the proper synchronization source and synchronization object from the servers for synchronization, thereby reducing the influence on the service, avoiding the problem of incapability of continuing synchronization due to the synchronization fault of a certain computer room, and realizing the quick and efficient synchronous mirroring for each computer room.
Example two
Fig. 2 is a schematic structural diagram of a cross-machine-room mirror synchronization apparatus according to a second embodiment of the present invention, where the apparatus may be implemented in a hardware and/or software manner, and may be generally integrated in a computer device, and is used to execute the cross-machine-room mirror synchronization method according to any embodiment of the present invention. As shown in fig. 2, the apparatus includes:
the first target machine room determining module 21 is configured to determine a first number of machines in all machine rooms, and determine a first target machine room to make a target mirror image in all machine rooms according to the first number;
the second target machine room determining module 22 is configured to query a second number of machines in each machine room to be synchronized, and determine a second target machine room in the machine rooms to be synchronized according to the second number;
a third target machine room determining module 23, configured to query a third number of machines in each synchronization source machine room that already possesses the target mirror, and determine a third target machine room in the synchronization source machine room according to the third number, where the synchronization source machine room includes the first target machine room;
and a target mirror image synchronization module 24, configured to perform target mirror image synchronization on the second target machine room by using the third target machine room as a synchronization source, and return to the second target machine room determination module to continue execution until synchronization of all machine rooms is completed.
According to the technical scheme provided by the embodiment of the invention, the first number of machines in all the machine rooms is determined, the first target machine room is determined to manufacture the target mirror image in all the machine rooms according to the first number, then the second number of the machines in each machine room to be synchronized and the third number of the machines in each synchronization source machine room are respectively inquired, the second target machine room is determined in the machine rooms to be synchronized according to the second number, the third target machine room is determined in the synchronization source machine room according to the third number, so that the third target machine room is used as a synchronization source to synchronize the target mirror image of the second target machine room, and the determining process and the synchronizing process of the second target machine room and the third target machine room are repeated until the synchronization of all the machine rooms is completed. The technical scheme provided by the embodiment of the invention cancels the limitation to the main computer room, and avoids the problem of fixed link by determining the number of the servers available for each computer room in real time and selecting the proper synchronization source and synchronization object from the servers for synchronization, thereby reducing the influence on the service, avoiding the problem of incapability of continuing synchronization due to the synchronization fault of a certain computer room, and realizing the quick and efficient synchronous mirroring for each computer room.
On the basis of the above technical solution, optionally, the first target machine room determining module 21 is specifically configured to:
determining the machine room with the minimum first number in all the machine rooms as the first target machine room;
the second target machine room determining module 22 is specifically configured to:
determining the machine room with the minimum second number in the machine rooms to be synchronized as the second target machine room;
the third target machine room determining module 23 is specifically configured to:
and determining the machine room with the minimum third number in the synchronous source machine room as the third target machine room.
On the basis of the foregoing technical solution, optionally, the third target machine room determining module 23 includes:
a target synchronization source machine room determining unit, configured to determine, in the synchronization source machine room, a target synchronization source machine room that is the same as the cloud manufacturer of the second target machine room;
the first determining unit is configured to query a fourth number of machines in each target synchronization source machine room, and determine the third target machine room in the target synchronization source machine room according to the fourth number.
On the basis of the foregoing technical solution, optionally, the third target machine room determining module 23 further includes:
a second determining unit, configured to determine, if the target synchronization source machine room does not exist in the synchronization source machine room, a third target machine room in the synchronization source machine room according to the third number.
On the basis of the foregoing technical solution, optionally, the target mirror synchronization module 24 includes:
a synchronization source request sending unit, configured to send a synchronization source request to the synchronization service of the second target equipment room through the third target equipment room.
On the basis of the above technical solution, optionally, the target mirror synchronization module 24 further includes:
an information table adding unit, configured to add the second target machine room to a synchronous task queue information table after the third target machine room sends a synchronization source request to the synchronization service of the second target machine room;
and the information table query unit is used for querying the synchronous task queue information table according to a preset period so as to determine the synchronization condition of the second target machine room until synchronization is completed.
On the basis of the above technical solution, optionally, the cross-machine-room mirror image synchronization device further includes:
a first synchronization source list adding module, configured to add a first target machine room to a synchronization source list after determining that a first target machine room makes a target mirror image in all machine rooms according to the first number;
and a second synchronization source list adding module, configured to add the second target machine room to the synchronization source list after the third target machine room is used as a synchronization source to synchronize the target mirror image in the second target machine room, so as to determine the synchronization source machine room according to the synchronization source list.
The cross-machine-room mirror image synchronization device provided by the embodiment of the invention can execute the cross-machine-room mirror image synchronization method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the above embodiment of the cross-machine-room mirror synchronization apparatus, each included unit and module are only divided according to functional logic, but are not limited to the above division, as long as corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a computer device provided in the third embodiment of the present invention, and shows a block diagram of an exemplary computer device suitable for implementing the embodiment of the present invention. The computer device shown in fig. 3 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention. As shown in fig. 3, the computer apparatus includes a processor 31, a memory 32, an input device 33, and an output device 34; the number of the processors 31 in the computer device may be one or more, one processor 31 is taken as an example in fig. 3, the processor 31, the memory 32, the input device 33 and the output device 34 in the computer device may be connected by a bus or in other ways, and the connection by the bus is taken as an example in fig. 3.
The memory 32 is a computer-readable storage medium, and can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the cross-room mirror synchronization method in the embodiment of the present invention (for example, the first target room determining module 21, the second target room determining module 22, the third target room determining module 23, and the target mirror synchronization module 24 in the cross-room mirror synchronization apparatus). The processor 31 executes various functional applications and data processing of the computer device by running software programs, instructions and modules stored in the memory 32, that is, the cross-room mirror synchronization method described above is realized.
The memory 32 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 32 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 32 may further include memory located remotely from the processor 31, which may be connected to a computer device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 33 may be used to acquire the number of available servers in each room in real time, and to generate key signal inputs related to user settings and function control of the computer apparatus, and the like. The output device 34 may be used to send synchronization tasks to the rooms, etc.
Example four
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a cross-room mirror synchronization method, where the method includes:
step A, determining a first number of machines in all machine rooms, and determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number;
b, inquiring a second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine rooms to be synchronized according to the second number;
step C, inquiring a third number of machines in each synchronous source machine room which already has the target mirror image, and determining a third target machine room in the synchronous source machine room according to the third number, wherein the synchronous source machine room comprises the first target machine room;
and D, taking the third target machine room as a synchronization source to synchronize the target mirror image of the second target machine room, and returning to execute the step B until all the machine rooms are synchronized.
The storage medium may be any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lambda (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network (such as the internet). The second computer system may provide the program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the cross-machine-room mirror synchronization method provided in any embodiment of the present invention.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A cross-machine room mirror image synchronization method is characterized by comprising the following steps:
step A, determining a first number of machines in all machine rooms, and determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number;
b, inquiring a second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine rooms to be synchronized according to the second number;
step C, inquiring a third number of machines in each synchronous source machine room which already has the target mirror image, and determining a third target machine room in the synchronous source machine room according to the third number, wherein the synchronous source machine room comprises the first target machine room;
and D, taking the third target machine room as a synchronization source to synchronize the target mirror image of the second target machine room, and returning to execute the step B until all the machine rooms are synchronized.
2. The method according to claim 1, wherein the determining a first target machine room production target image in all machine rooms according to the first number comprises:
determining the machine room with the minimum first number in all the machine rooms as the first target machine room;
determining a second target machine room in the machine rooms to be synchronized according to the second number comprises:
determining the machine room with the minimum second number in the machine rooms to be synchronized as the second target machine room;
determining a third target machine room in the synchronization source machine room according to the third number includes:
and determining the machine room with the minimum third number in the synchronous source machine room as the third target machine room.
3. The cross-room mirror synchronization method according to claim 1, wherein the querying a third number of machines in each synchronization source room that already owns the target mirror, and determining a third target room in the synchronization source room according to the third number comprises:
determining a target synchronization source machine room which is the same as the cloud manufacturer of the second target machine room in the synchronization source machine room;
and inquiring the fourth quantity of the machines in each target synchronous source machine room, and determining the third target machine room in the target synchronous source machine room according to the fourth quantity.
4. The cross-room mirror synchronization method according to claim 3, wherein the querying a third number of machines in each synchronization source room that already owns the target mirror, and determining a third target room in the synchronization source room according to the third number, further comprises:
and if the target synchronous source machine room does not exist in the synchronous source machine room, determining a third target machine room in the synchronous source machine room according to the third quantity.
5. The cross-room mirror synchronization method according to claim 1, wherein the synchronizing the target mirror with the third target room as a synchronization source to the second target room comprises:
and sending a synchronization source request to the synchronization service of the second target machine room through the third target machine room.
6. The cross-room mirror synchronization method of claim 5, further comprising, after the sending a synchronization source request to the synchronization service of the second target room through the third target room:
adding the second target machine room into a synchronous task queue information table;
and inquiring the synchronous task queue information table according to a preset period to determine the synchronization condition of the second target machine room until synchronization is completed.
7. The cross-room mirror synchronization method according to claim 1, after determining the first target room in all rooms according to the first number to make the target mirror, further comprising:
adding the first target machine room into a synchronous source list;
after the synchronization of the target mirror is performed on the second target machine room by taking the third target machine room as a synchronization source, the method further includes:
and adding the second target machine room into the synchronous source list so as to determine the synchronous source machine room according to the synchronous source list.
8. A cross-machine-room mirror synchronization device, comprising:
the first target machine room determining module is used for determining a first number of machines in all machine rooms and determining a first target machine room to manufacture target mirror images in all machine rooms according to the first number;
the second target machine room determining module is used for inquiring the second number of the machines in each machine room to be synchronized and determining a second target machine room in the machine rooms to be synchronized according to the second number;
a third target machine room determining module, configured to query a third number of machines in each synchronization source machine room that already has the target mirror, and determine a third target machine room in the synchronization source machine room according to the third number, where the synchronization source machine room includes the first target machine room;
and the target mirror image synchronization module is used for performing target mirror image synchronization on the second target machine room by taking the third target machine room as a synchronization source and returning the third target machine room to the second target machine room determination module to continue executing the target mirror image synchronization until all machine rooms are synchronized.
9. A computer device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the cross-room mirror synchronization method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a cross-room mirror synchronization method according to any one of claims 1 to 7.
CN202111621405.3A 2021-12-28 2021-12-28 Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium Pending CN114296874A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111621405.3A CN114296874A (en) 2021-12-28 2021-12-28 Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111621405.3A CN114296874A (en) 2021-12-28 2021-12-28 Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114296874A true CN114296874A (en) 2022-04-08

Family

ID=80968959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111621405.3A Pending CN114296874A (en) 2021-12-28 2021-12-28 Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114296874A (en)

Similar Documents

Publication Publication Date Title
CN109032796B (en) Data processing method and device
EP3713195B1 (en) Log processing method, related device, and system
CN112583931A (en) Message processing method, message middleware, electronic device and storage medium
WO2022134797A1 (en) Data fragmentation storage method and apparatus, a computer device, and a storage medium
EP3786802A1 (en) Method and device for failover in hbase system
KR20020013401A (en) Merge protocol for clustered computer system
CN109508912B (en) Service scheduling method, device, equipment and storage medium
CN114546493A (en) Core sharing method and device, processing core, electronic device and medium
CN113810216A (en) Cluster fault switching method and device and electronic equipment
CN113094431A (en) Read-write separation method and device and server
CN116954816A (en) Container cluster control method, device, equipment and computer storage medium
CN114979286A (en) Access control method, device and equipment for container service and computer storage medium
US10776392B2 (en) Apparatus and method to establish a connection between apparatuses while synchronization of connection information thereof is suspended
CN111813795B (en) Method and apparatus for confirming transactions in a blockchain network
CN110113217B (en) Micro-service management method, device, management platform and storage medium
CN110798492B (en) Data storage method and device and data processing system
CN110798358A (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN114296874A (en) Cross-machine-room mirror image synchronization method and device, computer equipment and storage medium
CN114205354A (en) Event management system, event management method, server, and storage medium
CN112764897B (en) Task request processing method, device and system and computer readable storage medium
CN115150457A (en) Micro-service management method, vehicle-mounted system and vehicle-mounted equipment
CN114706923A (en) Data synchronization method and device, electronic equipment and storage medium
CN112306962B (en) File copying method, device and storage medium in computer cluster system
CN114221971A (en) Data synchronization method, device, server, storage medium and product
CN113743564B (en) Counting method, counting device, electronic 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518000 702, block 5D, software industry base, 14 Haitian 2nd Road, Binhai community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Weike Software Technology Co.,Ltd.

Address before: 518000 7022, block 5D, software industry base, No. 14, Haitian Second Road, Binhai community, Yuehai street, Nanshan District, Shenzhen, Guangdong

Applicant before: Shenzhen Weike Software Technology Co.,Ltd.