2

I'm currently learning Hadoop by http://tecadmin.net/steps-to-install-hadoop-on-centosrhel-6/ in the 5th step when I apply this command $ bin/hadoop namenode -format I get following error enter image description here

I also have checked these links for resolving my problem "hadoop namenode -format" returns a java.net.UnknownHostException java.net.UnknownHostException: Invalid hostname for server: local I don't know where is domain name in the configuration files for replacing it by localhost. also I went to /etc/hosts file and replaced text by localhost.. still I haven't resolve the problem please someone help me.

Community
  • 1
  • 1
Azhar Ak
  • 159
  • 3
  • 11
  • Can u please attach your /etc/hosts file here..? and how many node you are running..? – subZero Apr 26 '14 at 09:05
  • before editing it was like this(127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6) now I have edited with this (127.0.0.1 localhost static.98.35.ebonenet.com) and its running.. thanks. – Azhar Ak Apr 26 '14 at 09:25
  • got you..you are Wlcm.! – subZero Apr 26 '14 at 09:30

3 Answers3

6

The unknownHostException could be resolved by the following steps:

  • Go to /etc/hosts
  • Edit the "hosts" file with IP 127.0.0.1 [space] HostName (e.g. static.98.35.ebonenet.com)
  • Save the file and try again
Aadil
  • 189
  • 4
1

With the help of Aadil's answer I resolved The unknownHostException by the following steps:

Step-1 Go to /etc/hosts Step-2 Edit the "hosts" file with IP 127.0.0.1 [space/tab] localhost [space/tab] HostName (e.g. static.98.35.ebonenet.com) Step-3 Save the file and try again

Azhar Ak
  • 159
  • 3
  • 11
  • My /etc/hosts file is correct and yarn configuration is working fine. the nodes are running DataNode and are reported in Yarn node list. I am getting this exception while executing my MapReduce application. Any idea why is it like and where shall I look for a solution? – Tariq Feb 03 '15 at 14:17
0

Problem: If anyone facing:

SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: ubuntu: ubuntu: unknown error

Solution:

  • Go to /etc/hosts
  • Disable/Remove if any IPV6 configuration maintained in /etc/hosts file
  • Save the file and try again
Pardeep Dhingra
  • 3,916
  • 7
  • 30
  • 56
Nagarjuna D N
  • 541
  • 6
  • 26