# How to isolate elastic search node from other nodes?

**URL:** <https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638>\
**Category:** Elasticsearch\
**Created:** [May 10, 2012, 3:19pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638 "2012-05-10T15:19:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Domagala\_2](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@Michal\_Domagala\_2](https://discuss.elastic.co/u/Michal_Domagala_2)\
**Post date:** [May 10, 2012, 3:19pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/1 "2012-05-10T15:19:44Z")

</div>

Hello,

I have some integration test of my application. The integration test  
starts own elastic search instance by _node =  
nodeBuilder().settings(settings).local(true).node();_  
and do its job.

However, I have other, running elastic search instance on my computer.  
I observed that runnich elastic search instance and integration test  
instance establish a connection (because I see IO exception in running  
ES log when integration test is terminated)

My question is: how to configure ES for integration test to make sure  
it is isolated against any other working ES in my computer/LAN?

I tried settings  
_.put("multicast.enabled","false")  
.put("discovery.zen.ping.multicast.ping.enabled", "false")_

but without success

best regards  
Michal Domagala

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 10, 2012, 3:25pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/2 "2012-05-10T15:25:59Z")

</div>

Here is the elasticsearch property file I use for JUnit tests:

# Node test setup

cluster.name=junit.cluster  
name=junit.node

# Disable network

discovery.zen.ping.multicast.enabled=false  
node.local=true

# Using less filesystem as possible

index.store.type=memory  
index.store.fs.memory.enabled=true  
index.gateway.type=none  
gateway.type=none

# If ES needs to write something, it's here

path.data=${mytarget}/data  
path.logs=${mytarget}/logs

# Index are minimalists by default

index.number\_of\_shards=1  
index.number\_of\_replicas=0

HTH  
David.

Le 10 mai 2012 à 17:19, Michal Domagala [outsider404@gmail.com](mailto:outsider404@gmail.com) a écrit :

> Hello,
> 
> I have some integration test of my application. The integration test  
> starts own Elasticsearch instance by _node =  
> nodeBuilder().settings(settings).local(true).node();_  
> and do its job.
> 
> However, I have other, running Elasticsearch instance on my computer.  
> I observed that runnich Elasticsearch instance and integration test  
> instance establish a connection (because I see IO exception in running  
> ES log when integration test is terminated)
> 
> My question is: how to configure ES for integration test to make sure  
> it is isolated against any other working ES in my computer/LAN?
> 
> I tried settings  
> _.put("multicast.enabled","false")  
> .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> 
> but without success
> 
> best regards  
> Michal Domagala

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Andrew\_at\_DataFeedFi](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Andrew\_at\_DataFeedFi](https://discuss.elastic.co/u/Andrew_at_DataFeedFi)\
**Post date:** [May 10, 2012, 3:26pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/3 "2012-05-10T15:26:51Z")

</div>

Michal,

Maybe I do not understand your question enough...

We have 4 ES clusters inside our LAN without any problem.

We simply ensure we have unique cluster name for each cluster  
and we also use Unicast and list all the nodes IP address for that  
cluster in the elasticsearch.yml config file for each cluster.

That should do it.

--Andrew

On May 10, 10:19 am, Michal Domagala [outsider...@gmail.com](mailto:outsider...@gmail.com) wrote:

> Hello,
> 
> I have some integration test of my application. The integration test  
> starts own Elasticsearch instance by _node =  
> nodeBuilder().settings(settings).local(true).node();_  
> and do its job.
> 
> However, I have other, running Elasticsearch instance on my computer.  
> I observed that runnich Elasticsearch instance and integration test  
> instance establish a connection (because I see IO exception in running  
> ES log when integration test is terminated)
> 
> My question is: how to configure ES for integration test to make sure  
> it is isolated against any other working ES in my computer/LAN?
> 
> I tried settings  
> _.put("multicast.enabled","false")  
> .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> 
> but without success
> 
> best regards  
> Michal Domagala

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 10, 2012, 3:30pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/4 "2012-05-10T15:30:54Z")

</div>

Problem is that ES find other nodes in the LAN and ask each of them the  
cluster name.

But, If you have one instance running 0.17.1, one other with 0.18.1 and the  
last one on 0.19.1, nodes can not speak to each others.

That's why it could be better to isolate nodes when doing unit tests.

My 2 cents  
David.

Le 10 mai 2012 à 17:26, "Andrew[.:at:.][DataFeedFile.com](http://DataFeedFile.com)"  
[andrew@datafeedfile.com](mailto:andrew@datafeedfile.com) a écrit :

