| 
 | 
 
 本帖最后由 huangjianan 于 2019-12-21 10:11 编辑  
  |. \" h% b/ }5 X$ t* ^- c- i0 }8 a9 U0 z1 O 
解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制” 
- f9 M7 [1 H. I- J: \报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify% M8 m5 ?/ T8 n, K# Z 
fs.inotify.max_queued_events = 16384& b  y! a2 ~) o. a 
fs.inotify.max_user_instances = 128# j0 I2 f* W* j, H: B9 L- k- A5 T 
fs.inotify.max_user_watches = 8192" }9 R) a5 R. d( N 
# 临时修改配置(重启后会恢复) 
/ y8 a4 k4 z  w) _$ sudo sysctl -w fs.inotify.max_user_watches=100000$ r* G( L/ T9 N( v% L  y 
 
6 y6 ~0 }) w  k8 ^$ c2 j永久解决方法:2 C% Z( W* A2 M  _" f6 l 
$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf 
: _) q" l' e( `$ @. O# 重载配置文件,使之马上生效 
7 U% V# r9 y' s3 a8 _" s3 }6 v" ^$ sudo sysctl -p5 I* S# l6 |: C9 D/ ] 
' m" T8 z; y0 K% ]2 l1 h8 j2 L 
, e5 P, m  A8 x6 _: N 
 |   
 
 
 
 |