zip-targz.asciidoc 7.2 KB

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