|
|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑
2 s, n& b6 P2 S- I/ Z& T( O+ e, `9 U4 u1 [+ }
解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”. ~4 j0 n, l. S0 i2 i' G+ h
报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify r7 G# B" s& q0 i1 `
fs.inotify.max_queued_events = 163841 `$ Y: w0 y3 Z" W% u% I2 @
fs.inotify.max_user_instances = 128# w( @. ]+ R. B
fs.inotify.max_user_watches = 8192& P( u0 ?9 q0 J* _5 q; S' T
# 临时修改配置(重启后会恢复)
% `- v, H6 Z5 Z7 A5 [+ ]" p1 {! B$ sudo sysctl -w fs.inotify.max_user_watches=100000
1 c7 V: d) z6 M' ]# _6 T
6 h. O- m$ O) _- J9 Y1 {8 ?7 _永久解决方法:
( J; h6 [: i2 W, K$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf* o, g, J$ R! D* U y# T
# 重载配置文件,使之马上生效
9 d- z! t, @% D& h9 a' M, A$ sudo sysctl -p
/ L+ B: {% ~' P V. N8 e
& T8 C6 e- P H" |
; T: J. X, o+ q( l4 ^ |
|