免费注册 查看新帖 |

Chinaunix

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

squid小问题解决又出现问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-24 10:52 |只看该作者 |倒序浏览
本帖最后由 dwm123 于 2010-05-25 10:30 编辑

各位:

  最近小弟在做squid代理的时候,遇到下面问题,请大家帮忙分析一下,squid用的tar包。系统用的是rhel5.3  ,

/etc/sysconfig/network  hostname  /etc/hosts 里面主机名都是一样的,slave.example.com

[root@slave etc]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]


[root@slave etc]# nslookup slave.example.com
Server:         192.168.1.2
Address:        192.168.1.2#53

Name:   slave.example.com
Address: 192.168.1.2


[root@slave etc]# nslookup 192.168.1.2
Server:         192.168.1.2
Address:        192.168.1.2#53

2.1.168.192.in-addr.arpa        name = slave.example.com.


[root@slave etc]# cat /etc/resolv.conf
nameserver 192.168.1.2


[root@slave etc]# /usr/local/squid/sbin/squid -NCd1

2010/05/21 18:35:08| Starting Squid Cache version 3.0.STABLE9 for i686-pc-linux-gnu...
2010/05/21 18:35:08| Process ID 3442
2010/05/21 18:35:08| With 1024 file descriptors available
2010/05/21 18:35:08| Performing DNS Tests...
FATAL: ipcache_init: DNS name lookup tests failed.

论坛徽章:
0
2 [报告]
发表于 2010-05-24 21:31 |只看该作者
visible_hostname  slave.example.com

配置squid.conf  增加一条。试试

论坛徽章:
0
3 [报告]
发表于 2010-05-24 22:02 |只看该作者
呵呵,我的问题都是你来回答啊。上面的问题已经弄好了,我dns开了chroot,所以我在/etc/named.*都是来自/var/named/chroot/etc/named.*的软连接,其中一个连接处了问题,虽然dns能启动。不过现在又有个新问题,我在弄弄,如果弄不好再请教版主。

论坛徽章:
0
4 [报告]
发表于 2010-05-24 22:13 |只看该作者
缘分哈

论坛徽章:
0
5 [报告]
发表于 2010-05-25 10:23 |只看该作者
本帖最后由 dwm123 于 2010-05-25 10:30 编辑

[root@slave logs]# /usr/local/squid/sbin/squid  -z
2010/05/24 17:04:28| Creating Swap Directories
2010/05/24 17:04:28| /usr/local/squid/var/cache exists
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/00
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/01
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/02
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/03
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/04
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/05
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/06
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/07
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/08
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/09
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0A
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0B
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0C
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0D
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0E
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0F



[root@slave logs]#[/usr/local/squid/sbin/squid -NCd1
2010/05/24 17:04:45| Starting Squid Cache version 3.0.STABLE9 for i686-pc-linux-gnu...
2010/05/24 17:04:45| Process ID 20611
2010/05/24 17:04:45| With 1024 file descriptors available
2010/05/24 17:04:45| Performing DNS Tests...
2010/05/24 17:04:45| Successful DNS name lookup tests...
2010/05/24 17:04:45| helperOpenServers: Starting 5 'dnsserver' processes
2010/05/24 17:04:45| User-Agent logging is disabled.
2010/05/24 17:04:45| Referer logging is disabled.
2010/05/24 17:04:45| Swap maxSize 102400 KB, estimated 7876 objects
2010/05/24 17:04:45| Target number of buckets: 393
2010/05/24 17:04:45| Using 8192 Store buckets
2010/05/24 17:04:45| Max Mem  size: 102400 KB
2010/05/24 17:04:45| Max Swap size: 102400 KB
2010/05/24 17:04:45| Rebuilding storage in /usr/local/squid/var/cache (DIRTY)
2010/05/24 17:04:45| Using Least Load store dir selection
2010/05/24 17:04:45| Set Current Directory to /usr/local/squid/var/cache
2010/05/24 17:04:45| Loaded Icons.
2010/05/24 17:04:45| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 13.
2010/05/24 17:04:45| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2010/05/24 17:04:45| HTCP Disabled.
2010/05/24 17:04:45| Pinger socket opened on FD 16
2010/05/24 17:04:45| Ready to serve requests.
2010/05/24 17:04:46| Done scanning /usr/local/squid/var/cache swaplog (0 entries)
2010/05/24 17:04:46| Finished rebuilding storage from disk.
2010/05/24 17:04:46|         0 Entries scanned
2010/05/24 17:04:46|         0 Invalid entries.
2010/05/24 17:04:46|         0 With invalid flags.
2010/05/24 17:04:46|         0 Objects loaded.
2010/05/24 17:04:46|         0 Objects expired.
2010/05/24 17:04:46|         0 Objects cancelled.
2010/05/24 17:04:46|         0 Duplicate URLs purged.
2010/05/24 17:04:46|         0 Swapfile clashes avoided.
2010/05/24 17:04:46|   Took 0.84 seconds (  0.00 objects/sec).
2010/05/24 17:04:46| Beginning Validation Procedure
2010/05/24 17:04:46|   Completed Validation Procedure
2010/05/24 17:04:46|   Validated 25 Entries
2010/05/24 17:04:46|   store_swap_size = 0
2010/05/24 17:04:46| storeLateRelease: released 0 objects ---  问题1:为什么一直停留在此,这样是否正确

