DRBDSETUP(8)

NAME
drbdsetup - Setup tool for DRBD

SYNOPSIS
drbdsetup device disk lower_dev meta_data_dev meta_data_index [ -d size ] [ -e err_handler ] [ -f fencing_policy ] [ -b ] drbdsetup device net local_addr [ :port ] remote_addr [ :port ] protocol [ -c time ] [ -i time ] [ -t val ] [ -S size ] [ -k count ] [ -e max_epoch_size ] [ -b max_buffers ] [ -m ] [ -a hash_alg ] [ -x shared_secret ] [ -A asb-0p-policy ] [ -B asb-1p-policy ] [ -C asb-2p-policy ] [ -D ] [ -R role-resync-conflict-policy ] [ -p ping_timeout ] [ -u val ] drbdsetup device syncer [ -a dev_minor ] [ -r rate ] [ -e extents ] drbdsetup device disconnect drbdsetup device detach drbdsetup device down drbdsetup device primary [ -o ] drbdsetup device secondary drbdsetup device invalidate drbdsetup device invalidate-remote drbdsetup device wait-connect [ -t wfc_timeout ] [ -d degr_wfc_timeout ] [ -w ] drbdsetup device wait-sync [ -t wfc_timeout ] [ -d degr_wfc_timeout ] [ -w ] drbdsetup device state drbdsetup device cstate drbdsetup device dstate drbdsetup device resize [ -d size ] drbdsetup device pause-sync drbdsetup device resume-sync drbdsetup device outdate drbdsetup device show-gi drbdsetup device get-gi drbdsetup device show drbdsetup device suspend-io drbdsetup device resume-io drbdsetup device events [ -u ] [ -a ]

DESCRIPTION

drbdsetup is used to associate DRBD devices with their backing block devices, to set up DRBD device pairs to mirror their backing block devices, and to inspect the configuration of running DRBD devices.

NOTE

drbdsetup is a low level tool of the DRBD program suite. It is used by the data disk and drbd scripts to communicate with the device driver.

COMMANDS

Each drbdsetup sub-command might require arguments and bring its own set of options. All values have default units which might be overruled by K, M or G. These units are defined in the usual way (e.g. K = 2^10 = 1024).

  COMMON OPTIONS

All drbdsetup sub-commands accept these two options

--create-device
    In case the specified DRBD device (minor number) does not exist yet, create it implicitly.

--set-defaults
    When --set-defaults is given on the command line, all options of the invoked sub-command that are not explicitly set are reset to their default values.

  DISK

Associates device with lower_device to store its data blocks on. The -d (or --disk-size) should only be used if you wish not to use as much as possible from the backing block devices. If you do not use -d, the device is only ready for use as soon as it was connected to its peer once. (See the net command.)

-d, --disk-size size
    You can override DRBD's size determination method with this option. If you need to use the device before it was ever connected to its peer, use this option to pass the size of the DRBD device to the driver. Default unit is sectors (1s = 512 bytes). If you use the size parameter in drbd.conf, we strongly recommend to add an explicit unit postfix. drbdadm and drbdsetup used to have mismatching default units.

-e, --on-io-error err_handler
    If the driver of the lower_device reports an error to DRBD, DRBD will either pass the error to the upper layers of the operating system, call a helper program, or detach the device from its backing storage and perform all further IO by requesting it from the peer. The valid err_handlers are: pass_on, call-local-io-error and detach.

-f, --fencing fencing_policy
    Under fencing we understand preventative measures to avoid situations where both nodes are primary and disconnected (AKA split brain). Valid fencing policies are:

    dont-care
        This is the default policy. No fencing actions are undertaken.

    resource-only
        If a node becomes a disconnected primary. it tries to outdate the peer's disk. This is done by calling the outdate-peer handler. The handler is supposed to reach the other node over alternative communication paths and call 'drbdadm outdate res' there.

    resource-and-stonith
        If a node becomes a disconnected primary, it freezes all its IO operations and calls its outdate-peer handler. The outdate-peer handler is supposed to reach the peer over alternative communication paths and call 'drbdadm outdate res' there. In case it cannot reach the peer, it should stonith the peer. IO is resumed as soon as the situation is resolved. In case your handler fails, you can resume IO with the resume-io command.

