Linux-HA Logo

Frequently Asked Questions about DRBD

Contents

  1. Frequently Asked Questions about DRBD
  2. General Issues
    1. What is DRBD, to begin with?
    2. Which license conditions apply to DRBD?
    3. Where do I get Support for DRBD
    4. Where can I download DRBD, or get more information?
  3. Setup and Installation
    1. Can I encrypt/compress the exchanged data?
    2. Can I mount the secondary at least readonly?
    3. Why does DRBD not allow concurrent access from all nodes? I'd like to use it with GFS/OCFS2...
    4. Can DRBD use two devices of different size?
    5. Can XFS be used with DRBD?
    6. When I try to load the drbd module, I am gettin the following error: compiled for kernel version ''some version'' while this kernel is ''some other version''
    7. Can I use DRBD with LVM?
    8. I use DRBD and Linux-vServer, and I cannot umount anymore: "file system in use"
    9. What about Xen, DRBD and iSCSI?
    10. Can I use DRBD with OpenVZ?
  4. Operation Issues
    1. drbdadm create-md fails with "Operation refused." - what can I do?
    2. I get "access beyond end of device" errors, drbd is broken!?
    3. Why is Synchronization (SyncingAll) so slow?
    4. How can I speed up the Synchronization performance?
    5. How can I speed up write throughput?
    6. Why is my "load average" that high?
    7. What is warning: ''Return code 255 from /etc/ha.d/resource.d/datadisk'' telling me when using the datadisk script with heartbeat?
    8. When the node goes from secondary to primary the drbd device will not be mounted on the primary. Manually mounting works.
    9. What is warning: ''out of vmalloc space''
    10. What do the fields like st, ns, nr, dw, dr etc. in /proc/drdb mean?

General Issues

What is DRBD, to begin with?

Which license conditions apply to DRBD?

Where do I get Support for DRBD

Where can I download DRBD, or get more information?

Setup and Installation

Can I encrypt/compress the exchanged data?

Can I mount the secondary at least readonly?

Why does DRBD not allow concurrent access from all nodes? I'd like to use it with GFS/OCFS2...

Can DRBD use two devices of different size?

Can XFS be used with DRBD?

When I try to load the drbd module, I am gettin the following error: compiled for kernel version ''some version'' while this kernel is ''some other version''

Can I use DRBD with LVM?

I use DRBD and Linux-vServer, and I cannot umount anymore: "file system in use"

What about Xen, DRBD and iSCSI?

Can I use DRBD with OpenVZ?

Operation Issues

drbdadm create-md fails with "Operation refused." - what can I do?

I get "access beyond end of device" errors, drbd is broken!?

Why is Synchronization (SyncingAll) so slow?

How can I speed up the Synchronization performance?

How can I speed up write throughput?

Why is my "load average" that high?

What is warning: ''Return code 255 from /etc/ha.d/resource.d/datadisk'' telling me when using the datadisk script with heartbeat?

When the node goes from secondary to primary the drbd device will not be mounted on the primary. Manually mounting works.

What is warning: ''out of vmalloc space''

For each device, drbd will (try to) allocate X MB of bitmap, plus some constant amount (<1MB). X = storage_size_in_GB/32, so 1 TB storage -> 32 MB bitmap.

By default Linux allocates 128MB to Vmalloc. For systems using more than 4TB, this may cause an issue.

If you get the following error message in /var/log/messages, Try a Linux 2.6 hugemem kernel.

kernel: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.

What do the fields like st, ns, nr, dw, dr etc. in /proc/drdb mean?

 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
 ^   ^            ^                    ^                   ^ ^-[*]
 |   |            |                    |                   |
 |   |            |                    |    wire protocol -ยด
 |   |            |                    `- disk state
 |   |            `- state (should be named role, but historically)
 |   `- connection state
 `- minor number

    ns:67582830 nr:1293290 dw:68880243 dr:124296536
    net sent    net read   disk write  disk read

                              al:13693       bm:101
    meta data updates for     activity log   bitmap

                                          ,--------- lo:0 pe:0 ua:0 ap:0
    gauges of currently pending requests, see below.

     ,- resync: used:0/31 hits:335 misses:109 starving:0 dirty:0 changed:109
     |- act_log: used:0/1801 hits:6527480 misses:13790 starving:0 dirty:97 changed:13693
   cache statistics for the resync and activity log in memory cache.
   you can safely ignore these.

