|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑 ! }1 O0 t) x; n8 R4 o6 Y6 I9 v# u) P; n# K
4 i. O# f i6 S$ c解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”
# d; p/ T0 J" [2 d& J5 ?报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify+ z: I0 F3 Q+ w: g' o
fs.inotify.max_queued_events = 163846 [0 o. |7 _6 w8 U
fs.inotify.max_user_instances = 128/ r; p5 j6 I$ S* c
fs.inotify.max_user_watches = 8192- {7 c0 w) `3 q/ e6 w
# 临时修改配置(重启后会恢复)
/ O. E0 z# s/ J. M+ t2 a$ sudo sysctl -w fs.inotify.max_user_watches=1000005 A% l) \/ y7 y' p( X# d0 I
& `: ?: F; X% Q3 x8 D
永久解决方法:& h6 t! G+ K, b! e" y0 t# ^2 G; A# q
$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf
6 R& Z5 R; o3 q) d6 d# 重载配置文件,使之马上生效+ G, M8 P' P/ L: P o# S; X
$ sudo sysctl -p5 m( x/ |# O# D+ {
6 k m8 _+ G, l# V
( K! C! e2 e: @ |
|