解决HDFS和spark-shell启动的警告:Unable to load native-hadoop library for your platform... using builtin-java

一、问题

在启动hadoop和spark-shell的时候会有警告:

start-dfs.sh
2018-10-03 09:43:31,795 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
spark-shell
2018-10-03 09:49:05 WARN  NativeCodeLoader:60 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

 虽然这两个警告不会对任务产生影响,但是看到WARN就会感到不安,所以就解决一下

二、解决方案

(问题详细描述可以参考:WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform...问题详解)

针对启动hadoop的警告,需要将hadoop安装目录下的lib/native引入到环境变量中

   export JAVA_LIBRAY_PATH=/usr/local/hadoop/lib/native

针对spark-shell的警告,需要在Spark安装目录下的conf/spark-env.sh引入JAVA_LIBRAY_PATH

  export LD_LIBRARY_PATH=$JAVA_LIBRARY_PATH

重启生效后就不会有警告了

 

 

 

你可能感兴趣的:(hadoop,spark,大数据,hadoop,spark-shell,WARN)