You need to do something like this:
bin/stop-all.sh(orstop-dfs.shandstop-yarn.shin the 2.x serie)rm -Rf /app/tmp/hadoop-your-username/*bin/hadoop namenode -format(orhdfsin the 2.x serie)
the solution was taken from:
http://pages.cs.brandeis.edu/~cs147a/lab/hadoop-troubleshooting/. Basically it consists in restarting from scratch, so make sure you won’t loose data by formating the hdfs.