關於heartbeat與DR問題…一定要ping,cluster才會運作正常

章博士,您好:
我有二台做heartbeat,二台做cluster,服務為80 port,但user一開始連至vip時,都會顯示「找不到網頁」,非ping cluster的IPADDRESS才會成功,請章博士點明我一下,謝謝
OS:centos 3.6 in vmware
rpm package:heartbeat、heartbeat-ldirectord、heartbeat-pils、heartbeat-stonith、ipvsadm、keepalived
VIP:192.168.0.205
heartbeat:192.168.0.206、192.168.0.207 cluster:192.168.0.208、192.168.0.209
以下是heatbeat configure for 192.168.0.206、192.168.0.207
net.ipv4.ip_forward = 1
ha.cf:
debugfile /var/log/ha.debug
logfacility local0
keepalive 1
deadtime 10
warntime 5
initdead 120
udpport 694
bcast eth0
auto_failback off
node ldapserver.test.tw
node ldapserver1.test.tw
respawn hacluster /usr/lib/heartbeat/ipfail
use_logd yes
apiauth ipfail gid=haclient uid=hacluster

haresources:
ldapserver.test.tw \
IPaddr::192.168.0.205 \
ldirectord::ldirectord.cf \
LVSSyncDaemonSwap::master

ldirectord.cf:
# Global Directives
checktimeout=3
checkinterval=1
fallback=127.0.0.1:80
autoreload=no
logfile="/var/log/ldirectord.log"
quiescent=yes

# Virtual Server for HTTP
virtual=192.168.0.205:80
real=192.168.0.208:80 gate #(RD)
real=192.168.0.209:80 gate #(RD)
fallback=127.0.0.1:80
service=http
request="index.html"
receive="192.168.0" # index.html's contain
scheduler=rr
persistent=600
protocol=tcp
checktype=negotiate

Cluster arp configure for 192.168.0.208、192.168.0.209
/sbin/arptables -F
/sbin/arptables -A IN -d 192.168.0.205/32 -j DROP
/sbin/arptables -A OUT -s 192.168.0.205/32 -j DROP
/sbin/modprobe dummy
ifconfig dummy0 192.168.0.205 netmask 255.255.255.255 broadcast 192.168.0.205 up
service httpd start

連至vip觀看ipvadm狀況
[root@ldapserver1 ha.d]# ipvsadm -L
IP Virtual Server version 1.0.8 (size=65536)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.0.205:http rr persistent 600
-> 192.168.0.209:http Route 1 0 1
-> 192.168.0.208:http Route 1 0 0

[root@ldapserver1 ha.d]# ipvsadm -L -n -c
IPVS connection entries
pro expire state source virtual destination
TCP 09:58 NONE 192.168.0.133:0 192.168.0.205:80 192.168.0.209:80
TCP 00:58 SYN_RECV 192.168.0.133:1068 192.168.0.205:80 192.168.0.209:80

Client需ping 192.168.0.208、192.168.0.209這樣一來,cluster便能正常的運作…請章博士為我點明一下,是否有我沒有注意到的地方

Forums:

好像是192.168.0.208和192.168.0.209回响应报文到Client有点问题,不知道是ARP原因还是其他的。

你可以考虑在192.168.0.208和192.168.0.209上抓报文看看,看SYN报文在这些机器是否收到,看响应报文(SYN+ACK)是否能正常发到Client?