解决hadoop本地库问题

执行hadoop的相关命令时,总提示如下:

]$ hadoop fs -ls /
2020-03-09 16:09:39,384 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

解决:

在当前用户的bashrc文件里面添加:

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib:$HADOOP_COMMON_LIB_NATIVE_DIR"