hadoop安裝中錯誤

1057718341_h發表於2017-09-06

 

1.1. hadoop錯誤

1.1.1.  啟動錯誤

[root@xuegod63 hadoop-2.6.2]#sbin/start-all.sh

This script is Deprecated. Instead use start-dfs.sh andstart-yarn.sh

17/05/15 18:58:59 WARN util.NativeCodeLoader: Unable to loadnative-hadoop library for your platform... using builtin-java classes whereapplicable

Starting namenodes on [xuegod63]

The authenticity of host 'xuegod63 (192.168.1.63)' can't beestablished.

RSA key fingerprint is06:42:3e:1a:f6:55:f1:ac:4d:15:c5:ac:c4:d8:0c:26.

Are you sure you want to continue connecting (yes/no)? yes

xuegod63: Warning: Permanently added 'xuegod63' (RSA) to thelist of known hosts.

xuegod63: starting namenode, logging to/usr/local/hadoop-2.6.2/logs/hadoop-root-namenode-xuegod63.out

The authenticity of host 'localhost (::1)' can't beestablished.

RSA key fingerprint is06:42:3e:1a:f6:55:f1:ac:4d:15:c5:ac:c4:d8:0c:26.

Are you sure you want to continue connecting (yes/no)? yes

localhost: Warning: Permanently added 'localhost' (RSA) tothe list of known hosts.

localhost: starting datanode, logging to/usr/local/hadoop-2.6.2/logs/hadoop-root-datanode-xuegod63.out

Starting secondary namenodes [xuegod63]

xuegod63: starting secondarynamenode, logging to/usr/local/hadoop-2.6.2/logs/hadoop-root-secondarynamenode-xuegod63.out

17/05/15 18:59:43 WARN util.NativeCodeLoader:Unable to load native-hadoop library for your platform... using builtin-javaclasses where applicable

starting yarn daemons

resourcemanager running as process 3400. Stop it first.

localhost: starting nodemanager, logging to/usr/local/hadoop-2.6.2/logs/yarn-root-nodemanager-xuegod63.out

[root@xuegod63 hadoop-2.6.2]#

[root@xuegod63 hadoop-2.6.2]#

[root@xuegod63 hadoop-2.6.2]#

 

解決辦法:

下載hadoop-native包,解壓到lib/native目錄下即可。

 

 

1.1.2.  hadoop建立目錄錯誤

現錯誤提示:mkdir:org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot createdirectory /hbase. Name node is in safe mode

解決方法:

進入Hadoop的bin目錄執行命令手動離開安全模式:

[root@localhost85bin]#

[root@localhost85bin]# ./hadoop dfsadmin -safemode leave

[root@localhost85bin]#

出錯原因:

這是因為在分散式檔案系統啟動的時候,開始的時候會有安全模式,當分散式檔案系統處於安全模式的情況下,檔案系統中的內容不允許修改也不允許刪除,直到安全模式結束。安全模式主要是為了系統啟動的時候檢查各個DataNode上資料塊的有效性,同時根據策略必要的複製或者刪除部分資料塊。執行期通過命令也可以進入安全模式。在實踐過程中,系統啟動的時候去修改和刪除檔案也會有安全模式不允許修改的出錯提示,只需要等待一會即可。

 

2.6以前解決辦法:

離開安全模式方法: bin/Hadoop  dfsadmin -safemode leave

root@localhost85 hadoop-2.7.3]# bin/hadoop dfsadmin-safemode leave

root@localhost85 hadoop-2.7.3]# bin/hadoop dfsadmin-safemode -report

 

新版(2.7.3)推薦使用hdfs命令關閉安全模式:bin/hdfs dfsadmin -safemode leave

root@localhost85 hadoop-2.7.3]#

[root@localhost85 hadoop-2.7.3]# bin/hdfs dfsadmin -safemodeleave

Safe mode is OFF

You have new mail in /var/spool/mail/root

[root@localhost85 hadoop-2.7.3]#

 

在hdfs-site.xml中把dfs.safemode.threshold.pct設定為0即可關閉safemode

相關文章