CN114385573A - Method and device for initializing DRBD block device, computer device and storage medium - Google Patents

Method and device for initializing DRBD block device, computer device and storage medium Download PDF

Info

Publication number
CN114385573A
CN114385573A CN202210285369.6A CN202210285369A CN114385573A CN 114385573 A CN114385573 A CN 114385573A CN 202210285369 A CN202210285369 A CN 202210285369A CN 114385573 A CN114385573 A CN 114385573A
Authority
CN
China
Prior art keywords
drbd
data
synchronization
range
data 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.)
Pending
Application number
CN202210285369.6A
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.)
Guangdong Eflycloud Computing Co Ltd
Original Assignee
Guangdong Eflycloud Computing 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 Guangdong Eflycloud Computing Co Ltd filed Critical Guangdong Eflycloud Computing Co Ltd
Priority to CN202210285369.6A priority Critical patent/CN114385573A/en
Publication of CN114385573A publication Critical patent/CN114385573A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems

Abstract

The application relates to a method and a device for initializing DRBD block equipment, computer equipment and a storage medium, wherein the method comprises the following steps: adding an initialization management module and a configuration file in the DRBD, and setting a data synchronization range in the configuration file; loading the configuration file by an initialization management module to obtain the data synchronization range; and according to the data synchronization range, the DRBD executes data synchronization of the master copy block device and the slave copy block device. The data synchronization range of the master copy block device and the slave copy block device is set by the DRBD through adding the initialization management module and the configuration file in the DRBD, and then the data synchronization of the master copy block device and the slave copy block device is executed by the DRBD according to the data synchronization range, so that the data range can be flexibly set according to the actual situation, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.

Description

