# Elasticsearch takes a very long time to stop

**URL:** <https://discuss.elastic.co/t/elasticsearch-takes-a-very-long-time-to-stop/23599>\
**Category:** Elasticsearch\
**Created:** [May 10, 2015, 4:05pm UTC](https://discuss.elastic.co/t/elasticsearch-takes-a-very-long-time-to-stop/23599 "2015-05-10T16:05:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsarkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bsarkar/32/42967_2.png) [@bsarkar](https://discuss.elastic.co/u/bsarkar)\
**Post date:** [May 10, 2015, 4:05pm UTC](https://discuss.elastic.co/t/elasticsearch-takes-a-very-long-time-to-stop/23599/1 "2015-05-10T16:05:30Z")

</div>

We perform rolling upgrades on Elasticsearch cluster in our production  
environment. Current version of Elasticsearch is 1.3.4 and we're running it  
on Windows Server 2012 machines. Rolling upgrade needs each node to be  
stopped one at a time. We use "service.bat stop" to do so. Sometimes this  
operation successfully stops Elasticsearch service quickly but some other  
times, it does not stop for a very long time and we resort to killing the  
process from Task Manager. Obviously this is not the most elegant way to do  
things but we've been getting away with it till now. In Elasticsearch  
documents regarding rolling upgrade, it is mentioned to use Nodes Shutdown  
API  
[http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html)  
to stop Elasticsearch. Apparently both do the same thing but I'm not sure  
about it and hence asking in this forum. Below are some of my queries  
hoping somebody will be able to answer in this group:

1. Do "service.bat stop" and Nodes Shutdown API behave exactly in the  
same way?
2. When "service.bat stop" is stuck for a very long time (more than 30  
minutes), what is the recommended way to do a graceful shutdown or at least  
know the consequences of killing the process from Task Manager?

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 10, 2015, 9:39pm UTC](https://discuss.elastic.co/t/elasticsearch-takes-a-very-long-time-to-stop/23599/2 "2015-05-10T21:39:55Z")

</div>

1. Yes
2. That doesn't sound right, I'd suggest upgrading to 1.5.X and see if  
the problem still exists and then we can go from there. It may mean raising  
an issue on Github to track down a problem.

Though the methods you have listed are the best to stop the process.

PS - We're moving to [https://discuss.elastic.co/](https://discuss.elastic.co/), please join us there for  
any future discussions!

On 11 May 2015 at 02:05, Mouzer [bittusrk@gmail.com](mailto:bittusrk@gmail.com) wrote:

> We perform rolling upgrades on Elasticsearch cluster in our production  
> environment. Current version of Elasticsearch is 1.3.4 and we're running it  
> on Windows Server 2012 machines. Rolling upgrade needs each node to be  
> stopped one at a time. We use "service.bat stop" to do so. Sometimes this  
> operation successfully stops Elasticsearch service quickly but some other  
> times, it does not stop for a very long time and we resort to killing the  
> process from Task Manager. Obviously this is not the most elegant way to do  
> things but we've been getting away with it till now. In Elasticsearch  
> documents regarding rolling upgrade, it is mentioned to use Nodes  
> Shutdown API  
> [http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html)  
> to stop Elasticsearch. Apparently both do the same thing but I'm not sure  
> about it and hence asking in this forum. Below are some of my queries  
> hoping somebody will be able to answer in this group:
> 
> 1. Do "service.bat stop" and Nodes Shutdown API behave exactly in the  
> same way?
> 2. When "service.bat stop" is stuck for a very long time (more than 30  
> minutes), what is the recommended way to do a graceful shutdown or at least  
> know the consequences of killing the process from Task Manager?
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c6f3abcf-c6a7-4a77-b273-bfae73b65013%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-Jze-aoDkhipmBnyiKEu4iWqndgqxqbxDgP1RN1us4ZA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-Jze-aoDkhipmBnyiKEu4iWqndgqxqbxDgP1RN1us4ZA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:14am UTC](https://discuss.elastic.co/t/elasticsearch-takes-a-very-long-time-to-stop/23599/3 "2017-07-06T00:14:44Z")

</div>


