java.io.IOException: All specified directories are failed to load

2015-09-02 01:17:37,962 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompatible clusterIDs in /usr/local/hadoop/data1: namenode clusterID = CID-c7970b3b-e127-4054-ba7b-7736183904d2; datanode clusterID = CID-4b42cd9e-35ec-4194-b516-d4de4055c35b
2015-09-02 01:17:37,977 INFO org.apache.hadoop.hdfs.server.common.Storage: Lock on /usr/local/hadoop/data2/in_use.lock acquired by nodename 6889@ubuntu
2015-09-02 01:17:37,978 WARN org.apache.hadoop.hdfs.server.common.Storage: org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /usr/local/hadoop/data2 is in an inconsistent state: cluster Id is incompatible with others.
2015-09-02 01:17:37,980 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool (Datanode Uuid unassigned) service to localhost/127.0.0.1:9000. Exiting. 
java.io.IOException: All specified directories are failed to load.
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:477)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1387)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1352)
at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:316)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:228)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:852)
at java.lang.Thread.run(Thread.java:745)

提醒连个cid不一致,原因是Hadoop启动后,在使用格式化namenode,会导致datanode和namenode的clusterID不一致

这个ID的位置这么找:

先找到/etc/hadoop/hdfs-site.xml

里面有datanode的路径,在那个路径下找:/current/VERSION文件,即可修改clusterID

你可能感兴趣的:(hadoop)