Error on creating replicas

(lucifer) #1

When I change the number of replicas of a particular index from 1 to 2, the data stops entering the elasticsearch. The document count becomes static and does not change. Moreover, all the replicated shards are unassigned. Kindly help. Please.

(Christian Dahlqvist) #2

How many nodes do you have in your cluster?

(lucifer) #3

Right now I have only one. Kindly explain me how adding more nodes will affect this?

I have one node, status is green with 0 replicas, and data enters elasticsearch.
status is yellow with 1 replica, but still data enters.
status is yellow with >1 replicas, but data does not enter the elasticsearch.

(Christian Dahlqvist) #4

Elasticsearch will never allocate replicas to the same node as the primary, so if you only have one node in your cluster you should set the number of replicas to 0. When writing to an index, a quorum of shards (primary and replica) must be available in order for the write to succeed. If you have 1 replica, quorum is assumed to be 1, meaning that your single primary shard is able to accept writes. When you set the number of replicas to 2, a quorum of 2 shards that to be available, which can never be the case on a single node cluster, which is why all writes fail.

(system) #5