Installing and Configuring DRBD
To install DRBD, you can choose either the pre-built binary installation packages, or you can use the source packages and build from source. To build from source, you must have installed the source and development packages.
To install using a binary distribution, ensure that the kernel version number of the binary package matches your currently active kernel. You can use uname to find out this information:
shell> uname -r 2.6.20-gentoo-r6
Once DRBD has been built and installed, edit the /etc/drbd.conf
file and then run a number of commands to build the block device and set up the replication.
Although the steps below are split into those for the primary node and the secondary node, the configuration files for all nodes should be identical, and many of the same steps have to be repeated on each node to enable the DRBD block device.
Building from source:
To download and install from the source code:
- Download the source code.
- Unpack the package:
shell> tar zxf
drbd-8.3.0.tar.gz
- Change to the extracted directory, and then run make to build the DRBD driver:
shell> cd drbd-8.3.0 shell> make
- Install the kernel driver and commands:
shell> make install
Binary Installation:
- SUSE Linux Enterprise Server (SLES)
For SUSE, use yast:
shell> yast -i drbd
Alternatively:
shell> rug install drbd
- Debian
Use apt-get to install the modules. You do not need to install any other components.
shell> apt-get install drbd8-utils drbd8-module
- Debian 3.1 and 4.0
You must install the
module-assistant
to build the DRBD kernel module, in addition to the DRBD components.shell> apt-get install drbd0.7-utils drbd0.7-module-source \ build-essential module-assistant shell> module-assistant auto-install drbd0.7
- CentOS
DRBD can be installed using
yum
:shell> yum install drbd kmod-drbd
- Ubuntu
Enable the universe component for your preferred Ubuntu mirror in
/etc/apt/sources.list
, then issue these commands:shell> apt-get update shell> apt-get install drbd8-utils drbd8-module-source \ build-essential module-assistant shell> module-assistant auto-install drbd8
- Gentoo
You can now emerge DRBD 0.8.x into your Gentoo installation:
root-shell> emerge drbd
Once
drbd
is downloaded and installed, decompress and copy the default configuration file from/usr/share/doc/drbd-8.0.7/drbd.conf.bz2
into/etc/drbd.conf
.