hadoop 启动报错 Incompatible clusterIDs in /tmp/hadoop-root/dfs/data: namenode

调用 start-dfs.sh 时候 报错如下,导致datanode无法启动:

ava.io.IOException: Incompatible clusterIDs in /tmp/hadoop-root/dfs/data: namenode clusterID = CID-3e3e295a-0dff-4d4c-ac57-ea965289a4ee; datanode clusterID = CID-092549d0-a8ff-4ad6-b93b-13079d654109
	at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:477)
	at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:226)
	at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:254)
	at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:975)
	at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:946)
	at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:278)
	at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:220)
	at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:812)
	at java.lang.Thread.run(Thread.java:745)
解决办法:

You need to do something like this:
bin/stop-all.sh 
rm -Rf /tmp/hadoop-your-username/*    (所有datanode节点都要执行)
bin/hadoop namenode -format
来源:

http://blog.sina.com.cn/s/blog_3fe961ae010189q5.html

你可能感兴趣的:(hadoop 启动报错 Incompatible clusterIDs in /tmp/hadoop-root/dfs/data: namenode)