Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
Hi,
I'm a begginner with DRBD. I read all the docs on the drbd site, and
some on linux-ha's website (still reading). I've also done some work
with Heartbeat (http + mysql) but stopped it because I was using
Master-Slave MySQL replication and it caused problems. Hence my testing
with DRBD now.
I've been slightly disappointed about DRBD's doc. I feel like I'm a
total linux newbie, but I haven't found a concise tutorial or article
explaining the critical steps of setting a simple drdb setup. Please
correct me if I'm wrong, but here are the steps I've found. I'm using
CentOS 4 so it is rather easy to install heartbeat and drbd.
My goal is to be able to write a simple tutorial to get 2 servers to
use heartbeat + drbd to make a HA cluster for one application.
1- Install heartbeat + drbd
# yum install heartbeat
# yum install drbd
# yum install kernel-module-drbd
So these packages (and their dependencies) are installed:
heartbeat-1.2.3.cvs.20050927-1.centos4
drbd-0.7.14-1.centos4
kernel-module-drbd-2.6.9-34.EL-0.7.14-1.centos4
2- Setup the drbd system
In /etc/drbd.conf, I put (on both servers)
================================
resource drbd0 {
protocol C;
incon-degr-cmd "halt -f";
on www1.test.local {
device /dev/drbd0;
disk /dev/sdb;
address 192.168.2.200:7789;
meta-disk internal;
}
on www2.test.local {
device /dev/drbd0;
disk /dev/sdb;
address 192.168.2.201:7789;
meta-disk internal;
}
}
===============================
3- Start drbd
# service drbd start
4- Make the primary primary
# drbdadm -- --do-what-I-say primary all
5- Check the status
# watch cat /proc/drbd
6- Once in sync, create a filesystem on the drbd device (on both servers)
# mkfs -t ext3 /dev/drbd0
7- Create a mount point (both servers)
# mkdir /drbd
8- Mount the drbd device on it (only on the primary)
# mount /dev/drbd0 /drbd
Finally, integrate with Heartbeat (which I haven't understood yet either.
Am I ok? One question I had is:
I've seen some examples using partition devices instead of disk devices
in drbd.conf. How do they do that? What kind of partition do they
create on the disk to be able to put a drbd device over it? My example
uses /dev/sdb, which is the 2nd SCSI disk. I didn't create any
partition on it, in fact, the partition is the drbd device and I created
the FS on the drbd device. Is that OK? Would it be better to use a
partition instead? How?
Thanks,
Ugo Bellavance