HDFS follows the same configuration scheme than the whole Hadoop platform. See Hadoop - Configuration (HADOOP_CONF_DIR)
The configuration are split between two files:
The hdfs configurations are stored in:
With the hdfs utility, to get the value of a key:
hdfs getconf -confKey key
Example with the file system URI. You get the value here of a wasb azure file system
hdfs getconf -confKey fs.defaultFS
wasb://[email protected]
hdfs envvars | grep -i HADOOP_CONF_DIR
HADOOP_CONF_DIR='/usr/hdp/2.6.2.25-1/hadoop/conf'
hdfs dfs -D "fs.default.name=hdfs://mycluster/" -ls /
Configuration conf = new Configuration();
String hdfsUri = "hdfs://mycluster/";
conf.set("fs.defaultFS", hdfsUri);
FileSystem fileSystem = FileSystem.get(URI.create(hdfsUri), conf);