Will multiple Opensearch instances (JVM) configured to the same data volume and directory lead to data corruption?


Is it totally okay to have multiple Opensearch instances (i.e JVM processes) configure to the same data volume and directory?

It works fine but I don’t know how Opensearch manages files (e.g will each instance locks the file first etc). Just want to make sure that doing so will not lead to data corruption.

We need to do this during new K8 cluster standup before doing DNS swap so that we don’t have to migrate data from existing cluster to new cluster.

Please advise. Thank you.

I wouldn’t do that, because one process might change files (e.g. merge segments) when the other process doesn’t expect them to do so.