hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Minder (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-11699) _HOST not consistently resolving to lowercase fully qualified hostname
Date Tue, 10 Mar 2015 00:26:38 GMT
Kevin Minder created HADOOP-11699:

             Summary: _HOST not consistently resolving to lowercase fully qualified hostname
                 Key: HADOOP-11699
                 URL: https://issues.apache.org/jira/browse/HADOOP-11699
             Project: Hadoop Common
          Issue Type: Bug
          Components: security
    Affects Versions: 2.6.0
            Reporter: Kevin Minder

The _HOST marker used for Kerberos principals in various configuration files does not always
return lowercase fully qualified hostnames.  For example this setting in hdfs-site.xml

In particular, this is impeding our work to have Hadoop work with equivalent security on Windows
as on Linux.

In the windows env in which I'm having the issue, I was able to get a fully qualified host
name using this version of method getLocalHostName() in .  

  public static String getLocalHostName() throws UnknownHostException {
    String hostname = InetAddress.getLocalHost().getCanonicalHostName();
    if ( !hostname.contains( "." ) ) {
      final String os = System.getProperties().getProperty( "os.name", "?" ).toLowerCase();
      if ( os.startsWith( "windows" ) ) {
        String domain = System.getenv( "USERDNSDOMAIN" );
        if ( domain != null ) {
          hostname += "." + domain.trim();
    return hostname == null ? "localhost" : hostname.toLowerCase();

This message was sent by Atlassian JIRA

View raw message