I have tried to install two elasticsearch instances in single server and failed to do so ( on same port). Is there any way i can create 2 elasticsearch instances in same server and on same port. Will reverse proxy help here. If so how.
Asked
Active
Viewed 6,036 times
2
-
1possible duplicate of [Multiple nodes in ElasticSearch](http://stackoverflow.com/questions/13477303/multiple-nodes-in-elasticsearch) – bittusarkar Jan 26 '15 at 01:20
1 Answers
7
Creating 2 Elasticsearch instances on the same server and the same port is impossible, and pointless.
Just set 2 instances running on the same box, put have them pointed at different ports, one at the default port of 9200 and one at port 9300. Give them the same cluster name and they will automatically network together.
One important point, make sure you set the data and plugin directories to different locations otherwise you'll get data from one node writing over the data from the other node.
EDIT:
By the way, if you're looking to create 2 completely separate clusters on the same machine you still need to do what I said above, but just make sure the cluster name is different in each configuration file so that they don't network together.

Garry Welding
- 3,599
- 1
- 29
- 46
-
6As for the port configuration, you don't have to change anything, as any instance will pick the first free port in the [9200-9300) range for http and [9300-9400) for the transport. – javanna Feb 27 '14 at 11:23
-
Isn't it possible to launch multiple instances on the same host, same port using Docker? – RRM Mar 22 '22 at 23:31
-
Probably now yes, but this question was originally asked and answered back in 2014. – Garry Welding Apr 19 '22 at 12:05