Update Linux/kubernetes.md
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
##
|
||||||
|
Q. failed to make file target manager: too many open files.
|
||||||
|
A. Promtail 的 file target manager 会为每个匹配的日志路径(或每个 scrape job)创建一个独立的 inotify 实例来监听文件变化。当你的 Promtail 配置了多个 scrape_configs、或者通配符匹配了大量目录时,很容易瞬间创建超过 128 个 inotify 实例,直接触发 too many open files 报错并停止采集。
|
||||||
|
同时也应用于 drone runner,之前找不到原因大概率也是这个原因现在已经不出现了。
|
||||||
|
解决方案为
|
||||||
|
|
||||||
|
# 临时生效(立即验证)
|
||||||
|
sysctl -w fs.inotify.max_user_instances=1024
|
||||||
|
|
||||||
|
# 持久化(重启不丢失)
|
||||||
|
echo 'fs.inotify.max_user_instances=1024' >> /etc/sysctl.conf
|
||||||
|
sysctl -p
|
||||||
Reference in New Issue
Block a user