|
|
本帖最后由 huangjianan 于 2019-12-21 10:11 编辑
7 h$ U$ M4 ?$ M4 S! O4 J; V$ ~! n
% o$ @+ n7 b9 K$ ~' R3 T# A解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify 机制,回归为 polling 机制”
. L; W, D+ |9 G报错的原因是 inotify 跟踪的文件数量超出了系统设置的上限值,要是这个问题不经常出现可以使用临时解决方法,或者写入配置文件来永久解决。 临时解决方法: # 查看 inotify 的相关配置$ sysctl fs.inotify- P! ?% Z6 b+ }& y1 Q+ S0 ^0 c8 o
fs.inotify.max_queued_events = 163848 p/ {/ V0 l& n% c$ v6 h
fs.inotify.max_user_instances = 128: V/ N, e' ]6 \. }" {1 M
fs.inotify.max_user_watches = 8192* I# T: L# Z0 d+ Q6 c. `
# 临时修改配置(重启后会恢复)
9 V4 J. E7 D, M% ~: I; r @% b2 F% u$ sudo sysctl -w fs.inotify.max_user_watches=1000008 ]( c f4 f4 n. Y2 C, H
2 Q$ A3 O+ Q/ {& @1 i7 B6 X$ I6 B
永久解决方法:
" A- M$ e# h" h% W ^$ echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf* x3 H) z4 g2 x
# 重载配置文件,使之马上生效
2 w$ w; I2 K* q2 G7 O$ sudo sysctl -p
8 u% }1 W7 i7 b& Z
- t6 Y- k, B+ m" g
; U. ]$ [& l& V$ i% k) H+ W# @ |
|