# Index settings in configuration file does not take effect

**URL:** <https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120>\
**Category:** Elasticsearch\
**Created:** [December 25, 2017, 5:41am UTC](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120 "2017-12-25T05:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jubel-han](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jubel-han](https://discuss.elastic.co/u/jubel-han)\
**Post date:** [December 25, 2017, 5:41am UTC](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120/1 "2017-12-25T05:41:04Z")

</div>

I want to add some index global settings in the configuration file `elasticsearch.yml`, however, the index settings do not take effect in the config file.

I'm using the Elasticsearch 2.x whether on Mac or in docker container

here are steps to reproduce it

on Mac:

```auto
brew install elasticsearch@2.4

cat >> /usr/local/etc/elasticsearch/elasticsearch.yml << EOF
index:
    number_of_shards: 2
    refresh_interval: 50s
    max_result_window: 20000
EOF

brew services start elasticsearch@2.4

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/account/' -d '{"index":{"_id":"1"}}'

curl http://127.0.0.1:9200/_all/_settings\?pretty
{
  "account" : {
    "settings" : {
      "index" : {
        "_id" : "1",
        "creation_date" : "1514178481311",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "O8w2TyZnQCqYZymuN0klmg",
        "version" : {
          "created" : "2040699"
        }
      }
    }
  }
}

```

In container:

The result is same when using the docker container with image of `elasticsearch:2.4-alpine`  
the image is from docker hub since there is no the image for 2.x version from the official site.

Am I missing something or doing wrong in there? since that there are several introductions about the add index settings in the configuration file (I know it not possible doing it after 5.x version)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 25, 2017, 8:02am UTC](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120/2 "2017-12-25T08:02:31Z")

</div>

I don't think everything is reflected via the APIs. Have you created an index to check if they are applied?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 25, 2017, 9:04am UTC](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120/3 "2017-12-25T09:04:01Z")

</div>

Setting index settings in elasticsearch.yml is not supported anymore from 5.x anyway.  
Use index templates instead.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 22, 2018, 9:04am UTC](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120/4 "2018-01-22T09:04:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
