# Elasticsearch isn't making new indices have replicas

**URL:** https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626
**Category:** Elasticsearch
**Created:** [February 24, 2016, 5:34pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626 "2016-02-24T17:34:08Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)
#### Post date: [February 24, 2016, 5:34pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/1 "2016-02-24T17:34:08Z")

</div>

Despite:

index.number\_of\_replicas: 2

in /etc/elasticsearch/elasticsearch.yml on my cluster nodes

new indices are not being replicated:

summary | awk '$5 == 0'  
health status index pri rep docs.count docs.deleted store.size pri.store.size  
green open logstash-2016.02.20 5 0 3536958 0 1gb 1gb  
green open logstash-2016.02.21 5 0 3656177 0 1.1gb 1.1gb  
green open logstash-2016.02.22 5 0 5557430 0 1.5gb 1.5gb  
green open logstash-2016.02.23 5 0 4782864 0 1.1gb 1.1gb  
green open logstash-2016.02.24 5 0 3079991 0 853.9mb 853.9mb

Past ones after a manual PUT of replica count as 2 are all 2 up to the 20th.

The elasticsearch cluster nodes has been rebooted several times since the

index.number\_of\_replicas: 2

was put into elasticsearch.yml weeks ago.

My question is why isn't elasticsearch automatically setting up replicas for the new daily indices?

Thanks for any thoughts.

---

<div class="post-metadata">

### Author: ![crickes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crickes/32/18009_2.png) [@crickes](https://discuss.elastic.co/u/crickes)
#### Post date: [February 25, 2016, 4:17pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/2 "2016-02-25T16:17:28Z")

</div>

Hard to say from just this as to what could be causing the issue. In the past when I've come across the same problem its been because I had tagged the index to go to a hot node, and there wasn't enough space any hot nodes to store the data. Have you set node-type on any of your nodes?

---

<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: [February 25, 2016, 8:31pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/3 "2016-02-25T20:31:57Z")

</div>

It's because the template for Logstash defines a single replica, and templates take precedence over that setting.

---

<div class="post-metadata">

### Author: ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)
#### Post date: [February 25, 2016, 8:58pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/4 "2016-02-25T20:58:24Z")

</div>

Do you know where the template is defined?

I can of course run a script to replicate logstash indexes automatically via cron daily but would like to take the other road if it is even feasible to change the logstash template.

---

<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: [February 26, 2016, 12:11am UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/5 "2016-02-26T00:11:10Z")

</div>

Check the `_template` API endpoint.

---

<div class="post-metadata">

### Author: ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)
#### Post date: [February 26, 2016, 5:26pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/6 "2016-02-26T17:26:32Z")

</div>

Okay, I've put this in on all the ES cluster nodes:

cat /etc/elasticsearch/templates/logstash.template  
{  
"logstash" : {  
"order" : 0,  
"template" : "logstash-_",  
"settings" : {  
"index.refresh\_interval" : "5s",  
"index.number\_of\_replicas": "2",  
"index.number\_of\_shards:" "5"  
},  
"mappings" : {  
"default" : {  
"dynamic\_templates" : [ {  
"string\_fields" : {  
"mapping" : {  
"index" : "analyzed",  
"omit\_norms" : true,  
"type" : "string",  
"fields" : {  
"raw" : {  
"index" : "not\_analyzed",  
"ignore\_above" : 256,  
"type" : "string"  
}  
}  
},  
"match\_mapping\_type" : "string",  
"match" : "_"  
}  
} ],  
"properties" : {  
"geoip" : {  
"dynamic" : true,  
"path" : "full",  
"properties" : {  
"location" : {  
"type" : "geo\_point"  
}  
},  
"type" : "object"  
},  
"@version" : {  
"index" : "not\_analyzed",  
"type" : "string"  
}  
},  
"\_all" : {  
"enabled" : true  
}  
}  
},  
"aliases" : { }  
}  
}

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [February 26, 2016, 6:15pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/7 "2016-02-26T18:15:23Z")

</div>

Be mindful that file based templates went away in Elasticsearch 2.0.

---

<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: [February 26, 2016, 6:42pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/8 "2016-02-26T18:42:47Z")

</div>

Also, two replicas is overkill.

---

<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 5, 2017, 11:13pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-making-new-indices-have-replicas/42626/9 "2017-07-05T23:13:17Z")

</div>


