Table of Contents |
---|
The basic
bsr synchronizes and replicates the volumes of hosts in a cluster in real time over the network.
Synchronization and Replication
To replicate, you volume data on both hosts must first match the data on both volumes. To achieve this, the bsr performs a process of copying data in disk blocks from the source to the target using disk blocks as a unit, which is called synchronization. On the other hand, replication is an operation that reflects the change in real time to the target side
Once synchronization is complete, both volumes will be in a completely identical state, and if data changes occur on the source side, only the changes will be reflected to the target side to maintain the consistency of both volumes.
Here, when data on the source side is changed by write I/O. Synchronization works side changes, the operation of reflecting the change in real time to the target side is called replication. Synchronization operates slowly in the background, but while replication happens quickly and without any delays.
Although synchronization and replication operate separately, they can occur simultaneously at one point. In other words, since replication can be processed simultaneously while synchronization is being performed (if the actual operating node is synchronizing, you should think that these two operations are always processed simultaneously by write I/O during operation), the processing bandwidth between them is reduced. It is important to properly adjust within the range of maximum network processing bandwidth. For information on setting the sync band, see Adjust sync speed.
Replication works in the following way:
...
The application writes data to the block device while replicating it in real time.
...
Real-time replication does not affect other application services or system elements.
Replicate synchronously or asynchronously
...
In the synchronous method, replication is considered complete when the replication data has been written to the local disk and the target host's disk.
...
occurs quickly in the context of local I/O.
Replication works in the following way:
The application writes data to the block device while replicating it in real time.
Real-time replication does not affect other application services or system elements.
Replicate synchronously or asynchronously
In the synchronous method, replication is considered complete when the replication data has been written to the local disk and the target host's disk.
The asynchronous method treats replication as complete when replication data is written to the local disk and transmitted to the target host.
Synchronization and replication operate separately within bsr, but can occur simultaneously at a single point in time. In other words, since replication can be processed simultaneously while synchronization is being performed (the operating node processes synchronization and simultaneously replicates write I/O that occurs during operation), the throughput between each node must be appropriately adjusted within the range of the maximum network bandwidth. . For information on setting the sync band, see https://mantech.jira.com/wiki/spaces/BUGE/pages/1419935915/Working#Adjusting-the-synchronization-speed.
Kernel drivers
The core engine of BSR is implemented as a kernel driver.
...
A resource is a replication group consisting of one or more volumes that share a common replication stream, which . bsr ensures the consistency of all volumes within the a resource.
A volume is described as a single device and is specified by a drive letter in Windows.
A replica set requires one volume for data replication and a separate volume to store metadata associated with the volume. The meta volume is used to store and manage internal information for replication.
Metadata is divided into external and internal meta types based on where it is stored. For example, if the metadata is located on the disk of the volume being replicated, it is internal meta; if it is located on another device or another disk, it is external meta.
External meta types have an advantage over internal meta in terms of performance because replication I/O and meta data writing can be performed simultaneously during operation, and the I/O performance of the meta disk directly affects replication performance, so it is recommended to configure it with a high-performance disk as much as possible.
The volume for the meta should not be formatted with a filesystem like NTFS and should be configured as RAW.
...
Once a full sync has been performed, it always operates as a partial sync. It is efficient by synchronizing only for out-of-sync areas (OOS).
...
Fast synchronization (FastSync)
bsr implements FastSync, which synchronizes only the parts of the volume that are in filesystem use. Without FastSync, you would have to synchronize over the entire volume, which can take a lot of synchronization time if the volume is large. FastSync is a powerful feature of bsr that can significantly reduce sync time.
...
Checksum-
...
based synchronization
In fixed-rate synchronization, the data rate of synchronization to the relative node per second can be adjusted within upper bounds (this is called the synchronization rate) and can be specified as a minimum (c-min-rate) and maximum (c-max-rate).
Variable-rate synchronization
Variable-rate sync detects the available network bandwidth and compares it to the I/O received from the application, and automatically calculates the appropriate sync rate. BSR uses variable-rate sync as the default setting.
Checksum-based synchronization
The efficiency of the synchronization algorithm can be further improved by using a summary of the checksum data. Checksum-based sync reads a block before syncing, obtains a hash summary of what is currently on the disk, and then compares it to the hash summary obtained by reading the same sector from the other node. If the hashes match, it skips the sync rewrite for that block. This can have a performance advantage over simply overwriting the block that needs to be synchronized, and if the file system rewrote the same content to a sector while disconnected (disconnect state), it will skip the re-sync for that sector, which can reduce the overall sync timeThe efficiency of the synchronization algorithm can be further improved by using a summary of the checksum data. Checksum-based sync reads a block before syncing, obtains a hash summary of what is currently on the disk, and then compares it to the hash summary obtained by reading the same sector from the other node. If the hashes match, it skips the sync rewrite for that block. This can have a performance advantage over simply overwriting the block that needs to be synchronized, and if the file system rewrote the same content to a sector while disconnected (disconnect state), it will skip the re-sync for that sector, which can reduce the overall sync time.
Specify synchronization bandwidth
If you specify a synchronization band within the replication network band, the remaining bands are used as replication bands. If there is no synchronization behavior, all bands will be used as replication. You can specify the minimum value (c-min-rate) and maximum value (c-max-rate).
Fixed-rate synchronization
The data rate synchronized to the counterpart node is fixed to the resync-rate value.
Variable-rate synchronization
Variable-band synchronization handles synchronization between c-min-rate and c-max-rate by detecting available network bandwidth and arbitrating with replication throughput. In variable band synchronization, resync-rate only has the meaning of the initial synchronization band value.
bsr defaults to variable band synchronization.
Fixed-rate synchronization
In fixed-rate synchronization, the data rate of synchronization to the relative node per second can be adjusted within upper bounds (this is called the synchronization rate) and can be specified as a minimum (c-min-rate) and maximum (c-max-rate).
Variable-rate synchronization
Variable-rate sync detects the available network bandwidth and compares it to the I/O received from the application, and automatically calculates the appropriate sync rate. BSR uses variable-rate sync as the default setting.
Congestion mode
BSR provides a congestion mode feature that allows asynchronous replication to detect and proactively deal with congestion on the replication network. Congestion Mode provides three modes of operation: Blocking, Disconnect, and Ahead.
...