Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11699

_HOST not consistently resolving to lowercase fully qualified hostname on Windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 2.6.0
    • None
    • security
    • None

    Description

      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

      <property>
        <name>dfs.namenode.kerberos.principal</name>
        <value>hdfs/_HOST@YOURREALM.COM</value>
      </property>
      

      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 .
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java

        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();
        }
      

      Attachments

        Issue Links

          Activity

            People

              brahmareddy Brahma Reddy Battula
              kminder Kevin Minder
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: