亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標題: squid反向代理無法實現(xiàn)輪詢,請高人指點 [打印本頁]

作者: zhancat200801    時間: 2015-12-02 14:26
標題: squid反向代理無法實現(xiàn)輪詢,請高人指點
本人在學習squid負載均衡,環(huán)境如下:

squid代理服務(wù)器IP:

eth0 192.168.1.107

eth1 192,.168.0.254

web-server1:192.168.0.1

web-server2:192.168.0.2

兩臺web-server上均安裝apache

配置文件:
vi /etc/squid/squid.conf

http_port 80 accel vhost vport
http_port 3128
cache_peer 192.168.0.1 parent 80 0 no-query originserver round-robin name=server1
cache_peer 192.168.0.2 parent 80 0 no-query originserver round-robin name=server2
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 8080 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access allow all
cache_dir aufs /data/squidcache 512 16 256
cache_mem 128 MB
hierarchy_stoplist cgi-bin ?
coredump_dir /var/spool/squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern \.(jpg|png|gif|mp3|xml) 1440 50% 2880 ignore-reload
refresh_pattern . 0 20% 4320

然而每次訪問192.168.1.107都只能訪問到192.168.0.2的數(shù)據(jù),而沒有訪問192.168.0.1

也就是說,無法實現(xiàn)輪詢。


請問這是怎么回事呢,請高人指點,謝謝!
作者: woxizishen    時間: 2015-12-02 16:54
本帖最后由 woxizishen 于 2015-12-02 16:57 編輯

這個不是一句兩句講的那么簡單的,幾年前研究過,并測試成功了,不過從事傳統(tǒng)運維的工作一直用不到^_^。
看看我之前發(fā)的貼,你要的是不是這玩意,我再跟你說
http://72891.cn/thread-4153827-1-1.html
作者: zhancat200801    時間: 2015-12-20 15:03
回復 2# woxizishen

你的帖子里的圖中反向代理A,B,C上面用的是squid服務(wù)器吧?如果是的話,應(yīng)該就是這個意思。
拿你的圖作比方,我現(xiàn)在反向代理A上每次輪詢,只能讀到WEB服務(wù)器A上的數(shù)據(jù),卻讀不到WEB服務(wù)器B,C的數(shù)據(jù)。不知道是什么原因?
   
作者: woxizishen    時間: 2015-12-22 14:26
回復 3# zhancat200801

那我寫的這個和你的可能不同了哦,我的這個反向代理做了負載均衡,而不是在反向代理上做輪詢噢,輪詢的工作是dns在做。


反向代理A收到用戶請求時,在其緩存中沒有找到請求的資源時,通過 ICP 查詢?nèi)テ溧従覤和C中取得緩存,如果B和C都沒有時,則通過反向代理自身帶的簡單負載均衡技術(shù),去父鄰居的原始WEB服務(wù)器A或B或C來獲取數(shù)據(jù),獲取數(shù)據(jù)后除了轉(zhuǎn)發(fā)給用戶一份外,自己保留一份。這個反向代理A到底去原始WEB服務(wù)器A還是B或者C去獲取數(shù)據(jù)是通過一個響應(yīng)值來決定的,誰最短我就獲取誰的。




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2