DRBD 3 nodes howto (Beta Version)
We have installed 3 nodes drbd, but it is not reliable as two DRBD server setup. We are facing some issues after the installation.
[root@drbd1 ~]# yum install drbd83 kmod-drbd83
[root@drbd2 ~]# yum install drbd83 kmod-drb83
[root@drbd3 ~]# yum install drbd83 kmod-drb83
Insert the lines(for first 2 nodes )
vi /etc/drbd.conf
global { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
protocol C;
net {
}
on drbd1.isb.ots.com {
device /dev/drbd0;
disk /dev/hda5;
address 192.168.1.224:7789;
flexible-meta-disk internal;
}
on drbd2.isb.ots.com {
device /dev/drbd0;
disk /dev/hda5;
address 192.168.1.223:7789;
flexible-meta-disk internal;
}
[root@drbd1 ~]# modprobe drbd
[root@drbd2 ~]# modprobe drbd
[root@drbd2 ~]# vi /etc/ha.d/haresources
[root@drbd1 ~]# drbdadm create-md r0
[root@drbd2 ~]# drbdadm create-md r0
HEAR BEAT Setup for 2 nodes (drbd1 , drbd 2)
[root@drbd1 ha.d]# vi ha.cf
logfacility local0
keepalive 2
#deadtime 30 # USE THIS!!!
deadtime 10
bcast eth2
#serial /dev/ttyS0
#baud 19200
auto_failback off
node drbd1.isb.ots.com drbd2.isb.ots.com
[root@drbd1 ha.d]# vi /etc/ha.d/haresources
drbd1.isb.ots.com IPaddr::10.0.0.5/27/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/data::ext3
SAME configuration on node 2 with different name and IP
root@drbd1 ~]# cat /proc/drbd
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:02:24
[root@drbd2 ~]# cat /proc/drbd
version: 8.3.6 (api:88/proto:86-91)
GIT-hash: f3606c47cc6fcf6b3f086e425cb34af8b7a81bbf build by root@drbd2.isb.ots.com, 2009-11-10 08:57:54
[root@drbd1 ~]# /etc/init.d/drbd start
Starting DRBD resources: [ d(r0) s(r0) n(r0) ]....
[root@drbd1 ~]# cat /proc/drbd
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:02:24
0: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:200736
[root@drbd2 ~]# /etc/init.d/drbd start
[root@drbd2 ~]# cat /proc/drbd
version: 8.3.6 (api:88/proto:86-91)
GIT-hash: f3606c47cc6fcf6b3f086e425cb34af8b7a81bbf build by root@drbd2.isb.ots.com, 2009-11-10 08:57:54
0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:200736
[root@drbd1 ~]# drbdadm -- --overwrite-data-of-peer primary r0
[root@drbd1 ~]# cat /proc/drbd
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:02:24
0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----
ns:70656 nr:0 dw:0 dr:70656 al:0 bm:4 lo:0 pe:100 ua:0 ap:0 ep:1 wo:b oos:133280
[======>.............] sync'ed: 36.0% (133280/200736)K
finish: 0:00:15 speed: 8,432 (8,432) K/sec
For Node 3
Now add 3rd node resource on /etc/drbd.conf
}
resource r1 {
protocol A;
syncer {
after r0;
rate 12M;
al-extents 513;
}
net {
}
stacked-on-top-of r0 {
device /dev/drbd3;
address 192.168.1.224:7788; # Virtul of 2 node DRBD clusterIP provided by Heartbeat
}
on drbd3.isb.ots.com {
device /dev/drbd3;
disk /dev/hda5;
address 192.168.1.225:7788; # Public IP of the backup node
meta-disk internal;
}
}
[root@drbd1 ~]# drbdadm --stacked create-md r1
[root@drbd1 ~]# drbdadm --stacked up r1
[root@drbd1 ~]# drbdadm --stacked -- --overwrite-data-of-peer primary r1
[root@drbd3 ~]# drbdadm create-md r1
root@drbd3 ~]# cat /proc/drbd
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:02:24
3: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate A r—-
ns:0 nr:40524 dw:37720 dr:0 al:0 bm:1 lo:702 pe:0 ua:701 ap:0 ep:1 wo:b oos:162972
[===>…………….] sync’ed: 20.5% (162972/200692)K
finish: 0:00:17 speed: 9,428 (9,428) K/sec
[root@drbd3 ~]#