【问题标题】:How do you set config file for Prometheus?你如何为 Prometheus 设置配置文件?
【发布时间】:2020-10-05 06:45:26
【问题描述】:

我安装了 prometheus 但卡在: 首先运行 Prometheus,使用位于此存储库的 ./conf 目录中的 prometheus-near.yml 配置文件: $ prometheus --config.file=$PATH_TO_REPO/conf/prometheus-near.yml

【问题讨论】:

    标签: nearprotocol nearprotocol-validator


    【解决方案1】:

    安装 Prometheus 基本上是为您的平台下载压缩的二进制文件并在本地解压缩 (per the documentation)。 prometheus 二进制文件位于该文件夹内。给start prometheus 使用:

    $> ./prometheus --config.file=prometheus.yml
    

    如果您想按照问题的建议使用不同的配置文件,只需提供配置文件的路径作为config.file 的参数,例如:

    $> ./prometheus --config.file=/path/to/config/prometheus-near.yml
    

    您应该能够在端口9090 查询prometheus 服务器。

    【讨论】:

    • 我运行:~/prometheus-2.19.0.linux-amd64# ls LICENSE console_libraries data prometheus-near.yml promtool NOTICE consoles prometheus prometheus.yml tsdb root@ubuntu-4gb-fsn1-1:~/prometheus-2.19.0.linux-amd64# ./prometheus --config.file=prometheus-near.yml,错误是level=error ts=2020-06-16T14:30:02.977Z caller=main.go:758 err="error loading config from \"prometheus-near.yml\": couldn't load configuration (--config.file=\"prometheus-near.yml\"): parsing YAML file prometheus-near.yml: yaml: line 118: mapping values are not allowed in this context"
    • 您使用的prometheus-near.yml 格式似乎有误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-02
    • 2018-06-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-30
    • 1970-01-01
    • 2013-10-05
    相关资源
    最近更新 更多