# Discovery.type : single-node but the new indexes are always : index.number\_of\_replicas" : "1"?

**URL:** https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318
**Category:** Elasticsearch
**Created:** [July 11, 2022, 12:28pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318 "2022-07-11T12:28:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![PM75](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@PM75](https://discuss.elastic.co/u/PM75)
#### Post date: [July 11, 2022, 12:28pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/1 "2022-07-11T12:28:59Z")

</div>

Hello,

```auto
[root@STL-SAS-025 ~]# /usr/share/elasticsearch/bin/elasticsearch --version
Version: 8.3.1, Build: rpm/b9a6b2867996ba92ceac66cb5bafc6db25e7910e/2022-06-29T18:39:55.731992798Z, JVM: 18.0.1.1

```

I'm having trouble understanding this result.  
If someone has an explanation?  
Thanks.

Regards,

PM75.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [July 11, 2022, 12:35pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/2 "2022-07-11T12:35:29Z")

</div>

It is the default value for any index that does not have a template with this setting.

If you want your new indices to not have `index.number_of_replicas` set to `1`, then you need to create a template that will match the index pattern name.

You can change the number of replicas at any time, it is a [dynamic setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings).

---

<div class="post-metadata">

### Author: ![PM75](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@PM75](https://discuss.elastic.co/u/PM75)
#### Post date: [July 11, 2022, 1:49pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/3 "2022-07-11T13:49:45Z")

</div>

Thank you for your feedback.  
However, I thought that when the :

- discovery.type: single-node  
as explained here :  
[Is it possible to set default number of replicas in elasticsearch - #2 by robertknutzen](https://discuss.elastic.co/t/is-it-possible-to-set-default-number-of-replicas-in-elasticsearch/281215/2)

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [July 11, 2022, 2:20pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/4 "2022-07-11T14:20:58Z")

</div>

Setting `discovery.type` as `single-node` doesn't change the default number of replicas for indices without a template, the default value of `index.number_of_replicas` will still be `1` and your cluster will be in the `YELLOW` state.

You will need to create or edit templates for your indices to change that behavior.

---

<div class="post-metadata">

### Author: ![PM75](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@PM75](https://discuss.elastic.co/u/PM75)
#### Post date: [July 11, 2022, 2:46pm UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/5 "2022-07-11T14:46:57Z")

</div>

All right.  
I will do that.  
Thanks again.  
I will leave this topic unresolved until the new indices are created at midnight.

---

<div class="post-metadata">

### Author: ![PM75](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@PM75](https://discuss.elastic.co/u/PM75)
#### Post date: [July 19, 2022, 10:21am UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/6 "2022-07-19T10:21:43Z")

</div>

Hello,

I have created a template index of the index pattern whose index setting has the value of the number of replicas at 0 :

```auto
"number_of_replicas": "0"

```

Now everything works.  
Thank you.

Regards,

PM75.

---

<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: [August 16, 2022, 10:22am UTC](https://discuss.elastic.co/t/discovery-type-single-node-but-the-new-indexes-are-always-index-number-of-replicas-1/309318/7 "2022-08-16T10:22:08Z")

</div>

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