deb.asciidoc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. [[deb]]
  2. === Install Elasticsearch with Debian Package
  3. The Debian package for Elasticsearch can be <<install-deb,downloaded from our website>>
  4. or from our <<deb-repo,APT repository>>. It can be used to install
  5. Elasticsearch on any Debian-based system such as Debian and Ubuntu.
  6. include::license.asciidoc[]
  7. The latest stable version of Elasticsearch can be found on the
  8. link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
  9. be found on the link:/downloads/past-releases[Past Releases page].
  10. NOTE: Elasticsearch includes a bundled version of http://openjdk.java.net[OpenJDK]
  11. from the JDK maintainers (GPLv2+CE). To use your own version of Java,
  12. see the <<jvm-version, JVM version requirements>>
  13. [[deb-key]]
  14. ==== Import the Elasticsearch PGP Key
  15. include::key.asciidoc[]
  16. [source,sh]
  17. -------------------------
  18. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  19. -------------------------
  20. [[deb-repo]]
  21. ==== Installing from the APT repository
  22. ifeval::["{release-state}"=="unreleased"]
  23. Version {version} of Elasticsearch has not yet been released.
  24. endif::[]
  25. ifeval::["{release-state}"!="unreleased"]
  26. You may need to install the `apt-transport-https` package on Debian before proceeding:
  27. [source,sh]
  28. --------------------------------------------------
  29. sudo apt-get install apt-transport-https
  30. --------------------------------------------------
  31. Save the repository definition to +/etc/apt/sources.list.d/elastic-{major-version}.list+:
  32. ifeval::["{release-state}"=="released"]
  33. ["source","sh",subs="attributes,callouts"]
  34. --------------------------------------------------
  35. echo "deb https://artifacts.elastic.co/packages/{major-version}/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-{major-version}.list
  36. --------------------------------------------------
  37. endif::[]
  38. ifeval::["{release-state}"=="prerelease"]
  39. ["source","sh",subs="attributes,callouts"]
  40. --------------------------------------------------
  41. echo "deb https://artifacts.elastic.co/packages/{major-version}-prerelease/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-{major-version}.list
  42. --------------------------------------------------
  43. endif::[]
  44. [NOTE]
  45. ==================================================
  46. These instructions do not use `add-apt-repository` for several reasons:
  47. . `add-apt-repository` adds entries to the system `/etc/apt/sources.list` file
  48. rather than a clean per-repository file in `/etc/apt/sources.list.d`
  49. . `add-apt-repository` is not part of the default install on many distributions
  50. and requires a number of non-default dependencies.
  51. . Older versions of `add-apt-repository` always add a `deb-src` entry which
  52. will cause errors because we do not provide a source package. If you have added
  53. the `deb-src` entry, you will see an error like the following until you delete
  54. the `deb-src` line:
  55. Unable to find expected entry 'main/source/Sources' in Release file
  56. (Wrong sources.list entry or malformed file)
  57. ==================================================
  58. You can install the Elasticsearch Debian package with:
  59. [source,sh]
  60. --------------------------------------------------
  61. sudo apt-get update && sudo apt-get install elasticsearch
  62. --------------------------------------------------
  63. [WARNING]
  64. ==================================================
  65. If two entries exist for the same Elasticsearch repository, you will see an error like this during `apt-get update`:
  66. ["literal",subs="attributes,callouts"]
  67. Duplicate sources.list entry https://artifacts.elastic.co/packages/{major-version}/apt/ ...`
  68. Examine +/etc/apt/sources.list.d/elasticsearch-{major-version}.list+ for the duplicate entry or locate the duplicate entry amongst the files in `/etc/apt/sources.list.d/` and the `/etc/apt/sources.list` file.
  69. ==================================================
  70. endif::[]
  71. include::skip-set-kernel-parameters.asciidoc[]
  72. ifeval::["{release-state}"!="unreleased"]
  73. [NOTE]
  74. ==================================================
  75. An alternative package which contains only features that are available under the
  76. Apache 2.0 license is also available. To install it, use the following sources list:
  77. ifeval::["{release-state}"=="prerelease"]
  78. ["source","sh",subs="attributes,callouts"]
  79. --------------------------------------------------
  80. echo "deb https://artifacts.elastic.co/packages/oss-{major-version}-prerelease/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-{major-version}.list
  81. --------------------------------------------------
  82. endif::[]
  83. ifeval::["{release-state}"!="prerelease"]
  84. ["source","sh",subs="attributes,callouts"]
  85. --------------------------------------------------
  86. echo "deb https://artifacts.elastic.co/packages/oss-{major-version}/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-{major-version}.list
  87. --------------------------------------------------
  88. endif::[]
  89. ==================================================
  90. endif::[]
  91. [[install-deb]]
  92. ==== Download and install the Debian package manually
  93. ifeval::["{release-state}"=="unreleased"]
  94. Version {version} of Elasticsearch has not yet been released.
  95. endif::[]
  96. ifeval::["{release-state}"!="unreleased"]
  97. The Debian package for Elasticsearch v{version} can be downloaded from the website and installed as follows:
  98. ["source","sh",subs="attributes"]
  99. --------------------------------------------
  100. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-amd64.deb
  101. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-amd64.deb.sha512
  102. shasum -a 512 -c elasticsearch-{version}-amd64.deb.sha512 <1>
  103. sudo dpkg -i elasticsearch-{version}-amd64.deb
  104. --------------------------------------------
  105. <1> Compares the SHA of the downloaded Debian package and the published checksum, which should output
  106. `elasticsearch-{version}-amd64.deb: OK`.
  107. Alternatively, you can download the following package, which contains only
  108. features that are available under the Apache 2.0 license:
  109. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}-amd64.deb
  110. endif::[]
  111. ifdef::include-xpack[]
  112. [[deb-enable-indices]]
  113. ==== Enable automatic creation of {xpack} indices
  114. {xpack} will try to automatically create a number of indices within Elasticsearch.
  115. include::xpack-indices.asciidoc[]
  116. endif::include-xpack[]
  117. [[deb-sysv-init-vs-systemd]]
  118. ==== SysV `init` vs `systemd`
  119. include::init-systemd.asciidoc[]
  120. [[deb-running-init]]
  121. include::deb-init.asciidoc[]
  122. [[deb-running-systemd]]
  123. include::systemd.asciidoc[]
  124. [[deb-check-running]]
  125. include::check-running.asciidoc[]
  126. [[deb-configuring]]
  127. ==== Configuring Elasticsearch
  128. include::etc-elasticsearch.asciidoc[]
  129. The Debian package also has a system configuration file (`/etc/default/elasticsearch`),
  130. which allows you to set the following parameters:
  131. include::sysconfig-file.asciidoc[]
  132. NOTE: Distributions that use `systemd` require that system resource limits be
  133. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  134. file. See <<systemd>> for more information.
  135. [[deb-layout]]
  136. ==== Directory layout of Debian package
  137. The Debian package places config files, logs, and the data directory in the appropriate
  138. locations for a Debian-based system:
  139. [cols="<h,<,<m,<m",options="header",]
  140. |=======================================================================
  141. | Type | Description | Default Location | Setting
  142. | home
  143. | Elasticsearch home directory or `$ES_HOME`
  144. | /usr/share/elasticsearch
  145. d|
  146. | bin
  147. | Binary scripts including `elasticsearch` to start a node
  148. and `elasticsearch-plugin` to install plugins
  149. | /usr/share/elasticsearch/bin
  150. d|
  151. | conf
  152. | Configuration files including `elasticsearch.yml`
  153. | /etc/elasticsearch
  154. | <<config-files-location,ES_PATH_CONF>>
  155. | conf
  156. | Environment variables including heap size, file descriptors.
  157. | /etc/default/elasticsearch
  158. d|
  159. | data
  160. | The location of the data files of each index / shard allocated
  161. on the node. Can hold multiple locations.
  162. | /var/lib/elasticsearch
  163. | path.data
  164. | logs
  165. | Log files location.
  166. | /var/log/elasticsearch
  167. | path.logs
  168. | plugins
  169. | Plugin files location. Each plugin will be contained in a subdirectory.
  170. | /usr/share/elasticsearch/plugins
  171. |
  172. | repo
  173. | 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.
  174. d| Not configured
  175. | path.repo
  176. |=======================================================================
  177. include::next-steps.asciidoc[]