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 :

/etc/ucarp/vip-001.conf

ID=001
BIND_INTERFACE=eth1
SOURCE_ADDRESS=192.168.88.132
VIP_ADDRESS=192.168.88.135
PASSWORD="passwd"
OPTIONS="--shutdown --preempt"

/etc/squid/squid.conf

acl all src all
acl localhost src 127.0.0.1/32
acl localnet src 10.0.0.0/8
acl localnet src 172.16.0.0/12
acl localnet src 192.168.88.0/24

icp_port 3130
icp_access allow all

cache_peer 192.168.88.132 sibling 3128 3130
cache_peer 192.168.88.133 sibling 3128 3130

http_access allow localnet
http_access allow localhost
http_access deny all

http_port 3128

forwarded_for off

/etc/haproxy/haproxy.cfg

global
    user    haproxy
    group    haproxy

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

peers lbfarm
    peer ha2 192.168.88.133:3135
    peer ha1 192.168.88.132:3135

listen http_proxy 192.168.88.135:3131
    mode http
    balance uri
    server cache1 192.168.88.132:3128 check inter 100
    server cache2 192.168.88.133:3128 check inter 100

listen tcp_proxy 192.168.88.135:80
    mode tcp
    balance source
    server cache1 192.168.88.132:3128 check inter 100
    server cache2 192.168.88.133:3128 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

 
discard

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

Browse other questions tagged or ask your own question.