赞
踩
启动Hadoop集群和Yarn后,使用Yarn模式启动Flink时报错:
- [root@hadoop01 bin]# ./yarn-session.sh -nm test-yarn-flink
- Error: A JNI error has occurred, please check your installation and try again
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/exceptions/YarnException
- at java.lang.Class.getDeclaredMethods0(Native Method)
- at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
- at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
- at java.lang.Class.getMethod0(Class.java:3018)
- at java.lang.Class.getMethod(Class.java:1784)
- at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
- at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
- Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.exceptions.YarnException
- at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
- ... 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目录下。
重新启动,成功。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。