2017-06-01 63 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

相關問題