• 监控日志
  • 【已解决】部署WhizardTelemetry 数据流水线时vector-agent运行失败

创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
物理机 Ubuntu 24.04,128C/128G

Kubernetes版本信息
将 Client Version: v1.30.11+rke2r1

Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

Server Version: v1.30.11+rke2r1

容器运行时
containerd

KubeSphere版本信息
v4.1.3,在线安装,在已有RKE2群集上安装

问题是什么
守护进程集 vector-agent 中的 vector 容器 CrashLoopBackOff, 日志如下:
2025-04-30T17:14:56.935799617+08:00 2025-04-30T09:14:56.935416Z INFO vector::app: Log level is enabled. level=“info”

2025-04-30T17:14:56.936201018+08:00 2025-04-30T09:14:56.935867Z INFO vector::config::watcher: Creating configuration file watcher.

2025-04-30T17:14:56.936226736+08:00 2025-04-30T09:14:56.935906Z ERROR vector::app: Unable to start config watcher. error=Too many open files (os error 24)

我已在节点上进行如下设置:

cat >> /etc/sysctl.conf << EOF
fs.file-max = 2097152
fs.nr_open = 2097152
EOF

cat >> /etc/security/limits.conf << EOF
root soft nofile 1048576
root hard nofile 1048576
* soft nofile 262144
* hard nofile 262144
EOF

kubelet-arg已添加了max-open-files=262144

执行 cat /proc/sys/fs/file-nr显示 15648 0 2097152

结果还是提示too many open files

5 天 后

解决了,调整inotify的最大可监听数就好了:

echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf
echo "fs.inotify.max_user_instances=4096" >> /etc/sysctl.conf
sysctl -p
echcz 更改标题为「【已解决】部署WhizardTelemetry 数据流水线时vector-agent运行失败