-b, --use-bmbv
    In case the backing storage's driver has a merge_bvec_fn() function, DRBD has to pretend that it can only process IO requests in units not lager than 4kByte. (At time of writing the only known drivers which have such a function are: md (software raid driver), dm (device mapper - LVM) and DRBD itself) To get best performance out of DRBD on top of software raid (or any other driver with a merge_bvec_fn() function) you might enable this function, if you know for sure that the merge_bvec_fn() function will deliver the same results on all nodes of your cluster. I.e. the physical disks of the software raid are exactly of the same type. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.

-i, --no-disk-flushes
    In case you are sure that your storage subsystem has battery-backed write cache, and you know from measurements that it really honors flush instructions by flushing data out from its non-volatile write cache to disk, you have double security. You might then reduce this to single security by disabling forced disk flushes with this option. It might improve performance in this case. If you use this option on plain disk drives, which have volatile write caches (enabled by default), you are at risk to lose your data with every power loss. Only use this option of you understand each and every statement in these two paragraphs.

-m, --no-md-flushes
    Disables the use of disk flushes and barrier BIOs when accessing the meta data device. See the notes on --no-disk-flushes.

  NET

Sets up the device to listen on local_addr:port for incoming connections and to try to connect to remote_addr:port. If port is omitted, 7788 is used as default.

On the TCP/IP link the specified protocol is used. Valid protocol specifiers are A, B, and C.

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.

-c, --connect-int time
    In case it is not possible to connect to the remote DRBD device immediately, DRBD keeps on trying to connect. With this option you can set the time between two tries. The default value is 10 seconds, the unit is 1 second.

-i, --ping-int time
    If the TCP/IP connection linking a DRBD device pair is idle for more than time seconds, DRBD will generate a keep-alive packet to check if its partner is still alive. The default value is 10 seconds, the unit is 1 second.

-t, --timeout val
    If the partner node fails to send an expected response packet within val 10ths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned. The default value is 60 (= 6 seconds).

-S, --sndbuf-size size
    The socket send buffer is used to store packets sent to the secondary node, which are not yet acknowledged (from a network point of view) by the secondary node. When using protocol A, it might be necessary to increase the size of this data structure in order to increase asynchronicity between primary and secondary nodes. But keep in mind that more asynchronicity is synonymous with more data loss in the case of a primary node failure. Since 8.0.13 setting the size value to 0 means that the kernel should autotune this. The default size is 128 KB, the default unit is KB.

-k, --ko-count count
    In case the secondary node fails to complete a single write request for count times the timeout, it is expelled from the cluster. (I.e. the primary node goes into StandAlone mode.) The default is 0, which disables this feature.

-e, --max-epoch-size val
    With this option the maximal number of write requests between two barriers is limited. Should be set to the same as --max-buffers . Values smaller than 100 can lead to degraded performance. The default value is 2048.

-b, --max-buffers val
    With this option the maximal number of buffer pages allocated by DRBD's receiver thread is limited. Should be set to the same as --max-epoch-size . Small values could lead to degraded performance. (Minimum 32) The default value is 2048.

-u, --unplug-watermark val
    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. Minimum 16, default 128, maximum 131072.

-m, --allow-two-primaries
    With this option set you may assign primary role to both nodes. You only should use this option if you use a shared storage file system on top of DRBD. At the time of writing the only ones are: OCFS2 and GFS. If you use this option with any other file system, you are going to crash your nodes and to corrupt your data!

-a, --cram-hmac-alg alg
    You need to specify the HMAC algorithm to enable peer authentication at all. You are strongly encouraged to use peer authentication. The HMAC algorithm will be used for the challenge response authentication of the peer. You may specify any digest algorithm that is named in /proc/crypto.

-x, --shared-secret secret
    The shared secret used in peer authentication. May be up to 64 characters.

