Squid3 FAIL with cache_peer round-robin on 127.0.0.1 different port

load balancingsquidssh-tunnel

I have 3 tunnels end to a Debian running squid3 (ports 9001 to 9003). At start of each tunnel runs a proxy. I try to load-balance those proxies this way:

http_access allow all
http_port 4128
cache_peer 127.0.0.1 sibling 9001 round-robin
cache_peer 127.0.0.1 sibling 9002 round-robin
cache_peer 127.0.0.1 sibling 9003 round-robin

When I restart squid3 get FAIL at line 3. I also try parent instead of sibling. Same fail.

FYI, if I set to clients to debian's IP with port 9001 or 9002 or 9003, works fine.

Any idea?

Best Answer

You should specify name option for each of cache_peer. Quote from the cache_peer documentation:

name=xxx --- Unique name for the peer. Required if you have multiple peers on the same host but different ports.

So your cache_peer configuration should look like this

cache_peer 127.0.0.1 parent 9001 0 name=A round-robin no-query no-digest
cache_peer 127.0.0.1 parent 9002 0 name=B round-robin no-query no-digest
cache_peer 127.0.0.1 parent 9003 0 name=C round-robin no-query no-digest
cache_peer 127.0.0.1 parent 9004 0 name=D round-robin no-query no-digest