| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | [[settings]]== Configuring ElasticsearchElasticsearch ships with good defaults and requires very little configuration.Most settings can be changed on a running cluster using the<<cluster-update-settings>> API.The configuration files should contain settings which are node-specific (suchas `node.name` and paths), or settings which a node requires in order to beable to join a cluster, such as `cluster.name` and `network.host`.[[config-files-location]][float]=== Config files locationElasticsearch has three configuration files:* `elasticsearch.yml` for configuring Elasticsearch* `jvm.options` for configuring Elasticsearch JVM settings* `log4j2.properties` for configuring Elasticsearch loggingThese files are located in the config directory, whose default location dependson whether or not the installation is from an archive distribution (`tar.gz` or`zip`) or a package distribution (Debian or RPM packages).For the archive distributions, the config directory location defaults to`$ES_HOME/config`. The location of the config directory can be changed via the`ES_PATH_CONF` environment variable as follows:[source,sh]-------------------------------ES_PATH_CONF=/path/to/my/config ./bin/elasticsearch-------------------------------Alternatively, you can `export` the `ES_PATH_CONF` environment variable via thecommand line or via your shell profile.For the package distributions, the config directory location defaults to`/etc/elasticsearch`. The location of the config directory can also be changedvia the `ES_PATH_CONF` environment variable, but note that setting this in yourshell is not sufficient. Instead, this variable is sourced from`/etc/default/elasticsearch` (for the Debian package) and`/etc/sysconfig/elasticsearch` (for the RPM package). You will need to edit the`ES_PATH_CONF=/etc/elasticsearch` entry in one of these files accordingly tochange the config directory location.[float]=== Config file formatThe configuration format is http://www.yaml.org/[YAML]. Here is anexample of changing the path of the data and logs directories:[source,yaml]--------------------------------------------------path:    data: /var/lib/elasticsearch    logs: /var/log/elasticsearch--------------------------------------------------Settings can also be flattened as follows:[source,yaml]--------------------------------------------------path.data: /var/lib/elasticsearchpath.logs: /var/log/elasticsearch--------------------------------------------------[float]=== Environment variable substitutionEnvironment variables referenced with the `${...}` notation within theconfiguration file will be replaced with the value of the environmentvariable, for instance:[source,yaml]--------------------------------------------------node.name:    ${HOSTNAME}network.host: ${ES_NETWORK_HOST}--------------------------------------------------
 |