Method and device for initializing DRBD block device, computer device and storage medium
Technical Field
The present application relates to the field of data copy technologies, and in particular, to a method and an apparatus for initializing a DRBD block device, a computer device, and a storage medium.
Background
Drbd (distributed Replicated Block device) is a distributed Block device replication scheme, and data at one end of a network is Replicated to the other end of the network in a synchronous, semi-synchronous or asynchronous manner, so as to ensure reliability.
As shown in fig. 1, the DRBD relates to two block devices, which are divided into a master copy and a slave copy, wherein only the master copy can receive a read/write request of a file system, and the slave copy passively receives a data synchronization request of the master copy, so that the dual-copy data consistency is finally achieved. When creating a DRBD chunk device, initialization needs to be performed on the DRBD chunk device so that the master-slave copy (master copy and slave copy) is data-consistent. As shown in fig. 2, since two block devices do not have corresponding synchronization flag bits, the DRBD performs data synchronization on the master and slave copies of the block devices in a full-volume synchronization manner, i.e., the data of the master copy device is completely synchronized to the slave copy device. At present, the capacity of a disk generally enters a TB level, the full synchronization of the disk at the TB level is a time-consuming process, and in addition, the data synchronization of the DRBD is carried out based on a network, so that the synchronization process is more time-consuming, and the efficiency of deploying the DRBD is greatly reduced. In practical application, in an initialization stage, two block devices often contain only invalid data or partially valid data, full synchronization does not need to be performed at all, full synchronization is performed indiscriminately during initialization, and a synchronized data range cannot be set as required.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for initializing a DRBD block device, a computer device, and a storage medium, so as to solve the problems that, when a DRBD is initialized at present, full synchronization is indiscriminately performed, a synchronized data range cannot be set as required, time consumption is high, and efficiency of deploying the DRBD is reduced.
In order to solve the above technical problem, the present application provides a method for initializing a DRBD block device, which adopts the following technical solutions:
adding an initialization management module and a configuration file in the DRBD, and setting a data synchronization range in the configuration file;
loading the configuration file by an initialization management module to obtain the data synchronization range;
and according to the data synchronization range, the DRBD executes data synchronization of the master copy block device and the slave copy block device.
Further, the data synchronization range includes: no synchronization, full synchronization, partial synchronization, or custom synchronization.
Further, the step of adding an initialization management module and a configuration file to the DRBD, and setting the data synchronization range in the configuration file specifically includes:
dynamically creating an initialization management module and a configuration file;
adding an initialization management module and a configuration file in the DRBD;
and setting a data synchronization range in the configuration file.
Further, the step of performing, by the DRBD, data synchronization of the master and slave duplicate block devices according to the data synchronization range specifically includes:
judging the value of the data synchronization range, and if the data synchronization range is non-synchronous, the primary copy does not need to synchronize data to the secondary copy; if the data synchronization range is full synchronization, the master copy needs to synchronize all data to the slave copy; if the data synchronization range is local synchronization, determining a data range needing synchronization according to the defined data range; and if the data synchronization range is the custom synchronization, determining the data range needing synchronization according to the specific data range of the custom synchronization.
Further, before the step of adding an initialization management module and a configuration file to the DRBD, setting a data synchronization range in the configuration file, the method further includes:
the md5 value of the data for which the primary replica needs to synchronize is calculated as the first md5 value.
Further, after the step of performing data synchronization of the master and slave duplicate block devices according to the data synchronization range, the DRBD further includes:
calculating the md5 value of the synchronized data from the primary replica to be a second md5 value, and returning the second md5 value to the primary replica;
the primary replica compares the difference of the first md5 value with the second md5 value, and if the difference is 0, the synchronization is correct, otherwise it is incorrect.
In order to solve the above technical problem, the present application further provides an apparatus for initializing a DRBD block device, which adopts the following technical solution, including:
the initialization module is used for adding an initialization management module and a configuration file in the DRBD, and setting a data synchronization range in the configuration file;
the loading module is used for initializing the management module to load the configuration file to obtain the data synchronization range;
and the synchronization module is used for executing data synchronization of the master and slave duplicate block devices according to the data synchronization range by the DRBD.
Further, the initialization module includes:
the initialization management module is used for initializing data synchronization of the DRBD master copy and the DRBD slave copy;
and the configuration module is used for configuring the data synchronization of the DRBD master copy and the DRBD slave copy.
In order to solve the above technical problem, the present application further provides a computer device, which adopts the following technical scheme:
the method comprises a memory and a processor, wherein the memory stores computer readable instructions, and the processor realizes the steps of the DRBD block device initialization method when executing the computer readable instructions.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, which adopts the following technical solution, including:
the computer readable storage medium has stored thereon computer readable instructions which, when executed by a processor, implement the steps of the DRBD block device initialization method described above.
Compared with the prior art, the application mainly has the following beneficial effects: the data synchronization range of the master copy block device and the slave copy block device is set by the DRBD through adding the initialization management module and the configuration file in the DRBD, and then the data synchronization of the master copy block device and the slave copy block device is executed by the DRBD according to the data synchronization range, so that the data range can be flexibly set according to the actual situation, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a data synchronization schematic diagram of a DRBD block device;
fig. 2 is a data synchronization flowchart of a DRBD block device in the prior art;
FIG. 3 is an exemplary system architecture diagram to which the present application may be applied;
fig. 4 is a data synchronization flowchart of the DRBD block device of the present application;
fig. 5 is a flowchart of one embodiment of a DRBD block device initialization method of the present application;
fig. 6 is a schematic structural diagram of an embodiment of a DRBD block device initialization apparatus of the present application;
FIG. 7 is a block diagram of one embodiment of a computer device of the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
Example one
FIG. 3 is an exemplary system architecture diagram in which the present application may be applied. As shown in fig. 3, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium of communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the first terminal device 101, the second terminal device 102, the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a background server that provides support for pages displayed on the first terminal apparatus 101, the second terminal apparatus 102, and the third terminal apparatus 103.
It should be noted that the DRBD block device initialization method provided in the embodiments of the present application is generally executed by a server/terminal device, and accordingly, the DRBD block device initialization apparatus is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 3 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Example two
Fig. 4 is a data synchronization flowchart of the DRBD block device of the present application. As shown in fig. 4, the DRBD block device data synchronization process of the present application includes:
the configuration file defines a data synchronization range;
initializing the DRBD;
loading a configuration file by an initialization management module;
the DRBD performs on-demand synchronization, performing synchronization of the master replica to the slave replica, according to the data synchronization range.
Continuing to refer to fig. 5, a flowchart of an embodiment of a DRBD block device initialization method of the present application is shown. The DRBD block device initialization method comprises the following steps:
step S201, add an initialization management module and a configuration file in the DRBD, and set a data synchronization range in the configuration file.
In this embodiment, an initialization management module and a configuration file are added to the DRBD, and the step of setting the data synchronization range in the configuration file specifically includes:
dynamically creating an initialization management module and a configuration file;
adding an initialization management module and a configuration file in the DRBD;
and setting a data synchronization range in the configuration file.
The data synchronization range includes: no synchronization, full synchronization, partial synchronization, or custom synchronization.
The configuration file can be defined as a txt file, an html file, an xml file and the like according to actual needs. Out-of-sync means that the master and slave copies in a DRBD do not directly need to synchronize data. Full synchronization means that the primary and secondary copies in the DRBD directly need to synchronize all the data on the primary copy. Local synchronization means that a range of data, which is specified in a configuration file, for example, a segment of data, may be continuous or discontinuous, needs to be synchronized between the master copy and the slave copy in the DRBD. Custom synchronization means that there is a need to synchronize between the master and slave copies in DRBD no regularly traceable, user-defined, possibly continuous or discontinuous data, this range also being illustrated in the configuration file.
In this embodiment, the electronic device (e.g., the server/terminal device shown in fig. 1) on which the DRBD block device initialization method operates may receive the DRBD block device initialization request through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a wimax bd block device initialization connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step S202, initializing a management module to load the configuration file and obtaining the data synchronization range.
In this embodiment, the step of loading the configuration file by the initialization management module and obtaining the data synchronization range specifically includes:
the initialization management module loads the configuration file, that is, the initialization management module dynamically opens the configuration file, reads the data synchronization range, and analyzes the value of the data synchronization range, for example, whether the value is one of no synchronization, full synchronization, local synchronization, or custom synchronization, and if not, it indicates that the configuration file fails to be opened.
Step S203, according to the data synchronization range, the DRBD performs data synchronization of the master and slave duplicate block devices.
In this embodiment, the step of performing, by the DRBD, data synchronization of the master and slave duplicate block devices according to the data synchronization range specifically includes:
judging the value of the data synchronization range, and if the data synchronization range is non-synchronous, the primary copy does not need to synchronize data to the secondary copy; if the data synchronization range is full synchronization, the master copy needs to synchronize all data to the slave copy; if the data synchronization range is local synchronization, determining a data range needing synchronization according to the defined data range; and if the data synchronization range is the custom synchronization, determining the data range needing synchronization according to the specific data range of the custom synchronization. In some optional implementations, in step S201, adding an initialization management module and a configuration file to the DRBD, and before the step of setting the data synchronization range in the configuration file, the method further includes:
the md5 value of the data for which the primary replica needs to synchronize is calculated as the first md5 value.
The md5 value of the data which needs to be synchronized by the primary copy is calculated in advance, so that a data basis is provided for judging whether the data synchronization is correct or not after the subsequent synchronization is completed.
In some optional implementations, in step 203, after the DRBD performs data synchronization of the master and slave counterpart block devices according to the data synchronization range, the electronic device may perform the following steps:
calculating the md5 value of the synchronized data from the primary replica to be a second md5 value, and returning the second md5 value to the primary replica;
the primary replica compares the difference of the first md5 value with the second md5 value, and if the difference is 0, the synchronization is correct, otherwise it is incorrect.
Before the application is synchronized, the master copy calculates the md5 value of the data needing synchronization. After the data synchronization is completed, the md5 value of the synchronized data is computed from the replicas and returned to the primary replica. The master copy compares the md5 value calculated by the master copy with the md5 value returned by the slave copy, and judges the correctness of synchronization according to whether the two values are consistent, if the two values are identical, the synchronization is correct, otherwise, the synchronization is incorrect. This further determines whether the data synchronization is correct.
The embodiment defines the data range to be synchronized by adding an initialization management module and using a text configuration file before initialization, and the data range can be but is not limited to be defined as no synchronization, full synchronization, local synchronization and custom synchronization. If no synchronization exists, the content of the configuration file is edited to be 'none'; editing the content of the configuration file to be 'all' if the full synchronization is carried out; local synchronization the editable profile content is "0-mGB", meaning that only data in the range of 0-mGB need be synchronized, and the units can be KB, MB, GB, TB. When the initialization is executed, the initialization management module loads a defined configuration file so as to determine the data range of the master copy needing synchronization, and the data of the master copy is synchronized to the slave copy according to the range. The data range can be flexibly set according to actual conditions, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
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 associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures 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 may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
EXAMPLE III
With further reference to fig. 6, as an implementation of the method shown in fig. 5, the present application provides an embodiment of an apparatus for initializing a DRBD block device, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 5, and the apparatus may be applied to various electronic devices.
As shown in fig. 6, the DRBD block device initializing apparatus 400 according to this embodiment includes: an initialization module 401, a loading module 402, and a synchronization module 403. Wherein:
the initialization module 401 is configured to add an initialization management module and a configuration file to the DRBD, and set a data synchronization range in the configuration file;
the loading module 402 is configured to initialize a management module to load the configuration file, and obtain the data synchronization range;
the synchronization module 403 is configured to perform data synchronization of the master and slave duplicate block devices according to the data synchronization range.
In this embodiment, the initialization module 401 includes:
the initialization management module 4011 is configured to initialize data synchronization between the DRBD master copy and the DRBD slave copy;
a configuration module 4012, configured to synchronize data of the DRBD master copy and the DRBD slave copy.
The embodiment defines the data range to be synchronized by adding an initialization management module and using a text configuration file before initialization, and the data range can be but is not limited to be defined as no synchronization, full synchronization, local synchronization and custom synchronization. If no synchronization exists, the content of the configuration file is edited to be 'none'; editing the content of the configuration file to be 'all' if the full synchronization is carried out; local synchronization the editable profile content is "0-mGB", meaning that only data in the range of 0-mGB need be synchronized, and the units can be KB, MB, GB, TB. When the initialization is executed, the initialization management module loads a defined configuration file so as to determine the data range of the master copy needing synchronization, and the data of the master copy is synchronized to the slave copy according to the range. The data range can be flexibly set according to actual conditions, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.
Example four
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only the computer device 6 having the component memory 61, the processor 62 and the network interface 63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., an SD or DDRBD block device initialization memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various application software, such as computer readable instructions of the DRBD block device initialization method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or process data, for example, execute computer readable instructions of the DRBD block device initialization method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The embodiment defines the data range to be synchronized by adding an initialization management module and using a text configuration file before initialization, and the data range can be but is not limited to be defined as no synchronization, full synchronization, local synchronization and custom synchronization. If no synchronization exists, the content of the configuration file is edited to be 'none'; editing the content of the configuration file to be 'all' if the full synchronization is carried out; local synchronization the editable profile content is "0-mGB", meaning that only data in the range of 0-mGB need be synchronized, and the units can be KB, MB, GB, TB. When the initialization is executed, the initialization management module loads a defined configuration file so as to determine the data range of the master copy needing synchronization, and the data of the master copy is synchronized to the slave copy according to the range. The data range can be flexibly set according to actual conditions, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.
EXAMPLE five
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the DRBD block device initialization method as described above.
The embodiment defines the data range to be synchronized by adding an initialization management module and using a text configuration file before initialization, and the data range can be but is not limited to be defined as no synchronization, full synchronization, local synchronization and custom synchronization. If no synchronization exists, the content of the configuration file is edited to be 'none'; editing the content of the configuration file to be 'all' if the full synchronization is carried out; local synchronization the editable profile content is "0-mGB", meaning that only data in the range of 0-mGB need be synchronized, and the units can be KB, MB, GB, TB. When the initialization is executed, the initialization management module loads a defined configuration file so as to determine the data range of the master copy needing synchronization, and the data of the master copy is synchronized to the slave copy according to the range. The data range can be flexibly set according to actual conditions, the synchronous data volume during initialization can be reduced, and the DRBD deployment efficiency is accelerated.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for initializing a DRBD block device, comprising the steps of:
adding an initialization management module and a configuration file in the DRBD, and setting a data synchronization range in the configuration file;
the initialization management module loads the configuration file to obtain the data synchronization range;
and according to the data synchronization range, the DRBD executes data synchronization of the master copy block device and the slave copy block device.
2. The DRBD block device initialization method of claim 1, wherein the data synchronization range includes: no synchronization, full synchronization, partial synchronization, or custom synchronization.
3. The DRBD block device initialization method of claim 1, wherein the step of adding an initialization management module and a configuration file to the DRBD, and setting the data synchronization range in the configuration file specifically includes:
dynamically creating an initialization management module and a configuration file;
adding an initialization management module and a configuration file in the DRBD;
and setting a data synchronization range in the configuration file.
4. The DRBD block device initialization method of claim 2, wherein the step of the DRBD performing data synchronization of the master and slave counterpart block devices according to the data synchronization range specifically includes:
judging the value of the data synchronization range, and if the data synchronization range is non-synchronous, the primary copy does not need to synchronize data to the secondary copy; if the data synchronization range is full synchronization, the master copy needs to synchronize all data to the slave copy; if the data synchronization range is local synchronization, determining a data range needing synchronization according to the defined data range; and if the data synchronization range is the custom synchronization, determining the data range needing synchronization according to the specific data range of the custom synchronization.
5. The DRBD block device initialization method of any one of claims 1 to 4, wherein adding an initialization management module and a configuration file in the DRBD, and before the step of setting the data synchronization range in the configuration file, further comprising:
the md5 value of the data for which the primary replica needs to synchronize is calculated as the first md5 value.
6. The DRBD block device initialization method of claim 5, further comprising, after the step of the DRBD performing data synchronization of a master slave replica block device according to the data synchronization range:
calculating the md5 value of the synchronized data from the primary replica to be a second md5 value, and returning the second md5 value to the primary replica;
the primary replica compares the difference of the first md5 value with the second md5 value, and if the difference is 0, the synchronization is correct, otherwise it is incorrect.
7. A DRBD block device initialization apparatus, comprising:
the initialization module is used for adding an initialization management module and a configuration file in the DRBD, and setting a data synchronization range in the configuration file;
the loading module is used for initializing the management module to load the configuration file to obtain the data synchronization range;
and the synchronization module is used for executing data synchronization of the master and slave duplicate block devices according to the data synchronization range by the DRBD.
8. The DRBD block device initialization apparatus of claim 7, wherein the initialization module comprises:
the initialization management module is used for initializing data synchronization of the DRBD master copy and the DRBD slave copy;
and the configuration module is used for configuring the data synchronization of the DRBD master copy and the DRBD slave copy.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the DRBD block device initialization method of any of claims 1 to 6.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the DRBD block device initialization method of any of claims 1 to 6.
CN202210285369.6A 2022-03-23 2022-03-23 Method and device for initializing DRBD block device, computer device and storage medium Pending CN114385573A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210285369.6A CN114385573A (en) 2022-03-23 2022-03-23 Method and device for initializing DRBD block device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210285369.6A CN114385573A (en) 2022-03-23 2022-03-23 Method and device for initializing DRBD block device, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN114385573A true CN114385573A (en) 2022-04-22

