故障现象:
[root@AY1312280620257702e0Z ~]#
jps
6822 NodeManager
6106
SecondaryNameNode
6561
ResourceManager
6005 NameNode
6955
JobHistoryServer
10964 Jps
Without datanode
[root@AY1312280620257702e0Z ~]# hadoop fs -mkdir
input
[root@AY1312280620257702e0Z ~]#
hadoop fs -put /etc/hadoop/conf/*.xml input
14/01/28 22:50:45
WARN hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException):
File /user/root/input/core-site.xml._COPYING_ could only be
replicated to 0 nodes instead of minReplication (=1).
There are 0 datanode(s) running and no node(s)
are excluded in this operation.
问题定位:
检查日志/var/log/hadoop-hdfs/hadoop-hdfs-datanode-AY1312280620257702e0Z.log.发现有如下异常:
2014-01-28 20:52:16,377 FATAL
org.apache.hadoop.hdfs.server.
datanode.DataNode:
Initialization failed for block pool
Block pool
BP-1814315425-10.144.162.11-1390913469801 (storage
id DS-938709897-10.144.162.11-50010-1390910093924) service
to localhost/127.0.0.1:8020
java.io.IOException: Incompatible clusterIDs in
/var/lib/hadoop-hdfs/cache/hdfs/dfs/data: namenode clusterID
= CID-398d1409-5590-4bed-a8e2-ee731cf3d508; datanode
clusterID = CID-28de7f67-d405-42fb-9dab-dbc69eb8f0b2
根因:
因为多次执行了"sudo
-u hdfs hdfs namenode -format" ,而没有手动清除cd
/var/lib/hadoop-hdfs/cache/hdfs/dfs/data路径下的多余文件,当手动删除该路径下的文件,重新运行启动HDFS的命令,则HDFS
DATANODE可以运行。
<!-- 正文结束 -->
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23246399/viewspace-1119341/
,如需转载,请注明出处,否则将追究法律责任。