首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Prometheus启动查询

Prometheus启动查询
EN

Stack Overflow用户
提问于 2016-09-12 20:16:27
回答 2查看 231关注 0票数 1

我刚接触Prometheus,正在尝试在我的RHEL 6服务器上安装Prometheus。我已经安装了RHEL的rpm,post我已经在配置文件中填写了详细信息,如下所示:

代码语言:javascript
复制
    global:
  scrape_interval:     5s
  evaluation_interval: 5s
scrape_configs:
- job_name: linux
target_groups:
        -targets: ['192.17.36.189:3306']
          labels:
            alias: db1

当我尝试启动prometheus时,我得到以下错误:

代码语言:javascript
复制
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

这里的问题是什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-13 02:18:30

你的缩进是关闭的,http://www.robustperception.io/configuring-prometheus-with-docker/有一个最小配置的例子,应该可以让你继续工作。

票数 3
EN

Stack Overflow用户

发布于 2018-02-10 12:44:37

target_groups已重命名为static_configs。请将最新的Prometheus镜像与以下内容一起使用。

代码语言:javascript
复制
static_configs:
  - targets: ['192.17.36.189:3306']

上面的方法对我很有效。

另外,prometheus端口9090是否在容器/pod/服务中公开?https://github.com/prometheus/prometheus/wiki/Default-port-allocations

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39450103

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档