在WebHDFS中返回IP地址而不是主机名

时间:2018-11-09 05:16:39

标签: hadoop webhdfs

我正在尝试使用webhdfs从hadoop获取文件,现在webhdfs正在将我重定向到datanode。它在address中返回主机名,是否有办法使它返回ip地址而不是主机名?

1 个答案:

答案 0 :(得分:0)

dfs.datanode.hostname
Optional. The hostname for the Datanode containing this configuration file. 
Will be different for each machine. Defaults to current hostname.

在hdfs-site.xml中,您可以设置dfs.datanode.hostname。

<property>
  <name>dfs.datanode.hostname</name>
  <value>IP-ADDRESS</value>
</property>

这样做,webhdfs将返回datanode的IP地址。

相关问题