hadoop错误日志输出位置/hadoop2.6.0/logs/hadoop-tucl-datanode-tucl.log
java.io.IOException: Incompatible clusterIDs in /usr/hadoop/data: namenode clusterID = CID-faa65317-6867-4e61-b366-19370a96459c; datanode clusterID = CID-d838dda7-8ffc-4ae0-a59f-0b097fab4454
at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:646)at org.apache.hadoop.hdfs.server.datanode.DataStorage.addStorageLocations(DataStorage.java:320)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:403)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:422)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1311)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1276)
at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:314)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:220)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:828)
at java.lang.Thread.run(Thread.java:745)
2016-03-31 02:04:35,248 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Ending block pool service for: Block pool <registering> (Datanode Uuid unassigned) service to tucl/192.168.72.130:9000
2016-03-31 02:04:35,250 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Removed Block pool <registering> (Datanode Uuid unassigned)
2016-03-31 02:04:37,250 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode
2016-03-31 02:04:37,253 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 0
2016-03-31 02:04:37,272 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at tucl/192.168.72.130
************************************************************/
出现该问题的原因:在第一次格式化dfs后,启动并使用了hadoop,后来又重新执行了格式化命令(hdfs namenode -format),这时namenode的clusterID会重新生成,而datanode的clusterID 保持不变
解决方案:
原因是由于datanode与namenode下的clusterId 不匹配,修改datanode的clusterid与namenode的一致就行了
data/current/VERSION文件下的clusterId 与datanodeUuid如下
namenode的clusterid信息如下:
修改data下面的数据