Two TAR archive instances of OpenSearch running independently on the same Linux machine?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.15

Describe the issue:

I would like to run two instances of OpenSearch on the same Linux machine, one on the default port 9200, and one on port 9210.

Configuration:

I have one instance already up: From the archive file opensearch-2.15.0-linux-x64.tar.gz I have installed the instance into the custom directory /my/path/to/opensearch-2.15.0/ and run in there the executable bin/opensearch.

I have created a copy of the opensearch-2.15.0 directory at /my/path/to/opensearch-2.15.0-tu and I changed in the associated config/opensearch.yml file the port.

More in detail, the config file opensearch.yml of the first opensearch installation looks like this:

# opensearch.yml for /my/path/to/opensearch-2.15.0
network.host: 0.0.0.0
discovery.type: single-node
plugins.security.disabled: true

The opensearch.yml of the second one looks like this:

# opensearch.yml for /my/path/to/opensearch-2.15.0-tu
network.host: 0.0.0.0
http.port: 9210
discovery.type: single-node
plugins.security.disabled: true

My question is: Can I safely run the 2nd instance and will its data be totally separate from the first instance?

From my brief research I think the data are not shared: Both instances have their own data directory in /my/path/to/opensearch-2.15.0/data and in /my/path/to/opensearch-2.15.0-tu/data respectively. I assume they use these as default locations.

However it would be great if somebody more experienced with OpenSearch could confirm (or deny) this.

Thank you so much for your help.

Hi @halloleo,

I`ve run some quick tests (v 2.16) in my lab and it does look like you can (Please do your test before you apply changes to prod), however, have you considered using a containerized approach instead looks like a better way forward in my opinion.
Note: This is two separate nodes and not a cluster.

Separate cluster seems to be working as well:

Best,
mj

1 Like

Thank you. I have tested it too - and it works for me as well: instances running of the TAR archive seem to have by default the data directory inside the OpenSearch directory. (However I was not able to find this default setting in the documentation!)

Good point. Will keep this in mind.

1 Like