Old indices being copied between nodes on recovery

Hi all,

am looking to put together a simple failover setup.
Have 2 nodes, 1 shard , 1 replica.

only departure from the elasticsearch.yml defaults are

cluster.name: mycluster
node.name: node1/node2
index.number_of_shards: 1
index.number_of_replicas: 1
http.port: 9210
http.compression: true

The index increments, eg if we have an index called "index_v1", then on re-indexing it is updated to "index_v2" (and the "index_v1" folder is removed from "C:\Elasticsearch\data\mycluster\nodes\0\indices.

Issue I have is.

1- node1(master) and node2 both have index "index_v1"

2 - node1 fails. node2 becomes master.

3 - automated re-indexing kicks in and node2 updates to "index_v2"

4 - restart node1.

5 - node1 and node2 communicate and we end up with "index_v1" and "index_v2" on each node (!)

My questions are...

a) is this the expected behaviour?

and

b) is there any way to have node1 update to the latest index, so we end up with just "index_v2 " on both nodes after a recovery?

Thanks for all and any help.

Yes this is expected.
If you don't want the "old" index on both nodes, delete it using the APIs.

If you have 2 master eligible nodes in your cluster, you should set 'minimum_master_nodes' to 2 in order to avoid split-brain scenarios. This would prevent one of the nodes to be elected master when one is missing (correct behaviour), which is why we always recommend having a minimum of 3 master eligible ondes in a cluster (this allows cluster to continue operating when one onde is down).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.