- ha.cf:
#
# keepalive: how many seconds between heartbeats
#
keepalive 2
#
# deadtime: seconds-to-declare-host-dead
#
deadtime 10
#
# What UDP port to use for udp or ppp-udp communication? - #
- udpport 694
bcast eth0
mcast eth0 225.0.0.1 694 1 0
ucast eth0 172.16.0.12# What interfaces to heartbeat over?
udp eth0
#
# Facility to use for syslog()/logger (alternative to log/debugfile)
#
logfacility local0
#
# Tell what machines are in the cluster
# node nodename … — must match uname -n
node vpn-solusi
#node lb2.mydomain.com
haresources:
vpn-solusi IPaddr::172.16.32.10/16/eth0/172.16.255.255
vpn-solusi IPaddr::172.16.32.11/16/eth0/172.16.255.255
#vpn-solusi IPaddr::172.16.32.13/16/eth0
vpn-solusi IPaddr::172.16.32.10/16/eth0/172.16.255.255
vpn-solusi IPaddr::172.16.32.11/16/eth0/172.16.255.255
#vpn-solusi IPaddr::172.16.32.13/16/eth0
authkeys:
auth 3
3 md5 somerandomstring
auth 3
3 md5 somerandomstring
i haproxy.cfg:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user haproxy
group haproxydefaults
log global
mode http
option httplog
option dontlognull
retries 3
redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user haproxy
group haproxydefaults
log global
mode http
option httplog
option dontlognull
retries 3
redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webfarm 172.16.32.10:80
mode http
stats enable
stats auth admin:admin
balance roundrobin
cookie JSESSIONID prefix
# cookie SERVERID insert nocache indirect
option httpclose
option forwardfor
option httpchk HEAD /index.php HTTP/1.0
server webA 172.16.0.10:80 cookie webA check maxconn 2 rise 1
server webB 172.16.0.130:80 cookie webB check maxconn 2 rise 1