Hello, <br><br>i've installed DRBD / Heartbeat (Ubuntu 10.04 LTS) on two HP Servers. <br><br>The final solution would be: <br>The KVM - Image is in the mirrored partition (resp. /dev/drbd0), and it should start on that machine, which becomes the drbd-"master" automatically. <br>
<br>Now i have a strange problem, and i still don't know on how to figure that out with Google :-(<br>The Master-Server is up, /dev/drbd0 is mounted, and the virtual machine with the image under /dev/drbd0 is running. eth0:0 also got an ip-Adress from heartbeat. <br>
On the Slave Server, no ip is assigned to eth0:0, and /dev/drbd0 isn't mounted so there's also no virtual machine running. <br><br>When i disconnect the ethernet cable, so that the heartbeat is missing from the master, on the Slave: /dev/drbd0 gets mounted correctly, eth0:0 gets an ip-Adress as configured, and the virtual machine is starting up.<br>
BUT: /dev/drbd0 is still mounted on the master server, and the virtual machine on the master server also stays up. eth0:0 has also still the same adress as before i unplugged the cable. <br>And that should not be, because this would cause to have 2 Servers with same IP in the network. <br>
<br>The next thing is, that i'm not quite sure if this the correct way to start up a KVM-VM with heartbeat. <br><br>Here are my configuration files: <br><br>----<br><br>/etc/heartbeat/<a href="http://ha.cf">ha.cf</a>:<br>
<br>debugfile /var/log/ha-debug<br>logfile /var/log/ha-log<br>logfacility local0<br>udpport 694<br>keepalive 1<br>deadtime 10<br>warntime 5<br>
initdead 15<br>bcast eth1<br>node hpsrv-master hpsrv-slave<br>crm off<br>nice_failback on<br>auto_failback off<br><br>------<br><br>
/etc/heartbeat/haresources<br><br>hpsrv-master <a href="http://192.168.118.99/24/eth0">192.168.118.99/24/eth0</a> drbddisk::ylogSync Filesystem::/dev/drbd0::/media/sync::ext3 startAph.sh::start<br><br>-----<br><br>/etc/heartbeat/authkeys<br>
<br>auth 3<br>#1 crc<br>#2 sha1 test-ha <br>3 md5 pw_sync<br><br>-----<br><br>/etc/init.d/startAph.sh<br><br>#!/bin/bash<br><br>#! /bin/sh<br>### BEGIN INIT INFO<br># Provides: urandom<br># Required-Start: $remote_fs<br>
# Required-Stop: $remote_fs<br># Default-Start: S<br># Default-Stop: 0 6<br># Short-Description: Save and restore random seed between restarts.<br># Description: This script saves the random seed between restarts.<br>
# It is called from the boot, halt and reboot scripts.<br>### END INIT INFO<br><br>TAPAPH_A=tapAphA<br><br>case "$1" in<br> start|"")<br> echo "Staring Aphrodite"<br>
/usr/bin/kvm -enable-kvm -hda /media/sync/KVM-Aphrodite/KVM_Aphrodite_Ubuntu11.04_32bit_Master.img \<br> -net nic,model=rtl8139 -net tap,ifname=${TAPAPH_A},script=/media/sync/KVM-Aphrodite/qemu-ifup-aphA, \<br>
downscript=/media/sync/KVM-Aphrodite/qemu-ifdown-aphA <br><br> ;;<br> stop)<br> echo "Stopping Aphrodite"<br> killall kvm<br> ;;<br> status)<br> ;;<br> *)<br>
exit 3<br> ;;<br>esac<br><br>:<br><br>-----<br><br>/etc/drbd.conf<br><br># You can find an example in /usr/share/doc/drbd.../drbd.conf.example<br><br>#include "drbd.d/global_common.conf";<br>#include "drbd.d/*.res";<br>
<br># Globale Angaben ###<br>global {<br> # an Statistikauswertung auf <a href="http://usage.drbd.org">usage.drbd.org</a> teilnehmen?<br> usage-count yes;<br>}<br>### Optionen, die an alle Ressourcen vererbt werden ###<br>
common {<br> syncer {<br> rate 1000M;<br> }<br>}<br><br>resource ylogSync {<br> # Protokoll-Version<br> protocol C;<br><br> syncer {<br> # Geschwindigkeit der HA-Verbindung<br> rate 1000M;<br> } <br> on hpsrv-master {<br>
### Optionen für Master-Server ###<br> # Name des bereitgestellten Blockdevices<br> device /dev/drbd0;<br> # dem DRBD zugrunde liegendes Laufwerk<br> disk /dev/cciss/c0d0p7; <br> # Adresse und Port, über welche die Synchr. läuft<br>
address <a href="http://10.110.214.1:7788">10.110.214.1:7788</a>;<br> # Speicherort der Metadaten, hier im Laufwerk selbst<br> meta-disk internal;<br> }<br> on hpsrv-slave {<br> ## Optionen für Slave-Server<br>
# Name des bereitgestellten Blockdevices<br> device /dev/drbd0;<br> # dem DRBD zugrunde liegendes Laufwerk<br> disk /dev/cciss/c0d0p7;<br> # Adresse und Port, über welche die Synchr. läuft<br> address <a href="http://10.110.214.2:7788">10.110.214.2:7788</a>;<br>
# Speicherort der Metadaten, hier im Laufwerk selbst<br> meta-disk internal;<br> }<br>}<br><br>----<br><br>/var/log/ha-log (Master Server)<br><br>root@hpsrv-master:/etc/heartbeat# tail /var/log/ha-log <br>harc[5171]: 2011/09/14_18:28:55 info: Running /etc/ha.d//rc.d/status status<br>
harc[5186]: 2011/09/14_18:28:55 info: Running /etc/ha.d//rc.d/status status<br>mach_down[5201]: 2011/09/14_18:28:55 info: /usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired<br>mach_down[5201]: 2011/09/14_18:28:55 info: mach_down takeover complete for node hpsrv-slave.<br>
Sep 14 18:28:55 hpsrv-master heartbeat: [4004]: info: mach_down takeover complete.<br>harc[5235]: 2011/09/14_18:28:55 info: Running /etc/ha.d//rc.d/status status<br>Sep 14 18:28:55 hpsrv-master heartbeat: [4004]: info: Heartbeat shutdown in progress. (4004)<br>
Sep 14 18:28:55 hpsrv-master heartbeat: [5250]: info: Giving up all HA resources.<br>ResourceManager[5264]: 2011/09/14_18:28:55 info: Releasing resource group: hpsrv-master <a href="http://192.168.118.99/24/eth0">192.168.118.99/24/eth0</a> drbddisk::ylogSync Filesystem::/dev/drbd0::/media/sync::ext3 startAph.sh::start<br>
ResourceManager[5264]: 2011/09/14_18:28:55 info: Running /etc/init.d/startAph.sh start stop<br><br>/var/log/ha-log (Slave Server)<br><br>root@hpsrv-slave:~# tail /var/log/ha-log <br>Filesystem[4417]: 2011/09/14_17:43:48 INFO: Resource is stopped<br>
ResourceManager[4175]: 2011/09/14_17:43:48 info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /media/sync ext3 start<br>Filesystem[4486]: 2011/09/14_17:43:48 INFO: Running start for /dev/drbd0 on /media/sync<br>
Filesystem[4480]: 2011/09/14_17:43:48 INFO: Success<br>Sep 14 17:43:58 hpsrv-slave heartbeat: [4106]: info: Local Resource acquisition completed. (none)<br>Sep 14 17:43:58 hpsrv-slave heartbeat: [4106]: info: local resource transition completed.<br>
Sep 14 18:36:20 hpsrv-slave heartbeat: [4106]: info: Link hpsrv-master:eth1 up.<br>Sep 14 18:36:20 hpsrv-slave heartbeat: [4106]: info: Status update for node hpsrv-master: status active<br>Sep 14 18:36:22 hpsrv-slave heartbeat: [4106]: info: all clients are now paused<br>
Sep 14 18:36:29 hpsrv-slave heartbeat: [4106]: info: all clients are now resumed<br><br>--------<br><br>Any help on that would be great. <br><br>Thank You. <br>Robert<br><br><br><br><br><br><br>