# Shards not being allocated according to "box\_type" setting in designated nodes of same type

**URL:** <https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723>\
**Category:** Elasticsearch\
**Created:** [September 2, 2019, 5:18pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723 "2019-09-02T17:18:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![viniciof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viniciof/32/53454_2.png) [@viniciof](https://discuss.elastic.co/u/viniciof)\
**Post date:** [September 2, 2019, 5:18pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/1 "2019-09-02T17:18:14Z")

</div>

I have an index of around 4.1TB~ total size in a cluster of 12 nodes (9 DATA & INGEST, 3 DATA & MASTER) and all of them are set to "hot" category - we don't currently have any "warm" node in this cluster.

The problem is I have 10 replica shards in state UNASSIGNED - I added in the first comment of this post the output from Explain API command regarding this (topic doesn't allow me to enter too many chars):

Every shard is around 300GB~ (above the recommended threshold of 50GB) and initially there were disk space issues in many nodes but then I performed clean up of garbage files there. After this, the explain output stopped complaining about disk watermark hit but keeps complaining about the box\_type setting.

Appreciate any help on this.

Regards,  
Vinicio

---

<div class="post-metadata">

**Author:** ![viniciof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viniciof/32/53454_2.png) [@viniciof](https://discuss.elastic.co/u/viniciof)\
**Post date:** [September 2, 2019, 5:23pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/2 "2019-09-02T17:23:21Z")

</div>

{  
"index": "puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest",  
"shard": 6,  
"primary": false,  
"current\_state": "unassigned",  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2019-08-29T22:58:11.191Z",  
"last\_allocation\_status": "no\_attempt"  
},  
"can\_allocate": "no",  
"allocate\_explanation": "cannot allocate because allocation is not permitted to any of the nodes",  
"node\_allocation\_decisions": [  
{  
"node\_id": "DSE\_zvuCQ2mbFjzI1559lA",  
"node\_name": "data1-iil-002\_data",  
"transport\_address": "10.184.95.2:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "L1f5FmIoQCa4Q-6q26W83w",  
"node\_name": "data1-iil-004\_data",  
"transport\_address": "10.184.95.4:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "MOHZnSRpQzSr0qI4Ki4aZQ",  
"node\_name": "data1-iil-008\_data",  
"transport\_address": "10.184.95.61:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "NdV2wnCaTKWjNr1Skdss1g",  
"node\_name": "data1-iil-001\_data",  
"transport\_address": "10.184.95.1:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "UxYWqOEgRKqPchErIvHCvg",  
"node\_name": "data1-iil-003\_data",  
"transport\_address": "10.184.95.3:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "Xa-4B4RKRxuYN0gTIZVWoA",  
"node\_name": "data1-iil-006\_data",  
"transport\_address": "10.184.95.59:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "bx9k4EVnRIWhadtwz7VwJw",  
"node\_name": "data1-iil-010\_data",  
"transport\_address": "10.184.95.63:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "lCdtln5LSF-7\_VQpvFRjiA",  
"node\_name": "data1-iil-012\_data",  
"transport\_address": "10.184.95.64:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "xzdfB0NNTU61pc5xTHkZlw",  
"node\_name": "data1-iil-009\_data",  
"transport\_address": "10.184.95.62:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
}  
]  
},  
{  
"node\_id": "yFOxEiLaQF2DAe5A9XOY6g",  
"node\_name": "data1-iil-005\_data",  
"transport\_address": "10.184.95.5:9300",  
"node\_attributes": {  
"ibi\_site": "iil",  
"box\_type": "hot"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.require] filters [box\_type:"hot",\_name:"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest"]"""  
},  
{  
"decider": "same\_shard",  
"decision": "NO",  
"explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest][6], node[yFOxEiLaQF2DAe5A9XOY6g], [P], s[STARTED], a[id=jSUFYBZQT0eddLe3kotinQ]]"  
}  
]  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![viniciof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viniciof/32/53454_2.png) [@viniciof](https://discuss.elastic.co/u/viniciof)\
**Post date:** [September 2, 2019, 5:26pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/3 "2019-09-02T17:26:29Z")

</div>

\*\*Index settings are: (excluding the schema mapping as it's too long too many fields) \*\*

{  
"puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest": {  
"aliases": {  
"puma.compilation.pipeline": {}  
},  
"mappings": {  
"doc": {  
"dynamic": "true",  
"\_all": {  
"enabled": false  
},  
"dynamic\_templates": [  
{  
"strings": {  
"match\_mapping\_type": "string",  
"mapping": {  
"index": true,  
"normalizer": "keyword\_lowercase",  
"type": "keyword"  
}  
}  
}  
]  
},  
"_default_": {  
"dynamic\_templates": [  
{  
"strings": {  
"match\_mapping\_type": "string",  
"mapping": {  
"index": true,  
"normalizer": "keyword\_lowercase",  
"type": "keyword"  
}  
}  
}  
]  
}  
},  
"settings": {  
"index": {  
"routing": {  
"allocation": {  
"include": {  
"ibi\_site": "iil,pdx,png"  
},  
"require": {  
"\_name": "puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest",  
"box\_type": "hot"  
}  
}  
},  
"refresh\_interval": "30s",  
"number\_of\_shards": "10",  
"translog": {  
"durability": "async"  
},  
"auto\_expand\_replicas": "1-1",  
"blocks": {  
"write": "false"  
},  
"provided\_name": "puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest",  
"creation\_date": "1519401031998",  
"analysis": {  
"normalizer": {  
"keyword\_lowercase": {  
"filter": [  
"lowercase"  
],  
"type": "custom"  
}  
}  
},  
"number\_of\_replicas": "1",  
"uuid": "69mUudmtSW2j2qWv8Dj2jQ",  
"version": {  
"created": "5040099",  
"upgraded": "5060299"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [September 2, 2019, 5:45pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/4 "2019-09-02T17:45:52Z")

</div>

Hi @viniciof,

it looks like you have two require criteria for each index: one on box\_type and one on \_name. Notice that using \_name you specify the [node name](https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html), not the index name. I think you need to remove that part from the require filter?

---

<div class="post-metadata">

**Author:** ![viniciof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viniciof/32/53454_2.png) [@viniciof](https://discuss.elastic.co/u/viniciof)\
**Post date:** [September 2, 2019, 6:07pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/5 "2019-09-02T18:07:19Z")

</div>

Thank you so much!! It works now by assigning that field to NULL 🙂

> PUT /puma.compilation.pipeline.96f19f5b-bc84-4d4b-8694-b80a293e78e4-latest/\_settings  
> {  
> "settings": {  
> "index.routing.allocation.require.\_name": null  
> }  
> }

Found more details on this PRD here [Index-level shard allocation filtering | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-allocation-filtering.html) for anyone else having similar issues

Regards,

---

<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:** [September 30, 2019, 6:07pm UTC](https://discuss.elastic.co/t/shards-not-being-allocated-according-to-box-type-setting-in-designated-nodes-of-same-type/197723/6 "2019-09-30T18:07:38Z")

</div>

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