"hadoop namenode -format" returns a java.net.UnknownHostException "hadoop namenode -format" returns a java.net.UnknownHostException hadoop hadoop

"hadoop namenode -format" returns a java.net.UnknownHostException


UnknownHostException is thrown when hadoop tries to resolve the DNS name (srv-clc-04.univ-nantes.prive3) to an ip address. This fails.

Look for the domain name in the configuration files and replace it by "localhost". (Or update the DNS up resolve the name to an ip address)


First get the host name of your computer. It can be obtained by running $hostname command.Then add 127.0.0.1 localhost hostname into the /etc/hosts file. That should solve the problem.


The tmp directory that you have created should have ownership issues. That is why hadoop is not able to write to the tmp directoy to fix it run the following commands

sudo chown hduser:hadoop /app/<your hadoop tmp dir>