2017-06-01 65 views
0

我在默认端口上运行9101 配置文件后普罗米修斯使用haproxy_exporter我不能够以默认的端口上运行此。无法在本地主机上运行haproxy_exporter:9101

为HAProxy的配置文件:普罗米修斯

frontend frontend 
    bind :1234 
    use_backend backend 

backend backend 
    server server 0.0.0.0:9000 

frontend monitoring 
    bind :1235 
    no log 
    stats uri/
    stats enable 

配置文件

global: 
    scrape_interval:  15s 
    evaluation_interval: 15s 


    external_labels: 
    monitor: 'codelab-monitor' 

scrape_configs: 
    - job_name: 'prometheus' 
    static_configs: 
     - targets: ['localhost:9090'] 

    - job_name: 'production' 
    static_configs: 
     - targets: ['localhost:8080', 'localhost:8081'] 
     labels: 
      group: 'production' 

    - job_name: 'canary' 
    static_configs: 
     - targets: ['localhost:8082'] 
     labels: 
      group: 'canary' 

    - job_name: 'test' 
    static_configs: 
     - targets: ['localhost:9091'] 

    - job_name: 'test1' 
    static_configs: 
     - targets: ['localhost:9091'] 

    - job_name: 'test2' 
    static_configs: 
     - targets: ['localhost:9091'] 

    - job_name: 'haproxy' 
    static_configs: 
     - targets: ['localhost:9188'] 

请,谁能帮助我这个?

回答

0

你应该不是frontend节点上设置属性,但是在listener(关键字,不前端):

listen monitoring 
    mode http 
    bind *:1235 
    stats enable 
    stats hide-version 
    stats realm Haproxy\ Statistics 
    stats uri/
    stats auth username:password 

我强烈建议您同时使用用户名/密码访问你的数据。

最后,你可以从HAProxy的与haproxy_exporter用命令抽取数据:

haproxy_exporter -haproxy.scrape-uri="http://username:[email protected]<haproxy-dns>:1235/?stats;csv" 

如果一切正常您的设置,你应该能够与此卷曲查询HAProxy的出口:

curl http://localhost:9101/metrics 

和输出应包括:

haproxy_up 1

如果输出中是haproxy_up 0,再有就是haproxyhaproxy_exporter之间的通信问题,仔细检查-haproxy.scrape-uri值。

+0

可能的问题是取决于操作系统的OS是你? HAproxy版本是1.7.2-1。 – honey

+0

现在工作正常。万分感谢 – honey

相关问题