Chinaunix

标题: 请问squid命中率怎么看? [打印本页]

作者: orangemm    时间: 2007-06-18 14:10
标题: 请问squid命中率怎么看?
[root@localhost bin]# ./squidclient mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
我装的是squid2.6,端口是默认的3128.请问命中率怎么看?先谢谢了!
作者: orangemm    时间: 2007-06-18 14:46
我知道是什么问题了,我在squid里配了两个IP.
我用./squidclient -l 10.0.0.1:3128 mgr:info就不报错了.
显示的是#client: bind: Success.
但是我要在哪才能看到输出的结果?

[ 本帖最后由 orangemm 于 2007-6-18 14:50 编辑 ]
作者: kaka_sun    时间: 2007-06-18 15:02
你squid的端口是3128 ?
./squidclient -p 端口号 mgr:info
作者: orangemm    时间: 2007-06-18 15:44
squid.conf
http_port 10.0.0.1:3128
用./squidclient -p 3128 mgr:info
报client: ERROR: Cannot connect to localhost:3128: Connection refused
用./squidclient -l 10.0.0.1:3128 mgr:info
报client: bind: Success
我把squid.conf 改为
http_port 3128
./squidclient mgr:info
就没有问题,能直接看到结果
请问我要在http_port 后加IP的话要怎样才能看mgr:info?
作者: jackbillow    时间: 2007-06-19 09:21
试试 squidclient -l 10.0.0.1 mgr:info
作者: orangemm    时间: 2007-06-19 09:55
这试过了,这样也不行.
http_port 10.0.0.1:3128
./squidclient -l 10.0.0.1 mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
./squidclient -l 10.0.0.1:3128 mgr:info
client: bind: Success
./squidclient -l 10.0.0.1 -p 3128 mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
请问还有什么办法吗?
作者: alexa    时间: 2007-06-19 13:01
acl Manager proto cache_object
http_access allow Manager localhost
作者: orangemm    时间: 2007-06-19 16:06
先谢谢各位的帮忙,但问题还没有解决
acl manager proto cache_objectacl
acl localhost src 127.0.0.1/255.255.255.255
acl localhost src 10.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
http_access allow Manager localhost
我加了acl localhost src 10.0.0.1/255.255.255.255后也不行,去掉acl localhost src 127.0.0.1/255.255.255.255也不行,请问跟这行"acl to_localhost dst 127.0.0.0/8"有关吗?
作者: alexa    时间: 2007-06-19 22:58
acl manager proto cache_objectacl
acl localhost src 127.0.0.1/255.255.255.255
http_access allow Manager localhost

# /usr/local/squid/bin/squidclient -p 80 -h localhost mgr:info

端口改成你http_port设置的端口
作者: simeiren    时间: 2007-12-15 17:26
标题: 配置虚拟主机了么?
试试这样:
squid]$ /usr/local/squid/bin/squidclient -h www.forum.com -p 80 mgr:info
作者: hello_he2000    时间: 2009-02-13 15:14
挖坟,呵呵。
第一次用时候,不小心也碰到这个问题,很巧,搜到这个帖子,遗憾是当时没搞明白。
后来搞定了,总结下,希望对后来者有益:
先看下squidclient的用法帮助,系统显示的,
Usage: /usr/local/squid/bin/squidclient [-arsv] [-i IMS] [-h remote host] [-l local host] [-p port] [-m method] [-t count] [-I ping-interval] [-H 'strings'] [-T timeout] url
注意-h、-l、-p三个参数。说明已经很明白了,分别是远程主机、本地主机、端口。
-l localhost,应该是本地套接字;-h remote host连接的是tcp/ip套接字。
楼主在2楼能够client: bind: Success.,据我估计,应该是可以的。
只需netstat看下squid是在哪个ip:port上监听的,-l 换成-h ip -p port就可以了。
所以我楼上前辈的回答,应该是帮楼主解决了问题吧。

据我这里看,squid并不在localhost(127.0.0.1)监听的,不知道他-l参数干嘛用的。
作者: bbppking    时间: 2009-07-06 00:55
兄弟:我终于找到解决方法了,此方法解决多虚拟IP地址监控3128端口的命中率查询的方法。

在squid配置里加一条

http_port 127.0.0.1:3128




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2