-A, --after-sb-0pri asb-0p-policy
    possible policies are:

    disconnect
        No automatic resynchronization, simply disconnect.

    discard-younger-primary
        Auto sync from the node that was primary before the split-brain situation occurred.

    discard-older-primary
        Auto sync from the node that became primary as second during the split-brain situation.

    discard-zero-changes
        In case one node did not write anything since the split brain became evident, sync from the node that wrote something to the node that did not write anything. In case none wrote anything this policy uses a random decision to perform a "resync" of 0 blocks. In case both have written something this policy disconnects the nodes.

    discard-least-changes
        Auto sync from the node that touched more blocks during the split brain situation.

    discard-node-NODENAME
        Auto sync to the named node.

-B, --after-sb-1pri asb-1p-policy
    possible policies are:

    disconnect
        No automatic resynchronization, simply disconnect.

    consensus
        Discard the version of the secondary if the outcome of the after-sb-0pri algorithm would also destroy the current secondary's data. Otherwise disconnect.

    discard-secondary
        Discard the secondary's version.

    call-pri-lost-after-sb
        Always honor the outcome of the after-sb-0pri algorithm. In case it decides the current secondary has the right data, call the pri-lost-after-sb on the current primary.

    violently-as0p
        Always honor the outcome of the after-sb-0pri algorithm. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary's data.

-C, --after-sb-2pri asb-2p-policy
    possible policies are:

    disconnect
        No automatic resynchronization, simply disconnect.

    call-pri-lost-after-sb
        Always honor the outcome of the after-sb-0pri algorithm. In case it decides the current secondary has the right data, call the pri-lost-after-sb on the current primary.

    violently-as0p
        Always honor the outcome of the after-sb-0pri algorithm. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary's data.

-P, --always-asbp
    Normally the automatic after-split-brain policies are only used if current states of the UUIDs do not indicate the presence of a third node. 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 have led to strange UUID sets.)

-R, --rr-conflict role-resync-conflict-policy
    This option sets DRBD's behavior when DRBD deduces from its meta data that a resynchronization is needed, and the SyncTarget node is already primary. The possible settings are: disconnect, call-pri-lost and violently. While disconnect speaks for itself, with the call-pri-lost setting the pri-lost handler is called which is expected to either change the role of the node to secondary, or remove the node from the cluster. The default is disconnect. With the violently setting you allow DRBD to force a primary node into SyncTarget state. This means that with that action the data exposed by DRBD change to the SyncSource's version of the data instantaneously. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.

-p, --ping-timeout ping_timeout
    The time the peer has to answer to a keep-alive packet. In case the peer's reply is not received within this time period, it is considered as dead. The default value is 500ms, the default unit is 100ms.

-D, --discard-my-data
    Use this option to manually recover from a split-brain situation. In case you do not have any automatic after-split-brain policies selected, the nodes refuse to connect. By passing this option you make a node to sync target immediately after successful connect.

  SYNCER

Changes the synchronization daemon parameters of device at runtime.

-r, --rate rate
    To ensure smooth operation of the application on top of DRBD, it is possible to limit the bandwidth that may be used by background synchronization. The default is 250 KB/sec, the default unit is KB/sec.

-a, --after minor
    Start resync on this device only if the device with minor is already in connected state. Otherwise this device waits in SyncPause state.

-e, --al-extents extents
    DRBD automatically performs hot area detection. With this parameter you control how big the hot area (=active set) can get. Each extent marks 4M of the backing storage. In case a primary node leaves the cluster unexpectedly, the areas covered by the active set must be resynced upon rejoining of the failed node. The data structure is stored in the meta-data area, therefore each change of the active set is a write operation to the meta-data device. A higher number of extents gives longer resync times but less updates to the meta-data. The default number of extents is 127. (Minimum: 7, Maximum: 3843)

  PRIMARY

Sets the device into primary role. This means that applications (e.g. a file system) may open the device for read and write access. Data written to the device in primary role are mirrored to the device in secondary role.

Normally it is not possible to set both devices of a connected DRBD device pair to primary role. By using the --allow-two-primaries option, you override this behavior and instruct DRBD to allow two primaries.

