# Example config file

**URL:** <https://discuss.elastic.co/t/example-config-file/2842>\
**Category:** Elasticsearch\
**Created:** [March 9, 2010, 3:40pm UTC](https://discuss.elastic.co/t/example-config-file/2842 "2010-03-09T15:40:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 9, 2010, 3:40pm UTC](https://discuss.elastic.co/t/example-config-file/2842/1 "2010-03-09T15:40:08Z")

</div>

Hiya

Does anybody have a real life example of an elasticsearch config file.

I'm somewhat confused about what goes into the config file, and what  
gets specified when (eg) creating an index.

thanks

Clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 9, 2010, 3:45pm UTC](https://discuss.elastic.co/t/example-config-file/2842/2 "2010-03-09T15:45:54Z")

</div>

HI,

If you can give an example of what you try and configure, then I can  
probably give a better answer. I tried and explain it here:  
[http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/](http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/), what  
specifically do you struggle with so I can explain it better in the docs....

-shay.banon

On Tue, Mar 9, 2010 at 5:40 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hiya
> 
> Does anybody have a real life example of an elasticsearch config file.
> 
> I'm somewhat confused about what goes into the config file, and what  
> gets specified when (eg) creating an index.
> 
> thanks
> 
> Clint
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 9, 2010, 5:00pm UTC](https://discuss.elastic.co/t/example-config-file/2842/3 "2010-03-09T17:00:58Z")

</div>

Hiya

> If you can give an example of what you try and configure, then I can  
> probably give a better answer. I tried and explain it here:  
> [http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/](http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/),  
> what specifically do you struggle with so I can explain it better in  
> the docs....

Yeah sorry, crap question 🙂

OK, for instance, do the following settings make sense. I realise that  
some are the same as the defaults (and thus redundant) but I wanted to  
be sure that I was putting them in the right place.

```
cluster:
    name: MyCluster

network:
    bindHost: 192.168.5.100
    publishHost: 192.168.5.100

node:
    data: true

http:
    enabled: true

gateway:
    type: fs
    fs:             
        location: /opt/elasticsearch/data/cluster

index:
    gateway:
        type: fs
        fs:             
            location: /opt/elasticsearch/data/index

    store:
        type: memory
        cacheSize: 100m

```

Of course, when I create an index, I can set the gateway.fs.location to  
a different directory, which would make sense, no?

For things like mappings, would/could you put them in the config file,  
would you just put\_mapping via the API?

ta

clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 9, 2010, 5:25pm UTC](https://discuss.elastic.co/t/example-config-file/2842/4 "2010-03-09T17:25:00Z")

</div>

Answered below:

On Tue, Mar 9, 2010 at 7:00 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hiya
> 
> > If you can give an example of what you try and configure, then I can  
> > probably give a better answer. I tried and explain it here:  
> > [http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/](http://www.elasticsearch.com/docs/elasticsearch/setup/configuration/),  
> > what specifically do you struggle with so I can explain it better in  
> > the docs....
> 
> Yeah sorry, crap question 🙂
> 
> OK, for instance, do the following settings make sense. I realise that  
> some are the same as the defaults (and thus redundant) but I wanted to  
> be sure that I was putting them in the right place.
> 
> cluster:  
> name: MyCluster
> 
> network:  
> bindHost: 192.168.5.100  
> publishHost: 192.168.5.100
> 
> node:  
> data: true
> 
> http:  
> enabled: true
> 
> gateway:  
> type: fs  
> fs:  
> location: /opt/elasticsearch/data/cluster
> 
> index:  
> gateway:  
> type: fs  
> fs:  
> location: /opt/elasticsearch/data/index
> 
> ```
> store:
> type: memory
> cacheSize: 100m
> 
> ```

The store one is wrong, and I would play with the bufferSize as well:

store:  
type: memory  
memory:  
cacheSize: 100m  
bufferSize: 10k

> Of course, when I create an index, I can set the gateway.fs.location to  
> a different directory, which would make sense, no?

Depends. When you explicitly set the one for the index, then you need to  
make sure that you don't have two indices pointing to the same location. If  
you don't specify one, then the global gateway location will be used, with  
the index name appended as a sub directory. So I would say just leave the  
global one to be fs, and let the index level ones "inherit it" (the index  
will automatically use fs gateway if the global gateway is fs).

> For things like mappings, would/could you put them in the config file,  
> would you just put\_mapping via the API?

Currently, you can only place do it through the API. There is no option for  
the cluster to start up and read mappings from a specific location. Of  
course, there is also the question of which mappings in such a case apply to  
which index...

> ta
> 
> clint
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 9, 2010, 5:37pm UTC](https://discuss.elastic.co/t/example-config-file/2842/5 "2010-03-09T17:37:35Z")

</div>

> Depends. When you explicitly set the one for the index, then you need  
> to make sure that you don't have two indices pointing to the same  
> location. If you don't specify one, then the global gateway location  
> will be used, with the index name appended as a sub directory. So I  
> would say just leave the global one to be fs, and let the index level  
> ones "inherit it" (the index will automatically use fs gateway if the  
> global gateway is fs).

OK - makes sense.

So if I wanted to change the mapping for an existing index/type, I could  
do something like this:

- create index 'temp\_index'
- put mapping 'new\_type'
- put other mappings from 'index' (except for 'old\_type')
- foreach document in 'index'
  - save to temp\_index

- stop nodes
- mv index old\_index
- mv temp\_index index
- restart nodes

ta

clint

> 

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 9, 2010, 5:52pm UTC](https://discuss.elastic.co/t/example-config-file/2842/6 "2010-03-09T17:52:27Z")

</div>

> - mv index old\_index
> - mv temp\_index index

I assume you mean mv the gateway location? Yes, this should work, though I  
don't like the fact that you need to stop the nodes and start them again!. I  
guess once elasticsearch will have the ability to "rename", or at the very  
least "alias/ln -s" indices then you won't need to restart nodes as you can  
create work with the aliases names and then "re-alias".

Also, iterating over the documents and reindexing should be simpler with  
elasticsearch. One step towards this is the ability to continue to scroll  
search requests (which I am working on now). The second is to have an API  
for that.

-shay.banon

On Tue, Mar 9, 2010 at 7:37 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> > Depends. When you explicitly set the one for the index, then you need  
> > to make sure that you don't have two indices pointing to the same  
> > location. If you don't specify one, then the global gateway location  
> > will be used, with the index name appended as a sub directory. So I  
> > would say just leave the global one to be fs, and let the index level  
> > ones "inherit it" (the index will automatically use fs gateway if the  
> > global gateway is fs).
> 
> OK - makes sense.
> 
> So if I wanted to change the mapping for an existing index/type, I could  
> do something like this:
> 
> - create index 'temp\_index'
> - put mapping 'new\_type'
> - put other mappings from 'index' (except for 'old\_type')
> - foreach document in 'index'
> - save to temp\_index
> 
> - stop nodes
> - mv index old\_index
> - mv temp\_index index
> - restart nodes
> 
> ta
> 
> clint
> 
> > 
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 9, 2010, 5:54pm UTC](https://discuss.elastic.co/t/example-config-file/2842/7 "2010-03-09T17:54:27Z")

</div>

One last point, I am also slowly making the put\_mapping API more smarter  
with merging new definitions with old ones. Changing the type from integer  
to string will probably not be supported (though you can use the new  
multi\_field mapping to handle that), but changing things like term vectors  
and such should be supported. Of course, adding new mappings is supported  
already.

-shay.banon

On Tue, Mar 9, 2010 at 7:52 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> > - mv index old\_index
> > - mv temp\_index index
> 
> I assume you mean mv the gateway location? Yes, this should work, though I  
> don't like the fact that you need to stop the nodes and start them again!. I  
> guess once elasticsearch will have the ability to "rename", or at the very  
> least "alias/ln -s" indices then you won't need to restart nodes as you can  
> create work with the aliases names and then "re-alias".
> 
> Also, iterating over the documents and reindexing should be simpler with  
> elasticsearch. One step towards this is the ability to continue to scroll  
> search requests (which I am working on now). The second is to have an API  
> for that.
> 
> -shay.banon
> 
> On Tue, Mar 9, 2010 at 7:37 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:
> 
> > > Depends. When you explicitly set the one for the index, then you need  
> > > to make sure that you don't have two indices pointing to the same  
> > > location. If you don't specify one, then the global gateway location  
> > > will be used, with the index name appended as a sub directory. So I  
> > > would say just leave the global one to be fs, and let the index level  
> > > ones "inherit it" (the index will automatically use fs gateway if the  
> > > global gateway is fs).
> > 
> > OK - makes sense.
> > 
> > So if I wanted to change the mapping for an existing index/type, I could  
> > do something like this:
> > 
> > - create index 'temp\_index'
> > - put mapping 'new\_type'
> > - put other mappings from 'index' (except for 'old\_type')
> > - foreach document in 'index'
> > - save to temp\_index
> > 
> > - stop nodes
> > - mv index old\_index
> > - mv temp\_index index
> > - restart nodes
> > 
> > ta
> > 
> > clint
> > 
> > > 
> > 
> > --  
> > Web Announcements Limited is a company registered in England and Wales,  
> > with company number 05608868, with registered address at 10 Arvon Road,  
> > London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 9, 2010, 5:58pm UTC](https://discuss.elastic.co/t/example-config-file/2842/8 "2010-03-09T17:58:51Z")

</div>

On Tue, 2010-03-09 at 19:54 +0200, Shay Banon wrote:

> One last point, I am also slowly making the put\_mapping API more  
> smarter with merging new definitions with old ones. Changing the type  
> from integer to string will probably not be supported (though you can  
> use the new multi\_field mapping to handle that), but changing things  
> like term vectors and such should be supported. Of course, adding new  
> mappings is supported already.

w00t!

> 

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<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:** [July 6, 2017, 4:25am UTC](https://discuss.elastic.co/t/example-config-file/2842/9 "2017-07-06T04:25:22Z")

</div>


