Troubleshooting DRBD

The drbd setup involves many different components and problems may arise from different sources. The following sections cover several common problems and give hints to solve the issues.

Configuration

If the initial drbd setup does not work as expected, there is probably something wrong with your configuration.

To get information about the configuration:

  1. Open a terminal console, then log in as the root user.

  2. Test the configuration file by running drbdadm with the -d option. Enter

    drbdadm -d adjust r0
    

    In a dry run of the adjust option, drbdadm compares the actual configuration of the DRBD resource with your DRBD configuration file, but it does not execute the calls. Review the output to make sure you know the source and cause of any errors.

  3. If there are errors in the drbd.conf file, correct them before continuing.

  4. If the partitions and settings are correct, run drbdadm again without the -d option. Enter

    drbdadm adjust r0
    

    This applies the configuration file to the DRBD resource.

Hostnames

For DRBD, hostnames are case sensitive and therefore Node0 would be a different host than node0.

If you have several network devices, and want to use a dedicated network device, the hostname will likely not resolve to the used ip address. In this case, use the parameter disable-ip-verification to make DRBD ignore this fact.

TCP Port 7788

If your system is unable to connect to the peer, this might be a problem of a local firewall. By default, DRBD uses the TCP port 7788 to access the other node. Make sure that this port is accessible on both nodes.

DRBD Devices Broken after Reboot

In cases when DRBD does not know which of the real devices holds the latest data, it changes to a split brain condition. In this case, the respective DRBD subsystems come up as secondary and do not connect to each other. In this case, the following message is written to /var/log/messages:

Split-Brain detected, dropping connection!

To resolve this situation, you must select one node whose modifications should be discarded. Log in to that node and run the following commands:

drbdadm secondary r0 
drbdadm -- --discard-my-data connect r0

On the other node, run the command:

drbdadm connect r0