# Change default replica factor for monitor\* index?

**URL:** https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468
**Category:** Elasticsearch
**Created:** [November 13, 2017, 10:27pm UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468 "2017-11-13T22:27:34Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [November 13, 2017, 10:27pm UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/1 "2017-11-13T22:27:34Z")

</div>

I want to increase the number\_of\_replicas for all the `.monitoring*` index created by x-pack. I realize they are using templates such as `.monitoring-es-2`.

Do I just create another index `/_template/.monitoring-es-3` and that's it? where do I tell x-pack to create index from the new template not the old one? should I delete `/_template/.monitoring-es-2` when I created 3?

```
PUT /_template/.monitoring-es-3
{
  "order": 0,
  "template": ".monitoring-es-3*",
  "settings": {
    "number_of_replicas": 4
  }
  ... # all other settings and stuff
}

```

Does this look right? Thank you!

---

<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: [November 13, 2017, 11:17pm UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/2 "2017-11-13T23:17:24Z")

</div>

How come you want so many replicas for this?

---

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [November 14, 2017, 12:25am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/3 "2017-11-14T00:25:12Z")

</div>

I just want to increase the reliability of internal indexes. If anything goes wrong, internal indexes should be the last one to cause problem.

For example, let's say I have a data index that has 3 replica, so I should be able to afford losing 3 nodes in the same time. However that's not true because the replica for monitoring indexes are 1, so when 2 nodes go down, we lost shards for monitoring indexes, which causes elasticsearch cluster to be red status, which means we cannot read or write to the whole cluster. Even though our data index has 3 replica, it doesn't help.

I hope this makes sense. Thank you!

---

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [November 14, 2017, 12:25am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/4 "2017-11-14T00:25:44Z")

</div>

Oh 4 in the post is just an example, I want it to be greater than 1.

---

<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: [November 14, 2017, 1:07am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/5 "2017-11-14T01:07:15Z")

</div>

Ok, so you need to balance the risk of losing 3 nodes with the cost of extra shards. One of the biggest problems we see with clusters is over-sharding and the resource cost of that.

So what is the risk of losing 3 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: [November 14, 2017, 1:08am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/6 "2017-11-14T01:08:36Z")

</div>

Also, you should really store Monitoring data in a separate cluster, it's the best way to ensure there is no impact and also means that you can get access to data if your main cluster is unavailable.

---

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [November 14, 2017, 1:41am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/7 "2017-11-14T01:41:25Z")

</div>

The monitor index is relatively small comparing to our data. So we're perfectly fine to increase the replica of the monitoring shard. Increasing replica for that index from 1 to 5 will not impact the cluster size we choose.

For current situation, we're ok to increase the replica for monitoring index.

---

<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: [November 14, 2017, 10:02am UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/8 "2017-11-14T10:02:25Z")

</div>

Maybe have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/6.x/index-modules.html#dynamic-index-settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/index-modules.html#dynamic-index-settings) - `index.auto_expand_replicas`.

---

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [November 14, 2017, 9:47pm UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/9 "2017-11-14T21:47:01Z")

</div>

Interesting. It's very useful actually. But looks like this is dynamic settings so I have to update this setting after the index get created, I was hoping to avoid this manual part. That is why I was looking at the monitoring template.

---

<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: [December 12, 2017, 9:47pm UTC](https://discuss.elastic.co/t/change-default-replica-factor-for-monitor-index/107468/10 "2017-12-12T21:47:21Z")

</div>

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