当前位置:   article > 正文

以Yarn模式启动Flink报错Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/ex_flink yarn "main" java.lang.noclassdeffounderror:

flink yarn "main" java.lang.noclassdeffounderror: org/apache/hadoop/yarn/exc

启动Hadoop集群和Yarn后,使用Yarn模式启动Flink时报错:

  1. [root@hadoop01 bin]# ./yarn-session.sh -nm test-yarn-flink
  2. Error: A JNI error has occurred, please check your installation and try again
  3. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/exceptions/YarnException
  4. at java.lang.Class.getDeclaredMethods0(Native Method)
  5. at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  6. at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
  7. at java.lang.Class.getMethod0(Class.java:3018)
  8. at java.lang.Class.getMethod(Class.java:1784)
  9. at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
  10. at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
  11. Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.exceptions.YarnException
  12. at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
  13. at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
  14. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
  15. at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
  16. ... 7 more

解决方案:

下载对应的jar,按照Hadoop的版本(我的是2.7.5)下载。

https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.7.5-8.0/

 然后放到Flink的lib目录下。

重新启动,成功。

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/278803
推荐阅读
相关标签
  

闽ICP备14008679号