未能创建 fsnotify 观察程序:打开的文件太多

Ste*_*ven 4 linux linux-kernel kubernetes

我在尝试跟踪 Kubernetes Pod 的日志时收到此错误。

failed to create fsnotify watcher: too many open files

Ste*_*ven 9

我能够通过在我的服务器上运行这些命令来解决这个问题。这可能需要大量查看每个文件,但它会解决您的问题。您可能还想了解为什么有这么多文件被监视。

sudo sysctl -w fs.inotify.max_user_watches=2099999999
sudo sysctl -w fs.inotify.max_user_instances=2099999999
sudo sysctl -w fs.inotify.max_queued_events=2099999999
Run Code Online (Sandbox Code Playgroud)