在/usr/local/squid/var/logs和/usr/local/squid/var/cache下面会生成如下文件。而且此时squid是运行状态


[root@slave logs]# lsof -i:3128
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
squid   20611 nobody   13u  IPv4  75083       TCP *:squid (LISTEN)


[root@slave logs]# pwd
/usr/local/squid/var/logs

[root@slave logs]# ll
total 8
-rw-r----- 1 nobody nobody    0 May 24  2010 access.log
-rw-r----- 1 nobody nobody 3397 May 24  2010 cache.log
-rw-r--r-- 1 root   nobody    6 May 24  2010 squid.pid
-rw-r----- 1 nobody nobody    0 May 24  2010 store.log  


[root@slave logs]# cd ../cache/

[root@slave cache]# pwd
/usr/local/squid/var/cache

[root@slave cache]# ll
total 68
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 00
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 01
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 02
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 03
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 04
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 05
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 06
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 07
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 08
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 09
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0A
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0B
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0C
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0D
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0E
drwxr-x--- 258 nobody nobody 4096 May 24 15:08 0F
-rw-r-----   1 nobody nobody    0 May 24 16:21 netdb_state
-rw-r-----   1 nobody nobody   52 May 24 15:41 swap.state

如果人为停止/usr/local/squid/sbin/squid -NCd1 命令,会提示如下内容。而且squid进程将停止运行


