[
https://issues.apache.org/jira/browse/HDFS-6001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910863#comment-13910863
]
Jerry He commented on HDFS-6001:
--------------------------------
Thanks for all the comments. You all confirm the expected behavior.
And thanks Chris for the additional info.
Yes, we were looking to get the host name of the namenode via the URI,
Here is a simple use case we had:
To get the active nodes in a hdfs cluster:
1. get the name node host via the URI.
2. get the data nodes via datanodeReport, then DatanodeInfo.getHostName()
If we can get the host name via the alternative as described by Chris, it will
be ok in term of functionality gap.
Or is there any other alternative?
> In HDFS HA setup, FileSystem.getUri returns hdfs://<dfs.nameservices>
> ---------------------------------------------------------------------
>
> Key: HDFS-6001
> URL: https://issues.apache.org/jira/browse/HDFS-6001
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: ha
> Affects Versions: 2.2.0
> Reporter: Jerry He
> Priority: Minor
>
> When hdfs is set up with HA enable, FileSystem.getUri returns
> hdfs://<the-value-of-dfs.nameservices>
> Here dfs.nameservices is defined when HA is enabled. In documentation:
> {quote}
> dfs.nameservices - the logical name for this new nameserviceChoose a logical
> name for this nameservice, for example "mycluster", and use this logical name
> for the value of this config option. The name you choose is arbitrary. It
> will be used both for configuration and as the authority component of
> absolute HDFS paths in the cluster.
> Note: If you are also using HDFS Federation, this configuration setting
> should also include the list of other nameservices, HA or otherwise, as a
> comma-separated list.
> <property>
> <name>dfs.nameservices</name>
> <value>mycluster</value>
> </property>
> {quote}
> This is probably ok or even intended. But a caller may further process the
> URI, for example, call URI.getHost(). This will return the 'mycluster', which
> is not a valid host anywhere.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)