title: Why does the Hadoop incompatible namespaceIDs issue happen?
body: <p>This is a fairly well-documented error and the fix is easy, but does anyone know why Hadoop datanode NamespaceIDs can get screwed up so easily or how Hadoop assigns the NamespaceIDs when it starts up the datanodes?</p>
  
  <p>Here's the error:</p>
  
  <pre><code>2010-08-06 12:12:06,900 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Incompatible namespaceIDs in /Users/jchen/Data/Hadoop/dfs/data: namenode namespaceID = 773619367; datanode namespaceID = 2049079249
      at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:233)
      at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:148)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:298)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.&lt;init&gt;(DataNode.java:216)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1283)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1238)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1246)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1368)
  </code></pre>
  
  <p>This seems to even happen for single node instances. </p>