All shards remain unassigned

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.

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

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

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.

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.

1 Like

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