1、錯誤描述
當在Hadoop sbin目錄下執(zhí)行start-dfs.sh腳本的時候叁幢,出現(xiàn)報錯17:52:29 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Starting namenodes on [wh301]
$ ./start-dfs.sh
17/03/15 17:52:29 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [wh301]
wh301: starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-wh301.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-hadoop-datanode-wh301.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-wh301.out
17/03/15 17:52:47 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2刃泡、分析
這是由于hadoop-2.6.0.tar.gz安裝包是在32位機器上編譯的锨络,在64位的機器安裝此包后潦俺,當加載本地庫.so文件時就會出現(xiàn)版本不一致的情況拒课。
3、解決
我的建議是下載相關(guān)的64位lib庫進行替換lib目錄下的原native目錄事示,位置是/usr/local/hadoop/lib/native早像。(如果你的安裝目錄和我的一致的話)
tar -x hadoop-native-64-2.6.0.tar -C? /usr/local/hadoop/lib/native/
[hadoop@wh301 native]$ ls -ltr
total 4356
-rwxr-xr-x. 1 hadoop hadoop? 228435 Dec? 2? 2014 libhdfs.so.0.0.0
-rw-r--r--. 1 hadoop hadoop? 359458 Dec? 2? 2014 libhdfs.a
-rwxr-xr-x. 1 hadoop hadoop? 671189 Dec? 2? 2014 libhadoop.so.1.0.0
-rw-r--r--. 1 hadoop hadoop 1119486 Dec? 2? 2014 libhadoop.a
-rw-r--r--. 1 hadoop hadoop? 581944 Dec? 2? 2014 libhadooputils.a
-rw-r--r--. 1 hadoop hadoop 1486964 Dec? 2? 2014 libhadooppipes.a
lrwxrwxrwx. 1 hadoop hadoop? ? ? 18 Mar 15 17:55 libhadoop.so -> libhadoop.so.1.0.0
lrwxrwxrwx. 1 hadoop hadoop? ? ? 16 Mar 15 17:55 libhdfs.so -> libhdfs.so.0.0.0
[hadoop@wh301 native]$ pwd
/usr/local/hadoop/lib/native
[hadoop@wh301 sbin]$ ./start-dfs.sh
Starting namenodes on [wh301]
wh301: starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-wh301.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-hadoop-datanode-wh301.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-wh301.out
可以看到,錯誤解決了很魂。
如果你是hadoop2.6版本就可以右鍵下載: