1
votes

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:

  1. stop the drbd service on server1 and server2.
  2. change the IP of server2.
  3. change the hosts file.
  4. change the drbd config.
  5. start the DRBD service on server1 and server2.

And then I got some error such as diskless. So what's the correct step to change the IP and avoid data loss?

1

1 Answers

2
votes
  1. # drbdadm disconnect <resource_name> # on both nodes
  2. Change the IP address within the /etc/drbd.d/<resource_name>.res file on both nodes
  3. # 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.