Estou usando OCFS2 com DRBD .
Um recurso do DRBD /etc/drbd.d/r0.res
:
resource r0 {
syncer { rate 1000M; }
net {
allow-two-primaries;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}
startup { become-primary-on both; }
on s1 {
device /dev/drbd1;
disk /dev/sdc;
address ip1:7789;
meta-disk internal;
}
on s2 {
device /dev/drbd1;
disk /dev/xvdb2;
address ip2:7789;
meta-disk internal;
}
}
/dev/drbd1
está formatado como sistema de arquivos ocfs2:
/dev/drbd1 ocfs2 100660180 7427076 93233104 8% /data/webroot
Configuração para o OCFS2 sem marcapasso /etc/ocfs2/cluster.conf
:
node:
ip_port = 7777
ip_address = ip1
number = 0
name = s1
cluster = ocfs2
node:
ip_port = 7777
ip_address = ip2
number = 1
name = s2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
O status do DRBD pode ser visto com o utilitário drbd-overview
:
# drbd-overview
1:r0 Connected Primary/Primary UpToDate/UpToDate C r---- /data/webroot ocfs2 96G 9.8G 87G 11%
ou de /proc/drbd
:
cat /proc/drbd
version: 8.3.8 (api:88/proto:86-94)
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by [email protected], 2010-06-04 08:04:09
1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----
ns:953133955 nr:42207234 dw:1185526354 dr:62396241 al:230084 bm:5853 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0