flink1.12.x 支持HDFS(hadoop3)

说明

Flink 1.12 默认不能直接访问 HDFS(hadoop3),会弹出无法解析hdfs类型的schema的错误:

org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'hdfs'. The scheme is not directly supported by Flink and no Hadoop file system to support this scheme could be loaded.

解决方法-无效

网上找到的诸如添加 HADOOP_CLASSPATH 方法对我的flink集群无效

解决方法-有效

经过实验,需要用到 jar 包

将下面 2 个jar包添加到 flink的lib目录下:

  • Flink Shaded Hadoop 3 Uber
  • commons-cli

访问 下载网址

下载 commons-cli

访问 下载网址

上传到 lib目录

登录 hadoop1 ,将上面2个jar 上传到 /program/flink-1.12.5/lib/

感谢:
https://blog.csdn.net/wmpisadba/article/details/117952310
https://www.bilibili.com/read/cv11506216


原文出处:/show_1IX1yphI0EXh.html