After formatting my hdfs, I get the following errors:
2015-05-28 21:41:57,544 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompa
The same problem happened to me. I deleted the contents of data directory and then ran hdfs datanode. This created the VERSION and other files inside the datanode directory. This solved my problem.
2015-05-28 21:41:57,544 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompatible clusterIDs in /usr/local/hadoop/dfs/datanode: namenode clusterID = CID-e77ee39a-ab4a-4de1-b1a4-9d4da78b83e8; datanode clusterID = CID-6c250e90-658c-4363-9346-972330ff8bf9
Your namenode and datanode cluster ID does not match.
Open your usr/local/hadoop/dfs/datanode/current/VERSION
file and change:
clusterID=CID-6c250e90-658c-4363-9346-972330ff8bf9
to
clusterID=CID-e77ee39a-ab4a-4de1-b1a4-9d4da78b83e8
NOTE: Whenever you format your namenode, check the VERSION file of namenode and datanode. They both should have same clusterID and namespaceID. Otherwise your datanode, won't start.