-o, --overwrite-data-of-peer
    Becoming primary fails if the local replica is inconsistent. By using this option you can force it into primary state anyway. USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.

  SECONDARY

Sets the device into secondary state. This operation fails as long as at least one application (or file system) has the device open for write access.

It is however, possible that both devices of a connected DRBD device pair are in secondary state.

  INVALIDATE

This forces the local device of a pair of connected DRBD devices into SyncTarget state, which means that all data blocks of the device are copied over from the peer.

This command will fail if the device is not part of a connected device pair.

  INVALIDATE-REMOTE

This forces the local device of a pair of connected DRBD devices into SyncSource state, which means that all data blocks of the device are copied to the peer.

  WAIT-CONNECT

Returns as soon as the device can communicate with its partner device.

-t, --wfc-timeout wfc_timeout

-d, --degr-wfc-timeout degr_wfc_timeout

-w, --wait-after-sb
    This command will fail if the device cannot communicate with its partner for timeout seconds. If the peer was working before this node was rebooted, the wfc_timeout is used. If the peer was already down before this node was rebooted, the degr_wfc_timeout is used. The default value for wfc_timeout is 0 which means to wait forever. The default for degr_wfc_timeout is 120 seconds. In case the connection status goes down to StandAlone because the peer appeared but the devices had a split brain situation, the default for the command is to terminate. You can change this behavior with the --wait-after-sb option.

  WAIT-SYNC

Returns as soon as the device leaves any synchronization into connected state. The options are the same as with the wait-connect command.

  DISCONNECT

Removes the information set by the net command from the device. This means that the device goes into unconnected state and will no longer listen for incoming connections.

  DETACH

Removes the information set by the disk command from the device. This means that the device is detached from its backing storage device.

  DOWN

Removes all configuration information from the device and forces it back to unconfigured state.

  STATE

Shows the current states of the device and its peer. (local/peer).

  CSTATE

Shows the current connection state of the device.

  DSTATE

Shows the current states of the backing storage devices. (local/peer)

  RESIZE

This causes DRBD to reexamine the size of the device's backing storage device. To actually do online growing you need to extend the backing storages on both devices and call the resize command one of your nodes.

  PAUSE-SYNC

Temporarily suspend an ongoing resynchronization by setting the local pause flag. Resync only progresses if neither the local nor the remote pause flag is set. It might be desirable to postpone DRBD's resynchronization after eventual resynchronization of the backing storage's RAID setup.

  RESUME-SYNC

Unset the local sync pause flag.

  OUTDATE

Mark the data on the local backing storage as outdated. An outdated device refuses to become primary. This is used in conjunction with fencing and by the peer's outdate-peer handler.

  SHOW-GI

Displays the device's data generation identifiers verbosely.

  GET-GI

Displays the device's data generation identifiers.

  SHOW

Shows all available configuration information of the device.

  SUSPEND-IO

This command is of no apparent use and just provided for the sake of completeness.

  RESUME-IO

If the outdate-peer handler fails to stonith the peer node, and your fencing policy is set to resource-and-stonith, you can unfreeze IO operations with this command.

  EVENTS

Displays every state change of DRBD and all calls to helper programs. This might be used to get notified of DRBD's state changes by piping the output to another program.

-a, --all-devices
    Display the events of all DRBD minors.

-u, --unfiltered
    This is a debugging aid that displays the content of all received netlink messages.

EXAMPLES

For examples, please have a look at the DRBD User's Guide <URL:http://www.drbd.org/users-guide/>.

VERSION

This document was revised for version 8.0.14 of the DRBD distribution.

AUTHOR

Written by Philipp Reisner <philipp.reisner@linbit.com> and Lars Ellenberg <lars.ellenberg@linbit.com>

REPORTING BUGS

Report bugs to <drbd-user@lists.linbit.com>.

COPYRIGHT

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.

SEE ALSO

drbd.conf(5), drbd(8), drbddisk(8) drbdadm(8) DRBD User's Guide <URL:http://www.drbd.org/users-guide/>, DRBD web site <URL:http://www.drbd.org/>