Testing Data Replication/Synchronize on DRBD

Home » Linux » Testing Data Replication/Synchronize on DRBD
Linux No Comments

After configuration DRBD in the previous article, we must test first for ensure whether DRBD has been working properly or not. This is some testing to ensure DRBD has been worked

# TESTING ON NODE1

– Create folder tmp in /mnt folder

mkdir /mnt/tmp

– Mount DRBD devices into tmp folder who has been created

mount /dev/drbd0 /mnt/tmp

– Create file/folder into tmp folder

touch /mnt/tmp/created-on-node1.txt

– Please check whether file created-on-node1.txt has been there

ls /mnt/tmp/

– For testing/check on node2, umount DRBD devices and demoting into secondary

umount /dev/drbd0
drbdadm secondary r0

– Make sure DRBD has been demoted into Secondary

service drbd status

# TESTING ON NODE2

– Create folder tmp in /mnt folder

mkdir /mnt/tmp

– Promoting DRBD into Primary

drbdadm primary r0

– Mount DRBD devices into tmp folder who has been created

mount /dev/drbd0 /mnt/tmp

– Please check whether file created-on-node1.txt has been there too

ls /mnt/tmp/

If the file has been there, it’s meant DRBD has been replicated

– Umount DRBD devices, demoting again into secondary and promoting node1 into primary

umount /dev/drbd0
drbdadm secondary r0
service drbd status

# PROMOTING NODE1 INTO PRIMARY

run the following command on node1

service drbd status
drbdadm primary r0

Good luck and hopefully useful 😀

LEAVE A COMMENT