[root@slave logs]# /usr/local/squid/sbin/squid -NCd1
2010/05/24 17:04:45| Starting Squid Cache version 3.0.STABLE9 for i686-pc-linux-gnu...
2010/05/24 17:04:45| Process ID 20611
2010/05/24 17:04:45| With 1024 file descriptors available
2010/05/24 17:04:45| Performing DNS Tests...
2010/05/24 17:04:45| Successful DNS name lookup tests...
2010/05/24 17:04:45| helperOpenServers: Starting 5 'dnsserver' processes
2010/05/24 17:04:45| User-Agent logging is disabled.
2010/05/24 17:04:45| Referer logging is disabled.
2010/05/24 17:04:45| Swap maxSize 102400 KB, estimated 7876 objects
2010/05/24 17:04:45| Target number of buckets: 393
2010/05/24 17:04:45| Using 8192 Store buckets
2010/05/24 17:04:45| Max Mem  size: 102400 KB
2010/05/24 17:04:45| Max Swap size: 102400 KB
2010/05/24 17:04:45| Rebuilding storage in /usr/local/squid/var/cache (DIRTY)
2010/05/24 17:04:45| Using Least Load store dir selection
2010/05/24 17:04:45| Set Current Directory to /usr/local/squid/var/cache
2010/05/24 17:04:45| Loaded Icons.
2010/05/24 17:04:45| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 13.
2010/05/24 17:04:45| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2010/05/24 17:04:45| HTCP Disabled.
2010/05/24 17:04:45| Pinger socket opened on FD 16
2010/05/24 17:04:45| Ready to serve requests.
2010/05/24 17:04:46| Done scanning /usr/local/squid/var/cache swaplog (0 entries)
2010/05/24 17:04:46| Finished rebuilding storage from disk.
2010/05/24 17:04:46|         0 Entries scanned
2010/05/24 17:04:46|         0 Invalid entries.
2010/05/24 17:04:46|         0 With invalid flags.
2010/05/24 17:04:46|         0 Objects loaded.
2010/05/24 17:04:46|         0 Objects expired.
2010/05/24 17:04:46|         0 Objects cancelled.
2010/05/24 17:04:46|         0 Duplicate URLs purged.
2010/05/24 17:04:46|         0 Swapfile clashes avoided.
2010/05/24 17:04:46|   Took 0.84 seconds (  0.00 objects/sec).
2010/05/24 17:04:46| Beginning Validation Procedure
2010/05/24 17:04:46|   Completed Validation Procedure
2010/05/24 17:04:46|   Validated 25 Entries
2010/05/24 17:04:46|   store_swap_size = 0
2010/05/24 17:04:46| storeLateRelease: released 0 objects

2010/05/24 09:42:17| Killing RunCache, pid 20543
2010/05/24 09:42:17| kill 20543: (1) Operation not permitted
2010/05/24 09:42:17| Preparing for shutdown after 0 requests
2010/05/24 09:42:17| Waiting 0 seconds for active connections to finish
2010/05/24 09:42:17| FD 13 Closing HTTP connection
2010/05/24 09:42:17| Closing Pinger socket on FD 16
2010/05/24 09:42:18| Shutting down...
2010/05/24 09:42:18| FD 14 Closing ICP connection
2010/05/24 09:42:18| storeDirWriteCleanLogs: Starting...
2010/05/24 09:42:18|   Finished.  Wrote 0 entries.
2010/05/24 09:42:18|   Took 0.00 seconds (  0.00 entries/sec).


squid就停止了运行

[root@slave logs]# netstat -nplt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      2167/hpiod         
tcp        0      0 0.0.0.0:865                 0.0.0.0:*                   LISTEN      1955/rpc.statd      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1922/portmap        
tcp        0      0 192.168.85.2:53             0.0.0.0:*                   LISTEN      2983/named         
tcp        0      0 6.3.16.15:53                0.0.0.0:*                   LISTEN      2983/named         
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      2983/named         
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      2198/cupsd         
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      2983/named         
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      2172/python         
tcp        0      0 ::1:53                      :::*                        LISTEN      2983/named         
tcp        0      0 :::22                       :::*                        LISTEN      2187/sshd           
tcp        0      0 ::1:953                     :::*                        LISTEN      2983/named  


下面是logs信息
[root@slave logs]# ll
total 8
-rw-r----- 1 nobody nobody    0 May 24  2010 access.log
-rw-r----- 1 nobody nobody 4542 May 24 09:42 cache.log
-rw-r----- 1 nobody nobody    0 May 24  2010 store.log

