zip-targz.asciidoc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. [[zip-targz]]
  2. === Install Elasticsearch with `.zip` or `.tar.gz`
  3. Elasticsearch is provided as a `.zip` and as a `.tar.gz` package. These
  4. packages can be used to install Elasticsearch on any system and are the
  5. easiest package format to use when trying out Elasticsearch.
  6. The latest stable version of Elasticsearch can be found on the
  7. link:/downloads/elasticsearch[Download Elasticsearch] page.
  8. Other versions can be found on the
  9. link:/downloads/past-releases[Past Releases page].
  10. NOTE: Elasticsearch requires Java 8 or later. Use the
  11. http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution]
  12. or an open-source distribution such as http://openjdk.java.net[OpenJDK].
  13. [[install-zip]]
  14. ==== Download and install the `.zip` package
  15. ifeval::["{release-state}"=="unreleased"]
  16. Version {version} of Elasticsearch has not yet been released.
  17. endif::[]
  18. ifeval::["{release-state}"!="unreleased"]
  19. The `.zip` archive for Elasticsearch v{version} can be downloaded and installed as follows:
  20. ["source","sh",subs="attributes"]
  21. --------------------------------------------
  22. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip
  23. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip.sha512
  24. shasum -a 512 -c elasticsearch-{version}.zip.sha512 <1>
  25. unzip elasticsearch-{version}.zip
  26. cd elasticsearch-{version}/ <2>
  27. --------------------------------------------
  28. <1> Compares the SHA of the downloaded `.zip` archive and the published checksum, which should output
  29. `elasticsearch-{version}.zip: OK`.
  30. <2> This directory is known as `$ES_HOME`.
  31. endif::[]
  32. [[install-targz]]
  33. ==== Download and install the `.tar.gz` package
  34. ifeval::["{release-state}"=="unreleased"]
  35. Version {version} of Elasticsearch has not yet been released.
  36. endif::[]
  37. ifeval::["{release-state}"!="unreleased"]
  38. The `.tar.gz` archive for Elasticsearch v{version} can be downloaded and installed as follows:
  39. ["source","sh",subs="attributes"]
  40. --------------------------------------------
  41. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz
  42. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz.sha512
  43. shasum -a 512 -c elasticsearch-{version}.tar.gz.sha512 <1>
  44. tar -xzf elasticsearch-{version}.tar.gz
  45. cd elasticsearch-{version}/ <2>
  46. --------------------------------------------
  47. <1> Compares the SHA of the downloaded `.tar.gz` archive and the published checksum, which should output
  48. `elasticsearch-{version}.tar.gz: OK`.
  49. <2> This directory is known as `$ES_HOME`.
  50. endif::[]
  51. [[zip-targz-running]]
  52. ==== Running Elasticsearch from the command line
  53. Elasticsearch can be started from the command line as follows:
  54. [source,sh]
  55. --------------------------------------------
  56. ./bin/elasticsearch
  57. --------------------------------------------
  58. By default, Elasticsearch runs in the foreground, prints its logs to the
  59. standard output (`stdout`), and can be stopped by pressing `Ctrl-C`.
  60. NOTE: All scripts packaged with Elasticsearch require a version of Bash
  61. that supports arrays and assume that Bash is available at `/bin/bash`.
  62. As such, Bash should be available at this path either directly or via a
  63. symbolic link.
  64. include::check-running.asciidoc[]
  65. Log printing to `stdout` can be disabled using the `-q` or `--quiet`
  66. option on the command line.
  67. [[setup-installation-daemon]]
  68. ==== Running as a daemon
  69. To run Elasticsearch as a daemon, specify `-d` on the command line, and record
  70. the process ID in a file using the `-p` option:
  71. [source,sh]
  72. --------------------------------------------
  73. ./bin/elasticsearch -d -p pid
  74. --------------------------------------------
  75. Log messages can be found in the `$ES_HOME/logs/` directory.
  76. To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
  77. [source,sh]
  78. --------------------------------------------
  79. kill `cat pid`
  80. --------------------------------------------
  81. NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
  82. packages take care of starting and stopping the Elasticsearch process for you.
  83. [[zip-targz-configuring]]
  84. ==== Configuring Elasticsearch on the command line
  85. Elasticsearch loads its configuration from the `$ES_HOME/config/elasticsearch.yml`
  86. file by default. The format of this config file is explained in
  87. <<settings>>.
  88. Any settings that can be specified in the config file can also be specified on
  89. the command line, using the `-E` syntax as follows:
  90. [source,sh]
  91. --------------------------------------------
  92. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
  93. --------------------------------------------
  94. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  95. added to the `elasticsearch.yml` config file, while any node-specific settings
  96. such as `node.name` could be specified on the command line.
  97. [[zip-targz-layout]]
  98. ==== Directory layout of `.zip` and `.tar.gz` archives
  99. The `.zip` and `.tar.gz` packages are entirely self-contained. All files and
  100. directories are, by default, contained within `$ES_HOME` -- the directory
  101. created when unpacking the archive.
  102. This is very convenient because you don't have to create any directories to
  103. start using Elasticsearch, and uninstalling Elasticsearch is as easy as
  104. removing the `$ES_HOME` directory. However, it is advisable to change the
  105. default locations of the config directory, the data directory, and the logs
  106. directory so that you do not delete important data later on.
  107. [cols="<h,<,<m,<m",options="header",]
  108. |=======================================================================
  109. | Type | Description | Default Location | Setting
  110. | home
  111. | Elasticsearch home directory or `$ES_HOME`
  112. d| Directory created by unpacking the archive
  113. |
  114. | bin
  115. | Binary scripts including `elasticsearch` to start a node
  116. and `elasticsearch-plugin` to install plugins
  117. | $ES_HOME/bin
  118. d|
  119. | conf
  120. | Configuration files including `elasticsearch.yml`
  121. | $ES_HOME/config
  122. | <<config-files-location,ES_PATH_CONF>>
  123. | data
  124. | The location of the data files of each index / shard allocated
  125. on the node. Can hold multiple locations.
  126. | $ES_HOME/data
  127. | path.data
  128. | logs
  129. | Log files location.
  130. | $ES_HOME/logs
  131. | path.logs
  132. | plugins
  133. | Plugin files location. Each plugin will be contained in a subdirectory.
  134. | $ES_HOME/plugins
  135. |
  136. | repo
  137. | Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here.
  138. d| Not configured
  139. | path.repo
  140. | script
  141. | Location of script files.
  142. | $ES_HOME/scripts
  143. | path.scripts
  144. |=======================================================================
  145. include::next-steps.asciidoc[]