> Michal,
> 
> Maybe I do not understand your question enough...
> 
> We have 4 ES clusters inside our LAN without any problem.
> 
> We simply ensure we have unique cluster name for each cluster  
> and we also use Unicast and list all the nodes IP address for that  
> cluster in the elasticsearch.yml config file for each cluster.
> 
> That should do it.
> 
> --Andrew
> 
> On May 10, 10:19 am, Michal Domagala [outsider...@gmail.com](mailto:outsider...@gmail.com) wrote:
> 
> > Hello,
> > 
> > I have some integration test of my application. The integration test  
> > starts own Elasticsearch instance by _node =  
> > nodeBuilder().settings(settings).local(true).node();_  
> > and do its job.
> > 
> > However, I have other, running Elasticsearch instance on my computer.  
> > I observed that runnich Elasticsearch instance and integration test  
> > instance establish a connection (because I see IO exception in running  
> > ES log when integration test is terminated)
> > 
> > My question is: how to configure ES for integration test to make sure  
> > it is isolated against any other working ES in my computer/LAN?
> > 
> > I tried settings  
> > _.put("multicast.enabled","false")  
> > .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> > 
> > but without success
> > 
> > best regards  
> > Michal Domagala

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Michal\_Domagala\_2](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@Michal\_Domagala\_2](https://discuss.elastic.co/u/Michal_Domagala_2)\
**Post date:** [May 11, 2012, 11:59am UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/5 "2012-05-11T11:59:28Z")

</div>

Thanks David, that's exacty what I need

On 10 Maj, 17:30, "[da...@pilato.fr](mailto:da...@pilato.fr)" [da...@pilato.fr](mailto:da...@pilato.fr) wrote:

> Problem is that ES find other nodes in the LAN and ask each of them the  
> cluster name.
> 
> But, If you have one instance running 0.17.1, one other with 0.18.1 and the  
> last one on 0.19.1, nodes can not speak to each others.
> 
> That's why it could be better to isolate nodes when doing unit tests.
> 
> My 2 cents  
> David.
> 
> Le 10 mai 2012 à 17:26, "Andrew[.:at:.][DataFeedFile.com](http://DataFeedFile.com)"  
> [and...@datafeedfile.com](mailto:and...@datafeedfile.com) a écrit :
> 
> > Michal,
> 
> > Maybe I do not understand your question enough...
> 
> > We have 4 ES clusters inside our LAN without any problem.
> 
> > We simply ensure we have unique cluster name for each cluster  
> > and we also use Unicast and list all the nodes IP address for that  
> > cluster in the elasticsearch.yml config file for each cluster.
> 
> > That should do it.
> 
> > --Andrew
> 
> > On May 10, 10:19 am, Michal Domagala [outsider...@gmail.com](mailto:outsider...@gmail.com) wrote:
> > 
> > > Hello,
> 
> > > I have some integration test of my application. The integration test  
> > > starts own Elasticsearch instance by _node =  
> > > nodeBuilder().settings(settings).local(true).node();_  
> > > and do its job.
> 
> > > However, I have other, running Elasticsearch instance on my computer.  
> > > I observed that runnich Elasticsearch instance and integration test  
> > > instance establish a connection (because I see IO exception in running  
> > > ES log when integration test is terminated)
> 
> > > My question is: how to configure ES for integration test to make sure  
> > > it is isolated against any other working ES in my computer/LAN?
> 
> > > I tried settings  
> > > _.put("multicast.enabled","false")  
> > > .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> 
> > > but without success
> 
> > > best regards  
> > > Michal Domagala
> 
> --  
> David Pilatohttp://dev.david.pilato.fr/  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 13, 2012, 12:13pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/6 "2012-05-13T12:13:47Z")

</div>

You set the node to local(true), this means it will not discover other  
nodes using network, only within the same JVM.

On Thu, May 10, 2012 at 6:19 PM, Michal Domagala [outsider404@gmail.com](mailto:outsider404@gmail.com)wrote:

> Hello,
> 
> I have some integration test of my application. The integration test  
> starts own Elasticsearch instance by _node =  
> nodeBuilder().settings(settings).local(true).node();_  
> and do its job.
> 
> However, I have other, running Elasticsearch instance on my computer.  
> I observed that runnich Elasticsearch instance and integration test  
> instance establish a connection (because I see IO exception in running  
> ES log when integration test is terminated)
> 
> My question is: how to configure ES for integration test to make sure  
> it is isolated against any other working ES in my computer/LAN?
> 
> I tried settings  
> _.put("multicast.enabled","false")  
> .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> 
> but without success
> 
> best regards  
> Michal Domagala

---

<div class="post-metadata">

**Author:** ![Douglas\_Ferguson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/douglas_ferguson/32/2121_2.png) [@Douglas\_Ferguson](https://discuss.elastic.co/u/Douglas_Ferguson)\
**Post date:** [October 5, 2012, 6:07pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/7 "2012-10-05T18:07:30Z")

</div>

I'm attempting to use this config for my tests.

I am able to index a document but when I perform a get request on the id i  
just get back an empty document {}

On Thursday, May 10, 2012 10:25:59 AM UTC-5, David Pilato wrote:

> Here is the elasticsearch property file I use for JUnit tests:
> 
> # Node test setup
> 
> cluster.name=junit.cluster  
> name=junit.node
> 
> # Disable network
> 
> discovery.zen.ping.multicast.enabled=false  
> node.local=true
> 
> # Using less filesystem as possible
> 
> index.store.type=memory  
> index.store.fs.memory.enabled=true  
> index.gateway.type=none  
> gateway.type=none
> 
> # If ES needs to write something, it's here
> 
> path.data=${mytarget}/data  
> path.logs=${mytarget}/logs
> 
> # Index are minimalists by default
> 
> index.number\_of\_shards=1  
> index.number\_of\_replicas=0
> 
> HTH
> 
> David.
> 
> Le 10 mai 2012 à 17:19, Michal Domagala \<[outsi...@gmail.com](mailto:outsi...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> > Hello,
> > 
> > I have some integration test of my application. The integration test  
> > starts own Elasticsearch instance by _node =  
> > nodeBuilder().settings(settings).local(true).node();_  
> > and do its job.
> > 
> > However, I have other, running Elasticsearch instance on my computer.  
> > I observed that runnich Elasticsearch instance and integration test  
> > instance establish a connection (because I see IO exception in running  
> > ES log when integration test is terminated)
> > 
> > My question is: how to configure ES for integration test to make sure  
> > it is isolated against any other working ES in my computer/LAN?
> > 
> > I tried settings  
> > _.put("multicast.enabled","false")  
> > .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> > 
> > but without success
> > 
> > best regards  
> > Michal Domagala
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 5, 2012, 6:36pm UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/8 "2012-10-05T18:36:59Z")

</div>

Hey,

Have a look at this project: [GitHub - elasticsearchfr/hands-on at answers](https://github.com/elasticsearchfr/hands-on/tree/answers)  
It will help you to start with JUnit tests.

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 oct. 2012 à 20:07, Douglas Ferguson [thedug@gmail.com](mailto:thedug@gmail.com) a écrit :

I'm attempting to use this config for my tests.

I am able to index a document but when I perform a get request on the id i just get back an empty document {}

On Thursday, May 10, 2012 10:25:59 AM UTC-5, David Pilato wrote:

> Here is the elasticsearch property file I use for JUnit tests:
> 
> # Node test setup
> 
> cluster.name=junit.cluster  
> name=junit.node
> 
> # Disable network
> 
> discovery.zen.ping.multicast.enabled=false  
> node.local=true
> 
> # Using less filesystem as possible
> 
> index.store.type=memory  
> index.store.fs.memory.enabled=true  
> index.gateway.type=none  
> gateway.type=none
> 
> # If ES needs to write something, it's here
> 
> path.data=${mytarget}/data  
> path.logs=${mytarget}/logs
> 
> # Index are minimalists by default
> 
> index.number\_of\_shards=1  
> index.number\_of\_replicas=0
> 
> HTH  
> David.
> 
> Le 10 mai 2012 à 17:19, Michal Domagala [outsi...@gmail.com](mailto:outsi...@gmail.com) a écrit :
> 
> > Hello,
> > 
> > I have some integration test of my application. The integration test  
> > starts own Elasticsearch instance by _node =  
> > nodeBuilder().settings(settings).local(true).node();_  
> > and do its job.
> > 
> > However, I have other, running Elasticsearch instance on my computer.  
> > I observed that runnich Elasticsearch instance and integration test  
> > instance establish a connection (because I see IO exception in running  
> > ES log when integration test is terminated)
> > 
> > My question is: how to configure ES for integration test to make sure  
> > it is isolated against any other working ES in my computer/LAN?
> > 
> > I tried settings  
> > _.put("multicast.enabled","false")  
> > .put("discovery.zen.ping.multicast.ping.enabled", "false")_
> > 
> > but without success
> > 
> > best regards  
> > Michal Domagala
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

--

--

---

<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:09am UTC](https://discuss.elastic.co/t/how-to-isolate-elastic-search-node-from-other-nodes/7638/9 "2017-07-06T03:09:55Z")

</div>


