我刚接触Prometheus,正在尝试在我的RHEL 6服务器上安装Prometheus。我已经安装了RHEL的rpm,post我已经在配置文件中填写了详细信息,如下所示:
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_configs:
- job_name: linux
target_groups:
-targets: ['192.17.36.189:3306']
labels:
alias: db1当我尝试启动prometheus时,我得到以下错误:
INFO[0000] Starting prometheus (version=1.1.2, branch=master, revision=36fbdcc30fd13ad796381dc934742c559feeb1b5) source=main.go:73
INFO[0000] Build context (go=go1.6.3, user=root@a74d279a0d22, date=20160908-13:12:43) source=main.go:74
INFO[0000] Loading configuration file prometheus.yml source=main.go:221
ERRO[0000] Error loading config: couldn't load configuration (-config.file=prometheus.yml): yaml: line 6: found character that cannot start any token source=main.go:126这里的问题是什么?
发布于 2016-09-13 02:18:30
你的缩进是关闭的,http://www.robustperception.io/configuring-prometheus-with-docker/有一个最小配置的例子,应该可以让你继续工作。
发布于 2018-02-10 12:44:37
target_groups已重命名为static_configs。请将最新的Prometheus镜像与以下内容一起使用。
static_configs:
- targets: ['192.17.36.189:3306']上面的方法对我很有效。
另外,prometheus端口9090是否在容器/pod/服务中公开?https://github.com/prometheus/prometheus/wiki/Default-port-allocations
https://stackoverflow.com/questions/39450103
复制相似问题