Let's suppose I have cluster with 5 Elasticsearch nodes and there is some data in it.
Now one of the nodes crashed for some reason. After that it is recovered, data is lost (there is a new volume created). My question is - will recovered Elasticsearch node sync with the cluster in order to get the existing data?
if you set replica
setting to 1, yes data will be recovered.
https://codingexplained.com/coding/elasticsearch/understanding-replication-in-elasticsearch
The cluster health status is: green
, yellow
or red
. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated.
If the replication is 0, that means only one copy of data will be maintained. So if a node is crashed and data is lost then few of the shard for the indices will get unassigned. Your cluster health summary will become red.
But if your replication is 1. No need to worry as two copies for each shard will be maintained. Primary and replica shard. So if the crashed node contains the primary shard....then the replica shard will be promoted as primary and a copy of the shard will be created on another node which will act as replica node.