You can dump Hadoop config by running:
$ hadoop org.apache.hadoop.conf.Configuration
You can use GenericOptionsParser to load Hadoop's setting to Configuration-typed object and iterate its properties. Here is an example demonstrating this approach through a utility class (Configured).
public class ConfigPrinter extends Configured implements Tool {
static {
// by default core-site.xml is already added
// loading "hdfs-site.xml" from classpath
Configuration.addDefaultResource("hdfs-site.xml");
Configuration.addDefaultResource("mapred-site.xml");
}
@Override
public int run(String[] strings) throws Exception {
Configuration config = this.getConf();
for (Map.Entry<String, String> entry : config) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
return 0;
}
public static void main(String[] args) throws Exception {
ToolRunner.run(new ConfigPrinter(), args);
}
}
I hope this answer helps :)