drbd.conf

Name

drbd.conf -- The configuration file for DRBD's devices

Introduction

The /etc/drbd.conf, is read by /etc/init.d/drbd and /etc/ha.d/resrouce.d/datadisk which are included in the drbd distribution.

The file format was designed as to allow to have a verbatim copy of the file on both nodes of the cluster, and in order to keep your configuration manageable you should also do so.

Example 1. A small drbd.conf file

resource drbd0 {
  protocol=C
  fsck-cmd=fsck.ext2 -p -y

  on thost1 {
    device=/dev/nb1
    disk=/dev/hda7
    address=10.1.1.31
    port=7789
  }

  on thost2 {
    device=/dev/nb1
    disk=/dev/hda7
    address=10.1.1.32
    port=7789
  }
}	
In this example there is a singe DRBD resource (called drbd0) which uses protocol C for the connection between its devices. The application of this resource is an ext2 file system, since the command to restart it is fsck.ext2 -p -y. The device which runs on host thost1 uses /dev/nb1 as devices for its application, and /dev/hda7 as low level storage for the data. The IP addresses are used to specify the networking interfaces to use.

There may be multiple resource sections in a singe drbd.conf file.

File Format

The file consists of sections and parameter lines. A section begins with a keyword, sometimes an additional name and an opening brace. A section ends with a closing brace.

A parameter line starts with the identifier of the parameter followed by an equal sign ("="). Every subsequent character on that line is considered as part of the parameters value. There must not be a single white space between the identifier and the equal sing. A special case are Boolean parameters which only consists of the identifier.

Comment lines may be placed into the configuration file and must begin with a hash sign ("#") in the leftmost column.

Sections

resource name

Configures a DRBD resource. Each resource section needs to have two host sections (keyword on) and may have a net and a disk section. Required parameter in this section: protocol, fsck-cmd.

on host-name

Carries the necessary configuration parameters for a DRBD device of the enclosing resource. Required parameters in this section: device, disk, address, port.

disk

This section is used to fine tune DRBD's properties in respect to the low level storage. Please refer to drbdsetup(8) for detailed description of the parameters. Allowed parameters: disk-size, do-panic.

net

This section is used to fine tune DRBD's properties. Please refer to drbdsetup(8) for detailed description of this section's parameters. Allowed parameters: sync-rate, connect-int, skip-sync, ping-int, timeout, tl-size.

Parameter

protocol=prot-id

prot-id may be A, B or C.

fsck-cmd=command

Upon resource takeover datadisk runs the command on the device of the resource. Specify here the command that brings your file system into a consistent state. In case of a journaling file system you may use /bin/true instead.

port=number

Each DRBD resource needs a TCP port number which is used to connect to the node's partner device. Two DRBD resources may not use the same port.

device=name

The name of the block device node of the resource being described. You must use this device with your application (file system) and you must not use the block device which is specified with the disk= parameter.

The device nodes must have the same major number as the DRBD driver has. With the current implementation major 43 is used and the corresponding device nodes are usually named /dev/nb0, /dev/nb1, etc.

disk=name

DRBD uses this block device to actually store and retrieve the data. Never access such a device while DRBD is running on top of it. This holds also true for dumpe2fs(8) and similar commands.

address=ip-addr

A resource needs one IP address per device, which is used to wait for incoming connections from the partner device respectively to reach the partner device.

Author

Written by Philipp Reisner .

Reporting Bugs

Report bugs to .

Copyright

Copyright (c) 2001 Philipp Reisner. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILIT or FITNESS FOR A PARTICULAR PURPOSE.

See Also

drbdsetup(8)