召隆企博汇论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3106|回复: 0

解决tail命令提示“tail: inotify 资源耗尽,无法使用 inotify ...

[复制链接]

2

主题

1

回帖

81

积分

注册会员

Rank: 2

积分
81
发表于 2019-12-21 10:01:01 | 显示全部楼层 |阅读模式
本帖最后由 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# @
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|召隆企博汇 ( 粤ICP备14061395号 )

GMT+8, 2026-10-25 13:00 , Processed in 0.038113 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表