问题描述
我刚刚开始使用Hadoop 2。
使用基本配置安装后,我总是无法运行任何示例。有没有人看到这个问题,并请帮助我?
而且错误是类似于
启动MRAppMaster
时出错java.lang.RuntimeException:java.lang.reflect.InvocationTargetException
这是日志
20152015-01-06 11:56:23,194 INFO [main] org.apache。 hadoop.mapreduce.v2.app.MRAppMaster:为应用程序创建MRAppMaster appattempt_1420510526926_0002_000001
2015-01-06 11:56:23,362 FATAL [main] org.apache.hadoop.mapreduce.v2.app.MRAppMaster:启动MRAppMaster时出错
在org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
在org中的java.lang.RuntimeException:java.lang.reflect.InvocationTargetException
.apache.hadoop.security.Groups。< init>(Groups.java:70)
at org.apache.hadoop.security.Groups。< init>(Groups.java:66)
at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:280)
at org.apac在org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:299)
处使用$ .b $ b $ hellop.security.UserGroupInformation.initialize(UserGroupInformation.java:271)。 mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1473)
位于org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1429)
导致:java.lang.reflect.InvocationTargetException $ b $在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本地方法)
在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance(Constructor.java:408)
在org.apache.hadoop.util.ReflectionUtils .newInstance(ReflectionUtils.java:129)
... 7 more
引起:java.lang.UnsatisfiedLinkError:org.apache.hadoop.security.JniBasedUnixGroupsMappi ng.anchorNative()V
at org.apache.hadoop.security.JniBasedUnixGroupsMapping.anchorNative(Native Method)
at org.apache.hadoop.security.JniBasedUnixGroupsMapping。< clinit>(JniBasedUnixGroupsMapping.java: 49)
at org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback。< init>(JniBasedUnixGroupsMappingWithFallback.java:39)
... 12 more
2015-01-06 11:56:23,366 INFO [main] org.apache.hadoop.util.ExitUtil:以状态1退出
解决方案
根本原因:在类org.apache.hadoop.security.JniBasedUnixGroupsMapping中执行本地函数anchorNative失败
说明:函数anchorNative将调用库libhadoop.so中的函数。这个库的路径由这些环境变量指定:
export JAVA_LIBRARY_PATH
export HADOOP_COMMON_LIB_NATIVE_DIR
code>
在Hadoop源代码中,通过
打印java库类路径<$ System.err.println((System.getProperty(java.library.path));
#result
/ home / maidinh / hadoop2 / build / hadoop-2.6.0-src / hadoop-dist / target / hadoop-2.6.0 / lib / native:
/ usr / java / packages / lib / amd64:
/ usr / lib64:
/ lib64:
/ lib:
/ usr / lib
不同版本的库libhadoop.so可以在这些冲突地点找到。
解决方案: (在hadoop-2.6.0 / lib / native中),删除其他目录中的所有libhadoop.so。
$ b 注释:删除所有相关的hadoop库
rm -r libhadoop *
rm -r libhdfs *
I have just started to work with Hadoop 2.
After installing with basic configs, I always failed to run any examples. Has anyone seen this problem and please help me?
And the error is something like
Error starting MRAppMaster
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
This is the log
20152015-01-06 11:56:23,194 INFO [main] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Created MRAppMaster for application appattempt_1420510526926_0002_000001
2015-01-06 11:56:23,362 FATAL [main] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Error starting MRAppMaster
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
at org.apache.hadoop.security.Groups.<init>(Groups.java:70)
at org.apache.hadoop.security.Groups.<init>(Groups.java:66)
at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:280)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:271)
at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:299)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1473)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1429)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
... 7 more
Caused by: java.lang.UnsatisfiedLinkError: org.apache.hadoop.security.JniBasedUnixGroupsMapping.anchorNative()V
at org.apache.hadoop.security.JniBasedUnixGroupsMapping.anchorNative(Native Method)
at org.apache.hadoop.security.JniBasedUnixGroupsMapping.<clinit>(JniBasedUnixGroupsMapping.java:49)
at org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback.<init>(JniBasedUnixGroupsMappingWithFallback.java:39)
... 12 more
2015-01-06 11:56:23,366 INFO [main] org.apache.hadoop.util.ExitUtil: Exiting with status 1
Error messages: "Error starting MRAppMaster", "InvocationTargetException", "UnsatisfiedLinkError"
Root cause: Fail to execute the native function "anchorNative" in the class "org.apache.hadoop.security.JniBasedUnixGroupsMapping"
Description: the function "anchorNative" will call a function in the library "libhadoop.so". The path of this library is specified by these environment variables:
export JAVA_LIBRARY_PATH
export HADOOP_COMMON_LIB_NATIVE_DIR
In the Hadoop source code, print the java library class path by
System.err.println( (System.getProperty("java.library.path") );
# result
/home/maidinh/hadoop2/build/hadoop-2.6.0-src/hadoop-dist/target/hadoop-2.6.0/lib/native:
/usr/java/packages/lib/amd64:
/usr/lib64:
/lib64:
/lib:
/usr/lib
Different versions of the library "libhadoop.so" can be found in these locations that make a conflict.
Solution: Except the right path of native library (in hadoop-2.6.0/lib/native), delete all "libhadoop.so" in other directories.
Notes: delete all related libraries of hadoop
rm -r libhadoop*
rm -r libhdfs*
这篇关于Hadoop 2.6.0:基本错误“启动MRAppMaster”安装后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!