# Setting number\_of\_replicas on existing template

**URL:** https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672
**Category:** Elasticsearch
**Created:** [February 6, 2024, 6:16pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672 "2024-02-06T18:16:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![parisila](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@parisila](https://discuss.elastic.co/u/parisila)
#### Post date: [February 6, 2024, 6:16pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672/1 "2024-02-06T18:16:13Z")

</div>

Apologize for the screenshot but my elasticsearch instance is in a secure environment with only a jumphost browser that cannot copy anything out.

Elastic Stack version 7.17.4 single node

I am trying to update an index template to create new indexes with number\_of\_replicas = 0. I tried to update through the API and it accepts it but afterwards the setting does not take and I don't see the number\_of\_replicas set at all. Here is the screenshot with the field that I added highlighted in yellow:

![template_update](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a4fddacc471369d40ff0a78e9c2732ed5a846ff.png)

When I do a GET on the template after the PUT, the field is not there.

Can anyone tell me what I have to do differently?

---

<div class="post-metadata">

### Author: ![yago82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yago82/32/97755_2.png) [@yago82](https://discuss.elastic.co/u/yago82)
#### Post date: [February 6, 2024, 7:37pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672/2 "2024-02-06T19:37:05Z")

</div>

> [@parisila](#):
>
> Apologize for the screenshot but my elasticsearch instance is in a secure environment with only a jumphost browser that cannot copy anything out.
> 
> Elastic Stack version 7.17.4 single node
> 
> I am trying to update an index template to create new indexes with number\_of\_replicas = 0. I tried to update through the API and it accepts it but afterwards the setting does not take and I don't see the number\_of\_replicas set at all. Here is the screenshot with the field that I added highlighted in yellow:
> 
> ![template_update](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a4fddacc471369d40ff0a78e9c2732ed5a846ff.png)
> 
> When I do a GET on the template after the PUT, the field is not there.
> 
> Can anyone tell me what I have to do differently?

Hi,

Check the response of the PUT request. If the template was updated successfully, the response should be `{"acknowledged":true}`.

Regards

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [February 6, 2024, 7:49pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672/3 "2024-02-06T19:49:55Z")

</div>

or go to kibana, stack management, index template and find your template.  
then update it.

if it is still not keeping this value then one of the filebead daemon from a system is resetting it back.

you will have to check filebeat.yml file. and check " Elasticsearch template setting" section

---

<div class="post-metadata">

### Author: ![parisila](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@parisila](https://discuss.elastic.co/u/parisila)
#### Post date: [February 6, 2024, 8:09pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672/4 "2024-02-06T20:09:31Z")

</div>

Thank you for the response. I was getting back the acknowledged true. My mistake the new parameter was all the way at the bottom of template.settings.index array and not where I placed it in the request so I didn't notice it.

This is resolved. User error.

---

<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: [March 5, 2024, 8:10pm UTC](https://discuss.elastic.co/t/setting-number-of-replicas-on-existing-template/352672/5 "2024-03-05T20:10:00Z")

</div>

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