stopping.asciidoc 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [[stopping-elasticsearch]]
  2. == Stopping Elasticsearch
  3. An orderly shutdown of Elasticsearch ensures that Elasticsearch has a chance to cleanup and close
  4. outstanding resources. For example, a node that is shutdown in an orderly fashion will remove itself
  5. from the cluster, sync translogs to disk, and perform other related cleanup activities. You can help
  6. ensure an orderly shutdown by properly stopping Elasticsearch.
  7. If you're running Elasticsearch as a service, you can stop Elasticsearch via the service management
  8. functionality provided by your installation.
  9. If you're running Elasticsearch directly, you can stop Elasticsearch by sending control-C if you're
  10. running Elasticsearch in the console, or by sending `SIGTERM` to the Elasticsearch process on a
  11. POSIX system. You can obtain the PID to send the signal to via various tools (e.g., `ps` or `jps`):
  12. [source,sh]
  13. --------------------------------------------------
  14. $ jps | grep Elasticsearch
  15. 14542 Elasticsearch
  16. --------------------------------------------------
  17. From the Elasticsearch startup logs:
  18. [source,sh]
  19. --------------------------------------------------
  20. [2016-07-07 12:26:18,908][INFO ][node ] [I8hydUG] version[5.0.0-alpha4], pid[15399], build[3f5b994/2016-06-27T16:23:46.861Z], OS[Mac OS X/10.11.5/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_92/25.92-b14]
  21. --------------------------------------------------
  22. Or by specifying a location to write a PID file to on startup (`-p <path>`):
  23. [source,sh]
  24. --------------------------------------------------
  25. $ ./bin/elasticsearch -p /tmp/elasticsearch-pid -d
  26. $ cat /tmp/elasticsearch-pid && echo
  27. 15516
  28. $ kill -SIGTERM 15516
  29. --------------------------------------------------
  30. [discrete]
  31. [[fatal-errors]]
  32. === Stopping on Fatal Errors
  33. During the life of the Elasticsearch virtual machine, certain fatal errors could arise that put the
  34. virtual machine in a questionable state. Such fatal errors include out of memory errors, internal
  35. errors in virtual machine, and serious I/O errors.
  36. When Elasticsearch detects that the virtual machine has encountered such a fatal error Elasticsearch
  37. will attempt to log the error and then will halt the virtual machine. When Elasticsearch initiates
  38. such a shutdown, it does not go through an orderly shutdown as described above. The Elasticsearch
  39. process will also return with a special status code indicating the nature of the error.
  40. [horizontal]
  41. JVM internal error:: 128
  42. Out of memory error:: 127
  43. Stack overflow error:: 126
  44. Unknown virtual machine error:: 125
  45. Serious I/O error:: 124
  46. Unknown fatal error:: 1