# Move shard to another node error

**URL:** <https://discuss.elastic.co/t/move-shard-to-another-node-error/333235>\
**Category:** Elasticsearch\
**Created:** [May 11, 2023, 5:52pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235 "2023-05-11T17:52:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [May 11, 2023, 5:52pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235/1 "2023-05-11T17:52:32Z")

</div>

Hello,  
I need to move shards to another node.  
I get the following error. The command is first and the error after it:

# error to check

post \_cluster/reroute  
{  
"commands": [  
{  
"move": {  
"index": "yeshut\_2022.03.31-000152",  
"shard": 0,  
"from\_node": "S003.dom",  
"to\_node": "S017.dom"  
}  
}  
]  
}

{  
"error": {  
"root\_cause": [  
{  
"type": "remote\_transport\_exception",  
"reason": "[S001.dom][10.0.0.28:9300][cluster:admin/reroute]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "[move\_allocation] can't move 0, from {S003.dom}{EDit5b-bT4-lTuPdJ-LJoA}{UOCe\_9OfQC2E2NTUgJFD3w}{10.0.0.33}{10.0.0.33:9300}{di}{storage\_term=cold, xpack.installed=true}, to {S017.dom}{jLHVeaHzSvWkM\_Z2X9Zvmg}{EnEF9qvDRWW5woL\_J1365g}{10.0.0.51}{10.0.0.51:9300}{di}{xpack.installed=true}, since its not allowed, reason: [YES(shard has no previous failures)][YES(primary shard for this replica is already active)][YES(explicitly ignoring any disabling of allocation due to manual allocation commands via the reroute API)][YES(can allocate replica shard to a node with version [7.5.1] since this is equal-or-newer than the primary version [7.5.1])][YES(the shard is not being snapshotted)][YES(ignored as shard is not being recovered from a snapshot)][NO(node does not match index setting [index.routing.allocation.require] filters [storage\_term:"cold"])][YES(the shard does not exist on the same node)][YES(enough disk for shard on node, free: [1.8tb], shard size: [22.2gb], free after allocating shard: [1.8tb])][YES(below shard recovery limit of outgoing: [0 \< 20] incoming: [0 \< 20])][YES(total shard limits are disabled: [index: -1, cluster: -1] \<= 0)][YES(allocation awareness is not enabled, set cluster setting [cluster.routing.allocation.awareness.attributes] to enable it)]"  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![eMitch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emitch/32/93607_2.png) [@eMitch](https://discuss.elastic.co/u/eMitch)\
**Post date:** [May 11, 2023, 7:28pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235/2 "2023-05-11T19:28:02Z")

</div>

> [@mpniel](#):
>
> NO(node does not match index setting [index.routing.allocation.require] filters [storage\_term:"cold"]

You will either need to change the index to remove the allocation requirement or set this node as a cold node as well.

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [May 14, 2023, 7:05pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235/3 "2023-05-14T19:05:43Z")

</div>

Could you please provide a detailed action plan for a begginner?

---

<div class="post-metadata">

**Author:** ![eMitch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emitch/32/93607_2.png) [@eMitch](https://discuss.elastic.co/u/eMitch)\
**Post date:** [May 18, 2023, 9:02pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235/4 "2023-05-18T21:02:02Z")

</div>

Depending on your configuration, you will need to either change the [Index-level shard allocation filtering](https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-allocation-filtering.html) so that the index is no longer required to live on a "cold" node:  
Example:

```auto
PUT yeshut_2022.03.31-000152/_settings
{
  "index.routing.allocation.require.storage_term": ""
}

```

Or, you will need to change the attributes of `S017.dom` to have the `storage_term: cold` attribute in the configuration file. Example from [this link](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#enabling-awareness):

> Specify the location of each node with a custom node attribute. For example, if you want Elasticsearch to distribute shards across different racks, you might set an awareness attribute called `rack_id` in each node’s `elasticsearch.yml` config file.
> 
> node.attr.rack\_id: rack\_one

So, in the elasticsearch.yml file on `S017.dom`, you will want to look for a setting that is similar to `node.attr.storage_term: `

If you run `GET /_cat/nodeattrs?v` and find the S017.dom node, does its attributes align with the other nodes appropriately?

---

<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 15, 2023, 9:02pm UTC](https://discuss.elastic.co/t/move-shard-to-another-node-error/333235/5 "2023-06-15T21:02:15Z")

</div>

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