1

The output of the curl -X GET "localhost:9200/_cat/shards?v" is as follows:

index shard prirep state docs store ip node
test_index 1 p STARTED 0 283b 127.0.0.1 Deepaks-MacBook-Pro-2.local
test_index 1 r UNASSIGNED 0
test_index 1 r UNASSIGNED 0
test_index 0 p STARTED 2 12.5kb 127.0.0.1 Deepaks-MacBook-Pro-2.local
test_index 0 r UNASSIGNED 0
test_index 0 r UNASSIGNED 0

What is the meaning of 0/1 in the shard column?

Deepak Tatyaji Ahire
  • 4,883
  • 2
  • 13
  • 35

1 Answers1

0

Shards In Elasticsearch

Shard, a subset of data of the whole index, one index data will be saved into shards.

Shard has two parts to it, one primary shard, other one or more replica shards.

You have 2 shards with replica 2

First Shard

  1. test_index shard 0 which is the primary shard
  2. test_index shard 0 which is replica 1 shard - a copy of primary sard
  3. test_index shard 0 which is replica 2 shard - a copy of primary sard

Second Shard

  1. test_index shard 1 which is the primary shard
  2. test_index shard 1 which is replica 1 shard - a copy of primary sard
  3. test_index shard 1 which is replica 2 shard - a copy of primary sard

Another answer: Shards and replicas in Elasticsearch

Jinna Balu
  • 6,747
  • 38
  • 47