I have two-node cluster on one machine and one config file (elasticsearch.yml). Is it possible to create another .yml-config file and start every instance with different config-file? For example, i want run cluster on two ports (localhost:9200 and localhost:9201) on the same time.
I can't find command-line API for starting elastic-cluster (config-file as an argument?).
You should be able to start your second ES instance with the -Epath.conf
setting on the command line and point to another folder where you have your second elasticsearch.yml
configuration file
./bin/elasticsearch -Epath.conf=/path/to/my/second/config/
A newer approach starting from ES 6 release for launching multiple instances based on the same ES installation is to have multiple config folders and declaring path variable before startup execution
ES_PATH_CONF=/apps/my-es/conf/node-1 ./elasticsearch
ES_PATH_CONF=/apps/my-es/conf/node-2 ./elasticsearch
To launch as daemon include -d
and -p <pidName>
for defining pid name
ES_PATH_CONF=/apps/my-es/conf/node-1 ./elasticsearch -d -p es_node1_pid
ES_PATH_CONF=/apps/my-es/conf/node-2 ./elasticsearch -d -p es_node2_pid
here is a reference on ES docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With