我有三个隧道结束一个Debian运行squid3 (端口9001至9003)。在每个隧道的开始运行一个代理。我试着用这种方式来平衡那些代理:
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当我重新启动squid3时,在第3行就会失败,我也尝试使用parent而不是sibling。同样的失败。
FYI,如果我设置客户端到debian的IP端口9001或9002或9003,工作良好。
有什么想法吗?
发布于 2016-04-14 08:20:38
您应该为每个cache_peer指定名称选项。引用缓存_同行文件的话:
name=xxx --同侪的唯一名称。如果同一主机上有多个对等点,但端口不同,则需要。
所以您的cache_peer配置应该如下所示
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发布于 2015-01-18 20:19:50
最终解决办法!
编辑/etc/hosts并添加:
127.0.0.1 tunnelproxy1
127.0.0.1 tunnelproxy2
127.0.0.1 tunnelproxy3
127.0.0.1 tunnelproxy4然后转到/etc/squid3/squid.conf,然后:
http_access allow all
http_port 3128
cache_peer tunnelproxy1 parent 9001 0 round-robin no-query no-digest
cache_peer tunnelproxy2 parent 9002 0 round-robin no-query no-digest
cache_peer tunnelproxy3 parent 9003 0 round-robin no-query no-digest
cache_peer tunnelproxy4 parent 9004 0 round-robin no-query no-digest
never_direct allow all如果您认为有更好的解决方案,请放心:)
https://serverfault.com/questions/660411
复制相似问题