经常遇到这个警告
# hdfs dfs -ls /input 15/11/10 10:00:32 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
如何验证64bit还是32bit?
进入hadoop安装目录
cd /data/slot0/hadoop/lib/native用ldd命令查看依赖库
ldd libhadoop.so.1.0.0 ./libhadoop.so.1.0.0: /lib64/libc.so.6: version `GLIBC_2.14‘ not found (required by ./libhadoop.so.1.0.0) linux-vdso.so.1 => (0x00007fff10b79000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f4ef3512000) libc.so.6 => /lib64/libc.so.6 (0x00007f4ef317d000) /lib64/ld-linux-x86-64.so.2 (0x0000003401a00000)
但是看到报错,GLIBC_2.14找不到,现在检查系统的glibc库, ldd --version即可检查。
ldd --version ldd (GNU libc) 2.12 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.
原来系统预装的glibc库是2.12版本,而hadoop期望是2.14版本,所以打印警告信息。
现在有两个办法,重新编译glibc.2.14版本,安装后专门给hadoop使用,这个有点危险。
第二个办法直接在log4j日志中去除告警信息。在/data/slot0/hadoop/etc/hadoop/log4j.properties文件中添加
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
版权声明:本文为博主原创文章,未经博主允许不得转载。
去除HDFS WARN util.NativeCodeLoader
原文地址:http://blog.csdn.net/csfreebird/article/details/49755735