em cài heartbeat.
đây là 3 file cấu hình.
ha.cf
Code:
debugfile /var/log/ha-debug
logfile /test/halog
logfacility local0
keepalive 2
deadtime 30
initdead 120
udpport 694
bcast eth1 # Linux
mcast eth1 225.0.0.1 694 1 0
auto_failback off
node squid1
node squid2
ping 172.16.11.139
respawn hacluster /usr/lib/heartbeat/ipfail
haresources
Code:
squid1 \
ldirectord::ldirectord.cf \
LVSSyncDaemonSwap::master \
IPaddr2::192.168.1.10/24/eth1/192.168.1.255
ldirectord.cf
Code:
checktimeout=3
checkinterval=1
autoreload=yes
logfile="/var/log/ldirectord.log"
logfile="/test/ldirectord.log"
logfile="local0"
quiescent=yes
virtual=192.168.1.10:8080
real=192.168.1.11:8080 gate
real=192.168.1.12:8080 gate
fallback=127.0.0.1:8080
service=http
scheduler=rr
persistent=600
protocol=tcp
checktype=connect
checkport=8080