本帖最后由 howtodown 于 2014-1-8 00:04 编辑
1.Hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
把所有Datanode节点执行下面命令
[hadoop@hadoop3 local]$ chown -R hadoop:hadoop hadoop-0.20.2/
2.
2012-08-05 10:52:11,807 ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/hadoop/namenode is in an inconsistent state: storage directory does not exist or is not accessible.
hadoop配置好之后一定先要格式化,
[hadoop@hadoop1 local]$ hadoop namenode -format
3.
2012-08-05 11:20:40,127 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Call to hadoop1/192.168.127.118:9000 failed on local exception: java.net.NoRouteToHostException: No route to host
关闭防护墙
[hadoop@hadoop1 local]$ chkconfig --level 2345 iptables off
[hadoop@hadoop1 local]$ chkconfig --level 2345 ip6tables off
4
2012-08-05 14:53:50,041 FATAL org.apache.hadoop.mapred.JobTracker: java.lang.RuntimeException: Not a host:port pair: local
仔细检查你的mapred-site.xml文件
5 地址占用
org.apache.hadoop.hdfs.server.namenode.NameNode: Address already in use
查找被占用的端口号对应的PID : netstat -tunl
pkill -9 PID实在不行就killall -9 java
6 safemode
bin/hadoop fs -put ./input input
put: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/root/input. Name node is in safe mode.
hadoop dfsadmin -safemode leave
解决方法:
NameNode在启动的时候首先进入安全模式,如果datanode丢失的block达到一定的比例(1-dfs.safemode.threshold.pct),则系统会一直处于安全模式状态即只读状态。
dfs.safemode.threshold.pct(缺省值0.999f)表示HDFS启动的时候,如果DataNode上报的block个数达到了元数据记录的block个数的0.999倍才可以离开安全模式,否则一直是这种只读模式。如果设为1则HDFS永远是处于SafeMode。
下面这行摘录自NameNode启动时的日志(block上报比例1达到了阀值0.9990)
The ratio of reported blocks 1.0000 has reached the threshold 0.9990. Safe mode will be turned off automatically in 18 seconds.
有两个方法离开这种安全模式
(1)修改dfs.safemode.threshold.pct为一个比较小的值,缺省是0.999。
(2)hadoop dfsadmin -safemode leave命令强制离开
用户可以通过dfsadmin -safemode value 来操作安全模式,参数value的说明如下:
enter - 进入安全模式
leave - 强制NameNode离开安全模式
get - 返回安全模式是否开启的信息
wait - 等待,一直到安全模式结束。
|
|