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

$ XXXXXX

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.

http://stackoverflow.com/questions/6307244/hadoop-namenode-format-returns-a-java-net-unknownhostexception”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s