hadoopnamenodedatanode

How to format datanodes after formatting the namenode on hdfs?


I've recently been settings up hadoop in pseudo distributed mode and I have created data and loaded that into HDFS. Later I have formatted namenode because of a problem. Now when I do that, I find that the directories and the files which were already there before on the datanodes don't show up anymore. (the word "Formatting" makes sense though) But now, I do have this doubt. As the namenode doesn't hold the metadata of the files anymore, is access to the previously loaded files cut-off? If that's a yes, then how do we delete the data already there on the datanodes?


Solution

  • Your previous datanode directories are now stale, yes.

    You need to manually go through each datanode and delete the contents of those directories. There is no such format command via the Hadoop CLI

    By default, the data node directory is a single folder under /tmp

    Otherwise, you've configured your XML files where to store data

    Where HDFS stores data