1

我是 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

这里有什么问题?

4

2 回答 2

3

您的缩进已关闭,http://www.robustperception.io/configuring-prometheus-with-docker/有一个最小配置示例,可以让您继续前进。

于 2016-09-12T18:18:30.303 回答
0

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

于 2018-02-10T04:44:36.883 回答