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:

  1. Download the source code.
  2. Unpack the package:
    shell> tar zxf drbd-8.3.0.tar.gz
    
  3. Change to the extracted directory, and then run make to build the DRBD driver:
    shell> cd drbd-8.3.0
    shell> make
    
  4. Install the kernel driver and commands:
    shell> make install
    

Binary Installation:

Retornar