Configuration - gnuhub/elasticsearch GitHub Wiki

ElasticSearch configuration files can be found under ES_HOME/config folder. The folder comes with two files, the elasticsearch.yml for configuring a Node, and logging.yml for logging configuration.

Settings

The configuration format is "YAML":http://www.yaml.org/, here is an example of changing the address all network based modules will use to bind and publish to:

network :
    host : 10.0.0.4

Internally, all settings are collapsed into "namespaced" settings. For example, the above gets collapsed into network.host. This means that its easy to support other configuration formats, for example, "JSON":http://www.json.org. If JSON is a preferred configuration format, simply rename the elasticsearch.yml file to elasticsearch.json and add:

{
    "network" : {
        "host" : "10.0.0.4"
    }
}

It also means that its easy to provide the settings externally either using the ES_JAVA_OPTS or as parameters to the elasticsearch command, for example:

$ elasticsearch -f -Des.network.host=10.0.0.4

Another option is to use the ${...} notation within the configuration file which will resolve to an environment setting, for example:

{
    "network" : {
        "host" : "${ES_NET_HOST}"
    }
}

The location of the configuration file can be set externally using a system property:

$ elasticsearch -f -Des.config=/path/to/config/file

Index Settings

Indices created within the cluster can provide their own settings. For example, the following creates an index with memory based storage instead of the default file system based one (the format can be either YAML or JSON):

$ curl -XPUT http://localhost:9200/kimchy/ -d '
index :
    store:
        type: memory
'

Index level settings can be set on the node level as well, for example, within the elasticsearch.yml file, the following can be set:

index :
    store:
        type: memory

This means that every index that gets created on the specific node started with the mentioned configuration will store the index in memory unless the index explicitly sets it. In other words, any index level settings override what is set in the node configuration. Of course, the above can also be set as a "collapsed" setting, for example:

$ elasticsearch -f -Des.index.store.type=memory

All of the index level configuration can be found within each "index module":../../modules/index.

Logging

ElasticSearch uses an internal logging abstraction and comes, out of the box, with "log4j":http://logging.apache.org/log4j/. It tries to simplify log4j configuration by using "YAML":http://www.yaml.org/ to configure it, and the logging configuration file is config/logging.yml file.

⚠️ **GitHub.com Fallback** ⚠️