OPERATING DRBD

START

drbdadm up all
#drbdadm up r1

storage1

drbdadm primary r1
drbdadm primary r3

storage2

drbdadm primary r2
drbdadm primary r1

storage3

drbdadm primary r3
drbdadm primary r2

STATUS

lsmod | egrep 'drbd|lru_cache'
cat /proc/drbd # module version
drbdadm | grep -A1 ^Version # tools version
#drbd-overview
#drbdsetup status
drbdadm status
#drbdadm status r1
/etc/init.d/drbd status

STOP

both nodes

drbdadm down all
#drbdadm down r1

RELOAD

do some change and populate

vi /etc/drbd.conf
scp /etc/drbd.conf storage2:/etc/
scp /etc/drbd.conf storage3:/etc/

APPLY ON EVERY NODE

drbdadm adjust-with-progress r1 --dry-run
drbdadm adjust-with-progress r2 --dry-run
drbdsetup disk-options 1 --set-defaults --read-balancing=least-pending
drbdsetup disk-options 2 --set-defaults --read-balancing=least-pending
drbdsetup all show

and show resource configuration

drbdsetup all show
drbdsetup r1 show

ADDING A VDISK

lvcreate -V100G --thin vdisks/thinpool -n sabotage-data
vi /etc/drbd.conf
scp /etc/drbd.conf pro5s2:/etc/drbd.conf

ll /dev/sda3
ll /dev/vdisks/sabotage-data

drbdadm create-md res-data
drbdadm create-md res-sabotage-data

dd if=/dev/zero of=/dev/sda3 bs=1M count=1
dd if=/dev/zero of=/dev/vdisks/sabotage-data bs=1M count=1

drbdadm adjust res-data
drbdadm adjust res-sabotage-data

    drbdadm primary --force res-data
    drbdadm primary --force res-sabotage-data

    drbdadm status

MONITORING

output something only if there is a problem to report

mkdir -p /root/bin/
vi /root/bin/check.drbd.ksh

#!/bin/ksh
tmp=`/usr/local/sbin/drbdadm status | grep '^  disk:' | grep -v '^  disk:UpToDate$'`
[[ -n $tmp ]] && /usr/sbin/drbdadm status
unset tmp

chmod +x /root/bin/check.drbd.ksh

test

/root/bin/check.drbd.ksh

and enable

crontab -e

*/5 * * * * /root/bin/check.drbd.ksh

…assuming you got /etc/aliases defined alright

RESOURCES

drbdadm - Utility for DRBD administration https://docs.linbit.com/man/v9/drbdadm-8/

drbd.conf - DRBD Configuration Files https://docs.linbit.com/man/v9/drbd-conf-5/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun