|
|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑 0 Z$ W; L/ _) `$ Q0 C
9 ~; A) g) j+ @: m S解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”
# M2 X+ T/ p5 x' i) G报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify
% B# d; d2 b N0 U. @0 P, Ofs.inotify.max_queued_events = 16384( [) J% e+ f0 n4 Y0 ~
fs.inotify.max_user_instances = 128( s. o8 g5 q) s) g7 V: W2 @ M
fs.inotify.max_user_watches = 8192
% F Z3 T: ?9 {/ @: I' X: F# 临时修改配置(重启后会恢复)
' `, _/ _3 I) i f5 ]8 n2 [( ^$ sudo sysctl -w fs.inotify.max_user_watches=100000! J) d; t3 a" Z. {8 D5 L& R6 J) ]
6 Z+ Z$ d7 H9 I" o. a7 C永久解决方法:
6 o1 B& ?# H( D2 s3 w1 C @* N$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf, k' H" z0 X v) F0 b
# 重载配置文件,使之马上生效
7 O; R' w h' M( Q# N$ sudo sysctl -p
( ]: j( d0 y8 j/ I' ~( @: V* ?& W. e. P$ x
8 A" q6 k+ W; ?* q" U |
|