Primary-replica shard location

Hi,

How can I know if a certain node has the primary or replica shard?
I'm doing tests with the forced awareness settings and need to know if it
works.

Thanks

--
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.

The Indice Status APIhttp://www.elasticsearch.org/guide/reference/api/admin-indices-status.htmlis what you are looking for:

{
"ok": true,
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"indices": {
"test": {

           [...]

     "shards": {
        "0": [
           {
              "routing": {
                 "state": "STARTED",
                 "primary": true,
                 "node": "sLz81D7QSr-rdlqr8lAGKA",
                 "relocating_node": null,
                 "shard": 0,
                 "index": "test"
              }, 
       
         [...]

On Sunday, February 24, 2013 9:16:54 AM UTC-5, Ophir Michaeli wrote:

Hi,

How can I know if a certain node has the primary or replica shard?
I'm doing tests with the forced awareness settings and need to know if it
works.

Thanks

--
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.

Ophir Michaeli wrote:

How can I know if a certain node has the primary or replica shard?
I'm doing tests with the forced awareness settings and need to know
if it works.

Try this:

% curl -s download.elasticsearch.org/es2unix/es >es; chmod +x es
% ./es shards

The output is easier to parse visually than json. From
GitHub - elastic/es2unix: Command-line ES.

-Drew

--
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.