Hadoop 2.7.3 WARN util.NativeCodeLoader:无法为您的平台加载native-hadoop库...使用适用的builtin-java类

时间:2017-03-24 03:52:09

标签: java hadoop debian bigdata

当我在debian jessie上安装hadoop时遇到问题,我在运行脚本start-dfs.sh时收到警告

hadoop@debian1:~$ /usr/local/hadoop/sbin/start-dfs.sh 17/03/24 10:40:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Starting namenodes on [localhost] localhost: starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-debian1.out localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-hadoop-datanode-debian1.out Starting secondary namenodes [0.0.0.0] 0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-debian1.out 17/03/24 10:40:16 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

我正在运行

hadoop-2.7.3,debian jessie(8.7),默认java来自repo debian

有人可以帮我修理警告吗?

2 个答案:

答案 0 :(得分:1)

将以下行添加到hadoop-env.sh,它将修复

export HADOOP_HOME_WARN_SUPPRESS=1
export HADOOP_ROOT_LOGGER="WARN,DRFA"

答案 1 :(得分:1)

我的解决方案是在.bashrc文件中添加这些行:

... others enviroment variables... 
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_COMMON_LIB_NATIVE_DIR"

执行此操作后,您需要使用以下命令进行刷新:

source ~/.bashrc

您可以使用这些步骤来提供本机库的路径,而不是省略编辑hadoop-env.sh的警告。