Multiple nodes on one machine

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple nodes on one machine

Andrej
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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple nodes on one machine

Eric Jain
On Apr 10, 7:21 am, Andrej Rosenheinrich
<[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple nodes on one machine

Igor Motov-3
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> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple nodes on one machine

Otis Gospodnetic
In reply to this post by Andrej
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:  http://blog.sematext.com/2012/02/07/elasticsearch-poll/ 

Otis
--
Hiring ElasticSearch Engineers -- 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