How does hadoop decide what its nodes hostnames are?

Posted by Dan R on Server Fault See other posts from Server Fault or by Dan R
Published on 2012-09-04T17:33:10Z Indexed on 2012/09/15 9:40 UTC
Read the original article Hit count: 155

Filed under:
|

Currently the urls generated by the jobtracker & namenode return either hostnames like bubbles.local or just bubbles. These end up not resolving unless the client machine has specified these in their /etc/hosts file.

When I run the hostname command on these machines it returns a hostname complete with the domain (E.G bubbles.example.com)

Running a small java test on these machines

InetAddress addr = InetAddress.getLocalHost();
byte[] ipAddr = addr.getAddress();
String hostname = addr.getHostName();
System.out.println(hostname);

Produces output just like the hostname command.

Where else could hadoop be grabbing a hostname to use in its jobtracker / namenode UI?

This is occurring in clusters with Hadoop 1.0.3 and 1.0.4-SNAPSHOT from early august. The machines are running CentOS release 5.8 (Final).

The generated URLs I'm referring to are like this

http://example:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/

or http://example.local:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/

© Server Fault or respective owner

Related posts about centos

Related posts about hadoop