【发布时间】:2021-11-10 22:08:48
【问题描述】:
我正在使用 pm2 来查看包含我的应用服务器的 NodeJS 程序源代码的目录,该程序在 Kubernetes 集群中运行。
但是,我收到此错误:
ENOSPC: System limit for number of file watchers reached
我搜索了那个错误,找到了这个答案:https://stackoverflow.com/a/55763478
# insert the new value into the system config
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
但是,我尝试在目标 k8s 节点上的 pod 中运行它,它说找不到命令 sudo。如果我删除 sudo,我会收到此错误:
sysctl: setting key "fs.inotify.max_user_watches": Read-only file system
如何将文件系统观察程序限制从 Kubernetes 节点上的 8192 修改为更高的值,例如 524288?
【问题讨论】:
标签: linux kubernetes inotify