[root@slave logs]# cat cache.log
2010/05/24 17:04:28| Creating Swap Directories
2010/05/24 17:04:28| /usr/local/squid/var/cache exists
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/00
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/01
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/02
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/03
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/04
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/05
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/06
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/07
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/08
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/09
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0A
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0B
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0C
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0D
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0E
2010/05/24 17:04:28| Making directories in /usr/local/squid/var/cache/0F
2010/05/24 17:04:45| Starting Squid Cache version 3.0.STABLE9 for i686-pc-linux-gnu...
2010/05/24 17:04:45| Process ID 20611
2010/05/24 17:04:45| With 1024 file descriptors available
2010/05/24 17:04:45| Performing DNS Tests...
2010/05/24 17:04:45| Successful DNS name lookup tests...
2010/05/24 17:04:45| helperOpenServers: Starting 5 'dnsserver' processes
2010/05/24 17:04:45| User-Agent logging is disabled.
2010/05/24 17:04:45| Referer logging is disabled.
2010/05/24 17:04:45| Swap maxSize 102400 KB, estimated 7876 objects
2010/05/24 17:04:45| Target number of buckets: 393
2010/05/24 17:04:45| Using 8192 Store buckets
2010/05/24 17:04:45| Max Mem  size: 102400 KB
2010/05/24 17:04:45| Max Swap size: 102400 KB
2010/05/24 17:04:45| Rebuilding storage in /usr/local/squid/var/cache (DIRTY)
2010/05/24 17:04:45| Using Least Load store dir selection
2010/05/24 17:04:45| Set Current Directory to /usr/local/squid/var/cache
2010/05/24 17:04:45| Loaded Icons.
2010/05/24 17:04:45| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 13.
2010/05/24 17:04:45| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2010/05/24 17:04:45| HTCP Disabled.
2010/05/24 17:04:45| Pinger socket opened on FD 16
2010/05/24 17:04:45| Ready to serve requests.
2010/05/24 17:04:46| Done scanning /usr/local/squid/var/cache swaplog (0 entries)
2010/05/24 17:04:46| Finished rebuilding storage from disk.
2010/05/24 17:04:46|         0 Entries scanned
2010/05/24 17:04:46|         0 Invalid entries.
2010/05/24 17:04:46|         0 With invalid flags.
2010/05/24 17:04:46|         0 Objects loaded.
2010/05/24 17:04:46|         0 Objects expired.
2010/05/24 17:04:46|         0 Objects cancelled.
2010/05/24 17:04:46|         0 Duplicate URLs purged.
2010/05/24 17:04:46|         0 Swapfile clashes avoided.
2010/05/24 17:04:46|   Took 0.84 seconds (  0.00 objects/sec).
2010/05/24 17:04:46| Beginning Validation Procedure
2010/05/24 17:04:46|   Completed Validation Procedure
2010/05/24 17:04:46|   Validated 25 Entries
2010/05/24 17:04:46|   store_swap_size = 0
2010/05/24 17:04:46| storeLateRelease: released 0 objects
2010/05/24 09:42:17| Killing RunCache, pid 20543
2010/05/24 09:42:17| kill 20543: (1) Operation not permitted
2010/05/24 09:42:17| Preparing for shutdown after 0 requests
2010/05/24 09:42:17| Waiting 0 seconds for active connections to finish
2010/05/24 09:42:17| FD 13 Closing HTTP connection
2010/05/24 09:42:17| Closing Pinger socket on FD 16
2010/05/24 09:42:18| Shutting down...
2010/05/24 09:42:18| FD 14 Closing ICP connection
2010/05/24 09:42:18| storeDirWriteCleanLogs: Starting...
2010/05/24 09:42:18|   Finished.  Wrote 0 entries.
2010/05/24 09:42:18|   Took 0.00 seconds (  0.00 entries/sec).
CPU Usage: 0.200 seconds = 0.032 user + 0.168 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        total space in arena:    3428 KB
        Ordinary blocks:         3296 KB      8 blks
        Small blocks:               0 KB      1 blks
        Holding blocks:          1512 KB      7 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:     131 KB
        Total in use:            4808 KB 140%
        Total free:               131 KB 4%
2010/05/24 09:42:18| Squid Cache (Version 3.0.STABLE9): Exiting normally.


[root@slave var]# pwd
/usr/local/squid/var
[root@slave var]# ll
total 8
drwxrwxr-x 18 root nobody 4096 May 24 09:42 cache
drwxrwxr-x  2 root nobody 4096 May 24 09:42 logs  --nobody已经有了写的权限了

问题2:tar的squid启动时使用/usr/local/squid/sbin/squid  -z  和 /usr/local/squid/sbin/squid -NCd1命令,不知道停止用什么命令
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP