Hello Madison,
Your drbd configuration seems to work fine, but keep in mind that you
can only mount a drbd device that is in prmary state. So you have to
umount the filesystem on the master, switch drbd devices to secondary
mode and switch to primary mode on the slave ... but that can make
heartbeat for you ;-)
You configured your system ....mmmmh ... not in the easiest way ;-)
... I also configured DRBD8 today and the integration into heartbeat
is planned for next Monday. I configured it like this:
1) download latest tar.gz from drbd.org and compiled rpm packages on CentOS
2) installed packages on both nodes, doing an "modprobe drbd" do see
the module loads flawlessly
3) created a /etc/drbd.conf, copied to both nodes, tested with
"drbdadm -d up all"
4) executed "drbdadm up all" on both nodes ... watched kernel messages
with "dmesg"
5) executed "drbdadm -- --overwrite-data-of-peer primary all" on first node
6) created mountpoint on both nodes, created file system on primary
node on device /dev/drbd0, mounted filesystem ... works
7) activated /etc/init.d/drbd init script at system startup ... on
centos: chkconfig drbd on.... so the drbd devices get activated on
system startup in secondary mode, on both nodes
To enable the filesystem on the slave, the master has to be set to
secondary mode:
master# umount /dev/drbd0
master# drbdadm secondary all
slave# drbdadm primary all
slave# mount /dev/drbd0 /mnt
Works fine ... unmounted file system, made all secondary ... next step
heartbeat configuration ;-)
You normally don't need all these "low-level" drbd commands ....
drbdadm does that for you. At system startup the drbd init script
prepares the drbd devices and Heartbeat does the activation of the
primary and all the rest for you.
Regards,
Andreas
On 6/22/07, Madison Kelly <[EMAIL PROTECTED]> wrote:
Hi all,
With my heartbeat errors dealt with, I am back thumping my head
against the wall trying to get DRBD8 working. Unfortunately, The website
for DRBD on Linux-HA.org is no help. The section on a DRBD config is a
'TODO' entry. Alas...
I have been documenting everything I've been doing and am more than
happy to update the website's config once I figure it out (or rather,
provide my docs to the site maintainer). Could you guys help me once
more to try and get this working?
In short, I can create the device, format the primary and sync to the
slave. Though once I down the master and mount the DRBD device on the
slave I get the no filesystem error, so obviously it's not actually
sync'ing.
Here are my notes detailing everything I have done:
-=-=-] Notes with mistake(s) [-=-=-
### On each nodes:
# Create the '/dev/drbd' device. This assumes the resource in question
# is named 'r0' in '/etc/drbd.conf'.
drbdadm create-md r0
# If you are asked: 'Valid meta-data already in place, recreate new?'
# enter:
yes
# Examples:
# drbdsetup /dev/drbd0 disk /dev/sda3 /dev/sda3 internal \
# --set-defaults --create-device --on-io-error=detach
# drbdsetup /dev/drbd0 disk /dev/cciss/c0d0p3 /dev/cciss/c0d0p3 \
# internal --set-defaults --create-device --on-io-error=detach
drbdsetup /dev/drbd0 disk /dev/<device> /dev/<device> internal \
--set-defaults --create-device --on-io-error=detach
# Make the directory you will mount the DRBD partition on
mkdir /ha
# On the master node:
drbdsetup /dev/drbd0 primary -o
/etc/ha.d/resource.d/drbddisk r0 start
# Now initialize the array:
drbdadm -- --overwrite-data-of-peer primary all
# Now on the master server, format the partition:
# change the 'mkfs...' command to match the FS you want. If it's not
# <which?> filesystems then DON'T mount the FS on the slave!
mkfs.ext3 /dev/drbd0
# On each terminal issue:
drbdadm -d adjust r0 # Does a 'd'ry-run and shows you what
# you need to do.
<run the commands given by the above call>
<Wait some time while the disks sync. Monitor by examining '/proc/drbd'>
# Watch the sync with this pseudo-script:
perl -e '$foo=1; while($foo == 1 ) { system "clear"; print "Status on:
"; system "echo `uname -n`"; system "cat /proc/drbd"; sleep 1; }'
# Now edit the '/etc/ha.d/haresources' and edit the entry to read
# something like:
vash 192.168.2.13 drbddisk::r0 Filesystem::/dev/drbd0::/ha::ext3
postgresql-8.1 apache2
# Each machine add the following lines to '/etc/rc.local'.
# If necessary set this file to 'chmod 755':
# The last line in '/etc/rc.local' must be 'exit 0'!
# Master:
drbdsetup /dev/drbd0 disk /dev/cciss/c0d0p3 /dev/cciss/c0d0p3 internal
--set-defaults --create-device --on-io-error=detach
drbdsetup /dev/drbd0 primary -o
mount /dev/drbd0 /ha
# Slave
drbdsetup /dev/drbd0 disk /dev/sda3 /dev/sda3 internal --set-defaults
--create-device --on-io-error=detach
drbdsetup /dev/drbd0 secondary
-=-=-] Notes with mistake(s) [-=-=-
Can anyone see/point out where I am going wrong? I can remount the
DRBD partition on the master and the data is still there... It just
seems to not want to sync to the slave. At this point, here is the
output of '/proc/drbd' on the:
# Master:
Status on: vash
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by [EMAIL PROTECTED], 2007-06-21 15:05:15
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:2222564 nr:0 dw:1694000 dr:2200083 al:1448 bm:2450 lo:0 pe:0
ua:0 ap:0
resync: used:0/31 hits:137428 misses:756 starving:0 dirty:0
changed:756
act_log: used:0/257 hits:422052 misses:1832 starving:0
dirty:384 changed:1448
# Slave:
Status on: minuet
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by [EMAIL PROTECTED], 2007-06-21 15:04:42
0: cs:Connected st:Secondary/Primary ds:UpToDate/UpToDate C r---
ns:0 nr:2222564 dw:2222564 dr:0 al:0 bm:756 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:137428 misses:756 starving:0 dirty:0
changed:756
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
Thanks!!
Madison Kelly
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems