Flink error1:Windows下pylink报错

Flink error1:Windows下pylink报错

org.apache.flink.table.factories.TableSourceFactory

问题描述

Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in the classpath.

解决

scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;

问题描述

py4j.protocol.Py4JJavaError: An error occurred while calling z:org.apache.flink.table.api.bridge.java.StreamTableEnvironment.create. : java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
notion image

解决

原因:scala版本冲突
  • 下载flink-connector-kafka_2.12-1.14.4.jar
 

org.apache.flink.runtime.JobException: Recovery is suppressed by NoRestartBackoffTimeStrategy

  • 没有指定重启策略,在本地部署时,不需要指定重启策略。
可以通过下面的代码指定重启策略
from pyflink.common.restart_strategy import RestartStrategies env.setRestartStrategy(RestartStrategies.fixedDelayRestart( 3,// 尝试重启的次数 Time.of(10, TimeUnit.SECONDS)// 间隔 ));
失败率重启
from pyflink.common.restart_strategy import RestartStrategies val env = ExecutionEnvironment.getExecutionEnvironment() env.setRestartStrategy(RestartStrategies.failureRateRestart( 3,// 一个时间段内的最大失败次数 Time.of(5, TimeUnit.MINUTES),// 衡量失败次数的是时间段 Time.of(10, TimeUnit.SECONDS)// 间隔 ))
不重启
from pyflink.common.restart_strategy import RestartStrategies val env = ExecutionEnvironment.getExecutionEnvironment() env.setRestartStrategy(RestartStrategies.noRestart())