# Shutdown API is equivalent to kill ES PID?

**URL:** <https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159>\
**Category:** Elasticsearch\
**Created:** [March 14, 2013, 4:17pm UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159 "2013-03-14T16:17:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Rodriguez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fernando_rodriguez/32/2438_2.png) [@Fernando\_Rodriguez](https://discuss.elastic.co/u/Fernando_Rodriguez)\
**Post date:** [March 14, 2013, 4:17pm UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159/1 "2013-03-14T16:17:08Z")

</div>

Hi!!  
Recently I had problems with broken indexes after cluster restart (I Think  
that I killed the ES process while it was flushing)

I have a "stop" script (node level) that kill the process and wait for 10s,  
if it is still alive then shutdown it with a kill -9

I'm thinking to increase the waiting time, but also should I use the  
showdown API ? or is the same?

Thank You!!  
Regards,  
Fer

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [March 14, 2013, 7:47pm UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159/2 "2013-03-14T19:47:49Z")

</div>

A kill -9 kills the process without giving the process any notifications  
nor any chance to perform cleanup or continue with an orderly shutdown.

I usually just issue a kill to the PID and let ES come down on its own. I  
haven't had any problems, but I don't hurry it along either.

I currently have 4 indices: One tiny (for testing mappings), one relatively  
small (26K documents), and two very large (96M documents in 5 shards, and  
76M documents in 16 shards). No replicas at this time.

During start-up, I have a waitForYellow with a 5-minute timeout (after  
which it refuses to start subsequent applications), and have never seen it  
fail nor take more than perhaps 10 to 20 seconds.

After a full cycle of erase+create followed by a full bulk-load, there is  
some amount of indexing and flushing that occurs after the bulk-load  
process itself completes. But I'm not interested in shutting it down right  
after bulk-loading, so by the time I do a shutdown via kill it only seems  
to take 3 to 6 seconds before I can start it up again.

If I try to start too soon, it complains about a lock on the data  
directory. So I would just wait a bit more and then it started OK. I'm more  
patient now.

But I've never seen any data loss nor corruption. And there are some  
instances that were originally pre-loaded using ES 19.4, and were  
subsequently queried and updated using ES 19.4, 19.10, and now 20.4. No  
issues at all. Very smooth migration!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Fernando\_Rodriguez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fernando_rodriguez/32/2438_2.png) [@Fernando\_Rodriguez](https://discuss.elastic.co/u/Fernando_Rodriguez)\
**Post date:** [March 15, 2013, 9:48pm UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159/3 "2013-03-15T21:48:51Z")

</div>

ThankYou Brian,

I'll remove the "kill -9", but anyway, Do you know if a simple kill and  
shutdown api do the same?

thanks

2013/3/14 InquiringMind [brian.from.fl@gmail.com](mailto:brian.from.fl@gmail.com)

> A kill -9 kills the process without giving the process any notifications  
> nor any chance to perform cleanup or continue with an orderly shutdown.
> 
> I usually just issue a kill to the PID and let ES come down on its own. I  
> haven't had any problems, but I don't hurry it along either.
> 
> I currently have 4 indices: One tiny (for testing mappings), one  
> relatively small (26K documents), and two very large (96M documents in 5  
> shards, and 76M documents in 16 shards). No replicas at this time.
> 
> During start-up, I have a waitForYellow with a 5-minute timeout (after  
> which it refuses to start subsequent applications), and have never seen it  
> fail nor take more than perhaps 10 to 20 seconds.
> 
> After a full cycle of erase+create followed by a full bulk-load, there is  
> some amount of indexing and flushing that occurs after the bulk-load  
> process itself completes. But I'm not interested in shutting it down right  
> after bulk-loading, so by the time I do a shutdown via kill it only seems  
> to take 3 to 6 seconds before I can start it up again.
> 
> If I try to start too soon, it complains about a lock on the data  
> directory. So I would just wait a bit more and then it started OK. I'm more  
> patient now.
> 
> But I've never seen any data loss nor corruption. And there are some  
> instances that were originally pre-loaded using ES 19.4, and were  
> subsequently queried and updated using ES 19.4, 19.10, and now 20.4. No  
> issues at all. Very smooth migration!
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/NlKLSYOVAN0/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/NlKLSYOVAN0/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 15, 2013, 10:05pm UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159/4 "2013-03-15T22:05:55Z")

</div>

You can use the service wrapper for a clean start/stop script, no need  
to roll your own

> **[GitHub - elastic/elasticsearch-servicewrapper: A service wrapper on top of...](https://github.com/elastic/elasticsearch-servicewrapper)**
>
> A service wrapper on top of elasticsearch. Contribute to elastic/elasticsearch-servicewrapper development by creating an account on GitHub.

Jörg

Am 15.03.13 22:48, schrieb Fernando Rodriguez:

> ThankYou Brian,
> 
> I'll remove the "kill -9", but anyway, Do you know if a simple kill  
> and shutdown api do the same?
> 
> thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:46am UTC](https://discuss.elastic.co/t/shutdown-api-is-equivalent-to-kill-es-pid/11159/5 "2017-07-06T02:46:13Z")

</div>


