# Multiple nodes on one machine

**URL:** <https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283>\
**Category:** Elasticsearch\
**Created:** [April 10, 2012, 2:21pm UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283 "2012-04-10T14:21:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrej](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Andrej](https://discuss.elastic.co/u/Andrej)\
**Post date:** [April 10, 2012, 2:21pm UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283/1 "2012-04-10T14:21:12Z")

</div>

Hi,

I'm a bit stuck with trying to run several elasticsearch nodes (of the  
same cluster) on one machine. From a few posts I found this should be  
possible, so could someone maybe give a hint on how configuration has  
to be adapted to run two nodes on one machine? How is discovery  
handled in this case?

Thanks, Andrej

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [April 10, 2012, 9:01pm UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283/2 "2012-04-10T21:01:22Z")

</div>

On Apr 10, 7:21 am, Andrej Rosenheinrich  
[andrej.rosenheinr...@unister.de](mailto:andrej.rosenheinr...@unister.de) wrote:

> I'm a bit stuck with trying to run several elasticsearch nodes (of the  
> same cluster) on one machine. From a few posts I found this should be  
> possible, so could someone maybe give a hint on how configuration has  
> to be adapted to run two nodes on one machine? How is discovery  
> handled in this case?

Running multiple nodes on one machine doesn't seem to require any  
special configuration, you just start multiple instances. The Java  
Client doesn't seem to have trouble with nodes coming and going, but  
if you use the REST API and the first node is shut down, it looks like  
there is no longer anyone listening on port 9200 until you start  
another node.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 10, 2012, 9:38pm UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283/3 "2012-04-10T21:38:12Z")

</div>

I agree with Eric, running two nodes on one machine is not much different  
from running them on multiple machines. You just start elasticsearch twice  
and these two nodes should be able to find each other using multicast  
discovery. If it doesn't work, you might be running into firewall issues.  
Multicast discovery is using group 224.2.2.4 and port 54328.  
Try opening this port and see if it fixes the issue.

If it works, you will be able to find the second node running on the port  
9201. When a node starts it is trying to use first available port in  
9200-9300 range. If you start both services from the same directory, the  
second node will be using ELASTICSEARCH\_HOME/data/elasticsearch/nodes/1 as  
its data directory.

On Tuesday, April 10, 2012 5:01:22 PM UTC-4, Eric Jain wrote:

> On Apr 10, 7:21 am, Andrej Rosenheinrich  
> [andrej.rosenheinr...@unister.de](mailto:andrej.rosenheinr...@unister.de) wrote:
> 
> > I'm a bit stuck with trying to run several elasticsearch nodes (of the  
> > same cluster) on one machine. From a few posts I found this should be  
> > possible, so could someone maybe give a hint on how configuration has  
> > to be adapted to run two nodes on one machine? How is discovery  
> > handled in this case?
> 
> Running multiple nodes on one machine doesn't seem to require any  
> special configuration, you just start multiple instances. The Java  
> Client doesn't seem to have trouble with nodes coming and going, but  
> if you use the REST API and the first node is shut down, it looks like  
> there is no longer anyone listening on port 9200 until you start  
> another node.

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [April 11, 2012, 2:21am UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283/4 "2012-04-11T02:21:52Z")

</div>

Hi Andrej,  
It looks like a few people already provided with information.  
I have a Q for you: how come you want to run multiple nodes on the same  
cluster? What's the use-case?

You may also be interested in this poll on this very topic:

> **[What Is Elasticsearch: Getting Started Tutorial for Beginners](https://sematext.com/guides/elasticsearch/)**
>
> Get started with Elasticsearch! Detailed tutorial to learn the basic concepts: what is Elasticsearch, how it works, and what it is used for.

## Otis

Hiring Elasticsearch Engineers -- [Jobs](http://sematext.com/about/jobs.html#search)

On Tuesday, April 10, 2012 10:21:12 AM UTC-4, Andrej Rosenheinrich wrote:

> Hi,
> 
> I'm a bit stuck with trying to run several elasticsearch nodes (of the  
> same cluster) on one machine. From a few posts I found this should be  
> possible, so could someone maybe give a hint on how configuration has  
> to be adapted to run two nodes on one machine? How is discovery  
> handled in this case?
> 
> Thanks, Andrej

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:33am UTC](https://discuss.elastic.co/t/multiple-nodes-on-one-machine/7283/5 "2017-07-06T03:33:02Z")

</div>


