歡迎您光臨本站 註冊首頁

詢問一下SQUID的集群問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

詢問一下SQUID的集群問題

大家好

根據以前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 編輯 ]
《解決方案》

現在癥狀主要是如果CACHE過期了,他就從PARENT取,而不從SILBING取數據。所以想詢問一下各位,如何才能從SILBING取數據

沒仔細看你的配置. 但提示一下, squid取fresh cache object的優先順序, 是父cache高於姐妹cache的.
請使用never_direct或always_direct指令來配置.
另: 集群要麼使用ICP協議, 要麼使用HTCP協議, 不能把2個協議埠都關了.
《解決方案》

哦,謝謝,我現在是使用ICP協議,NEVER_DIRECT也使用過,不過似乎還是不行,請問你有什麼配置文件可以提供我參考一下嗎?
《解決方案》

頂下

[火星人 ] 詢問一下SQUID的集群問題已經有795次圍觀

http://coctec.com/docs/service/show-post-14481.html