# Unasigned shards

**URL:** <https://discuss.elastic.co/t/unasigned-shards/26627>\
**Category:** Elasticsearch\
**Created:** [July 31, 2015, 9:05am UTC](https://discuss.elastic.co/t/unasigned-shards/26627 "2015-07-31T09:05:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Diaz\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@Juan\_Diaz\_Gonzalez](https://discuss.elastic.co/u/Juan_Diaz_Gonzalez)\
**Post date:** [July 31, 2015, 9:05am UTC](https://discuss.elastic.co/t/unasigned-shards/26627/1 "2015-07-31T09:05:15Z")

</div>

If for example I add a new node I have unasigned shards although in the elasticsearch configuration (elasticsearch.yml) I have this wrote paremeter:

```
index.routing.allocation.disable_allocation: false

```

**It does not works I have unnasigned shards.**

So I executed a script to recollate all shards:

```
NODE="Node_name"
IFS=$'\n'
for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep UNASSIGNED); do
  INDEX=$(echo $line | (awk '{print $1}'))
  SHARD=$(echo $line | (awk '{print $2}'))

  curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
     "commands": [
        {
            "allocate": {
                "index": "'$INDEX'",
                "shard": '$SHARD',
                "node": "'$NODE'",
                "allow_primary": true
          }
        }
    ]
  }'
done

```

So **in this way I have all shards recollated**. And my question is if this could give me problems in a future because I want to have a structure of parent/child and the parent and the child they need to be in the same shard to the routing by parent or child works correctly or any other type problem.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 1, 2015, 5:14am UTC](https://discuss.elastic.co/t/unasigned-shards/26627/2 "2015-08-01T05:14:13Z")

</div>

It won't impact P&C as the routing they use is a little different.

---

<div class="post-metadata">

**Author:** ![Juan\_Diaz\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@Juan\_Diaz\_Gonzalez](https://discuss.elastic.co/u/Juan_Diaz_Gonzalez)\
**Post date:** [August 5, 2015, 6:41am UTC](https://discuss.elastic.co/t/unasigned-shards/26627/3 "2015-08-05T06:41:11Z")

</div>

Ok, thanks for your help.

Best regards

Juan

---

<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 5, 2017, 11:57pm UTC](https://discuss.elastic.co/t/unasigned-shards/26627/4 "2017-07-05T23:57:20Z")

</div>


