Hadoop - Configuration (HADOOP_CONF_DIR)


The Hadoop configuration has two entry point:



HADOOP_CONF_DIR is the environment variable that set the directory location.

Default is:




From the command line:

hdfs envvars | grep -i HADOOP_CONF_DIR


Hadoop configuration is driven by two types of important configuration files:

  • default files that are read-only default configuration. Example: core-default.xml
  • site file that specific configuration that overwrite the default values of the default files. Example: core-site.xml overrides values in core-default.xml.

They are loaded in order (first default) from the classpath

List example of configuration files:

Site files Default
core-site.xml core-default.xml
hdfs-site.xml hdfs-default.xml
yarn-site.xml yarn-default.xml
mapred-site.xml mapred-default.xml

Environment variable




Configuration parameters may be declared final. Once a resource declares a value final, no subsequently-loaded resource can alter that value. For example, one might define a final parameter with:


Administrators typically define parameters as final in core-site.xml for values that user applications may not alter.

Variable Expansion

Value strings are first processed for variable expansion. The available properties are:

Other properties defined in this Configuration; and, if a name is undefined here, Properties in System.getProperties().

For example, if a configuration resource contains the following property definitions:



When conf.get(“tempdir”) is called, then ${basedir} will be resolved to another property in this Configuration, while ${user.name} would then ordinarily be resolved to the value of the System property with that name. By default, warnings will be given to any deprecated configuration parameters and these are suppressible by configuring log4j.logger.org.apache.hadoop.conf.Configuration.deprecation in log4j.properties file.

Documentation / Reference

Powered by ComboStrap