I have a setup as follows:
- There's one 1 haproxy server that points to primary and secondary apache servers
- The primary apache server is A, and secondary is B.
- B should become the primary only if A is unavailable.
- A will return to the primary when it becomes available again.
To test, I stop apache on A, and haproxy points to B as expected.
The problem I'm having is: when I edit the IP address of A in /etc/hosts (on the haproxy server) to make A seem unavailable, haproxy does not point to B.
How can I accomplish this?
Thanks!
My haproxy.cfg is:
global
log 127.0.0.1 local1 debug
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option http-no-delay
option dontlognull
retries 3
option redispatch
option http-use-proxy-header
timeout connect 1000
timeout client 1000
timeout server 1000
listen appname haproxy-01:8080
mode http
option httpchk
stats enable
stats uri /haproxy?stats
stats realm Strictly\ Private
stats auth admin
assword
stats auth Another_User
asswd
balance static-rr
option httpclose
#option forwardfor
server lamp1 sandbox-01:80 check inter 2s fall 2 rise 2
server lamp2 sandbox-02:80 check backup inter 2s fall 2 rise 2