I have found some answers to this question on StackOverflow but those are a bit old. I need to configure multiple instances with the latest version (7.9.3) of elasticsearch
and couldn't find any answers which are compatible with that.
Step 01
Set environment variable on windows
ES_HOME
= ../elasticsearch
ES_PATH_CONF
= ../elastcisearch/config
Step 02
created elasticsearch_1.yml
and elastcsearch_2.yml
config files
Steo 03
run the elasticsearch.bat
with the config file
bin/elasticsearch -Des.config=$ES_HOME/config/elasticsearch.1.yml
then the following error will be thrown
ERROR: D is not a recognized option
Note - I know that the above approach is a bit old and how to do the above steps with the current (7.9) version
No need to give -D option and don't create two config file in a single ES installation folder.
Instead, just change the elasticsearch.config
in two ES installation folder and run them on separate ports.
ES-1 elasticsearch.config
http.port: 9200
ES-2 elasticsearch.config
http.port: 9500
And after this, simply start both the node, one by one from using bin/elasticsearch
command.