drbd.conf
Configuration file for DRBD's devices .
- Provided by: drbd8-utils (Version: 2:8.4.4-1ubuntu1)
- Source: drbd8
- Report a bug
Configuration file for DRBD's devices .
The file /etc/drbd.conf is read by drbdadm.
The file format was designed as to allow to have a verbatim copy of the file on both nodes of the cluster. It is highly recommended to do so in order to keep your configuration manageable. The file /etc/drbd.conf should be the same on both nodes of the cluster. Changes to /etc/drbd.conf do not apply immediately.
By convention the main config contains two include statements. The first one includes the file /etc/drbd.d/global_common.conf, the second one all file with a .res suffix.
alice uses /dev/drbd1 as devices for its application, and /dev/sda7 as low-level storage for the data. The IP addresses are used to specify the networking interfaces to be used. An eventually running resync process should use about 10MByte/second of IO bandwidth. This sync-rate statement is valid for volume 0, but would also be valid for further volumes. In this example it assigns full 10MByte/second to each volume.
There may be multiple resource sections in a single drbd.conf file. For more examples, please have a look at the DRBD User's Guide[1].
The file consists of sections and parameters. A section begins with a keyword, sometimes an additional name, and an opening brace (“{”). A section ends with a closing brace (“}”. The braces enclose the parameters.
section [name] { parameter value; [...] }
A parameter starts with the identifier of the parameter followed by whitespace. Every subsequent character is considered as part of the parameter's value. A special case are Boolean parameters which consist only of the identifier. Parameters are terminated by a semicolon (“;”).
Some parameter values have default units which might be overruled by K, M or G. These units are defined in the usual way (K = 2^10 = 1024, M = 1024 K, G = 1024 M).
Comments may be placed into the configuration file and must begin with a hash sign (“#”). Subsequent characters are ignored until the end of the line.
skip
global
common
resource name
on host-name
resource r1 {
protocol C;
device minor 1;
meta-disk internal;
on alice bob {
address 10.2.2.100:7801;
disk /dev/mapper/some-san;
}
on charlie {
address 10.2.2.101:7801;
disk /dev/mapper/other-san;
}
on daisy {
address 10.2.2.103:7801;
disk /dev/mapper/other-san-as-seen-from-daisy;
}
}
See also the floating section keyword. Required statements in this section: address and volume. Note for backward compatibility and convenience it is valid to embed the statements of a single volume directly into the host section.
volume vnr
stacked-on-top-of resource
floating AF addr:port
resource r2 {
protocol C;
device minor 2;
disk /dev/sda7;
meta-disk internal;
# short form, device, disk and meta-disk inherited
floating 10.1.1.31:7802;
# longer form, only device inherited
floating 10.1.1.32:7802 {
disk /dev/sdb;
meta-disk /dev/sdc8;
}
}
disk
net
startup
options
handlers
The interface is done via environment variables:
DRBD_PEER is deprecated.
Please note that not all of these might be set for all handlers, and that some values might not be useable for a floating definition.
minor-count count
Minor-count is a sizing hint for DRBD. It helps to right-size various memory pools. It should be set in the in the same order of magnitude than the actual number of minors you use. Per default the module loads with 11 more resources than you have currently in your config but at least 32.
dialog-refresh time
The user dialog redraws the second count every time seconds (or does no redraws if time is 0). The default value is 1.
disable-ip-verification
usage-count val
protocol prot-id
Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer.
Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache.
Protocol C: write IO is reported as completed, if it has reached both local and remote disk.
device name minor nr
One can ether omit the name or minor and the minor number. If you omit the name a default of /dev/drbdminor will be used.
Udev will create additional symlinks in /dev/drbd/by-res and /dev/drbd/by-disk.
disk name
address AF addr:port
Each DRBD resource needs a TCP port which is used to connect to the node's partner device. Two different DRBD resources may not use the same addr:port combination on the same node.
meta-disk internal, meta-disk device, meta-disk device [index]
When a device is specified, either with or without an index, DRBD stores the meta-data on this device. Without index, the size of the meta-data is determined by the size of the data device. This is usually used with LVM, which allows to have many variable sized block devices. The meta-data size is 36kB + Backing-Storage-size / 32k, rounded up to the next 4kb boundary. (Rule of the thumb: 32kByte per 1GByte of storage, rounded up to the next MB.)
When an index is specified, each index number refers to a fixed slot of meta-data of 128 MB, which allows a maximum data size of 4 GB. This way, multiple DBRD devices can share the same meta-data device. For example, if /dev/sde6[0] and /dev/sde6[1] are used, /dev/sde6 must be at least 256 MB big. Because of the hard size limit, use of meta-disk indexes is discouraged.
on-io-error handler
handler may be pass_on, call-local-io-error or detach.
pass_on: The node downgrades the disk status to inconsistent, marks the erroneous block as inconsistent in the bitmap and retries the IO on the remote node.
call-local-io-error: Call the handler script local-io-error.
detach: The node drops its low level device, and continues in diskless mode.
fencing fencing_policy
Valid fencing policies are:
dont-care
resource-only
resource-and-stonith
disk-barrier, disk-flushes, disk-drain
Since drbd-8.4.2 disk-barrier is disabled by default because since linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to determine if queuing of IO-barriers works. Dangerous only enable if you are told so by one that knows for sure.
When selecting the method you should not only base your decision on the measurable performance. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two. In case your backing storage device has battery-backed write cache you may go with option 3. Option 4 (disable everything, use "none") is dangerous on most IO stacks, may result in write-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles. Do not use no-disk-drain.
Unfortunately device mapper (LVM) might not support barriers.
The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device: b, f, d, n. The implementations are:
barrier
flush
drain
none
md-flushes
max-bio-bvecs
The best workaround is to proper align the partition within the VM (E.g. start it at sector 1024). This costs 480 KiB of storage. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63). Therefore most distribution's install helpers for virtual linux machines will end up with misaligned partitions. The second best workaround is to limit DRBD's max bvecs per BIO (= max-bio-bvecs) to 1, but that might cost performance.
The default value of max-bio-bvecs is 0, which means that there is no user imposed limitation.
disk-timeout
The default value of is 0, which means that no timeout is enforced. The default unit is 100ms. This option is available since 8.3.12.
read-balancing method
The default value of is prefer-local. This option is available since 8.4.1.
sndbuf-size size
rcvbuf-size size
timeout time
connect-int time
ping-int time
ping-timeout time
max-buffers number
ko-count number
max-epoch-size number
allow-two-primaries
unplug-watermark number
When the number of pending write requests on the standby (secondary) node exceeds the unplug-watermark, we trigger the request processing of our backing storage device. Some storage controllers deliver better performance with small values, others deliver best performance when the value is set to the same value as max-buffers, yet others don't feel much effect at all. Minimum 16, default 128, maximum 131072.
cram-hmac-alg
shared-secret
after-sb-0pri policy
disconnect
discard-younger-primary
discard-older-primary
discard-zero-changes
discard-least-changes
discard-node-NODENAME
after-sb-1pri policy
disconnect
consensus
violently-as0p
discard-secondary
call-pri-lost-after-sb
after-sb-2pri policy
disconnect
violently-as0p
call-pri-lost-after-sb
always-asbp
With this option you request that the automatic after-split-brain policies are used as long as the data sets of the nodes are somehow related. This might cause a full sync, if the UUIDs indicate the presence of a third node. (Or double faults led to strange UUID sets.)
rr-conflict policy
disconnect
violently
call-pri-lost
data-integrity-alg alg
This option can be set to any of the kernel's data digest algorithms. In a typical kernel configuration you should have at least one of md5, sha1, and crc32c available. By default this is not enabled.
See also the notes on data integrity.
tcp-cork
on-congestion congestion_policy, congestion-fill fill_threshold, congestion-extents active_extents_threshold
When DRBD is deployed with DRBD-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open.
The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD-proxy's buffer is not sufficient to buffer all write requests. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync. During that resync the peer node will have an inconsistent disk.
Available congestion_policys are block and pull-ahead. The default is block. Fill_threshold might be in the range of 0 to 10GiBytes. The default is 0 which disables the check. Active_extents_threshold has the same limits as al-extents.
The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.
wfc-timeout time
degr-wfc-timeout time
outdated-wfc-timeout time
wait-after-sb
become-primary-on node-name
stacked-timeouts
resync-rate rate
use-rle
Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange.
For backward compatibilty reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off.
resync-after res-name
al-extents extents
Note that the effective maximum may be smaller, depending on how you created the device meta data, see also drbdmeta(8). The effective maximum is 919 * (available on-disk activity-log ring-buffer area/4kB -1), the default 32kB ring-buffer effects a maximum of 6433 (covers more than 25 GiB of data). We recommend to keep this well within the amount your backend storage and replication link are able to resync inside of about 5 minutes.
al-updates {yes | no}
verify-alg hash-alg
See also the notes on data integrity.
csums-alg hash-alg
This setting is useful for DRBD setups with low bandwidth links. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync. But a large part of those will actually be still in sync, therefore using csums-alg will lower the required bandwidth in exchange for CPU cycles.
c-plan-ahead plan_time, c-fill-target fill_target, c-delay-target delay_target, c-max-rate max_rate
By plan_time the agility of the controller is configured. Higher values yield for slower/lower responses of the controller to deviation from the target value. It should be at least 5 times RTT. For regular data paths a fill_target in the area of 4k to 100k is appropriate. For a setup that contains drbd-proxy it is advisable to use delay_target instead. Only when fill_target is set to 0 the controller will use delay_target. 5 times RTT is a reasonable starting value. Max_rate should be set to the bandwidth available between the DRBD-hosts and the machines hosting DRBD-proxy, or to the available disk-bandwidth.
The default value of plan_time is 0, the default unit is 0.1 seconds. Fill_target has 0 and sectors as default unit. Delay_target has 1 (100ms) and 0.1 as default unit. Max_rate has 10240 (100MiB/s) and KiB/s as default unit.
The dynamic resync speed controller and its settings are available since DRBD 8.3.9.
c-min-rate min_rate
Note: The value 0 has a special meaning. It disables the limitation of resync IO completely, which might slow down application IO considerably. Set it to a value of 1, if you prefer that resync IO never slows down application IO.
Note: Although the name might suggest that it is a lower bound for the dynamic resync speed controller, it is not. If the DRBD-proxy buffer is full, the dynamic resync speed controller is free to lower the resync speed down to 0, completely independent of the c-min-rate setting.
Min_rate has 4096 (4MiB/s) and KiB/s as default unit.
on-no-data-accessible ond-policy
If ond-policy is set to suspend-io you can either resume IO by attaching/connecting the last lost data storage, or by the drbdadm resume-io res command. The latter will result in IO errors of course.
The default is io-error. This setting is available since DRBD 8.3.9.
cpu-mask cpu-mask
pri-on-incon-degr cmd
pri-lost-after-sb cmd
pri-lost cmd
fence-peer cmd
local-io-error cmd
initial-split-brain cmd
split-brain cmd
before-resync-target cmd
after-resync-target cmd
include file-pattern
There are two independent methods in DRBD to ensure the integrity of the mirrored data. The online-verify mechanism and the data-integrity-alg of the network section.
Both mechanisms might deliver false positives if the user of DRBD modifies the data which gets written to disk while the transfer goes on. This may happen for swap, or for certain append while global sync, or truncate/rewrite workloads, and not necessarily poses a problem for the integrity of the data. Usually when the initiator of the data transfer does this, it already knows that that data block will not be part of an on disk data structure, or will be resubmitted with correct data soon enough.
The data-integrity-alg causes the receiving side to log an error about "Digest integrity check FAILED: Ns +x\n", where N is the sector offset, and x is the size of the request in bytes. It will then disconnect, and reconnect, thus causing a quick resync. If the sending side at the same time detected a modification, it warns about "Digest mismatch, buffer modified by upper layers during write: Ns +x\n", which shows that this was a false positive. The sending side may detect these buffer modifications immediately after the unmodified data has been copied to the tcp buffers, in which case the receiving side won't notice it.
The most recent (2007) example of systematic corruption was an issue with the TCP offloading engine and the driver of a certain type of GBit NIC. The actual corruption happened on the DMA transfer from core memory to the card. Since the TCP checksum gets calculated on the card, this type of corruption stays undetected as long as you do not use either the online verify or the data-integrity-alg.
We suggest to use the data-integrity-alg only during a pre-production phase due to its CPU costs. Further we suggest to do online verify runs regularly e.g. once a month during a low load period.
This document was revised for version 8.4.0 of the DRBD distribution.
Written by Philipp Reisner philipp.reisner@linbit.com and Lars Ellenberg lars.ellenberg@linbit.com.
Report bugs to drbd-user@lists.linbit.com.
Copyright 2001-2008 LINBIT Information Technologies, Philipp Reisner, Lars Ellenberg. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
drbd(8), drbddisk(8), drbdsetup(8), drbdmeta(8), drbdadm(8), DRBD User's Guide[1], DRBD web site[3]