# Can't re-open nodes

**URL:** <https://discuss.elastic.co/t/cant-re-open-nodes/6612>\
**Category:** Elasticsearch\
**Created:** [February 7, 2012, 4:43am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612 "2012-02-07T04:43:55Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [February 7, 2012, 4:43am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/1 "2012-02-07T04:43:55Z")

</div>

I run elasticsearch embedded. It's started like so:

node = NodeBuilder.nodeBuilder().node();  
client = node.client();  
client.admin().cluster().prepareHealth()  
.setWaitForYellowStatus()  
.setTimeout("60s").execute().actionGet();

...and shut down like so:

client.close();  
node.close();

If I close and re-open without shutting down the application, I either  
get a "failed to bind error":

19:17:19,216 INFO ~ Closing node...  
19:17:19,217 INFO ~ [Machine Teen] {0.18.7}[3880]: stopping ...  
19:17:19,319 INFO ~ [Machine Teen] {0.18.7}[3880]: stopped  
19:17:19,319 INFO ~ [Machine Teen] {0.18.7}[3880]: closing ...  
19:17:19,330 INFO ~ [Machine Teen] {0.18.7}[3880]: closed

19:17:19,576 INFO ~ Starting node...  
19:17:19,581 INFO ~ [Bob] {0.18.7}[3880]: initializing ...  
19:17:19,582 INFO ~ [Bob] loaded [], sites []  
19:17:19,738 INFO ~ [Bob] {0.18.7}[3880]: initialized  
19:17:19,738 INFO ~ [Bob] {0.18.7}[3880]: starting ...  
19:17:19,855 ERROR ~

Caused by: org.elasticsearch.transport.BindTransportException: Failed  
to bind to [9300-9400]  
at  
org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:  
308)  
at  
org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:  
80)  
at  
org.elasticsearch.transport.TransportService.doStart(TransportService.java:  
89)  
at  
org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:  
80)  
at  
org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:  
185)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:  
166)  
...

...or a new node is created (elasticsearch/nodes/$n) and previously  
indexed data is no longer visible.

When I shut down the application and restart, the node is in RED state  
for a while. Is that normal, or does that indicate that the shutdown  
wasn't quite complete?

---

<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:** [February 7, 2012, 10:33am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/2 "2012-02-07T10:33:24Z")

</div>

Thats strange…, when you close the node, then will no longer hold any resources. Whats more strange is that even if you did not close the node properly, another node can be started while the other one is still live (so it will use a new port, between 9300-9400, for example, 9301).

What is this application? Where does it run? If you start a simple main app, and run it, can you start / close / start nodes without problems?

On Tuesday, February 7, 2012 at 6:43 AM, Eric Jain wrote:

> I run elasticsearch embedded. It's started like so:
> 
> node = NodeBuilder.nodeBuilder().node();  
> client = node.client();  
> client.admin().cluster().prepareHealth()  
> .setWaitForYellowStatus()  
> .setTimeout("60s").execute().actionGet();
> 
> ...and shut down like so:
> 
> client.close();  
> node.close();
> 
> If I close and re-open without shutting down the application, I either  
> get a "failed to bind error":
> 
> 19:17:19,216 INFO ~ Closing node...  
> 19:17:19,217 INFO ~ [Machine Teen] {0.18.7}[3880]: stopping ...  
> 19:17:19,319 INFO ~ [Machine Teen] {0.18.7}[3880]: stopped  
> 19:17:19,319 INFO ~ [Machine Teen] {0.18.7}[3880]: closing ...  
> 19:17:19,330 INFO ~ [Machine Teen] {0.18.7}[3880]: closed
> 
> 19:17:19,576 INFO ~ Starting node...  
> 19:17:19,581 INFO ~ [Bob] {0.18.7}[3880]: initializing ...  
> 19:17:19,582 INFO ~ [Bob] loaded , sites   
> 19:17:19,738 INFO ~ [Bob] {0.18.7}[3880]: initialized  
> 19:17:19,738 INFO ~ [Bob] {0.18.7}[3880]: starting ...  
> 19:17:19,855 ERROR ~
> 
> Caused by: org.elasticsearch.transport.BindTransportException: Failed  
> to bind to [9300-9400]  
> at  
> org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:  
> 308)  
> at  
> org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:  
> 80)  
> at  
> org.elasticsearch.transport.TransportService.doStart(TransportService.java:  
> 89)  
> at  
> org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:  
> 80)  
> at  
> org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:  
> 185)  
> at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:  
> 166)  
> ...
> 
> ...or a new node is created (elasticsearch/nodes/$n) and previously  
> indexed data is no longer visible.
> 
> When I shut down the application and restart, the node is in RED state  
> for a while. Is that normal, or does that indicate that the shutdown  
> wasn't quite complete?

---

<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:** [February 8, 2012, 4:18am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/3 "2012-02-08T04:18:57Z")

</div>

On Tue, Feb 7, 2012 at 02:33, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Thats strange…, when you close the node, then will no longer hold any  
> resources. Whats more strange is that even if you did not close the node  
> properly, another node can be started while the other one is still live (so  
> it will use a new port, between 9300-9400, for example, 9301).
> 
> What is this application? Where does it run? If you start a simple main app,  
> and run it, can you start / close / start nodes without problems?

Looks like this happens when running elasticsearch in a Play  
application, when classes are automatically reloaded (in "dev" mode).

---

<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:** [February 9, 2012, 7:09am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/4 "2012-02-09T07:09:26Z")

</div>

Sorry…, don't know how it works … . You can try and debug it maybe?

On Wednesday, February 8, 2012 at 6:18 AM, Eric Jain wrote:

> On Tue, Feb 7, 2012 at 02:33, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > Thats strange…, when you close the node, then will no longer hold any  
> > resources. Whats more strange is that even if you did not close the node  
> > properly, another node can be started while the other one is still live (so  
> > it will use a new port, between 9300-9400, for example, 9301).
> > 
> > What is this application? Where does it run? If you start a simple main app,  
> > and run it, can you start / close / start nodes without problems?
> 
> Looks like this happens when running elasticsearch in a Play  
> application, when classes are automatically reloaded (in "dev" mode).

---

<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:** [February 10, 2012, 4:12am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/5 "2012-02-10T04:12:22Z")

</div>

On Wed, Feb 8, 2012 at 23:09, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Sorry…, don't know how it works … . You can try and debug it maybe?

I'm not sure how this works myself. In any case, I haven't been able  
to reproduce this problem for a while.

---

<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:39am UTC](https://discuss.elastic.co/t/cant-re-open-nodes/6612/6 "2017-07-06T03:39:55Z")

</div>

Closed on July 6, 2017, 3:39am UTC


