欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Hadoop启动报错:Unable to load native

程序员文章站 2022-07-06 09:43:26
...

启动之后出现以下警告

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
说明hadoop的native库导入失败。一般是native库出现问题,重新安装与hadoop版本一致的native,并配置好配置文件就行

解决措施

先在官网下载native包
http://dl.bintray.com/sequenceiq/sequenceiq-bin/
上传解压到/hadoop/lib路径下

[[email protected] /] cd /opt/app/hadoop/lib
[[email protected] lib] rz #上传tar包
[[email protected] lib] mkdir native #新建native文件夹
[[email protected] lib] tar -xvf hadoop-native-64-2.6.0.tar -C native
[[email protected] lib] ls
hadoop-native-64-2.6.0.tar  native
[[email protected] lib] cd native
[[email protected] native] ls
libhadoop.a  libhadooppipes.a  libhadoop.so  libhadoop.so.1.0.0  libhadooputils.a  libhdfs.a  libhdfs.so  libhdfs.so.0.0.0

编辑并生效环境变量

[[email protected] /] vim /etc/profile
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native  
export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native" 
[[email protected] /] . /etc/profile #生效环境变量

启动hdfs

[[email protected] /] start-dfs.sh
Starting namenodes on [Hadoop01]
Hadoop01: namenode running as process 4548. Stop it first.
Hadoop01: datanode running as process 4679. Stop it first.
Starting secondary namenodes [0.0.0.0]
0.0.0.0: secondarynamenode running as process 4851. Stop it first.
您在 /var/spool/mail/root 中有新邮件
[[email protected] /] hadoop fs -ls #查看hdfs路径
ls: `.': No such file or directory
相关标签: Hadoop hadoop