我已将Apache Cassandra 3.11.3配置为使用metrics-graphite-3.1.2.jar
使用石墨。我已将metrics-graphite-3.1.2.jar复制到/usr/share/cassandra/lib/
文件夹,并在/etc/cassandra/cassandra-env.sh
中修改了指令,并在/etc/cassandra/metrics_reporter_graphite.yaml
中配置了metrics配置。
我重新启动了cassandra节点,它已启动并成功运行。我还可以看到石墨和grafana服务器中的指标图。但是,由于 /var/log/cassandra/system.log 中存在警告日志,因此石墨似乎无法正常运行。请帮助我。
错误日志:
[root@cass-fl-n1 ~]# tail -f /var/log/cassandra/system.log
at com.codahale.metrics.graphite.GraphiteReporter.report(GraphiteReporter.java:167) ~[metrics-graphite-3.1.2.jar:3.1.2]
at com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:162) [metrics-core-3.1.5.jar:3.1.5]
at com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:117) [metrics-core-3.1.5.jar:3.1.5]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_191]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_191]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_191]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
WARN [metrics-graphite-reporter-1-thread-1] 2019-03-11 02:06:07,870 GraphiteReporter.java:192 - Unable to report to Graphite
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_191]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_191]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_191]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_191]
下面我将附加必要的配置文件
/etc/cassandra/metrics_reporter_graphite.yaml
graphite:
-
period: 30
timeunit: 'SECONDS'
prefix: 'cassandra-node1'
hosts:
- host: 'localhost'
port: 2003
predicate:
color: 'white'
useQualifiedName: true
patterns:
- '^org.apache.cassandra.+'
- '^jvm.+'
/etc/cassandra/cassandra-env.sh
METRICS_REPORTER_CFG="metrics_reporter_graphite.yaml"
JVM_OPTS="$JVM_OPTS -Dcassandra.metricsReporterConfigFile=$METRICS_REPORTER_CFG"