在服务器上执行

tail -f /var/log/messages  

忽然显示

tail: cannot watch '/var/log/messages': No space left on device  

用df -h 和df -i看了下,都还早呢,才用了20%

无语,这台机器比较特别的就是用了inotify来监控文件变化。

所以看看inotify:

inotifywatch -v /var/log/messages  
Establishing watches...  
Failed to watch /var/log/messages; upper limit on inotify watches reached!  
Please increase the amount of inotify watches allowed per user via '/proc/sys/fs/inotify/max_user_watches'.`  

超限制了,看看设置:

cat /proc/sys/fs/inotify/max_user_watches  
160000  

已经放大到160000,都不行,看来得继续放大

sysctl fs.inotify.max_user_watches=200000  

在/etc/sysctl.conf里永久加上

fs.inotify.max_user_watches = 200000  
comments powered by Disqus