List Unassigned shards by index by node

Hi All,

I have looked through to find out any api available to list down the
unassigned shards.
Currently the cluster health api only list the number of unassigned shards.

{
"cluster_name" : "elasticsearch",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 5,
"number_of_data_nodes" : 5,
"active_primary_shards" : 36,
"active_shards" : 36,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 3
}

But my requirement is to list down the unassigned shard along with the index
name and node
that they belong to.

I have called the index status and segment api;

curl -XGET 'http://localhost:9200/_status' -- all shards have "state"
"STARTED"
curl -XGET 'http://localhost:9200/_segments'

but I don't get which shards are faling.

Any help would be greatly appreciated.

Thanks
Amit

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Look at the results of
curl -XGET http://localhost:9200/_cluster/state?pretty=true

  • you'll probably want to pipe that into less. Search for the string
    UNASSIGNED.

On Thu, Jun 27, 2013 at 12:47 PM, Amit Singh amitsingh.kec@gmail.comwrote:

Hi All,

I have looked through to find out any api available to list down the
unassigned shards.
Currently the cluster health api only list the number of unassigned shards.

{
"cluster_name" : "elasticsearch",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 5,
"number_of_data_nodes" : 5,
"active_primary_shards" : 36,
"active_shards" : 36,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 3
}

But my requirement is to list down the unassigned shard along with the index
name and node
that they belong to.

I have called the index status and segment api;

curl -XGET 'http://localhost:9200/_status' -- all shards have "state"
"STARTED"
curl -XGET 'http://localhost:9200/_segments'

but I don't get which shards are faling.

Any help would be greatly appreciated.

Thanks
Amit

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks Israel,

That helped , I called all other api except for cluster state api.

Now when I know the unassigned shards, I am trying to allocated them to a
node.

curl -XPOST '10.62.145.101:9200/_cluster/reroute' -d '{"commands" :
[{"allocate" : "index"
:"51c33c8d9a5cb0e4a498e94c51c438855555b0e40a09137a1","shard" : 3,
"node" : "fJxYr_ZMQyagiA2ilKVLYA"}}]}'

But when I call the cluster state api , I still get the same result.
I mean the shard did not got assigned to a node.

Thanks
Amit

On Thu, Jun 27, 2013 at 4:29 PM, Israel Tsadok itsadok@gmail.com wrote:

Look at the results of
curl -XGET http://localhost:9200/_cluster/state?pretty=true

  • you'll probably want to pipe that into less. Search for the string
    UNASSIGNED.

Elasticsearch Platform — Find real-time answers at scale | Elastic

On Thu, Jun 27, 2013 at 12:47 PM, Amit Singh amitsingh.kec@gmail.comwrote:

Hi All,

I have looked through to find out any api available to list down the
unassigned shards.
Currently the cluster health api only list the number of unassigned
shards.

{
"cluster_name" : "elasticsearch",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 5,
"number_of_data_nodes" : 5,
"active_primary_shards" : 36,
"active_shards" : 36,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 3
}

But my requirement is to list down the unassigned shard along with the index
name and node
that they belong to.

I have called the index status and segment api;

curl -XGET 'http://localhost:9200/_status' -- all shards have "state"
"STARTED"
curl -XGET 'http://localhost:9200/_segments'

but I don't get which shards are faling.

Any help would be greatly appreciated.

Thanks
Amit

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Try this...

curl localhost:9200/_cat/shards