2

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?

  • 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 1 '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 1 '16 at 17:22
  • Did that make a difference? – Gmck Feb 1 '16 at 17:38
  • No it is the same behavior, "no resources defined". – Matzes Feb 1 '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 1 '16 at 18:19
2

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.

| improve this answer | |
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

| improve this answer | |
  • 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 1 '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 1 '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 2 '16 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.