Reputation: 559
I do not understand this subject, where replica are stored in elasticsearch?
Is primary shard a replica?
So, how ElasticSearch can use replica when the server crashes?
Upvotes: 0
Views: 721
Reputation: 52366
I suggest installing the Marvel plugin. It has a dashboard where you can see where each shard is located and what its status is.
See below an example.
Upvotes: 0
Reputation: 6357
An Elasticsearch index is made up of 1 or more primary shards. Each of these primary shards can have 0 or more replica shards. A replica shard as the name suggests is an exact copy of the corresponding primary shard. Primary and its replica shard(s) are distributed among the cluster nodes such that they do not reside on the same node. This way, if a node containing a primary shard crashes, one of its replica shard that is hosted on another node is promoted to be act as a primary shard. Note: If you have a single node cluster, replica shards will not be allocated as then both primary and replica shards have to reside on the same node which does not make any sense.
There is a lot of material online about this topic. For starters, read this and this.
Upvotes: 2