hi,<br><br>i have two machine with gentoo installed with heartbeat 2.0.7, drbd 8.0.4 and mon<br><br>this setup is made for having a failover environment for a web application (apache2.2 + php + mysql)<br><br>when
mon stop the heartbeat or when i stop the heartbeat the machine is
restarted because the drbd device cannot be setted in secondary mode
<br><br>below are file config for heartbeat and for drbd<br><br>regards,<br>cosmih<br><br><br>/etc/ha.d/ha.cf<br>---------------------<br>debugfile /var/log/ha-debug<br>logfile /var/log/ha-log<br>logfacility local0<br>
keepalive 3<br>deadtime 12<br>warntime 9<br>initdead 20<br>udpport 694<br>baud 38400<br>serial /dev/ttyS0<br>auto_failback off<br>watchdog /dev/watchdog<br>node host01 host02<br>ping gateway_ip<br>respawn cluster /usr/lib/heartbeat/ipfail
<br>crm off<br>---------------------------<br><br>/etc/ha.d/haresources<br>-------------------------------<br>host02
ip1/27/eth1/broadcast ip2/27/eth1/broadcast ip3/27/eth1/broadcast
ip4/27/eth1/broadcast arpUpdate::ip1/ip2/ip3/ip4 drbddisk::mirror
sleep5 Filesystem::/dev/drbd0::<div id="mb_0">/mirror::reiserfs mountFORftp mysql apache2 fcron mon sshd_ip1
<br>------------------------------------<br>where arpUpdate,sleep5,mountFORftp and sshd_ip are some script made by me ... and this script works verry well<br><br>/etc/drbd.conf<br>--------------------<br>global {<br> usage-count no;
<br>}<br>common {<br> syncer { rate 70M; }<br>}<br>resource mirror {<br> protocol C;<br> handlers {<br> pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";<br> pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
<br> local-io-error "echo o > /proc/sysrq-trigger ; halt -f";<br> outdate-peer "/usr/sbin/drbd-peer-outdater";<br> }<br> startup {<br> wfc-timeout 12;<br> degr-wfc-timeout 120; # 2 minutes.
<br> }<br> disk {<br> on-io-error detach;<br> }<br> net {<br> cram-hmac-alg "md5";<br> shared-secret "somepass";<br> after-sb-0pri discard-younger-primary;<br> after-sb-1pri consensus;
<br> after-sb-2pri disconnect;<br> rr-conflict disconnect;<br> }<br> syncer {<br> rate 70M;<br> al-extents 257;<br> }<br> on host01 {<br> device /dev/drbd0;<br> disk /dev/sda7;<br> address
<a href="http://10.0.0.1:7788/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.0.0.1:7788</a>;<br> meta-disk /dev/sda8[0];<br> }<br> on host02 {<br> device /dev/drbd0;<br> disk /dev/sda7;
<br> address <a href="http://10.0.0.2:7788/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.0.0.2:7788
</a>;<br> meta-disk /dev/sda8[0];<br> }<br>}<br><br><br>here is the ha-debug log (the real IP was replaced)<br>-------------------------------------<br>heartbeat[6522]: 2007/07/03_11:35:54 info: Heartbeat shutdown in progress. (6522)
<br>heartbeat[10706]: 2007/07/03_11:35:54 info: Giving up all HA resources.<br>ResourceManager[10716]:
2007/07/03_11:35:54 info: Releasing resource group: host02
ip1/27/eth1/gateway_ip ip2/27/eth1/gateway_ip ip3/27/eth1/gateway_ip
ip4/27/eth1/gateway_ip arpUpdate::ip1/ip2/ip3/ip4 drbddisk::mirror
sleep5 Filesystem::/dev/drbd0::/mirror::reiserfs mountFORftp mysql apache2 fcron mon sshd_ip1
<br>ResourceManager[10716]: 2007/07/03_11:35:54 info: Running /etc/ha.d/resource.d/sshd_ip1 stop<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: Starting /etc/ha.d/resource.d/sshd_ip1 stop<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: /etc/ha.d/resource.d/sshd_ip1 stop done. RC=0
<br>ResourceManager[10716]: 2007/07/03_11:35:54 info: Running /etc/ha.d/resource.d/mon stop<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: Starting /etc/ha.d/resource.d/mon stop<br> [32;01m* [0m Stopping mon ...
<br> [A [72C [34;01m[ [32;01mok [34;01m ] [0m<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: /etc/ha.d/resource.d/mon stop done. RC=0<br>ResourceManager[10716]: 2007/07/03_11:35:54 info: Running /etc/ha.d/resource.d/fcron stop
<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: Starting /etc/ha.d/resource.d/fcron stop<br>Stopping fcron din heartbeat<br>11:35:54 reinstalling root's fcrontab<br>11:35:54 installing file /tmp/fcr-rCHC7Y for user root
<br>Modifications will be taken into account right now.<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: /etc/ha.d/resource.d/fcron stop done. RC=0<br>ResourceManager[10716]: 2007/07/03_11:35:54 info: Running /etc/ha.d/resource.d/apache2 stop
<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: Starting /etc/ha.d/resource.d/apache2 stop<br> [33;01m* [0m WARNING: apache2 has not yet been started.<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: /etc/ha.d/resource.d/apache2 stop done. RC=0
<br>ResourceManager[10716]: 2007/07/03_11:35:54 info: Running /etc/ha.d/resource.d/mysql stop<br>ResourceManager[10716]: 2007/07/03_11:35:54 debug: Starting /etc/ha.d/resource.d/mysql stop<br> [32;01m* [0m Stopping mysql ...
<br> [32;01m* [0m Stopping mysqld (0)<br> [A [72C [34;01m[ [32;01mok [34;01m ] [0m<br>ResourceManager[10716]: 2007/07/03_11:35:57 debug: /etc/ha.d/resource.d/mysql stop done. RC=0<br>ResourceManager[10716]: 2007/07/03_11:35:57 info: Running /etc/ha.d/resource.d/mountFORftp stop
<br>ResourceManager[10716]: 2007/07/03_11:35:57 debug: Starting /etc/ha.d/resource.d/mountFORftp stop<br>Unmounting /home/tony/website & /home/black/website<br>ResourceManager[10716]: 2007/07/03_11:35:57 debug: /etc/ha.d/resource.d/mountFORftp stop done. RC=0
<br>ResourceManager[10716]: 2007/07/03_11:35:57 info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /mirror reiserfs stop<br>ResourceManager[10716]: 2007/07/03_11:35:57 debug: Starting /etc/ha.d/resource.d/Filesystem /dev/drbd0 /mirror reiserfs stop
<br>Filesystem[11147]: 2007/07/03_11:35:57 INFO: Running stop for /dev/drbd0 on /mirror<br>Filesystem[11147]: 2007/07/03_11:35:57 INFO: Trying to unmount /mirror<br>Filesystem[11147]: 2007/07/03_11:35:57 INFO: unmounted /mirror successfully
<br>Filesystem[11083]: 2007/07/03_11:35:57 INFO: Filesystem Success<br>INFO: Filesystem Success<br>ResourceManager[10716]:
2007/07/03_11:35:57 debug: /etc/ha.d/resource.d/Filesystem /dev/drbd0
/mirror reiserfs stop done. RC=0
<br>ResourceManager[10716]: 2007/07/03_11:35:57 info: Running /etc/ha.d/resource.d/sleep5 stop<br>ResourceManager[10716]: 2007/07/03_11:35:57 debug: Starting /etc/ha.d/resource.d/sleep5 stop<br><br>ResourceManager[10716]: 2007/07/03_11:36:02 debug: /etc/ha.d/resource.d/sleep5 stop done. RC=0
<br>ResourceManager[10716]: 2007/07/03_11:36:02 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:02 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone
<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:02 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:02 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk
<br>ResourceManager[10716]: 2007/07/03_11:36:03 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:03 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:03 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop
<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:03 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11
<br>ResourceManager[10716]: 2007/07/03_11:36:03 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>ResourceManager[10716]: 2007/07/03_11:36:04 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:04 info: Running /etc/ha.d/resource.d/drbddisk mirror stop
<br>ResourceManager[10716]: 2007/07/03_11:36:04 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11
<br>ResourceManager[10716]: 2007/07/03_11:36:04 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:04 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>
ResourceManager[10716]: 2007/07/03_11:36:05 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:05 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:05 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop
<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:05 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11
<br>ResourceManager[10716]: 2007/07/03_11:36:05 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>ResourceManager[10716]: 2007/07/03_11:36:06 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:06 info: Running /etc/ha.d/resource.d/drbddisk mirror stop
<br>ResourceManager[10716]: 2007/07/03_11:36:06 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11
<br>ResourceManager[10716]: 2007/07/03_11:36:06 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:06 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>
ResourceManager[10716]: 2007/07/03_11:36:07 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:07 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:07 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop
<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:07 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11
<br>ResourceManager[10716]: 2007/07/03_11:36:07 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>ResourceManager[10716]: 2007/07/03_11:36:08 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:08 info: Running /etc/ha.d/resource.d/drbddisk mirror stop
<br>ResourceManager[10716]: 2007/07/03_11:36:08 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11
<br>ResourceManager[10716]: 2007/07/03_11:36:08 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:08 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>
ResourceManager[10716]: 2007/07/03_11:36:09 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:09 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:09 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop
<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:09 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11
<br>ResourceManager[10716]: 2007/07/03_11:36:09 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>ResourceManager[10716]: 2007/07/03_11:36:10 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:10 info: Running /etc/ha.d/resource.d/drbddisk mirror stop
<br>ResourceManager[10716]: 2007/07/03_11:36:10 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11
<br>ResourceManager[10716]: 2007/07/03_11:36:10 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:10 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>
ResourceManager[10716]: 2007/07/03_11:36:11 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:11 info: Running /etc/ha.d/resource.d/drbddisk mirror stop<br>ResourceManager[10716]: 2007/07/03_11:36:11 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop
<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11<br>ResourceManager[10716]: 2007/07/03_11:36:11 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11
<br>ResourceManager[10716]: 2007/07/03_11:36:11 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>ResourceManager[10716]: 2007/07/03_11:36:12 info: Retrying failed stop operation [drbddisk::mirror]<br>ResourceManager[10716]: 2007/07/03_11:36:12 info: Running /etc/ha.d/resource.d/drbddisk mirror stop
<br>ResourceManager[10716]: 2007/07/03_11:36:12 debug: Starting /etc/ha.d/resource.d/drbddisk mirror stop<br>State change failed: (-12) Device is held open by someone<br>Command '/sbin/drbdsetup /dev/drbd0 secondary' terminated with exit code 11
<br>ResourceManager[10716]: 2007/07/03_11:36:13 debug: /etc/ha.d/resource.d/drbddisk mirror stop done. RC=11<br>ResourceManager[10716]: 2007/07/03_11:36:13 ERROR: Return code 11 from /etc/ha.d/resource.d/drbddisk<br>
ResourceManager[10716]: 2007/07/03_11:36:13 CRIT: Resource STOP failure. Reboot required!<br>ResourceManager[10716]: 2007/07/03_11:36:13 CRIT: Killing heartbeat ungracefully!<br></div>