# Elasticsearch 7.1 index shards getting assigned on warm nodes

**URL:** https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466
**Category:** Elasticsearch
**Created:** [June 5, 2019, 10:42pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466 "2019-06-05T22:42:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ElkNovice](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@ElkNovice](https://discuss.elastic.co/u/ElkNovice)
#### Post date: [June 5, 2019, 10:42pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466/1 "2019-06-05T22:42:34Z")

</div>

Using Elastic 7.1 stack. Trying to use hot-warm architecture. I have started all my nodes with node.attr.data set to hot or warm, depending on the node. However, I have observed that the current/active index shards are getting allocated to warm nodes as well. This I have observed for both system indexes as well as for custom indexes created via logstash 7.1

I have two questions here:

1. The system indexes: I was expecting the shards for them will be allocated on hot nodes as I have added node.attr.data: hot in elasticsearch.yml file for the nodes with faster storage. Not sure how I can force that to happen
2. Custom indexes: I have create ILM policy and used that in logstash elasticsearch output section. Like shown below:  
if "unix\_syslog" in [tags] {  
elasticsearch {  
hosts =\> ["[http://host1](http://host1):port","[http://host2](http://host2):port","[http://host3](http://host3):port"]  
ilm\_policy =\> test\_ilm  
ilm\_pattern =\> "{now/d}-000001"  
ilm\_rollover\_alias =\> "unix\_syslog"  
}  
}

Using above setting, logstash created the index that had one primary shard on hot node and one replica on warm node. I was expecting both primary and replica will be on hot nodes. Is my expectation wrong? If yes, then how do I force active index to have both primary and replica shards on hot nodes ?

test\_ilm policy:  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"rollover": {  
"max\_age": "1d",  
"max\_size": "50gb"  
},  
"set\_priority": {  
"priority": 90  
}  
}  
},  
"warm": {  
"min\_age": "0ms",  
"actions": {  
"allocate": {  
"number\_of\_replicas": 0,  
"include": {},  
"exclude": {},  
"require": {  
"data": "warm"  
}  
},  
"set\_priority": {  
"priority": 30  
}  
}  
},  
"delete": {  
"min\_age": "2d",  
"actions": {  
"delete": {}  
}  
}  
}  
}  
}

---

<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: [June 6, 2019, 5:06am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466/2 "2019-06-06T05:06:46Z")

</div>

Have you created an index template that forces the allocation of new indices to hot nodes? If so what does it look like?

---

<div class="post-metadata">

### Author: ![ElkNovice](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@ElkNovice](https://discuss.elastic.co/u/ElkNovice)
#### Post date: [June 6, 2019, 6:35am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466/3 "2019-06-06T06:35:52Z")

</div>

I thought I don't need a index template as at index creation time I am specifying the ILM policy and other related details. Since ILM associates current data with hot state, it will assign that to hot nodes implicitly. Is this understanding wrong?  
If it is mandatory to create a template, then I believe I can do something like below, but I felt it shouldn't be needed.

Template:  
{  
"index\_patterns": ["unix\*"],  
"settings": {  
"index.routing.allocation.require.data": "hot",  
"index.lifecycle.name": "test\_ilm",  
"number\_of\_shards": 1,  
"number\_of\_replicas" : 1  
}  
}

and in logstash config elasticsearch output:  
if "unix\_syslog" in [tags] {  
elasticsearch {  
hosts =\> ["[http://host1](http://host1/):port","[http://host2](http://host2/):port","[http://host3](http://host3/):port"]  
ilm\_rollover\_alias =\> "unix\_syslog"  
template =\> "template.json"  
}  
}

---

<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: [June 6, 2019, 7:43am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466/4 "2019-06-06T07:43:20Z")

</div>

I am not sure if it has changed in 7.x, but [for earlier releases you had to use an index template if you were implementing a hot/warm or hot/warm/cold architecture](https://www.elastic.co/blog/implementing-hot-warm-cold-in-elasticsearch-with-index-lifecycle-management).

---

<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 4, 2019, 7:43am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-index-shards-getting-assigned-on-warm-nodes/184466/5 "2019-07-04T07:43:23Z")

</div>

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