# How works Allocation shards data tiers recommanded

**URL:** https://discuss.elastic.co/t/how-works-allocation-shards-data-tiers-recommanded/333274
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [May 12, 2023, 9:17am UTC](https://discuss.elastic.co/t/how-works-allocation-shards-data-tiers-recommanded/333274 "2023-05-12T09:17:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pepite](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@pepite](https://discuss.elastic.co/u/pepite)
#### Post date: [May 12, 2023, 9:17am UTC](https://discuss.elastic.co/t/how-works-allocation-shards-data-tiers-recommanded/333274/1 "2023-05-12T09:17:14Z")

</div>

Hi everybody,  
Fine ?

Questions about the allocation of the shards 😉

I have a big index that has his dedicated index template with 3 primary shards and 1 replica

```auto
{
  "order": 1,
  "index_patterns": [
	"tdir_business_prod-*"
  ],
  "settings": {
		"index.lifecycle.name": "Hot_toWarm_toCold_policy",
		"index.refresh_interval": "60s",
	  "index.number_of_shards": 3,
	  "index.number_of_replicas": 1

		}
  }

```

The ILM policy with data tiers options recommanded

```auto
PUT _ilm/policy/Hot_toWarm_toCold_policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "2d",
        "actions": {
          "forcemerge": {
            "max_num_segments": 1
          },
          "set_priority": {
            "priority": 50
          }
        }
      },
      "cold": {
        "min_age": "6d",
        "actions": {
          "set_priority": {
            "priority": 25
          }
        }
      },
      "delete": {
        "min_age": "150d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          },
          "wait_for_snapshot": {
            "policy": "tdirprod_daily_snapshots_without_business"
          }
        }
      }
    }
  }
}

```

When I check the allocation of the shards of this index, all the shards are not on my 3 data COLD

```auto
index shard prirep state docs store ip node
tdir_business_prod-2023.05.04 1 p STARTED 36909044 38.6gb 172.20.0.30 node_data_tlragsa030.a2569
tdir_business_prod-2023.05.04 1 r STARTED 36909044 38.6gb 172.20.0.55 node_data_cold_tlragsa055.a2569
tdir_business_prod-2023.05.04 2 r STARTED 36895180 38.6gb 172.20.0.31 node_data_tlragsa031.a2569
tdir_business_prod-2023.05.04 2 p STARTED 36895180 38.6gb 172.20.0.51 node_data_tlragsa051.a2569
tdir_business_prod-2023.05.04 0 p STARTED 36844203 38.5gb 172.20.0.40 node_data_cold_tlragsa040.a2569
tdir_business_prod-2023.05.04 0 r STARTED 36844203 38.5gb 172.20.0.39 node_data_cold_tlragsa039.a2569

```

p0, r0, r1 are on COLD DATA and p1,p2,r2 are on HOT DATA  
Why p1,p2,r2 are not on COLD DATA and why if there is a bug, there are not on WARM DATA instead ?

I need to free up disk space on HOT DATA and WARM DATA to have big disk space on COLD DATA  
Does i have to use node.attribute to ensure the allocation in WARM and COLD DATA and shrink the index in warm state ?

The allocation works well with the others indices that have only 1 primary shard and 1 replica

thanks a lot

---

<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: [June 9, 2023, 9:17am UTC](https://discuss.elastic.co/t/how-works-allocation-shards-data-tiers-recommanded/333274/2 "2023-06-09T09:17:40Z")

</div>

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