Family

ID=81205540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210285369.6A Pending CN114385573A (en) 2022-03-23 2022-03-23 Method and device for initializing DRBD block device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN114385573A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050246576A1 (en) * 2004-03-30 2005-11-03 Masaaki Takayama Redundant system utilizing remote disk mirroring technique, and initialization method for remote disk mirroring for in the system
US20070185937A1 (en) * 2005-12-19 2007-08-09 Anand Prahlad Destination systems and methods for performing data replication
US20110208908A1 (en) * 2010-02-24 2011-08-25 Avaya, Inc. Method and apparatus for high availability (ha) protection of a running virtual machine (vm)
CN104679907A (en) * 2015-03-24 2015-06-03 新余兴邦信息产业有限公司 Realization method and system for high-availability and high-performance database cluster
CN109062516A (en) * 2018-09-14 2018-12-21 成都云祺科技有限公司 Invalid data method for removing in a kind of windows virtual machine backup procedure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050246576A1 (en) * 2004-03-30 2005-11-03 Masaaki Takayama Redundant system utilizing remote disk mirroring technique, and initialization method for remote disk mirroring for in the system
US20070185937A1 (en) * 2005-12-19 2007-08-09 Anand Prahlad Destination systems and methods for performing data replication
US20110208908A1 (en) * 2010-02-24 2011-08-25 Avaya, Inc. Method and apparatus for high availability (ha) protection of a running virtual machine (vm)
CN104679907A (en) * 2015-03-24 2015-06-03 新余兴邦信息产业有限公司 Realization method and system for high-availability and high-performance database cluster
CN109062516A (en) * 2018-09-14 2018-12-21 成都云祺科技有限公司 Invalid data method for removing in a kind of windows virtual machine backup procedure

