Returning ip address instead of hostname in webhdfs

Viewed 520

I am trying to get files from hadoop using webhdfs, now the webhdfs is redirecting me to the datanodes. Its returning the hostnames in address , is there a way where we can make it return ip address instead of hostnames ?

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

In hdfs-site.xml, you can set dfs.datanode.hostname.

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

By doing this, webhdfs will return ip address of datanode.

Related