DRBD

From Bashlinux
(Redirected from Fs-drbd)
Jump to: navigation, search

How to setup DRBD with separated resource and meta-disk

On both servers

  • Create 2 separate partitions on each server, one for meta and one for data. Some meta-disk size approximations:
Block device size DRBD meta data
1 GB 2 MB
100 GB 4+1 MB
500 GB 16+2 MB
1 TB 32+2 MB
2 TB 64+1 MB
4 TB 128 MB
  • If the meta-disk and resource partition are both listed on /etc/fstab, then remove them from there
  • Install drbd
# apt-get -y install drbd8-utils
  • Edit drbd.conf to something similar to:
global { usage-count no; }
common { syncer { rate 100M; } }
resource srv {
       protocol C;
       startup {
               wfc-timeout  15;
               degr-wfc-timeout 60;
       }
       net {
               cram-hmac-alg sha1;
               shared-secret "B1ng0!";
       }
       on SERVER-01p {
               device /dev/drbd0;
               disk /dev/md4;
               address IP_SERVER-01p:7788;
               meta-disk /dev/md3[0];
       }
       on SERVER-01s {
               device /dev/drbd0;
               disk /dev/md4;
               address IP_SERVER-01s:7788;
               meta-disk /dev/md3[0];
       }
}
  • Create resource and meta-disk
# drbdadm create-md srv
  • Start DRBD
# service drbd start

On primary server only
When finish the previous setup on both servers

  • Tell DRBD which one is the