# Elastic: ilm-history-3-000004 index created with wrong number\_of\_replicas according to template

**URL:** <https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 23, 2021, 9:58am UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071 "2021-03-23T09:58:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 9:59am UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/1 "2021-03-23T09:59:00Z")

</div>

Elastic 7.11.1

Today, two of my elastic hosts (where there is 0 replicas), somehow created this index with number\_of\_replicas=1

`yellow open ilm-history-3-000004`

That is why it is in yellow state.

When I look index templates, then I see this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/b/cb40e5417ba8cd414b922e1c2c0a0baa791cd24d.png)

This **ilm-history** template has the following settings:

```
{
  "index": {
    "lifecycle": {
      "name": "ilm-history-ilm-policy"
    },
    "number_of_shards": "1",
    "auto_expand_replicas": "0-1",
    "number_of_replicas": "0"
  }
}

```

Here it says that **"number\_of\_replicas": "0"**  
But look at the **"Index patterns"** from the picture above.

Template has: "ilm-history-5\*"  
But the index which was created: "ilm-history-3-000004"

So why ilm-history index was created with different name than its template..?  
If there is no template for certain index, is the default value for number\_of\_replicas = 1 ? (if so, can I change this default?)

Raul

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 23, 2021, 10:04am UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/2 "2021-03-23T10:04:27Z")

</div>

I believe auto\_expand\_replicas takes precedence here resulting in 1 replica.

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 10:13am UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/3 "2021-03-23T10:13:29Z")

</div>

But look at the index pattern.

"ilm-history-5\*"  
vs  
"ilm-history-3-000004"

There is no way these could match.

Raul

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2021, 12:00pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/4 "2021-03-23T12:00:54Z")

</div>

> [@raulk89](#):
>
> If there is no template for certain index, is the default value for number\_of\_replicas = 1 ?

Yes.

> [@raulk89](#):
>
> (if so, can I change this default?)

Effectively yes, that's what index templates are for.

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 12:05pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/5 "2021-03-23T12:05:25Z")

</div>

> Effectively yes, that's what index templates are for.

But the problem.

ilm-history \<-- this is not user created index, this is internally managed index/template.

Am I supposed to create index template for internally managed indexes..?  
(I don't think so)

Raul

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2021, 12:26pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/6 "2021-03-23T12:26:06Z")

</div>

Ah I see. I don't think a 7.11.1 cluster should create an index matching `ilm-history-3-*`, do you have a mix of different versions in your cluster?

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 12:44pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/7 "2021-03-23T12:44:31Z")

</div>

Nop.  
As I said. I have single host cluster with 7.11.1 version.

I don’t have any template for “ilm-history-5\*” also.  
For some reason template is for “ilm-history-3\*”  
And index was created starting with “ilm-history-5..”

Strange.

Raul

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2021, 12:47pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/8 "2021-03-23T12:47:43Z")

</div>

> [@raulk89](#):
>
> I don’t have any template for “ilm-history-5\*” also.  
> For some reason template is for “ilm-history-3\*”  
> And index was created starting with “ilm-history-5..”

That's precisely the opposite of what you said in your original post: the index is called `ilm-history-3-000004` but the template in the screenshot matches `ilm-history-5*`.

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 12:48pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/9 "2021-03-23T12:48:41Z")

</div>

Yeah my bad.  
That previous post was wrong.

This is the correct one:

I don’t have any template for “ilm-history-3\*” also.  
For some reason template is for “ilm-history-5\*”  
And index was created starting with “ilm-history-3..”

Raul

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 12:56pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/10 "2021-03-23T12:56:34Z")

</div>

I have checked all my 7.11.1 clusters.  
All of these have the same behaviour - at midnight clusters all went to "yellow" state due to this "ilm-history-3" index.

E: "yellow" state followed for all the clusters where I had single host in cluster. But the issue still stands for multi node clusters also, since it is not using its designated index template.

Raul

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2021, 12:57pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/11 "2021-03-23T12:57:34Z")

</div>

I think you could report this as a bug on Github, it certainly sounds like Elasticsearch isn't doing the right thing here.

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [March 23, 2021, 1:04pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/12 "2021-03-23T13:04:26Z")

</div>

Ok, I see this beahviour with 7.11.2 also.  
I will create an issue.

> <https://github.com/elastic/elasticsearch/issues/70735>
>
> Elasticsearch version (bin/elasticsearch --version): 7.11.1 and 7.11.2
> Plugins installed: \[\] ingest-attachment
> JVM version (java -version):
> openjdk version "1.8.0\_282"
> OpenJDK Runtime Environment (build 1.8.0\_282-b08)
> OpenJDK 64-Bit Server...

Raul

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2021, 1:39pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/13 "2021-03-23T13:39:09Z")

</div>

👍 thanks

---

<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:** [April 20, 2021, 1:39pm UTC](https://discuss.elastic.co/t/elastic-ilm-history-3-000004-index-created-with-wrong-number-of-replicas-according-to-template/268071/14 "2021-04-20T13:39:18Z")

</div>

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