如何使用flink度量

zyfwsgd6  于 2021-06-21  发布在  Flink
关注(0)|答案(2)|浏览(518)

我有一个独立模式的apache flink集群,我想配置flink度量。

metrics.reporters: my_jmx_reporter,my_other_reporter

metrics.reporter.my_jmx_reporter.class: org.apache.flink.metrics.jmx.JMXReporter
metrics.reporter.my_jmx_reporter.port: 9020-9040

metrics.reporter.my_other_reporter.class: org.apache.flink.metrics.graphite.GraphiteReporter
metrics.reporter.my_other_reporter.host: 10.0.0.203
metrics.reporter.my_other_reporter.port: 10000

例外情况

2019-01-17 20:54:25.758 [Flink-MetricRegistry-thread-1] WARN  com.codahale.metrics.graphite.GraphiteReporter  - Unable to report to Graphite
java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at java.net.Socket.<init>(Socket.java:434)
        at java.net.Socket.<init>(Socket.java:244)
        at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:277)
        at com.codahale.metrics.graphite.Graphite.connect(Graphite.java:128)
        at com.codahale.metrics.graphite.GraphiteReporter.report(GraphiteReporter.java:166)
        at org.apache.flink.dropwizard.ScheduledDropwizardReporter.report(ScheduledDropwizardReporter.java:231)
        at org.apache.flink.runtime.metrics.MetricRegistryImpl$ReporterTask.run(MetricRegistryImpl.java:427)
        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:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)

我需要做什么

在10.0.0.203或其他什么东西上使用程序listen 10000端口

pkwftd7m

pkwftd7m1#

是的,你要向主人报告 10.0.0.203:10000 ,所以你需要一个程序监听端口 1000010.0.0.203 . 否则Flink就无法向它发送消息。在这种情况下,你需要开始 Graphite 在这个主机上。看医生。

eit6fx6z

eit6fx6z2#

您的公司使用哪种服务作为度量服务?然后您应该实现flink metric reporter来报告该服务。例如open falcon、opentsdb等等。

相关问题