Squid reverse proxy array - siblings not communicating with each other
Posted
by
V. Romanov
on Server Fault
See other posts from Server Fault
or by V. Romanov
Published on 2012-11-08T09:54:32Z
Indexed on
2012/11/08
11:06 UTC
Read the original article
Hit count: 268
I want to set up 2 squid servers to act as reverse proxy and cache for a webserver on our intranet. The load balancing will be done with DNS round robin or just different mappings for different clients.
The thing is, I want both servers to try and contact each other to see if they have the object required in cache before contacting the webserver for it (the network that servers the webserver is the bottleneck and I'm trying to eliminate it)
Both squids are configured the same, here are the relevant config lines :
acl dvr1_cache_it_best_tv_com dstdomain dvr1.cache.it.best-tv.com
acl squid1_it_best_tv_com dstdomain squid1.it.best-tv.com
acl squid2_it_best_tv_com dstdomain squid2.it.best-tv.com
http_access allow dvr1_cache_it_best_tv_com
http_access allow squid1_it_best_tv_com
http_access allow squid2_it_best_tv_com
http_access allow all
http_port 8081 accel defaultsite=dvr1.cache.it.best-tv.com
cache_peer dvr1.origin.it.best-tv.com parent 80 0 no-query originserver name=Proxy_dvr1_origin_it_best_tv_com
cache_peer squid1.it.best-tv.com sibling 8081 3130 weight=10 name=Proxy_Squid1_it_best_tv_com
cache_peer squid2.it.best-tv.com sibling 8081 3130 weight=10 name=Proxy_Squid2_it_best_tv_com
cache_peer_access Proxy_dvr1_origin_it_best_tv_com allow dvr1_cache_it_best_tv_com
cache_peer_access Proxy_squid1_it_best_tv_com allow squid1_it_best_tv_com
cache_peer_access Proxy_squid1_it_best_tv_com allow squid2_it_best_tv_com
cache_peer_access Proxy_squid1_it_best_tv_com allow dvr1_cache_it_best_tv_com
cache_peer_access Proxy_squid2_it_best_tv_com allow squid1_it_best_tv_com
cache_peer_access Proxy_squid2_it_best_tv_com allow squid2_it_best_tv_com
cache_peer_access Proxy_squid2_it_best_tv_com allow dvr1_cache_it_best_tv_com
just to make it clear - dvr1.cache is the alias for the proxy servers. dvr1.origin is the web server.
Both servers work, both serve content and cache it and work fine. However, when I clear the cache on one server and then access it, it gets the content from the parent (DVR1_ORIGIN) instead of going to the sibling squid.
What did I configure wrong? Or perhaps I don't understand the architecture correctly? I read the squid manuals but as far as I see i did it all by the book and yet it doesn't work right.
Any help will be appreciated!
© Server Fault or respective owner