Modify an Elasticsearch

Elasticsearch is configured within 5 shards and 1 replica by default. In the case of multinode, data loss may occur when two elasticsearch nodes are down and not available.

For example, if elasticsearch is configured in 3 nodes execute the following command to prevent the data loss:curl -k -X PUT https://admin:admin@<Elastic_ip:Elastic_port>/_template/template_1 -d '{"template":"*","index_patterns":["statistic*"],"settings":{"number_of_replicas": 2}}’'

This will configure the replicas in the elasticsearch servers and will prevent the data loss.

The disadvantage of the replica is that it will consume large disk spaces.