CN115617263A - Method for automatic discovery and real-time copy of changed data for block device and storage medium - Google Patents

Method for automatic discovery and real-time copy of changed data for block device and storage medium Download PDF

Info

Publication number
CN115617263A
CN115617263A CN202211141151.XA CN202211141151A CN115617263A CN 115617263 A CN115617263 A CN 115617263A CN 202211141151 A CN202211141151 A CN 202211141151A CN 115617263 A CN115617263 A CN 115617263A
Authority
CN
China
Prior art keywords
disk
real
block device
time
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211141151.XA
Other languages
Chinese (zh)
Inventor
王策
李凯
张锦志
冯建奎
李超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202211141151.XA priority Critical patent/CN115617263A/en
Publication of CN115617263A publication Critical patent/CN115617263A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0667Virtualisation aspects at data level, e.g. file, record or object virtualisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for automatically discovering and copying changed data in real time of block equipment and a storage medium, belonging to the technical field of cloud computing, aiming at solving the technical problem of how to realize the automatic discovery and the real-time copying of data of a newly-added disk of the block equipment, reducing the invasion to a user server and simultaneously increasing the continuity of user services, and adopting the technical scheme that: the method includes loading a kernel module for copying block device data in real time into a linux kernel and registering block device information, polling and scanning or actively triggering by monitoring block device events to inquire a newly mounted/unloaded disk, enabling/disabling a real-time copying function of the corresponding disk, and copying the disk in real time on the condition of not interrupting reading and writing I/O for the disk in use.

Description

