[drbd] Changes res conf between 8.2/9

Hello everyone,

I have just taken over an infrastructure with DRBD 9.15 with two nodes and two different raids.

I did find the procedure (upgrading DRBD) for upgrading versions, which i intend to do.

But i also realized that the configuration formalist was based on 8x versions and i would like to change it before.

My old configuration on both nodes:

global {
usage-count no;
minor-count 16;
}

common {
syncer {
c-plan-ahead 2;
c-fill-target 2M;
c-min-rate 25M;
c-max-rate 70M;
al-extents 3833;
rate 70M;
}
protocol C;
}

resource resource0 {
on FQDN1 {
device /dev/device0;
disk /dev/raid1;
meta-disk internal;
address IP.IP.IP.IP:PORT;
}
on FQDN2 {
device /dev/device0;
disk /dev/raid2;
meta-disk internal;
address IP.IP.IP.IP:PORT;
}

handlers {
before-resync-target “/usr/lib/drbd/snapshot-resync-target-lvm.sh”;
after-resync-target “/usr/lib/drbd/unsnapshot-resync-target-lvm.sh”;
}
}

I would have liked to both update the configuration and integrate internal load balancing via the second link between the two nodes.

/etc/drbd.conf

include “/etc/drbd.d/global_common.conf”;
include “/etc/drbd.d/*.res”;

/etc/drbd.d/global_common.conf

global {
usage-count no;
minor-count 16;
}

common {
handlers {
before-resync-target “/usr/lib/drbd/snapshot-resync-target-lvm.sh”;
after-resync-target “/usr/lib/drbd/unsnapshot-resync-target-lvm.sh”;
split-brain “/usr/lib/drbd/notify-split-brain.sh root”;
}
disk {
c-plan-ahead 2;
c-fill-target 2M;
c-min-rate 25M;
c-max-rate 70M;
al-extents 3833;
}
net {
protocol C;
}
}

/etc/drbd.d/r0.res

resource “resource0” {

device minor 0;
disk "/dev/device0"
meta-disk internal;

on FQDN1 {
    node-id 0;
    volume 0 {
        disk /dev/raid1;
    }
}
on FQDN2 {
    node-id 1;
    volume 1 {
        disk /dev/raid2;
    }
}
net {
    transport "tcp";
    tls yes;
    load-balance-paths: "yes";
}
connection {
    path {
        host "FQDN1" address IP1.IP1.IP1.IP1:PORT;
        host "FQDN2" address IP1.IP1.IP1.IP1:PORT;
    }
    path {
        host "FQDN1" address IP2.IP2.IP2.IP2:PORT;
        host "FQDN2" address IP2.IP2.IP2.IP2:PORT;
    }
}

}

I tried to follow documentations :

However, i’m not sure I fully understood the differences between versions as regards the “device” / “disk” / “minor” directives and how they now fit together…

Could you tell me if my configuration update seems correct or completely off the mark?

Thanks by advance,
Kind to you,

Greetings rasp,

Firstly, DRBD 9.15 is going be a version used for DRBD userland utilities (drbd-utils). What would be much more interesting would be the version of the kernel module loaded. You can easily check this with a cat /proc/drbd.

Regarding your new configuration file…

resource “resource0” {

device minor 0;
disk "/dev/device0"
meta-disk internal;

on FQDN1 {
    node-id 0;
    volume 0 {
        disk /dev/raid1;
    }
}
on FQDN2 {
    node-id 1;
    volume 1 {
        disk /dev/raid2;
    }
}

The device is used to specify the device node for DRBD. E.G. /dev/drbd1000 you do this in two ways. Either by specifying a minor number as you have done in your config which will result in /dev/drbd0. Alternatively, you can just specify the device node directly. For example, disk /dev/drbd0;. Both will get you the same result.

The disk will be the actual storage device. Such as /dev/raid1; in your example.

A few other things. You specify the disk twice. Once in the global section up top, but you use it more like device. If the physical device path is going to be different for each machine, i.e. /dev/raid1 and /dev/raid2 you’ll need to specify separately in each node as you already have. If they’re going to be identical, you can specify it in the global section up top.

You also specify the volume numbers, but they do not match. They will need to match if you want this to replicate. The volume options is to allow for multi-volume support (multiple disks per node per resource). If you’re simply using one volume, I would just remove it for simplicity (will default to volume 0). For example:

resource “resource0” {

device minor 0;
meta-disk internal;

on FQDN1 {
    node-id 0;
    disk /dev/raid1;
}
on FQDN2 {
    node-id 1;
    disk /dev/raid2;
}