How do I change the node IP of DRBD?
This is my config:
resource data {
protocol C;
on server1 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.56.101:7788;
meta-disk internal;
}
on server2 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.56.103:7788;
meta-disk internal;
}
}
These are the steps I took:
And then I got some error such as diskless. So what's the correct step to change the IP and avoid data loss?
# drbdadm disconnect <resource_name> # on both nodes
/etc/drbd.d/<resource_name>.res
file on both nodes# drbdadm adjust <resource_name> # on both nodes
When DRBD starts it runs through a series of steps, if any one of these fails it will skip the latter steps. One of these steps is to create a TCP socket. If it fails to do that, it will skip the latter steps, one of which is attaching to the disk.
I suspect in your case, that DRBD fails to find the IP address to use present on the system, and thus skips the latter steps of attaching to the disk, and thus starts up connectionless and diskless. Make sure the IP address you're changing DRBD to use is already present on the systems.