Readdressing drbd

Hi all, a quick question about DRBD: how can I modify the IP addresses of a DRBD resource without service disruption?

I had the following working network part of the resource configuration:


on east { address 10.0.0.5:7000; }
on west { address 10.0.0.6:7000; }

Now I want to move both hosts to different addresses on the same network. So I added the addresses with

east# ip addr add dev eth0 10.0.0.15/24
west# ip addr add dev eth0 10.0.0.16/24

and I want to update the drbd resource configuration accordingly. I tried the following:

on east { node-id 0; }
on west { node-id 1; }
connection {
    path {
        host east address 10.0.0.5:7000;
        host west address 10.0.0.6:7000;
    }
    path {
        host east address 10.0.0.15:7000;
        host west address 10.0.0.16:7000;
    }
}

Now I want to apply the configuration. I did the drbdadm down and up on the secondary node, and drbdadm adjust on the primary one, but in tcpdump I still see no traffic to 10.0.0.1[56]:7000.

I also tried drbdsetup new-path:

east# drbdsetup new-path myresource 1 10.0.0.15:7000 10.0.0.16:7000
west# drbdsetup new-path myresource 0 10.0.0.16:7000 10.0.0.15:7000
west# drbdsetup del-path myresource 0 10.0.0.6:7000 10.0.0.5:7000
myresource: Failure: (162) Invalid configuration request
additional info from kernel:
del_path on transport failed
west#  

So, what is the recommended way of moving the drbd connection to a different pair of addresses without disrupting the availability of the resource itself?

Thanks!

-Yenya

Paths are “active/passive” in DRBD (by default). If you block DRBD traffic on the currently used path, you should see DRBD replication begin using the secondary path. At which point you can remove the unwanted path from the DRBD configuration and run another DRBD adjust.

Next time, you can simply change the addresses, run a drbdadm adjust <res>, and that should cause the DRBD device to begin using the new address. There will be a tiny hiccup in connectivity, and probably a small resync of anything that changed during the hiccup, but reads/writes to the DRBD device will not be interrupted on the Primary.

I tried to change the addresses and run drbdadm adjust, but I must have done something wrong, as the test resource became stuck. So I went for a more complicated way. I did something similar to what you suggest - I blocked the original connection using iptables, and after 10 seconds or so, drbd switched to the next path, and then drbdsetup del-pathworked as expected.

Thanks!