问题遇到的现象和发生背景
运行容器
prometheus_targets(容器A,用于生成file_sd_configs文件)
挂载 /data/xxc/prometheus/targets/:/data/prometheus/targets/
prometheus(容器B)
挂载 /data/xxc/prometheus/targets/:/etc/prometheus/targets/
挂载内文件
xxc.json
容器B日志运行异常
ts=2024-11-25T05:33:05.105Z caller=file.go:342 level=error component="discovery manager scrape" discovery=file config=xxc msg="Error reading file" path=/etc/prometheus/targets/xxc.json err="open /etc/prometheus/targets/xxc.json: no such file or directory"
ts=2024-11-25T05:34:05.210Z caller=file.go:342 level=error component="discovery manager scrape" discovery=file config=xxc msg="Error reading file" path=/etc/prometheus/targets/xxc.json err="open /etc/prometheus/targets/xxc.json: no such file or directory"
操作环境、软件版本等信息
centos 7.9
docker 20.10.9
尝试过的解决方法
给挂载目录设置权限无效
chmod -R 777 /data//prometheus
我想要达到的结果
不在输出错误日志