Similar Documents

Publication Publication Date Title
CN110569311B (en) Data synchronization method and device for database and computer storage medium
CN111639287A (en) Page processing method and device, terminal equipment and readable storage medium
US20120254118A1 (en) Recovery of tenant data across tenant moves
CN110162517A (en) Data migration method, device, equipment and computer readable storage medium
CN111966631A (en) Mirror image file generation method, system, equipment and medium capable of being rapidly distributed
CN112380227A (en) Data synchronization method, device and equipment based on message queue and storage medium
CN111782304A (en) Logic control method and device for paging loading data, computer equipment and medium
CN113254445A (en) Real-time data storage method and device, computer equipment and storage medium
CN114996619A (en) Page display method and device, computer equipment and storage medium
US20220245208A1 (en) Method for switching skin of mini-program page, and electronic device
CN113052262A (en) Form generation method and device, computer equipment and storage medium
WO2022156087A1 (en) Data blood relationship establishing method and apparatus, computer device, and storage medium
CN113886332B (en) Large file difference comparison method and device, computer equipment and storage medium
CN112416934A (en) hive table incremental data synchronization method and device, computer equipment and storage medium
CN115934076B (en) Cross-platform client micro-service providing device and method and electronic equipment
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN114385573A (en) Method and device for initializing DRBD block device, computer device and storage medium
CN114416885A (en) Data synchronization method and device based on DRBD, computer equipment and storage medium
CN111880831A (en) Method and device for synchronously updating server, computer equipment and storage medium
CN112989773B (en) Method, apparatus, device and computer readable medium for synchronizing update data
CN113342836A (en) Synchronous data processing method and device, computer equipment and storage medium
CN112632192A (en) Node maintenance method and device, computer equipment and medium
CN113239670A (en) Method and device for uploading service template, computer equipment and storage medium
CN115630123A (en) Cross-system tree structure data synchronization method and related equipment thereof
CN114461152A (en) Method and device for optimizing ceph read-write quality, computer 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220422

RJ01 Rejection of invention patent application after publication