zip-targz.asciidoc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. ifdef::include-xpack[]
  52. [[zip-targz-enable-indices]]
  53. ==== Enable automatic creation of {xpack} indices
  54. {xpack} will try to automatically create a number of indices within {es}.
  55. include::{xes-repo-dir}/setup/xpack-indices.asciidoc[]
  56. endif::include-xpack[]
  57. [[zip-targz-running]]
  58. ==== Running Elasticsearch from the command line
  59. Elasticsearch can be started from the command line as follows:
  60. [source,sh]
  61. --------------------------------------------
  62. ./bin/elasticsearch
  63. --------------------------------------------
  64. By default, Elasticsearch runs in the foreground, prints its logs to the
  65. standard output (`stdout`), and can be stopped by pressing `Ctrl-C`.
  66. NOTE: All scripts packaged with Elasticsearch require a version of Bash
  67. that supports arrays and assume that Bash is available at `/bin/bash`.
  68. As such, Bash should be available at this path either directly or via a
  69. symbolic link.
  70. include::check-running.asciidoc[]
  71. Log printing to `stdout` can be disabled using the `-q` or `--quiet`
  72. option on the command line.
  73. [[setup-installation-daemon]]
  74. ==== Running as a daemon
  75. To run Elasticsearch as a daemon, specify `-d` on the command line, and record
  76. the process ID in a file using the `-p` option:
  77. [source,sh]
  78. --------------------------------------------
  79. ./bin/elasticsearch -d -p pid
  80. --------------------------------------------
  81. Log messages can be found in the `$ES_HOME/logs/` directory.
  82. To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
  83. [source,sh]
  84. --------------------------------------------
  85. kill `cat pid`
  86. --------------------------------------------
  87. NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
  88. packages take care of starting and stopping the Elasticsearch process for you.
  89. [[zip-targz-configuring]]
  90. ==== Configuring Elasticsearch on the command line
  91. Elasticsearch loads its configuration from the `$ES_HOME/config/elasticsearch.yml`
  92. file by default. The format of this config file is explained in
  93. <<settings>>.
  94. Any settings that can be specified in the config file can also be specified on
  95. the command line, using the `-E` syntax as follows:
  96. [source,sh]
  97. --------------------------------------------
  98. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
  99. --------------------------------------------
  100. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  101. added to the `elasticsearch.yml` config file, while any node-specific settings
  102. such as `node.name` could be specified on the command line.
  103. [[zip-targz-layout]]
  104. ==== Directory layout of `.zip` and `.tar.gz` archives
  105. The `.zip` and `.tar.gz` packages are entirely self-contained. All files and
  106. directories are, by default, contained within `$ES_HOME` -- the directory
  107. created when unpacking the archive.
  108. This is very convenient because you don't have to create any directories to
  109. start using Elasticsearch, and uninstalling Elasticsearch is as easy as
  110. removing the `$ES_HOME` directory. However, it is advisable to change the
  111. default locations of the config directory, the data directory, and the logs
  112. directory so that you do not delete important data later on.
  113. [cols="<h,<,<m,<m",options="header",]
  114. |=======================================================================
  115. | Type | Description | Default Location | Setting
  116. | home
  117. | Elasticsearch home directory or `$ES_HOME`
  118. d| Directory created by unpacking the archive
  119. |
  120. | bin
  121. | Binary scripts including `elasticsearch` to start a node
  122. and `elasticsearch-plugin` to install plugins
  123. | $ES_HOME/bin
  124. d|
  125. | conf
  126. | Configuration files including `elasticsearch.yml`
  127. | $ES_HOME/config
  128. | <<config-files-location,ES_PATH_CONF>>
  129. | data
  130. | The location of the data files of each index / shard allocated
  131. on the node. Can hold multiple locations.
  132. | $ES_HOME/data
  133. | path.data
  134. | logs
  135. | Log files location.
  136. | $ES_HOME/logs
  137. | path.logs
  138. | plugins
  139. | Plugin files location. Each plugin will be contained in a subdirectory.
  140. | $ES_HOME/plugins
  141. |
  142. | repo
  143. | 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.
  144. d| Not configured
  145. | path.repo
  146. | script
  147. | Location of script files.
  148. | $ES_HOME/scripts
  149. | path.scripts
  150. |=======================================================================
  151. include::next-steps.asciidoc[]