2017-09-13 76 views
-2

我有gerrit和石墨在我的centos 7 vm。我已經在gerrit中安裝了metrics-reporter-graphite插件。 這是我的指標 - 記者 - graphite.config文件發送gerrit指標石墨

[graphite] 
    host = http://127.0.0.1    ## Local host name## 
    port = 2003 
    prefix = gerrit 

,但指標沒有石墨到來。這是我的日誌文件

[2017-09-13 05:27:08,720] [metrics-graphite-reporter-1-thread-1] WARN com.codahale.metrics.graphite.GraphiteReporter : Unable to report to Graphite 
java.net.UnknownHostException: http://127.0.0.1 
     at com.codahale.metrics.graphite.Graphite.connect(Graphite.java:122) 
     at com.codahale.metrics.graphite.GraphiteReporter.report(GraphiteReporter.java:240) 
     at com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:251) 
     at com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:174) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 
     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) 
     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
     at java.lang.Thread.run(Thread.java:748) 

回答

1

插件試圖解決給定主機名和失敗:

java.net.UnknownHostException: http://127.0.0.1 

這樣做的原因是主機名不包括協議和我懷疑石墨實際上是通過端口2003上的HTTP接收數據的。因此,解決方案將如下更新配置:

[graphite] 
    host = 127.0.0.1 
    // ...