如何在 Amazon EC2 容器中提供 Prometheus 配置
How to provide Prometheus configuration in Amazon EC2 container
我在 EC2 实例中有 Prometheus 容器 运行,并且还在容器中安装了 ESF,如下所示:
/mount/efs
在 Prometheus 文档中,提供我自己的配置的方法是通过 运行:
从主机绑定安装我的 prometheus.yml
docker run \
-p 9090:9090 \
-v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
或为配置使用额外的卷:
docker run \
-p 9090:9090 \
-v /path/to/config:/etc/prometheus \
prom/prometheus
我尝试选择我的 EFS 作为挂载点并设置容器路径 /mount/efs:/etc/prometheus
但我收到错误:
CannotCreateContainerError: Error response from daemon: invalid mode: /etc/prometheus
任何人都可以帮助我从 EC2 任务或任何其他方式做到这一点吗?
谢谢
好的,我找到了解决方案:
EFS 必须安装为 /etc/prometheus
并且 prometheus.yml
文件要放在 EFS 的根目录中
我在 EC2 实例中有 Prometheus 容器 运行,并且还在容器中安装了 ESF,如下所示:
/mount/efs
在 Prometheus 文档中,提供我自己的配置的方法是通过 运行:
从主机绑定安装我的prometheus.yml
docker run \
-p 9090:9090 \
-v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
或为配置使用额外的卷:
docker run \
-p 9090:9090 \
-v /path/to/config:/etc/prometheus \
prom/prometheus
我尝试选择我的 EFS 作为挂载点并设置容器路径 /mount/efs:/etc/prometheus
但我收到错误:
CannotCreateContainerError: Error response from daemon: invalid mode: /etc/prometheus
任何人都可以帮助我从 EC2 任务或任何其他方式做到这一点吗?
谢谢
好的,我找到了解决方案:
EFS 必须安装为 /etc/prometheus
并且 prometheus.yml
文件要放在 EFS 的根目录中