|
|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑 * y, I- L* h" F y# X& P, s
3 ?% {6 w- A* P( C/ J% Z3 R, d5 `
解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”
, }) ~- L) q7 b" M' X报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify: t, R9 k5 q- L4 R- a
fs.inotify.max_queued_events = 16384
5 B% D) w0 W& s/ n* `5 Lfs.inotify.max_user_instances = 128
9 q* `3 ?* ~) n( o, ]0 Lfs.inotify.max_user_watches = 8192
4 [# \! w9 G6 U3 n3 Y. x# 临时修改配置(重启后会恢复)! b1 S5 r( f5 d3 T
$ sudo sysctl -w fs.inotify.max_user_watches=100000
D$ ^! Y6 J$ D y$ Z: Q x) A2 M2 ]' [* I3 F& T, Y. W
永久解决方法:
9 h3 U/ b& ^/ b) M$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; Q0 R L# z `: \
# 重载配置文件,使之马上生效/ f$ C. v, v# t* z3 f5 \
$ sudo sysctl -p
# O# D- w# m/ m7 q/ ~% a7 p8 O, l3 q) ]
6 G' F* p4 c- \ |
|