错误信息
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... usi
更改日志级别
export HADOOP_ROOT_LOGGER=DEBUG,console
重新执行命令,发现错误如下
16/05/26 14:24:15 DEBUG impl.MetricsSystemImpl: UgiMetrics, User and group related metrics
16/05/26 14:24:15 DEBUG util.KerberosName: Kerberos krb5 configuration not found, setting default realm to empty
16/05/26 14:24:15 DEBUG security.Groups: Creating new Groups object
16/05/26 14:24:15 DEBUG util.NativeCodeLoader: Trying to load the custom-built native-hadoop library...
16/05/26 14:24:15 DEBUG util.NativeCodeLoader: Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
16/05/26 14:24:15 DEBUG util.NativeCodeLoader: java.library.path=/usr/local/hadoop/lib/
16/05/26 14:24:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/05/26 14:24:15 DEBUG util.PerformanceAdvisory: Falling back to shell based
16/05/26 14:24:15 DEBUG security.JniBasedUnixGroupsMappingWithFallback: Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping
解决
配置/etc/profile中的环境变量,换成自己的路径,然后重新source
export HADOOP_COMMON_LIB_NATIVE_DIR="/usr/local/hadoop/lib/native/"
export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/"