How to keep 2 clusters in sync

We are in process of creating an ES cluster in GCP and our old cluster in AWS.

I have used es reindex api https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html to copy data from old aws cluster to new gcp cluster.

As of now old cluster in use and by the time of new cluster use, we see some new documents were not synced as apps are still using the old cluster. How to avoid these sync issues in cluster migration.

I would decide on a date for switching from old to new cluster.
I would make sure anything that is indexing to old cluster is paused. Then either use re-index API or snapshot to migrate data from old to new cluster.
Then make sure your application and indexer are pointing to new cluster.
This to be can be the best way to ensure you dont lose your data and have smooth migration.

You can achieve a much shorter pause by using cross-cluster replication to replicate documents from the old cluster to the new. That way you can do this:

  1. halt the indexing traffic on the old cluster
  2. wait for CCR to finish copying the last few documents
  3. unfollow everything
  4. restart indexing into the new cluster

That would be a lot quicker than stopping indexing for the whole copy process.

1 Like

@DavidTurner, @Jaspreet_Singh, Thanks for your inputs.

We disabled xpack in our ex.yaml. Still, I see some errors while doing CCR.

"type":"security_exception","reason":"current license is non-compliant for [ccr]","license.expired.feature":"ccr"

Anyways, We are going to use the maintenance window approach. which @Jaspreet_Singh suggested.

Is there any way we can copy or clone an index on the remote host to the new cluster which includes mappings and settings.

Yes, use snapshot/restore as Jaspreet suggested.

@mouli_v The other thing I would suggest is to start doing snapshot restore even before your maintenance window. Snapshots are incremental. So while your first snapshot and restore will take some time, subsequent ones will be a lot faster.

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