Destroy DRBD cluster

Hello
I have 2 nodes drbd cluster, now I need to remove node2 and leave only node1, drbd version is 8.4
what is correct steps to do it ?

Can you describe what you mean by “cluster”? drbd8 doesn’t have any concept of cluster - unlike linstor with drbd9, for example.

Do you have any existing drbd data? Do you want to keep it? If the answer to either of these is “no”, then simply delete all your drbd resources and you’re done.

Are you planning to replace node2? If “yes”, then make sure your resources are primary on node1 before you turn off node2, then leave it as it is until the new node2 comes along. The resources will go into some state like “Primary/Unknown”.

If your final configuration is node1 only, and you have data on node1 that you want to convert from drbd to plain volumes without drbd metadata, then that would require a longer answer.

Its DRBD (drbd device on LVM volume) and Pacemaker, yes disk with important data, final configuration no Pacemaker only node1 server.

If posible to convert to plain volume with data.

Yes, it’s possible; the exact details depend on how you set up drbd.

If you configured drbd with “external metadata” (this is unusual but sometimes done) then you’ll have one LVM volume for your data, and one LVM volume for drbd metadata. All you need do is delete the metadata volume, and you’re done.

More commonly drbd is configured with “internal metadata”, which means there’s a single LVM volume for data and metadata, and metadata goes in a reserved space at the end. You can find out how big the reserved space is like this:

blockdev --getsize64 /dev/drbd0
blockdev --getsize64 /dev/mapper/myvg-myvol   # the underlying LVM volume which drbd is using

The difference between these is the metadata. It’s likely to be a few hundred KiB.

The metadata is at the end of the volume, and hence the filesystem which is inside /dev/drbd0 is aligned with the start of /dev/mapper/myvg-myvol.

Therefore, it’s perfectly fine once you’ve got rid of drbd to mount /dev/mapper/myvg-myvol just as you would have mounted /dev/drbd0. The small amount of wasted space at the end, which held the drbd metadata, can be reclaimed by growing the filesystem, e.g. using resize2fs if it’s an ext4 filesystem.

The usual caveat applies: before doing anything like this, back up your data. (But if your data is important, you were backing it up already, weren’t you?)

HTH.

2 Likes