2

I recently set up a DRBD replication on two nodes, did the setup, mounted the drbd disk with "create-md", "up", "connect", etc. I, apparently, was successful when it shows the status "UpToDate", however when I create any file in /var/www, it does not replicate on the secondary, I've tried everything and I can't find out what the problem is. P.S: The first sync has already been done and it still doesn't work

Primary Node Secondary Node /etc/drbd.conf

SO_NAME="Fedora Linux" VERSION="36 (Workstation Edition)"

Froslass
  • 21
  • 1
  • 1
    Did you unmount it on the current Primary, failover (switch Primary and Secondary) then mount the DRBD device on the peer? DRBD is active/passive, you can only access and view the data where the node is Primary. – Dok Jun 15 '22 at 17:56

2 Answers2

2

It works as expected. DRBD is an active-passive replication by default, so only one copy of the data is accessible by host "owning" the volume currently. If you need both servers accessing data simultaneously, you need an active-active replication, global shared volume access, and some clustered file system. Here are some examples.

  1. VMware VSAN + VMFS

https://www.vmware.com/content/vmware/vmware-published-sites/us/products/vsan.html.html

  1. Microsoft S2D + CSFVS

https://learn.microsoft.com/en-us/azure-stack/hci/concepts/storage-spaces-direct-overview

  1. StarWind vSAN + GFSV2

https://www.starwindsoftware.com/starwind-virtual-san

BaronSamedi1958
  • 13,676
  • 1
  • 21
  • 53
Stuka
  • 5,445
  • 14
  • 13
-1

You have to promote and mount the device on the secondary, after unmounting and demoting the device on the primary, before you can access the replicated file system on the peer.

On the current primary:

umount /var/www
drbdadm secondary r0

Then on the other node:

drbdadm primary r0
mount /dev/drbd0 /var/www

Then you should see whatever you wrote on the original primary was replicated to the peer. Usually, people use Pacemaker to automate the failover between peers.

Matt Kereczman
  • 1,899
  • 9
  • 12