# All shards remain unassigned

**URL:** https://discuss.elastic.co/t/all-shards-remain-unassigned/53145
**Category:** Elasticsearch
**Created:** [June 17, 2016, 10:54am UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145 "2016-06-17T10:54:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Daan\_Aerts](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Daan\_Aerts](https://discuss.elastic.co/u/Daan_Aerts)
#### Post date: [June 17, 2016, 10:54am UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/1 "2016-06-17T10:54:21Z")

</div>

why are none of my shards being assigned? (ES 2.3)

Create index:

```
PUT 'host:9200/entities?pretty' -d ' {
  "mappings": {
      x
    }
  },
  "settings" : {
    "index" : {
        "number_of_shards" : 6, 
        "number_of_replicas" : 1
    }
  }
}'

```

Cluster Settings:

```
GET 'host:9200/_cluster/settings?pretty'
    {
      "persistent" : {
        "cluster" : {
          "routing" : {
            "allocation" : {
              "enable" : "all"
            }
          }
        }
      },
      "transient" : {
        "cluster" : {
          "routing" : {
            "allocation" : {
              "enable" : "all"
            }
          }
        }
      }
    }

```

Cluster:

```
host master 
node3 m  
node2 m
node1 * 

```

Shards

```
GET 'host:9200/_cat/shards?v'
index shard prirep state docs store ip node 
entities 5 p UNASSIGNED                    
entities 5 r UNASSIGNED                    
entities 1 p UNASSIGNED                    
entities 1 r UNASSIGNED                    
entities 4 p UNASSIGNED                    
entities 4 r UNASSIGNED                    
entities 2 p UNASSIGNED                    
entities 2 r UNASSIGNED                    
entities 3 p UNASSIGNED                    
entities 3 r UNASSIGNED                    
entities 0 p UNASSIGNED                    
entities 0 r UNASSIGNED 

```

I'm able to assign nodes directly through the routing API, but that doesn't seem to be the wait to go.

If I setup the cluster differently, with 1 master node and 2 data nodes, the problem doesn't occur.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 17, 2016, 12:37pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/2 "2016-06-17T12:37:46Z")

</div>

Hey,

does that setup allow for data nodes, I am a bit worried about your last sentence that it works with 1 master node and two data nodes. In the setup where it does not work, are there data nodes? You can check via `GET _cat/nodes?h=name,master,role&v` to the if each node has the `d` data role in the last column. Note, that a master node, without data role cannot hold any data.

Can you check if allocation is also enabled for the index itself? I guess so (as it is just being created, but would like to make sure). You can check via `GET _all/_settings`

If all is correct, you can check the allocation decider output

```auto
PUT /_cluster/settings
{
    "transient" : {
        "logger.cluster.routing.allocation.decider": "TRACE",
        "logger.cluster.routing.allocation": "TRACE"
    }
}

```

**Note** : This generates a lot of logs, so leave that turned on in production.

--Alex

---

<div class="post-metadata">

### Author: ![Daan\_Aerts](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Daan\_Aerts](https://discuss.elastic.co/u/Daan_Aerts)
#### Post date: [June 17, 2016, 1:08pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/3 "2016-06-17T13:08:20Z")

</div>

Hi Alexander,

Thanks for the help.

```
    /_cat/nodes?v&h=name,master,role'
name master role 
ec2-52-58-254-182.eu-central-1.compute.amazonaws.com-node1 m -    
ec2-52-58-19-123.eu-central-1.compute.amazonaws.com-node1 * -    
ec2-52-58-249-131.eu-central-1.compute.amazonaws.com-node1 m -   

```

with those logging settings, creating the index logs only this line.

`[2016-06-17 13:03:42,335][INFO][cluster.metadata] [xx] [entities] creating index, cause [api], templates [], shards [6]/[1], mappings [csi, entity]`

I suspect I'm doing something very basic wrong with master/data nodes or shard setup.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 17, 2016, 2:19pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/4 "2016-06-17T14:19:28Z")

</div>

Looks to me, as if in your one setup you only configured `node.master: true`, but none of your nodes is configured as `node.data: true` - which means, not a single node can hold any data. Only nodes which are configured to have the `node.data: true` setting will hold any data. Three master-only nodes will never be able to hold any data.

---

<div class="post-metadata">

### Author: ![Daan\_Aerts](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Daan\_Aerts](https://discuss.elastic.co/u/Daan_Aerts)
#### Post date: [June 17, 2016, 2:38pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/5 "2016-06-17T14:38:03Z")

</div>

stupid me. Kind a found out by your previous answer already. Thanks

---

<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, 10:42pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned/53145/6 "2017-07-05T22:42:42Z")

</div>


