[NTLUG:Discuss] Primary/Primary DRBD ? Anyone
David Stanaway
david at stanaway.net
Sat Sep 8 23:19:56 CDT 2007
Hey,
is anyone using primary/primary mode in DRBD? I am trying to use that
for a share ocfs2 filesystem and it works, but I need to manually put
each node into primary - it doesn't automatically recover after a node
reboot.
My next project in the same vein was to set up an active/active
iscsi-target cluster sharing a Primary/Primary DRBD LUN for use with
multipath iscsi initators. That also will need to automatically recover
to a primary/primary mode.
One way I could do it is to alter the init scripts to explicitly promote
the node to primary on boot, but I am not sure how that will play with
different split brain scenarios.
[node1] debian/etch
/dev/drbd0 = ocfs2 FS cluster for /home with node1/node2 Primary/Primary
/dev/drbd1 = iscsi-target LUN for multipath access from node3 - with
node1/node2 Primary/Primary
[node2] debian/unstable
/dev/drbd0 = ocfs2 FS cluster for /home with node1/node2 Primary/Primary
/dev/drbd1 = iscsi-target LUN for multipath access from node3 - with
node1/node2 Primary/Primary
[node3] XP Home
iscsi-initiator multipath with node1/node2 for user data.
I know there are other ways to do this. Consider it a personal proof of
concept for potential use for other things at work :)
david at yezhov:~$ cat /etc/drbd.conf | sed -e 's/#.*//' -e '/^ *$/d'
global {
usage-count yes;
}
common {
syncer { rate 10M; }
}
resource home {
protocol C;
handlers {
pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
outdate-peer "/usr/sbin/drbd-peer-outdater";
}
startup {
wfc-timeout 12;
degr-wfc-timeout 120;
}
disk {
on-io-error detach;
}
net {
allow-two-primaries;
cram-hmac-alg "sha1";
shared-secret "boo";
after-sb-0pri disconnect;
after-sb-1pri disconnect;
after-sb-2pri disconnect;
rr-conflict disconnect;
}
syncer {
rate 10M;
al-extents 257;
}
on yezhov {
device /dev/drbd0;
disk /dev/YEZHOV-320G/HOME;
address 10.0.50.6:7788;
meta-disk internal;
}
on huey {
device /dev/drbd0;
disk /dev/HUEY-320G/HOME;
address 10.0.50.5:7788;
meta-disk internal;
}
}
david at yezhov:~$ cat /etc/ocfs2/cluster.conf | sed -e 's/#.*//' -e '/^ *$/d'
node:
ip_port = 7777
ip_address = 10.0.50.6
number = 0
name = yezhov
cluster = ocfs2
node:
ip_port = 7777
ip_address = 10.0.50.5
number = 1
name = huey
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
david at yezhov:~$ cat /etc/ha.d/haresources | sed -e 's/#.*//' -e '/^ *$/d'
yezhov drbddisk::home Filesystem::/dev/drbd0::/home::ocfs2
huey drbddisk::home Filesystem::/dev/drbd0::/home::ocfs2
More information about the Discuss
mailing list