4

I have some problems getting a drbd cluster running.

When I want to start creating my storage, i get the following error:

root@raspberrypi-ha1~# drbdadm create-md drbd1
no resources defined

But my resource is definitely defined in /etc/drbd.conf on both hosts:

include "drbd.d/global_common.conf";
include "drbd.d/*.res";

resource drbd1{
        protocol C;

        syncer {
        rate 3M;
        al-extents 257;
}
on raspberrypi-ha1 {
    device    /dev/drbd1;
    disk      /dev/sda1;
    address   192.168.178.201:7789;
    meta-disk internal;
  }
  on raspberrypi-ha2 {
    device    /dev/drbd1;
    disk      /dev/sda1;
    address   192.168.178.202:7789;
    meta-disk internal;
  }

}

The hostname is set to raspberrypi-ha1 Does anyone have an idea?

Matzes
  • 41
  • 1
  • 2
  • The docs instruct the resource definitions should be in `/etc/drbd.d/[resource].res`, not in the main drbd.conf. I checked mine and they are all in `/etc/drbd.d/[resource].res` and work flawlessly. – Gmck Feb 01 '16 at 17:18
  • I changed the configuration back to the default drbd.conf and set up the resource in /etc/drbd.d/drbd1.res, same as above – Matzes Feb 01 '16 at 17:22
  • Did that make a difference? – Gmck Feb 01 '16 at 17:38
  • No it is the same behavior, "no resources defined". – Matzes Feb 01 '16 at 17:45
  • I copied the same configuration file (drbd1.res) to another server (ubuntu 14.04) and there I can use the command drbdadm create-md drbd1 without any errors. Is there a problem with DRBD and debian/raspbian? – Matzes Feb 01 '16 at 18:19
  • Are the addresses of each node in the /etc/hosts files on each? That's only other thing I can think would cause a problem. – Gmck Feb 01 '16 at 21:10
  • yes both are in the /etc/hosts file on each host and i can ping each node with the hostname – Matzes Feb 01 '16 at 21:11
  • What's your DRBD version please ? – Chaminda Bandara May 29 '19 at 11:59

2 Answers2

4

I had the same issue. The fix is quite simple actually. Typically this happens when you update your drbdutils package to version 8.9.6. The configuration file is now in /usr/local/etc/drbd.conf NOT /etc/drbd.conf

Typically the /usr/local/etc/drbd.conf just says to include the file /usr/local/etc/drbd.d/global_common.conf and /usr/local/etc/drbd.d/*.res

So all you need to do is move your config files to the new location. I would remove /etc/drbd.conf and /etc/drbd.d to avoid confusion in the future.

Another very useful command and the one I used to determine the problem is:

drbdadm dump --config-to-test=/dev/null

which dumps the configuration as is.

Drifter104
  • 3,693
  • 2
  • 22
  • 39
0

It looks like there is no space between the resource name (drbd1) and the open bracket; perhaps this is a problem.

Also, DRBD needs the hostnames in your configuration to match exactly what is shown with: $ uname -n

Matt Kereczman
  • 1,887
  • 8
  • 12
  • I have changed the config and added the missing space, but i get the same error message. uname -n gives me raspberrypi-ha1 bzw. on the other node raspberrypi-ha2 – Matzes Feb 01 '16 at 21:20
  • Does your 'global_common.conf' exist? Perhaps try using full paths in the 'include' lines in your 'drbd.conf'. I've seen plenty of people define their devices in drbd.conf as opposed to the convention of placing them in '/etc/drbd.d', and everything else looks good... real head scratcher. Did you compile from source? What options did you use for your utils? – Matt Kereczman Feb 01 '16 at 22:29
  • Yes, the global_common.conf exists. I have installed both raspberry pi new with debian jessy (first try was with wheezy), used the same config and it worked. Must be a problem with wheezy and drbd, not a configuration problem. But thanks for your help. – Matzes Feb 02 '16 at 11:56