November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

DRBD

db1.rmohan.com 192.168.1.105
db2.rmohan.com 192.168.1.106
Add a hard disk

fdisk /dev/sdb
wget http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch
rpm -ivUh elrepo-release-6-4.el6.elrepo.noarch.rpm

vi /etc/yum.repos.d/elrepo.repo

Edit /etc/yum.repos.d/elrepo.repo ( change line #8 ‘enable=0′ )
yum –enablerepo=elrepo install drbd83-utils kmod-drbd83
yum -y install parted

partprobe /dev/sdb1

pvcreate /dev/sdb1

vgcreate vg_db /dev/sdb1
lvcreate -n lv_db -L +50G vg_db
lvcreate -n lv_meta -L +10G vg_db
groupadd haclient
chgrp haclient /sbin/drbdsetup
chmod o-x /sbin/drbdsetup
chmod u+s /sbin/drbdsetup
chgrp haclient /sbin/drbdmeta
chmod o-x /sbin/drbdmeta
chmod u+s /sbin/drbdmeta

 

global {
usage-count yes;
}

common {
syncer { rate 300M; }
}

resource r0 {
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/lib/heartbeat/drbd-peer-outdater -t 5”;
}

startup {
}

disk {
on-io-error detach;
}

net {
after-sb-0pri disconnect;
after-sb-1pri disconnect;
after-sb-2pri disconnect;
rr-conflict disconnect;
}

syncer {
rate 300M;
al-extents 257;
}

on db1.rmohan.com {
device /dev/drbd0;
disk /dev/vg_db/lv_db;
address 192.168.1.105:7788;
meta-disk /dev/vg_db/lv_meta[1];
}

on db2.rmohan.com {
device /dev/drbd0;
disk /dev/vg_db/lv_db;
address 192.168.1.106:7788;
meta-disk /dev/vg_db/lv_meta[1];

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>