Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
在配置的时候,频繁出现这个问题,在网上找了相关资料,都是说libray包没找到。
检查所有配置,一切都正常。都配置正常。
修改过:etc/profile
问题还是没解决。
之后尝试如下步骤:
1, 开启调试日志 export HADOOP_ROOT_LOGGER=DEBUG,console
2,/data/server/hadoop-2.6.0/bin
./hadoop checknative -a
查看日志,报如下错误:
[hadoop@DEV-NEW-HADOOP-01 bin]$ ./hadoop checknative
18/09/28 09:55:34 DEBUG util.NativeCodeLoader: Trying to load the custom-built native-hadoop library...
18/09/28 09:55:34 DEBUG util.NativeCodeLoader: Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
18/09/28 09:55:34 DEBUG util.NativeCodeLoader: java.library.path=:/data/server/hadoop-2.6.0/lib/native/Linux-amd64-64/
18/09/28 09:55:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/09/28 09:55:35 DEBUG util.Shell: setsid exited with exit code 0
Native library checking:
hadoop: false
zlib: false
snappy: false
lz4: false
bzip2: false
openssl: false
18/09/28 09:55:35 INFO util.ExitUtil: Exiting with status 1
查看环境变量,并没有配置 java.library.path=:/data/server/hadoop-2.6.0/lib/native/Linux-amd64-64/。
之后,尝试使用:export JAVA_LIBRARY_PATH=$JAVA_LIBRARY_PATH:/data/server/hadoop-2.6.0/lib/native/
然后在检查:./hadoop checknative
恢复正常,问题解决
[hadoop@DEV-NEW-HADOOP-02 bin]$ ./hadoop checknative
18/09/28 09:57:14 WARN bzip2.Bzip2Factory: Failed to load/initialize native-bzip2 library system-native, will use pure-Java version
18/09/28 09:57:14 INFO zlib.ZlibFactory: Successfully loaded & initialized native-zlib library
Native library checking:
hadoop: true /data/server/hadoop-2.6.0/lib/native/libhadoop.so
zlib: true /lib64/libz.so.1
snappy: true /data/server/hadoop-2.6.0/lib/native/Linux-amd64-64/libsnappy.so.1
lz4: true revision:99
bzip2: false
openssl: true /usr/lib64/libcrypto.so