настроил hearbeat на двух серверах под управления Debian 6.
вот конфиги
cat ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 1
#warntime 2
deadtime 10
initdead 30
bcast eth1
udpport 694
auto_failback off
node n1
node n2
cat haresources
n1 IP/24/eth0/85.115.208.255 gw
файл gw
#!/bin/bash
act=$1
if [ "$act" = "start" ]
then
ifc=`ifconfig eth0:0 | grep "inet addr"`
if [ -n "$ifc" ]
then
route add default gw gatewayIP
fi
elif [ "$act" = "stop" ]
then
ifc1=`ifconfig eth0:0 | grep "inet addr"`
if [ -n "$ifc1" ]
then
route del default gw gatewayIP
fi
fi
Файлы одинаковые что на n1 и ns2
объясню почему gw прописывает маршрут
дело в том, что изначально eth0 не имеет IP .. и нужный мне IP плавает между двумя нодами
на этот IP привязана лицензия
запускаю hearbeat на обоих нодах все подымается
на n1
eth0:0 Link encap:Ethernet HWaddr 00:15:c5:fd:48:f5
inet addr:IP Bcast:broadcast Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16 Memory:f8000000-f8012800
все отлично
=)
при выполнении на n1
/etc/init.d/heartbeat stop
IP адрес мигрирует
при выполнении на n2
/etc/init.d/heartbeat stop
IP мигрирует обратно на n1
На этом этапе все ОК
Далее
останавливаем
/etc/init.d/heartbeat stop на обоих нодах
и вновь запускаем на n1 и n2
/etc/init.d/heartbeat start
n1 был выдан IP - т.е. все ок
Делаю на n2 -
/etc/init.d/heartbeat stop
после чего
зачем-то на n1 опускается все
Oct 17 16:26:27 ispcp-2 heartbeat: [15596]: info: Received shutdown notice from 'ispcp-3'.
Oct 17 16:26:27 ispcp-2 heartbeat: [15596]: info: Resources being acquired from ispcp-3.
Oct 17 16:26:27 ispcp-2 heartbeat: [15968]: info: acquire local HA resources (standby).
ResourceManager[15996]: 2012/10/17_16:26:27 info: Acquiring resource group: ispcp-2 IP/24/eth0/85.115.208.255 gw
IPaddr[16040]: 2012/10/17_16:26:27 INFO: Running OK
Oct 17 16:26:27 ispcp-2 heartbeat: [15969]: info: Local Resource acquisition completed.
IPaddr[16048]: 2012/10/17_16:26:27 INFO: Running OK
ResourceManager[15996]: 2012/10/17_16:26:27 info: Running /etc/ha.d/resource.d/gw start
ResourceManager[15996]: 2012/10/17_16:26:27 ERROR: Return code 7 from /etc/ha.d/resource.d/gw
ResourceManager[15996]: 2012/10/17_16:26:27 CRIT: Giving up resources due to failure of gw
ResourceManager[15996]: 2012/10/17_16:26:27 info: Releasing resource group: ispcp-2 85.115.208.27/24/eth0/85.115.208.255 gw
ResourceManager[15996]: 2012/10/17_16:26:27 info: Running /etc/ha.d/resource.d/gw stop
ResourceManager[15996]: 2012/10/17_16:26:27 info: Running /etc/ha.d/resource.d/IPaddr 85.115.208.27/24/eth0/85.115.208.255 stop
IPaddr[16242]: 2012/10/17_16:26:27 INFO: ifconfig eth0:0 down
IPaddr[16217]: 2012/10/17_16:26:27 INFO: Success
Oct 17 16:26:27 ispcp-2 heartbeat: [15968]: info: local HA resource acquisition completed (standby).
Oct 17 16:26:27 ispcp-2 heartbeat: [15596]: info: Standby resource acquisition done [all].
harc[16268]: 2012/10/17_16:26:27 info: Running /etc/ha.d//rc.d/status status
mach_down[16283]: 2012/10/17_16:26:27 info: /usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired
mach_down[16283]: 2012/10/17_16:26:27 info: mach_down takeover complete for node ispcp-3.
Oct 17 16:26:27 ispcp-2 heartbeat: [15596]: info: mach_down takeover complete.
Вопрос нафига оно пытается положить сеть на n1 ? и пытается чего там эвакуировать с n2 ? зачем и для чего ?
как это обойти ?
Спасибо!