4.8. Setting options for resources

Currently, it is possible to set the following drbdsetup options:

  1. net-options
  2. peer-device-options
  3. disk-options
  4. resource-options

Additionally, it is possible to set DRBD event handler.

As for example net-options are allowed in the common section as well as per resource, these commands then provide the according switches.

Setting max-buffers for a resource backups looks like this:

# drbdmanage net-options --max-buffers 2048 --resource backups

Setting this option in the common section looks like this:

# drbdmanage net-options --max-buffers 2048 --common

Additionally, there is always an --unset- option for every option that can be specified. So, unsetting max-buffers for a resource backups looks like this:

# drbdmanage net-options --unset-max-buffers --resource backups

It is possible to visualize currently set options with the show-options subcommand.

Setting net-options per site is also supported. Lets assume alpha and bravo should be part of site first and charlie and delta should be part of site second. Further, we want to use DRBD protocol C within the two sites, and protocol A between the sites first and second. This would be set up as follows:

# drbdmanage modify-config
[Node:alpha]
site = first

[Node:bravo]
site = first

[Node:charlie]
site = second

[Node:delta]
site = second
# drbdmanage net-options --protocol C --sites 'first:first'
# drbdmanage net-options --protocol C --sites 'second:second'
# drbdmanage net-options --protocol A --sites 'first:second'

The --sites parameter follows a from:to syntax, where currently from and to have a symetric semantic. Setting an option from first:second also sets this option from second:first.

DRBD event handler can be set in the common section and per resource:

# drbdmanage handlers --common --after-resync-target /path/to/script.sh
# drbdmanage handlers --common --unset-after-resync-target
# drbdmanage handlers --resource backups --after-resync-target /path/to/script.sh