背景
部署好Hadoop集群后,发现native-hadoop不可用。
root@test-hdfs-client-7956fbd4f9-gxsf4:/# hdfs dfs -ls /
2019-07-10 12:36:20,232 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
drwxr-xr-x - root supergroup 0 2019-07-09 08:02 /user
调查
- 为了获取更多信息,开启debug日志。在$HADOOP_CONF_DIR/log4j.properties中添加如下行:
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=DEBUG
- 继续执行hdfs命令
root@test-hdfs-client-7956fbd4f9-gxsf4:/# hdfs dfs -ls /
2019-07-10 12:43:01,887 DEBUG util.NativeCodeLoader: Trying to load the custom-built native-hadoop library...
2019-07-10 12:43:01,888 DEBUG util.NativeCodeLoader: Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.pa