免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4080 | 回复: 3
打印 上一主题 下一主题

[proxy] 询问一下SQUID的集群问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-11 19:46 |只看该作者 |倒序浏览
大家好

根据以前CU中的帖子,我想配置一下SQUID的集群,主要使用PARENT,SILBING,在使用过程中,我使用了2台机器,都使用UBUNTU8.0操作系统,使用SQUID2.6做反向代理,

A机器:192.168.18.7    这台机器的8080端口上跑着APACHE 80端口SQUID
B机器:192.168.18.12 80端口SQUID


A机器的CONF文件


# set by font
#
#http_port 80
http_port 192.168.18.7:80 vhost vport

#
#acl OverConnLimit maxconn 16 #限制同一IP最大连接数
#http_access deny OverConnLimit
#
acl Manager proto cache_object #允许本地管理
acl Localhost src localhost
http_access allow Manager Localhost
http_access deny Manager
#

#acl allowed_methods method GET
#acl allowed_methods method POST
#acl allowed_methods method HEAD

#只允许80端口做代理
acl all src 0.0.0.0/0.0.0.0
acl gsrc src 192.168.18.12 192.168.18.7
acl gdst dst 192.168.18.12 192.168.18.7
http_access allow gsrc
http_access allow gdst


acl Safe_ports port 80 8080 3132 3133
http_access deny !Safe_ports
http_access allow all
#never_direct allow all
#never_direct allow all
#http_reply_access allow all

#SQUID信息设置
visible_hostname 192.168.18.7
cache_mgr webmaster@good8.com
#基本设置
cache_effective_user proxy
cache_effective_group proxy
tcp_recv_bufsize 65536 bytes

#反响代理加速配置
cache_peer 192.168.18.7 parent 8080 0 no-query originserver no-digest name=cache0
cache_peer 192.168.18.12 sibling 80 3133 name=cache2
cache_peer_access 192.168.18.12 allow all


#单台使用,不使用该功能
icp_port 3132
#htcp_port 4827
icp_query_timeout 2000
icp_access allow all
igest_generation on
log_icp_queries on
icp_hit_stale on

cache_dir ufs /var/spool/squid 10240 16 256
#为了调试方便,目录结构设置的相当简单,实际应用要多建一些

#dns_children 32
hosts_file /etc/hosts

cache_mem 400 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 32768 KB
maximum_object_size_in_memory 4096 KB
emulate_httpd_log on

cache_store_log /var/log/squid/store.log
cache_log /var/log/squid/cache.log



B机器的CONF文件

# set by font
#
#http_port 80
http_port 192.168.18.12:80 vhost vport

#
#acl OverConnLimit maxconn 16 #限制同一IP最大连接数
#http_access deny OverConnLimit
#
acl Manager proto cache_object #允许本地管理
acl Localhost src localhost
http_access allow Manager Localhost
http_access deny Manager
#

#acl allowed_methods method GET
#acl allowed_methods method POST
#acl allowed_methods method HEAD

#只允许80端口做代理
acl all src 0.0.0.0/0.0.0.0
acl gsrc src 192.168.18.12 192.168.18.7
acl gdst dst 192.168.18.12 192.168.18.7
http_access allow gsrc
http_access allow gdst


acl Safe_ports port 80 8080 3132 3133
http_access deny !Safe_ports
http_access allow all
#never_direct allow all
#never_direct allow all
#http_reply_access allow all

#SQUID信息设置
visible_hostname 192.168.18.12
cache_mgr webmaster@good8.com
#基本设置
cache_effective_user proxy
cache_effective_group proxy
tcp_recv_bufsize 65536 bytes

#反响代理加速配置
cache_peer 192.168.18.7 parent 8080 0 no-query originserver no-digest name=cache0
cache_peer 192.168.18.7 sibling 80 3132 name=cache1
cache_peer_access 192.168.18.7 allow all
#cache_peer 192.168.18.7 parent 8080 0 no-query originserver no-digest name=cache0


#单台使用,不使用该功能
icp_port 3133
#htcp_port 4827
icp_query_timeout 2000
icp_access allow all
igest_generation on
log_icp_queries on
icp_hit_stale on

cache_dir ufs /var/spool/squid 10240 16 256
#为了调试方便,目录结构设置的相当简单,实际应用要多建一些

#dns_children 32
hosts_file /etc/hosts

cache_mem 400 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 32768 KB
maximum_object_size_in_memory 4096 KB
emulate_httpd_log on

cache_store_log /var/log/squid/store.log
cache_log /var/log/squid/cache.log


现在症状主要是如果CACHE过期了,他就从PARENT取,而不从SILBING取数据。所以想询问一下各位,如何才能从SILBING取数据。

[ 本帖最后由 font99 于 2008-6-11 19:47 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-06-11 20:09 |只看该作者
现在症状主要是如果CACHE过期了,他就从PARENT取,而不从SILBING取数据。所以想询问一下各位,如何才能从SILBING取数据


没仔细看你的配置. 但提示一下, squid取fresh cache object的优先级, 是父cache高于姐妹cache的.
请使用never_direct或always_direct指令来配置.
另: 集群要么使用ICP协议, 要么使用HTCP协议, 不能把2个协议端口都关了.

论坛徽章:
0
3 [报告]
发表于 2008-06-12 09:08 |只看该作者
哦,谢谢,我现在是使用ICP协议,NEVER_DIRECT也使用过,不过似乎还是不行,请问你有什么配置文件可以提供我参考一下吗?

论坛徽章:
0
4 [报告]
发表于 2011-06-10 17:57 |只看该作者
顶下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP