You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2014/07/30 21:54:40 UTC
[jira] [Resolved] (HADOOP-6797) DNS#getHosts() fallback leads to
mix of network-interface addresse in case reverse lookup fails
[ https://issues.apache.org/jira/browse/HADOOP-6797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Allen Wittenauer resolved HADOOP-6797.
--------------------------------------
Resolution: Incomplete
I'm going to close this as stale at this point.
> DNS#getHosts() fallback leads to mix of network-interface addresse in case reverse lookup fails
> -----------------------------------------------------------------------------------------------
>
> Key: HADOOP-6797
> URL: https://issues.apache.org/jira/browse/HADOOP-6797
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 0.20.2
> Reporter: Johannes Zillmann
>
> org.apache.hadoop.net.DNS#getHosts():
> {noformat}
> public static String[] getHosts(String strInterface, String nameserver)
> throws UnknownHostException {
> String[] ips = getIPs(strInterface);
> Vector<String> hosts = new Vector<String>();
> for (int ctr = 0; ctr < ips.length; ctr++)
> try {
> hosts.add(reverseDns(InetAddress.getByName(ips[ctr]),
> nameserver));
> } catch (Exception e) {
> }
> if (hosts.size() == 0)
> return new String[] { InetAddress.getLocalHost().getCanonicalHostName() };
> else
> return hosts.toArray(new String[] {});
> }
> {noformat}
> I have the situation where i choosing eth1 as network interface (fs.datanode.dns.interface and mapred.tasktracker.dns.interface) which is the internal interface.
> The reverse lookup fails for eth1 so the fallback:
> {noformat}
> if (hosts.size() == 0)
> return new String[] { InetAddress.getLocalHost().getCanonicalHostName() };
> {noformat}
> comes to action. The dns of eth0 is returned which is the external interface.
> This leads in my case to a combination of internal ip and external dns as the default ip/host.
--
This message was sent by Atlassian JIRA
(v6.2#6252)