2017-09-13 79 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 
    // ...