Can't run drbdadm up with DRBD 8.4 on CentOS 7.3
You don't want to create the filesystem on your backing disks for DRBD (sdb
and sdc
); you want to create the DRBD first, and then format the resulting DRBD device with your filesystem. It can be done the other way, but then you'd need to grow the backing partition, or reduce the size of the filesystem to make room for DRBD's metadata (which lives at the end of the block device when using internal metadata).
The process should be something like this:
-Install all your software like you have done above.
-Zero out your partition on both nodes (optional, but do it):
# dd if=/dev/zero of=/dev/sdb bs=1M oflag=direct status=progress
# dd if=/dev/zero of=/dev/sdc bs=1M oflag=direct status=progress
-Create the configuration file for your DRBD resources like you have done above.
-Add the firewall rules like you've done above (except you don't really need the port 7799, as that's not used in your configuration).
-Create DRBD's metadata on the backing block devices, and bring up r0
on both nodes:
# drbdadm create-md r0
# drbdadm up r0
# cat /proc/drbd
-Check the output of cat /proc/drbd
, you should see your device is Connected
, Secondary/Secondary
, and Inconsistent/Inconsistent
. If any of those things are NOT true, STOP, something isn't right.
-Then, pick either node (NOT BOTH), force it to be primary (DRBD will not let you go primary on a node with Inconsistent
data) and create the FS:
# drbdadm primary r0 --force
# mkfs.ext4 /dev/drbd0
Then you'd use /dev/drbd0
just like you would have used /dev/sda
or /dev/sdc
; don't touch /dev/sdb
or /dev/sdc
ever again unless you're confident in what you're doing. Touching DRBD's backing disks can introduce inconsistencies that DRBD will be unaware of (until you run a verify
or otherwise overwrite the block).
Keep reading LINBIT's documentation. DRBD is obviously a great tool, and is easy to use once you understand the basics, but you're dealing with storage so there is a lot of room to mess things up in a permanent way.