【问题标题】:Prometheus Startup queryPrometheus 启动查询
【发布时间】:2016-09-12 12:16:26
【问题描述】:

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

    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

这里有什么问题?

【问题讨论】:

    标签: prometheus


    【解决方案1】:

    您的缩进已关闭,http://www.robustperception.io/configuring-prometheus-with-docker/ 有一个最小配置示例,可以帮助您进行操作。

    【讨论】:

    • 谢谢,我可以启动它,但是 localhost:9090 页面打不开。可能是什么问题?
    【解决方案2】:

    target_groups 重命名为 static_configs。请使用最新的 Prometheus 镜像和以下内容。

    static_configs:
      - targets: ['192.17.36.189:3306']
    

    以上对我有用。

    另外,prometheus 9090 端口是否暴露在容器/pod/service 中? https://github.com/prometheus/prometheus/wiki/Default-port-allocations

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-03
      • 2021-11-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-12
      • 2021-10-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多