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 😀
I’ve following your work sr, its unfourtunately you dont work under centos 7 but well. Its a great help for me since im working with zimbra now.
Thanks a lot!
Hi Pepe,
Thanks for visit my blog. It should be work also on CentOS 7 🙂
Yup, it works on 7. Forgot to mention it… 😛
Cheers!
Hi Iman,
I’ve followed your instruction and it is working as you described.
But actually I don’t understand how come it is considered as working?
By data replication, I thought each node would have its /dev/drbd0 to be mounted all the time and every changes made on whatever nodes to be reflected on the other node as well.
I still don’t get why we need to do promote/demote on each side.
Maybe I have a wrong concept about drbd. It would be very kind if you could enlighten me
Hi,
You can sync any folder/file on DRBD devices if DRBD has mounted. DRBD can be mounted if have primary status. You can’t mount DRBD on secondary. Albeit secondary did not mounted, secondary always syncing with primary
hi iman,
how can I setup heartbeat in centos 7? or do you have any application to recommend aside from heartbeat?
Dear Iman
I have successfully deployed drbd9 + zimbra in ubuntu 20.04. Everything goes fine. I am facing one thing, when node-1 goes down, node -2 getting up but zimbra all service not getting ok, I have to restart zimbra service manually or by script that’s why down time(zimbra web) getting more.
Is it normal or I have done any mistake..? If have any solution please give me.(I mean no need to restart zimbra service when server switch)
use:
ubuntu 20.04, zimbra 8.8.15, drbd9, pacemaker, corosync and pcs
Hello Ashraful,
I am not experience with Pacemaker, corosync and pcs. So, I cannot give you an advice for this case