Tagged: namenode

hadoop namenode format error : java.net.UnknownHostException

I am setting up Hadoop 0.23.1 in a pseudo distributed mode on Fedora 17,  when I tried to format the namenode using “bin/hadoop namenode -format” I came across the following error.

net.DNS (DNS.java:resolveLocalHostname(184)) – Unable to determine local hostname -falling back to “localhost”
java.net.UnknownHostException: XXXX:XXXX
This can be solved by the changing the hostname to localhost

check the hostname by the command

$ hostname


change the hostname to localhost

to permanently change the hostname

1) debian based systems( example : ubuntu)

edit etc/hostname and enter localhost in it  and run /etc/init.d/hostname.sh start

2) RedHat based systems

edit /etc/sysconfig/network to enter the new hostname and new hostname is preserved even on reboot also.

the same problem is occured in the following link.