Seg*_*ult 4 containers docker prometheus cadvisor
我有一个运行端口映射4000:8080的cadvisor,我必须将它与一个带有prometheus的容器连接起来.
我的prometheus.yml是:
scrape_configs:
# Scrape Prometheus itself every 2 seconds.
- job_name: 'prometheus'
scrape_interval: 2s
target_groups:
- targets: ['localhost:9090', 'cadvisor:8080']
Run Code Online (Sandbox Code Playgroud)
此文件具有路径/home/test/prometheus.yml.为了用prometheus运行容器,我做:
docker run -d -p 42047:9090 --name=prometheus -v /home/test/prometheus.yml:/etc/prometheus/prometheus.yml --link cadvisor:cadvisor prom/prometheus -config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000
Run Code Online (Sandbox Code Playgroud)
容器已创建,但会立即死亡.你能告诉我问题出在哪里吗?
消息形式docker events&:
2016-11-21T11:43:04.922819454+01:00 container start 69d03c68525c5955cc40757dc973073403b13fdd41c7533f43b7238191088a25 (image=prom/prometheus, name=prometheus)
2016-11-21T11:43:05.152141981+01:00 container die 69d03c68525c5955cc40757dc973073403b13fdd41c7533f43b7238191088a25 (exitCode=1, image=prom/prometheus, name=prometheus)
Run Code Online (Sandbox Code Playgroud)
小智 7
配置格式已更改.目标在最新版本的static_config下.
scrape_configs:
# Scrape Prometheus itself every 2 seconds.
- job_name: 'prometheus'
scrape_interval: 2s
static_configs:
- targets: ['localhost:9090', 'cadvisor:8080']
Run Code Online (Sandbox Code Playgroud)
是的,target_groups重命名为static_configs. 请使用带有以下内容的最新 Prometheus 映像。
static_configs:
- targets: ['localhost:9090', 'cadvisor:8080']
Run Code Online (Sandbox Code Playgroud)
以上对我有用。
缩进不正确,请尝试:
scrape_configs:
# Scrape Prometheus itself every 2 seconds.
- job_name: 'prometheus'
scrape_interval: 2s
target_groups:
- targets: ['localhost:9090', 'cadvisor:8080']
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5528 次 |
| 最近记录: |