setup.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. [[setup]]
  2. = Setup
  3. [partintro]
  4. --
  5. This section includes information on how to setup *elasticsearch* and
  6. get it running. If you haven't already, http://www.elastic.co/downloads[download] it, and
  7. then check the <<setup-installation,installation>> docs.
  8. NOTE: Elasticsearch can also be installed from our repositories using `apt` or `yum`.
  9. See <<setup-repositories>>.
  10. [[setup-installation]]
  11. [float]
  12. == Installation
  13. After link:/downloads/elasticsearch[downloading] the latest release and extracting it,
  14. *elasticsearch* can be started using:
  15. [source,sh]
  16. --------------------------------------------------
  17. $ bin/elasticsearch
  18. --------------------------------------------------
  19. On *nix systems, the command will start the process in the foreground.
  20. [[setup-installation-daemon]]
  21. [float]
  22. === Running as a daemon
  23. To run it in the background, add the `-d` switch to it:
  24. [source,sh]
  25. --------------------------------------------------
  26. $ bin/elasticsearch -d
  27. --------------------------------------------------
  28. [[setup-installation-pid]]
  29. [float]
  30. === PID
  31. The Elasticsearch process can write its PID to a specified file on startup,
  32. making it easy to shut down the process later on:
  33. [source,sh]
  34. --------------------------------------------------
  35. $ bin/elasticsearch -d -p pid <1>
  36. $ kill `cat pid` <2>
  37. --------------------------------------------------
  38. <1> The PID is written to a file called `pid`.
  39. <2> The `kill` command sends a `TERM` signal to the PID stored in the `pid` file.
  40. NOTE: The startup scripts provided for <<setup-service,Linux>> and <<setup-service-win,Windows>>
  41. take care of starting and stopping the Elasticsearch process for you.
  42. .*NIX
  43. *************************************************************************
  44. There are added features when using the `elasticsearch` shell script.
  45. The first, which was explained earlier, is the ability to easily run the
  46. process either in the foreground or the background.
  47. Another feature is the ability to pass `-D` or getopt long style
  48. configuration parameters directly to the script. When set, all override
  49. anything set using either `JAVA_OPTS` or `ES_JAVA_OPTS`. For example:
  50. [source,sh]
  51. --------------------------------------------------
  52. $ bin/elasticsearch -Des.index.refresh_interval=5s --node.name=my-node
  53. --------------------------------------------------
  54. *************************************************************************
  55. [float]
  56. [[jvm-version]]
  57. == Java (JVM) version
  58. Elasticsearch is built using Java, and requires at least
  59. http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java 7] in
  60. order to run. Only Oracle's Java and the OpenJDK are supported. The same JVM
  61. version should be used on all Elasticsearch nodes and clients.
  62. We recommend installing the *Java 8 update 20 or later*, or *Java 7 update 55
  63. or later*. Previous versions of Java 7 are known to have bugs that can cause
  64. index corruption and data loss. Elasticsearch will refuse to start if a
  65. known-bad version of Java is used.
  66. The version of Java to use can be configured by setting the `JAVA_HOME`
  67. environment variable.
  68. --
  69. include::setup/configuration.asciidoc[]
  70. include::setup/as-a-service.asciidoc[]
  71. include::setup/as-a-service-win.asciidoc[]
  72. include::setup/dir-layout.asciidoc[]
  73. include::setup/repositories.asciidoc[]
  74. include::setup/upgrade.asciidoc[]