Support Questions

Find answers, ask questions, and share your expertise

How can i start Namenode service of Hadoop without formating it every time want to start it ?

avatar
New Contributor

When i want to start Namenode of Hadoop i'm forced to format it or i'll got the error connection to localhost:9000, so for this reason i will lose all my data storaged in HDFS after formating the Namenode.
Because the dir of namenode and datanode were in tmp folder which will be cleaned after every reboot the machine,

So how i can resolve this problem in order to start the Namenode service without formating to keep my data on HDFS ?

1 REPLY 1

avatar
Master Collaborator

@Slimani Ibrahim

It's not recommended to format the NameNode more than once except when NameNode loses metadata information.

The reason could be this property which tells NameNode where to store its metadata information on disk is dfs.namenode.name.dir in your case its points to /tmp, so every time you restart your system the /tmp directory gets flushed and hence you have to format the NameNode again.

So, make sure you point the property dfs.namenode.name.dir to a more persistent location
(something like /hadoop/hdfs/namenode similar for datanode property/hadoop/hdfs/datanode) which does not get's cleared every time if you restart your system that will resolve this problem.

I hope that the above answers your questions. Please accept the answer you found most useful.