From 05230027583cd6b73520131af74f6215c7cb26c5 Mon Sep 17 00:00:00 2001 From: simple321vip <635344988@qq.com> Date: Mon, 13 Jul 2026 01:03:20 +0000 Subject: [PATCH] Update Linux/kubernetes.md --- Linux/kubernetes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Linux/kubernetes.md b/Linux/kubernetes.md index e69de29..6224842 100644 --- a/Linux/kubernetes.md +++ b/Linux/kubernetes.md @@ -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 \ No newline at end of file