Method for automatic discovery and real-time copy of changed data for block device and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method for automatically discovering and copying changed data in real time for block equipment and a storage medium.
Background
Distributed block device replication technology (drbd), a software-based, shared-nothing, replicated storage solution. The core function of the technology is realized through a linux kernel module, and the realization position of the core function is at the bottom of a linux I/O stack, namely below a file system and above an I/O scheduling layer. After the distributed block device data real-time copying module is loaded, a virtual block device/dev/drbdX based on the block device/dev/sdc specified in the server is created through the module.
If the user uses the block-level replication capability of the distributed block device data real-time replication technology, the user needs to read and write data from/dev/drbdX virtual block devices instead (originally, data is read and written from/dev/sdc block devices). Meanwhile, the virtual block device created by the distributed block device data real-time copying module for each block device needs to monopolize the original block device, that is, when drbd is used, each block device cannot be mounted on the file directory. Two problems are caused, the first is that umount needs to be firstly mounted to the partition of the file directory, then the virtual block device drbdX needs to be created, and finally mount/dev/drbdX needs to be mounted to the original file directory. This process interrupts the read/write block device service and requires modification of the read/write block device name. The second problem is that the root partition has mount to the root directory, and the root directory umount cannot be copied, so that the real-time copy of the block-based device cannot be performed on the system packing partition.
In addition, the existing version of the distributed block device data real-time replication technology lacks a mechanism for actively discovering a newly added disk, so that automatic real-time replication of the newly added disk cannot be automatically performed.
Conventional hard disk backup functions are typically created manually by a user or periodically. When the server or the hard disk is damaged due to natural disasters, machine room faults and disk hardware faults to cause data damage and cannot be restored, the hard disk backup data can be used for restoring the data at the backup moment, but the RPO time is long, and meanwhile, the continuity of the service cannot be guaranteed, namely, the RTO time is long.
The real-time copying technology of the block device data can meet the requirement that the disk data is copied to a remote disk in real time, and can solve the problem of long RPO time. However, since the real-time block device data copying technology needs to monopolize the target block device, the target block device needs to unload the file system first, and a service interruption situation occurs, which causes data read-write abnormality; meanwhile, the root file system of the system disk is mounted to the root directory and cannot be unloaded without closing the server, so that the real-time block device data copying technology cannot be applied to the system disk.
Therefore, how to implement automatic discovery of block devices and real-time copy of data of newly added disks, reduce intrusiveness on a user server, and increase continuity of user services is a technical problem to be solved urgently at present.
Disclosure of Invention
The technical task of the invention is to provide a method for automatically discovering and copying the changed data in real time of a block device and a storage medium, so as to solve the problems of how to realize the automatic discovery of the block device and the real-time copying of the data of a newly added disk, reduce the invasion to a user server and increase the continuity of user services.
The technical task of the invention is realized according to the following mode, the method for automatically discovering and copying the changed data in real time of the block device is that after loading a core module for copying the data of the block device in real time into a linux core and registering the information of the block device, polling scanning is carried out or the main trigger of the event of the block device is monitored to inquire a newly mounted/unloaded disk, then the real-time copying function of the corresponding disk is enabled/disabled, and simultaneously, the disk is copied in real time aiming at the disk in use under the condition of not interrupting the reading and writing I/O.
Preferably, the method specifically comprises the following steps:
loading block equipment data into a linux kernel through a modprobe or an insmod to copy a kernel module in real time;
a user registers all disks on a server through a register device command, a block device data real-time copying kernel module records information of all disks, and a tcp monitoring is started for each disk;
when the real-time copying kernel module of the block device data identifies a new mounted/unloaded disk, starting/stopping the tcp service of the changed disk;
discovering a newly added or unloaded disk and starting/stopping real-time copying through udev circular query or an adding/removing disk event triggering mechanism;
the system call related to the linux disk I/O is changed into the corresponding function call address, and the real-time copying of the block device data is realized under the condition of not interrupting the read-write service.
Preferably, after the block device data is loaded and the kernel module is copied in real time, the following is executed:
a user executes a register device command, and a block device data real-time copying kernel module records all disk information in a current server into a disk _ resource.json file under a specified directory, such as { "UUID": xxx "," size ":100 GB", and "size": }; the disk information comprises disk UUID, size, disk identifier, serial number, manufacturer ID, product ID number, provider ID and product ID number;
when a block device data real-time copying kernel module function 'up block device' is started, starting a tcp monitoring service for each disk of a home terminal server for transmitting disk change data;
actively discovering and starting/stopping the real-time replication of the disk by a timing task and a udev monitoring disk change mechanism;
after the tcp clients of the local disk and the remote disk handshake for three times, a long connection is established and real-time copying of data is started.
Preferably, when the block device data real-time copying kernel module is loaded, the udevadm monitor is called to monitor the addition and deletion of the disk on the machine, and the mounting and the unloading of the disk are detected;
after the local server finishes processing, the remote server mounts the disks with the same size and starts the tcp client, the tcp client and the server establish tcp monitoring through tcp three-way handshake, and start real-time replication of disk data;
and when the unloading of the disk is detected, stopping the tcp service of the device, and recording the state of the disk in the disk _ resource.
Preferably, the manner of detecting the mounting and the dismounting of the disk is as follows:
(1) in the block device data real-time copying kernel module, detection and detection are executed once every 5 minutes through a timing task, and the obtained disk information is compared with the disk information in disk _ resource.json:
if a new disk is added, recording new disk information into a disk _ resource.json file, distributing a metadata area of the disk, and then automatically starting tcp monitoring service corresponding to the new disk;
(2) and udev monitoring add and remove events of the disk, and automatically executing a function probe device () in a block device data real-time copying kernel module when the disk mounting and unloading are detected, wherein the processing mode is the same as (1).
Preferably, the block device data real-time copying kernel module changes a read-only attribute of a page table address where the virtual address is located into a read-write attribute, modifies system calls sys _ read () and sys _ write () related to disk I/O to an I/O system call entry function bd _ read () and bd _ write () specified by the block device data real-time copying kernel module, and when a user executes a function that read (fd, buffer, n _ to _ read) or write (fd, buffer, n _ to _ write) relates to disk I/O, the call system call is changed to call a function hook _ device () specified by the block device data real-time copying kernel module.
Preferably, when the linux kernel adopts the linux 4.15.0 kernel version, the specific steps are as follows:
in the linux I/O stack, each disk driver registers a make _ request _ fn () function aiming at a specific device driver in a block layer in the linux kernel, wherein the make _ request _ fn () function is in a request _ queue of each device;
when the I/O writing request is executed to a function of make _ request _ fn () registered by a block device data real-time copying kernel module, copying a bio to tcp send buffer and sending the buffer to a disk device at the opposite end, setting struct block _ device _ bi _ bdev in struct bio as an actual disk partition, and continuously executing subsequent I/O according to an original path and writing the subsequent I/O into a target disk.
Preferably, the real-time copying of the kernel module by loading the block device data into the linux kernel via modprobe or insmod specifically comprises the following steps:
the user make & make install generates a ko kernel file and loads into the linux kernel through modprobe or insmod.
An electronic device, comprising: a memory and at least one processor;
wherein the memory has stored thereon a computer program;
the at least one processor executes the memory-stored computer program causing the at least one processor to perform a method of auto-discovery and real-time replication of changed data for a block device as described above.
A computer-readable storage medium having stored thereon a computer program executable by a processor to implement a method of automatic discovery and real-time replication of changed data of a block device as described above.
The method for automatically discovering and copying the change data in real time of the block device and the storage medium have the following advantages that:
the method can circularly detect and monitor the addition and removal events of the disks by combining the capability of the udev, and start/close the copying function of the newly added disks in time when newly mounted and unloaded disks on the server are found; compared with the real-time copying module technology of original block device data, the method and the device reduce the operation that a user needs to manually start the copying function and stop the copying function for a new disk after mounting or unloading the disk on the server, avoid the risk of misoperation of the user, and increase the flexibility and the convenience of the use of the kernel module;
after a user disk creates a file system and is mounted to a mounting point, real-time copying of original edition block device data to a kernel module requires an umount disk to create a virtual block device for the original edition block device data, the system disk cannot use an umount root file system, and the operations interrupt an I/O request of the disk; in the invention, the I/O related system call is intercepted in the kernel module for copying the data of the block device in real time through the hook function, so that the smooth switching of the execution path can be realized, the original I/O execution path is recovered after the kernel module is unloaded, the intrusiveness to the user server operating system is lower, no trace is left after the kernel module is unloaded, and the effect of hot plug is realized;
the invention does not establish virtual block equipment to monopolize target block equipment any more, and the user still continues to store read-write data to the original block, thereby reducing the complexity of using the invention and realizing that the I/O data can still be collected in real time and copied to remote block equipment under the condition of not interrupting the read-write service;
the invention provides a mechanism for dynamically detecting and discovering the change of the server disk, and the data of the newly added disk can be discovered and copied in real time after the disk is newly added.
Drawings
The invention is further described below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of automatically discovering disk mount/unmount and enabling/disabling a real-time copy function;
FIG. 2 is a schematic diagram of an uninterrupted service copy-on-real-time disk I/O request.
Detailed Description
The method for automatically discovering and real-time copying changed data of a block device and a storage medium according to the present invention will be described in detail with reference to the accompanying drawings and embodiments.
Example 1:
as shown in fig. 1, this embodiment provides a method for automatically discovering and copying changed data in real time for a block device, and the method includes loading a block device data real-time copy kernel module into a linux kernel and registering block device information, polling and scanning or querying a newly mounted/unloaded disk by monitoring a block device event active trigger, then enabling/disabling a real-time copy function of a corresponding disk, and simultaneously copying the disk in real time for a disk in use without interrupting read/write I/O; the method comprises the following specific steps:
s1, loading block equipment data into a kernel module in real time through modprobe or insmod in a linux kernel, and copying the kernel module;
s2, a user registers all disks on a server through a register device command, a block device data real-time copying kernel module records information of all the disks, and a tcp monitoring is started for each disk;
s3, when the kernel module for copying the data of the block device in real time identifies a new mounted/unloaded disk, starting/stopping the tcp service of the changed disk;
s4, discovering newly added or unloaded disks and starting/stopping real-time copying through udev circular query or an event trigger mechanism for adding/removing disks;
and S5, changing the system call related to the I/O of the linux disk into a corresponding function call address, and realizing real-time copying of the data of the block device under the condition of not interrupting the read-write service.
In this embodiment, after the block device data is loaded and the kernel module is copied in real time, the following is executed:
(1) The user executes a register device command, and the block device data real-time copying kernel module records all disk information in the current server into disk _ resource.json files under a specified directory, such as { "UUID": xxx "," size ":100 GB", and "size": }; the disk information comprises disk UUID, size, disk identifier, serial number, manufacturer ID, product ID number, provider ID and product ID number;
(2) When the function 'up block device' of the kernel module is copied in real time when the block device data is started, starting a tcp monitoring service for each disk of the local server, wherein the tcp monitoring service is used for transmitting disk change data;
(3) Actively discovering and starting/stopping the real-time replication of the disk by a timing task and a udev monitoring disk change mechanism;
(4) And after the tcp clients of the local disk and the remote disk handshake for three times, establishing long connection and starting real-time copying of data.
In the embodiment, when the block device data real-time copying kernel module is loaded, the udevadm monitor is called to monitor the addition and deletion of the disk on the machine, and the mounting and the unloading of the disk are detected;
after the local server finishes processing, the remote server mounts the disks with the same size and starts the tcp client, the tcp client and the server establish tcp monitoring through tcp three-way handshake, and start real-time replication of disk data;
and when the unloading of the disk is detected, stopping the tcp service of the device, and recording the state of the disk in the disk _ resource.
In this embodiment, the manner of detecting the mounting and dismounting of the disk is specifically as follows:
(1) in the block device data real-time copying kernel module, detection is executed once every 5 minutes through a timing task, and obtained disk information is compared with disk information in disk _ resource.json:
if a new disk is added, recording new disk information into a disk _ resource.json file, distributing a metadata area of the disk, and then automatically starting tcp monitoring service corresponding to the new disk;
(2) and udev monitoring add and remove events of the disk, and automatically executing a function probe device () in a block device data real-time copying kernel module when the disk mounting and unloading are detected, wherein the processing mode is the same as (1).
As shown in fig. 2, in this embodiment, the block device data real-time copying kernel module changes the read-only attribute of the page table address where the virtual address is located into the read-write attribute, modifies the system calls sys _ read () and sys _ write () related to the disk I/O to the I/O system call entry functions bd _ read () and bd _ write () specified by the block device data real-time copying kernel module, and when the user executes the function of read (fd, buffer, n _ to _ read) or write (fd, buffer, n _ to _ write) related to the disk I/O, the calling system is changed to call the function hook _ device () specified by the block device data real-time copying kernel module.
In this embodiment, when the linux kernel adopts the linux 4.15.0 kernel version, the following details are provided:
(1) In a linux I/O stack, each disk driver registers a make _ request _ fn () function aiming at a specific device driver in a block layer in a linux kernel, wherein the make _ request _ fn () function is in a request _ queue of each device;
(2) When the write I/O request is executed to a function of make _ request _ fn () registered by a block device data real-time copying kernel module, copying the bio to a tcp send buffer and sending the buffer to a disk device of an opposite end, setting structure block _ device _ bi _ bdev in the structure bio to be an actual disk partition, and continuously executing subsequent I/O according to an original path and writing the subsequent I/O into a target disk.
In this embodiment, the module for copying the kernel in real time by loading the block device data in the linux kernel through the modprobe or insmod specifically includes:
the user make & make install generates a ko kernel file and loads it into the linux kernel through modprobe.
Example 2:
the present embodiment also provides an electronic device, including: a memory and a processor;
wherein the memory stores computer execution instructions;
the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the method of automatic discovery and real-time replication of changed data for a block device in any embodiment of the present invention.
The processor may be a Central Processing Unit (CPU), but may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), array of off-the-shelf programmable gates (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the electronic device by executing or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the terminal, and the like. The memory may also include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a memory only card (SMC), a Secure Digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid state memory device.
Example 3:
the present embodiments also provide a computer-readable storage medium having stored thereon a plurality of instructions, which are loaded by a processor, and cause the processor to execute the method for automatically discovering and copying changed data in real time of a block device according to any of the embodiments of the present invention. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the embodiments described above are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for automatically discovering and copying changed data in real time of a block device is characterized in that after a core module for copying data in real time of the block device is loaded into a linux core and information of the block device is registered, a new mounted/unloaded disk is inquired by polling scanning or active triggering of monitoring events of the block device, the real-time copying function of the corresponding disk is enabled/disabled, and meanwhile, the disk is copied in real time under the condition of not interrupting reading and writing I/O aiming at the disk in use.
2. The method for automatic discovery and real-time replication of changed data for a block device of claim 1, wherein the method comprises:
loading block equipment data into a linux kernel through modprobe or insmod to copy a kernel module in real time;
a user registers all disks on a server through a register device command, a block device data real-time copying kernel module records information of all the disks, and a tcp monitoring is started for each disk;
when the real-time copying kernel module of the block device data identifies a new mounted/unloaded disk, starting/stopping the tcp service of the changed disk;
discovering a newly added or unloaded disk and starting/stopping real-time copying through udev circular query or an adding/removing disk event triggering mechanism;
the system call related to the linux disk I/O is changed into the corresponding function call address, and the real-time copying of the block equipment data is realized under the condition of not interrupting the read-write service.
3. The method for automatically discovering and real-time copying of changed data of a block device according to claim 1, wherein the following is performed after the kernel module for real-time copying of data of the block device is loaded:
a user executes a register device command, and a block device data real-time copying kernel module records all disk information in a current server into a disk _ resource.json file under a specified directory; the disk information comprises disk UUID, size, drive letter, serial number, manufacturer ID and product ID number, and provider ID and product ID number;
when a block device data real-time copying kernel module function 'up block device' is started, starting a tcp monitoring service for each disk of a home terminal server for transmitting disk change data;
actively discovering and starting/stopping the real-time replication of the disk by a timing task and a udev monitoring disk change mechanism;
after the tcp clients of the local disk and the remote disk handshake for three times, a long connection is established and real-time replication of data is started.
4. The method for automatically discovering and real-time copying the changed data of the block device according to any one of claims 1 to 3, wherein when the block device data real-time copying kernel module is loaded, a udevadm monitor is called to monitor the addition and deletion of a disk on a machine, and the mounting and the unloading of the disk are detected;
after the local server finishes processing, the remote server mounts the disks with the same size and starts the tcp client, the tcp client and the server establish tcp monitoring through tcp three-way handshake, and start real-time replication of disk data;
and when the unloading of the disk is detected, stopping the tcp service of the device, and recording the state of the disk in the disk _ resource.
5. The method for automatically discovering and copying changed data in real time of a block device according to claim 4, wherein the manner of detecting disk mount and unload is as follows:
(1) in the block device data real-time copying kernel module, detection and detection are executed once every 5 minutes through a timing task, and the obtained disk information is compared with the disk information in disk _ resource.json:
if a new disk is added, recording new disk information into a disk _ resource.json file, distributing a metadata area of the disk, and then automatically starting tcp monitoring service corresponding to the new disk;
(2) and udev monitors add and remove events of the disk, and when the disk mounting and unloading are detected, the function probe device () in the kernel module of the real-time copying of the block device data is automatically executed, and the processing mode is the same as (1).
6. The method of claim 1, wherein the block device data real-time copy kernel module changes the read-only attribute of the page table address where the virtual address is located into the read-write attribute, and modifies the system calls sys _ read () and sys _ write () related to the disk I/O to the I/O system call entry functions bd _ read () and bd _ write () specified by the block device data real-time copy kernel module, and when the user executes the function that read (fd, buffer, n _ to _ read) or write (fd, buffer, n _ to _ write) relates to the disk I/O, the call system call is changed to the function hook _ view () specified by the block device data real-time copy kernel module.
7. The method for automatically discovering and copying changed data in real time according to claim 6, wherein when the linux kernel adopts a linux 4.15.0 kernel version, the following is specific:
in the linux I/O stack, each disk driver registers a make _ request _ fn () function aiming at a specific device driver in a block layer in the linux kernel, wherein the make _ request _ fn () function is in a request _ queue of each device;
when the write I/O request is executed to a function of make _ request _ fn () registered by a block device data real-time copying kernel module, copying a bio-to-tcp send buffer and sending the buffer to a disk device at the opposite end, setting structure block _ device bi _ bdev in the structure bio as an actual disk partition, and continuously executing subsequent I/O according to an original path and writing the subsequent I/O into a target disk.
8. The method for automatically discovering and real-time copying change data of a block device according to claim 2, wherein the real-time copying kernel module for loading block device data in a linux kernel through modprobe or insmod specifically comprises the following steps:
the user make & make install generates a ko kernel file and loads into the linux kernel through modprobe or insmod.
9. An electronic device, comprising: a memory and at least one processor;
wherein the memory has stored thereon a computer program;
the at least one processor executing the memory-stored computer program causes the at least one processor to perform a method of auto-discovery and real-time replication of changed data for a block device according to any of claims 1 to 8.
10. A computer-readable storage medium, in which a computer program is stored, the computer program being executable by a processor to implement a method of auto-discovery and real-time replication of change data of a block device according to any one of claims 1 to 8.
CN202211141151.XA 2022-09-20 2022-09-20 Method for automatic discovery and real-time copy of changed data for block device and storage medium Pending CN115617263A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211141151.XA CN115617263A (en) 2022-09-20 2022-09-20 Method for automatic discovery and real-time copy of changed data for block device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211141151.XA CN115617263A (en) 2022-09-20 2022-09-20 Method for automatic discovery and real-time copy of changed data for block device and storage medium

Publications (1)

Publication Number Publication Date
CN115617263A true CN115617263A (en) 2023-01-17

Family

ID=84858674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211141151.XA Pending CN115617263A (en) 2022-09-20 2022-09-20 Method for automatic discovery and real-time copy of changed data for block device and storage medium

Country Status (1)

Country Link
CN (1) CN115617263A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux
CN117724905B (en) * 2024-02-05 2024-04-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Similar Documents

Publication Publication Date Title
JP6571202B2 (en) System and method for automatic cloud-based full data backup and restore on mobile devices
US7689859B2 (en) Backup system and method
US7603533B1 (en) System and method for data protection on a storage medium
US8380678B2 (en) Tracking files which have been processed by a backup or a restore operation
CA2315446C (en) External job scheduling with a distributed processing system having a local job control system
US7761734B2 (en) Automated firmware restoration to a peer programmable hardware device
US7761735B2 (en) Automated firmware restoration to a peer programmable hardware device
US6425093B1 (en) Methods and apparatuses for controlling the execution of software on a digital processing system
CN109656742B (en) Node exception handling method and device and storage medium
US11366682B1 (en) Automatic snapshotting for recovery of instances with local storage
CN110225078B (en) Application service updating method, system and terminal equipment
CN111209265B (en) Database switching method and terminal equipment
US11640340B2 (en) System and method for backing up highly available source databases in a hyperconverged system
CN115617263A (en) Method for automatic discovery and real-time copy of changed data for block device and storage medium
US7315959B2 (en) Real-time remote backup system and related method
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN111090546A (en) Method, device and equipment for restarting operating system and readable storage medium
CN113157491A (en) Data backup method and device, communication equipment and storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN111522598A (en) Method and device for recording restart information of embedded equipment
US8171345B2 (en) Disablement of an exception generating operation of a client system
US11226875B2 (en) System halt event recovery
US12020039B2 (en) Compute instance warmup operations
CN107704399B (en) Method and device for storing data
US7770054B2 (en) Apparatus, system, and method to prevent queue stalling

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