|
|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑
5 q5 U# ^" `! y6 n( c$ ?
8 R& ~, K* ]0 y解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”
9 u! l/ @! o, h2 O( m% i: h报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify4 }" j, f+ W6 Z+ f9 J- F n
fs.inotify.max_queued_events = 16384
& v" w3 n2 Z, m1 X$ `& Wfs.inotify.max_user_instances = 128; U9 c6 e8 m' w
fs.inotify.max_user_watches = 8192# x! a q' ?) F) A/ A
# 临时修改配置(重启后会恢复)! C) b3 ]9 K$ p8 C6 ]9 m8 J4 f
$ sudo sysctl -w fs.inotify.max_user_watches=100000
2 V# }: k P. g: K0 Y" s' m+ u$ }2 d% S1 j* b9 I. `2 q
永久解决方法:4 k& F0 j. Z: ^7 o l3 C
$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf
9 \% L! N% _6 b& A: r# 重载配置文件,使之马上生效
. s) j- \' ^1 F2 c- X: a$ sudo sysctl -p) D# A {0 s; q
3 f# [) z$ N5 y+ ~ Z0 S5 y
+ o/ q. d6 P: B5 r3 S1 M+ P3 u |
|