[
https://issues.apache.org/jira/browse/HDFS-5338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793056#comment-13793056
]
Chris Nauroth commented on HDFS-5338:
-------------------------------------
In addition to the performance impact of redundant DNS lookups, there is also a
correctness problem when skipping this check. If the excludes file specifies
the hostname, and an unresolved registration is allowed, then an excluded
datanode could register successfully by IP address during a DNS outage.
[~daryn] explains it well in this comment from HDFS-4269:
https://issues.apache.org/jira/browse/HDFS-4269?focusedCommentId=13638500&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13638500
The patch looks good to me. If you're running in an environment where reverse
DNS lookup isn't possible, then by definition, you can't put hostnames in the
excludes file anyway.
Shall we document the new property in hdfs-default.xml? Here is some proposed
text:
{code}
<property>
<name>dfs.namenode.datanode.registration.ip-hostname-check</name>
<value>true</value>
<description>
If true (the default), then the namenode requires that a connecting
datanode's address must be resolved to a hostname. If necessary, a reverse
DNS lookup is performed. All attempts to register a datanode from an
unresolvable address are rejected.
It is recommended that this setting be left on to prevent accidental
registration of datanodes listed by hostname in the excludes file during a
DNS outage. Only set this to false in environments where there is no
infrastructure to support reverse DNS lookup.
</description>
</property>
{code}
> Add a conf to disable hostname check in DN registration
> -------------------------------------------------------
>
> Key: HDFS-5338
> URL: https://issues.apache.org/jira/browse/HDFS-5338
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Attachments: h5338_20131009.patch
>
>
> During DN registration, if the ip and the hostname in the DN InetAddress are
> the same (i.e. reverse name lookup falied; see [the
> javadoc|http://docs.oracle.com/javase/6/docs/api/java/net/InetAddress.html#getHostName%28%29]),
> the DN will be disallowed to register, where the DN InetAddress was obtained
> from the socket. It is a performance improvement added by HDFS-3990 to avoid
> unnecessary DNS resolutions.
> We propose to add a conf property for disabling the check. Otherwise,
> clusters without reverse DNS lookup support does not work.
--
This message was sent by Atlassian JIRA
(v6.1#6144)