[ 
https://issues.apache.org/jira/browse/HDFS-13955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16828870#comment-16828870
 ] 

CR Hota commented on HDFS-13955:
--------------------------------

[~elgoiri] [~brahmareddy] [~surendrasingh] Thanks for the discussion.

The latest patch doesn't work. getInfoServer is dependent on exact keys whereas 
keys configured in routers is key.<nameservice>.<namenodeid>. I would just 
prefer changing DFSUtil#getNamenodeWebAddr to something like below and continue 
using it. Tested whole https jmx flow and works well. 

 {code}
  public static String getNamenodeWebAddr(final Configuration conf, String nsId,
      String nnId) {
    String scheme = getHttpClientScheme(conf);

    if (nsId == null) {
      nsId = getOnlyNameServiceIdOrNull(conf);
    }

    String webAddrKey;
    String webAddr;
    if ("http".equals(scheme)) {
      webAddrKey = DFSUtilClient.concatSuffixes(
          DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, nsId, nnId);
      webAddr = conf.get(webAddrKey,
          DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_DEFAULT);
    } else if ("https".equals(scheme)) {
      webAddrKey = DFSUtilClient.concatSuffixes(
          DFSConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_KEY, nsId, nnId);
      webAddr = conf.get(webAddrKey,
          DFSConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_DEFAULT);
    } else {
      throw new IllegalArgumentException("Invalid scheme:" + scheme);
    }

    return webAddr;
  }

{code}

Also we dont need to think about RouterWebHdfsMethods#forwardRequest(Router, 
String) as this method is deleted as part of webhdfs security changes.

Do you want me to take up this jira? 

> RBF: Support secure Namenode in NamenodeHeartbeatService
> --------------------------------------------------------
>
>                 Key: HDFS-13955
>                 URL: https://issues.apache.org/jira/browse/HDFS-13955
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Íñigo Goiri
>            Assignee: Sherwood Zheng
>            Priority: Major
>         Attachments: HDFS-13955-HDFS-13532.000.patch, 
> HDFS-13955-HDFS-13532.001.patch
>
>
> Currently, the NamenodeHeartbeatService uses JMX to get the metrics from the 
> Namenodes. We should support HTTPs.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to