This is what I have in my /etc/init.d/drbdctrl for my HB V1 machines.
This almost always seems to work. I do make sure that all important
services that should be accessing the disk are already dead, but who
knows who may be logged in scanning logfiles etc.
It is important to point fuser -mk at the disk device, not at the mount
point. If the device is already dismounted, that latter syntax kills a
lot of processes that it shouldn't.
#!/bin/bash
case "$1" in
start)
# makes this node the primary node
/sbin/drbdadm primary all
mount /dev/drbd0 /service
;;
stop)
# makes this node the secondary node
fuser -mk /dev/drbd0
sleep 2
umount /service
/sbin/drbdadm secondary all
;;
*)
echo "Usage: /etc/init.d/drbctrl {start|stop}"
exit 1
;;
esac
exit 0
Alastair Young
Director, Operations
Ludi labs
399 West El Camino Real
Mountain View, CA 94040
Email: [EMAIL PROTECTED]
Direct: 650-241-0068
Mobile: 925-784-0812
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Piotr
Kaczmarzyk
Sent: Saturday, April 21, 2007 5:30 AM
To: General Linux-HA mailing list
Subject: Re: [Linux-HA] Forced umount of DRBD volume
> If would be the best to replace underlying DRBD with NFS so that user
could
> still operate on his files without logging out, but user processes
(including
> bash) would have to be restarted to reopen the files.
I'll answer to myself (partially) - first of all I found 'Filesystem'
OCF
script and it's use of fuser command (so the recommended solution is to
kill everything), second - I read a note on
http://www.linux-ha.org/HaNFS
saying that "NFS-mounting any filesystem on your NFS servers is highly
discouraged".
I don't understand why. I did that manually and it worked:
- mounted /dev/drbd2 as /usr/local/mysql-drbd
- added IP 10.0.0.1 to eth0
- started NFS
- mounted via NFS 10.0.0.1:/usr/local/mysql-drbd as /usr/local/mysql
Then:
- stopped mysqld (just in case)
- stopped NFS server
- removed IP 10.0.0.1
- unmounted /dev/drbd2 (only nfsd used it) and set it as secondary
On second node:
- set /dev/drbd2 as primary
- mounted it as /usr/local/mysql-drbd
- added IP 10.0.0.1 to eth0
- started NFS
And the directory was still accessible from the first node. So what's
wrong with such configuration and why it should be avoided? It has
advantages - users having shell access won't notice that something has
changed, postfix will be able to deliver mail queued in local spool,
etc.
Best regards,
Piotr
_______________________________________________
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