0

我根据this向lib文件夹添加了系统监控的依赖项

wget https://repo1.maven.org/maven2/com/github/oshi/oshi-core/3.4.0/oshi-core-3.4.0.jar
wget https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/4.2.2/jna-platform-4.2.2.jar
wget https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar

但是为我展示这个例外:

WARN  org.apache.flink.runtime.metrics.MetricRegistryImpl           - Error while reporting metrics
java.lang.NoSuchMethodError: org.apache.flink.metrics.influxdb.shaded.okio.BufferedSource.getBuffer()Lorg/apache/flink/metrics/influxdb/shaded/okio/Buffer;
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonUtf8Reader.<init>(JsonUtf8Reader.java:97)
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonReader.of(JsonReader.java:196)
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:40)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:172)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:821)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460)
    at org.apache.flink.metrics.influxdb.InfluxdbReporter.report(InfluxdbReporter.java:118)
    at org.apache.flink.runtime.metrics.MetricRegistryImpl$ReporterTask.run(MetricRegistryImpl.java:441)
    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)
4

1 回答 1

2

这是与FLINK-12147一起引入的 Flink 错误。问题是我们在不影响传递依赖的情况下增加了依赖版本。我创建了问题FLINK-16635来解决这个问题。此问题还包含有关导致问题的原因的更多详细信息。

更新

Flink 1.10.1 和 1.11.0 已修复该问题。

于 2020-03-17T11:07:06.873 回答