Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure a high availability squid farm on CentOs 6.4 with haproxy1.5 for load balancing and ucarp1.5.2 for ip failover alongside squid3.1.10, running on each server

these are my configs on the first server :


OPTIONS="--shutdown --preempt"


acl all src all
acl localhost src
acl localnet src
acl localnet src
acl localnet src

icp_port 3130
icp_access allow all

cache_peer sibling 3128 3130
cache_peer sibling 3128 3130

http_access allow localnet
http_access allow localhost
http_access deny all

http_port 3128

forwarded_for off


    user    haproxy
    group    haproxy

    timeout client      5000s
    timeout server      5000s
    timeout connect     500s

peers lbfarm
    peer ha2
    peer ha1

listen http_proxy
    mode http
    balance uri
    server cache1 check inter 100
    server cache2 check inter 100

listen tcp_proxy
    mode tcp
    balance source
    server cache1 check inter 100
    server cache2 check inter 100
    option tcp-smart-accept
    option tcp-smart-connect

listen stats *:8888
    mode http
    stats enable
    stats realm HAProxy
    stats uri /haproxy?stats
    stats auth user:passwd
    stats refresh 5s

the other two servers have the same configuration except the ip address

Everything works fine except I need to configure a stateful load balancing that if server1 is down, server2 can handle the tcp connection without any errors so I've tried to set the peers section in the haproxy configuration but I get a "Server closed the connection unexpectedly" error

another thing that I need ucarp to consider the host is down if the haproxy instance is stopped

any ideas how to get this work ?

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.