[*]: four characters showing certain flag bits

cs
connection state
  • Unconfigured

    Device waits for configuration.

    StandAlone

    Not trying to connect to peer, IO requests are only passed on locally.

    Unconnected

    Transitory state, while bind() blocks.

    WFConnection

    Device waits for configuration of other side.

    WFReportParams

    Transitory state, while waiting for first packet on a new TCP connection.

    Connected

    Everything is fine.

    Timeout, BrokenPipe, NetworkFailure

    Transitory states when connection was lost.

    {i} DRBD-0.6 specific

    SyncingAll

    All blocks of the primary node are being copied to the secondary node.

    SyncingQuick

    The secondary is updated, by copying the blocks which were updated since the now secondary node has left the cluster.

    SyncPaused

    Sync of this device has paused while higher priority (lower sync-group value) device is resyncing.

    {i} DRBD-0.7 / DRBD-8; trailing S or T indicates this node is SyncSource or SyncTarget, respectively.

    WFBitMap{S,T}

    Transitory state when synchronization starts; "dirty"-bits are exchanged.

    SyncSource

    Synchronization in progress, this node has the good data.

    SyncTarget

    Synchronization in progress, this node has inconsistent data.

    PausedSync{S,T}

    see SyncPaused.

    SkippedSync{S,T}

    you should never see this. "Developers only" ;-)

st:Local/Remote
state, the respective node's role for this device.
  • Primary

    the active node; may access the device.

    Secondary

    the passive node; must not access the device; expects mirrored writes from the other node.

    Unconfigured

    this is not a role, obviously.

ld
local data consistentency (DRBD-0.7)
ds
disk state (DRBD 8)
  • Diskless

    No storage attached, or storage had IO errors previously and got detached.

    Attaching

    in the process of attaching the local storage

    Failed

    storage had io errors

    Negotiating

    storage attached, but is not yet decided whether it is UpToDate[21]

    Inconsistent

    storage is Inconsistent (e.g. half way during bitmap based resync)

    Outdated

    storage is consistent, but not UpToDate[21]

    DUnknown

    (peer's) storage state is not known

    Consistent

    storage is consistent, not yet decided whether it is UpToDate[21] or Outdated

    UpToDate[21]

    storage is good

ns,nr,dw,dr,...
statistic counters in number of blocks (1KB) respectively number of requests
  • ns

    network send

    nr

    network receive

    dw

    disk write

    dr

    disk read

    al

    activity log updates (0.7 and later)

    bm

    bitmap updates (0.7 and later)

    lo

    reference count on local device

    pe

    pending (waiting for ack)

    ua

    unack'd (still need to send ack)

    ap

    application requests expecting io-completion


References

[1]http://www.drbd.org/publications.html
[2]http://www.linux-ha.org/DRBD
[3]http://www.linux-ha.org/PhilippReisner
[4]http://www.linux-ha.org/LarsEllenberg
[5]http://www.linbit.com/en/drbd/drbd/support/
[6]http://www.linbit.com/support/drbd-current/
[7]http://www.drbd.org/download.html
[8]http://git.drbd.org/
[9]http://lists.linbit.com/mailman/listinfo/drbd-user
[10]http://sites.inka.de/~bigred/devel/cipe-faq.html
[11]http://openvpn.net/
[12]http://www.linux-ha.org/HaNFS
[13]http://en.wikipedia.org/wiki/OCFS2
[14]http://en.wikipedia.org/wiki/Global_File_System_2
[15]http://git.drbd.org/?p=drbd-8.2.git;a=blob;f=ChangeLog;hb=HEAD
[16]http://thread.gmane.org/gmane.comp.linux.drbd/6175
[17]http://linux-vserver.org/advanced+DRBD+mount+issues
[18]http://lists.xensource.com/archives/html/xen-users/
[19]http://wiki.openvz.org/HA_cluster_with_DRBD_and_Heartbeat
[20]http://thread.gmane.org/gmane.linux.network.drbd/12690/focus=12692
[21]http://www.linux-ha.org/UpToDate


This information provided courtesy of the Linux-HA project at http://linux-ha.org/