deb.asciidoc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. [[deb]]
  2. === Install Elasticsearch with Debian Package
  3. The Debian package for Elasticsearch can be <<install-rpm,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. The latest stable version of Elasticsearch can be found on the
  7. link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
  8. be found on the link:/downloads/past-releases[Past Releases page].
  9. [[deb-key]]
  10. ==== Import the Elasticsearch PGP Key
  11. include::key.asciidoc[]
  12. [source,sh]
  13. -------------------------
  14. wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  15. -------------------------
  16. [[deb-repo]]
  17. ==== Installing from the APT repository
  18. You may need to install the `apt-transport-https` package on Debian before proceeding:
  19. [source,sh]
  20. --------------------------------------------------
  21. sudo apt-get install apt-transport-https
  22. --------------------------------------------------
  23. Save the repository definition to +/etc/apt/sources.list.d/elasticsearch-{major-version}.list+:
  24. ["source","sh",subs="attributes,callouts"]
  25. --------------------------------------------------
  26. echo "deb https://packages.elastic.co/elasticsearch/{major-version}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-{major-version}.list
  27. --------------------------------------------------
  28. [WARNING]
  29. ==================================================
  30. Do not use `add-apt-repository` as it will add a `deb-src` entry as well, but
  31. we do not provide a source package. If you have added the `deb-src` entry, you
  32. will see an error like the following:
  33. Unable to find expected entry 'main/source/Sources' in Release file
  34. (Wrong sources.list entry or malformed file)
  35. Delete the `deb-src` entry from the `/etc/apt/sources.list` file and the
  36. installation should work as expected.
  37. ==================================================
  38. You can install the Elasticsearch Debian package with:
  39. [source,sh]
  40. --------------------------------------------------
  41. sudo apt-get update && sudo apt-get install elasticsearch
  42. --------------------------------------------------
  43. [WARNING]
  44. ==================================================
  45. If two entries exist for the same Elasticsearch repository, you will see an error like this during `apt-get update`:
  46. ["literal",subs="attributes,callouts"]
  47. Duplicate sources.list entry https://packages.elastic.co/elasticsearch/{major-version}/debian/ ...`
  48. 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.
  49. ==================================================
  50. [[install-deb]]
  51. ==== Download and install the Debian package manually
  52. The Debian package for Elastisearch v{version} can be downloaded from the website and installed as follows:
  53. ["source","sh",subs="attributes"]
  54. --------------------------------------------
  55. wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/{version}/elasticsearch-{version}.deb
  56. sha1sum elasticsearch-{version}.deb <1>
  57. sudo dpkg -i elasticsearch-{version}.deb
  58. --------------------------------------------
  59. <1> Compare the SHA produced by `sha1sum` or `shasum` with the
  60. https://download.elastics.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/{version}/elasticsearch-{version}.deb.sha1[published SHA].
  61. include::init-systemd.asciidoc[]
  62. [[deb-running-init]]
  63. ==== Running Elasticsearch with SysV `init`
  64. Use the `update-rc.d` command to configure Elasticsearch to start automatically
  65. when the system boots up:
  66. [source,sh]
  67. --------------------------------------------------
  68. sudo update-rc.d elasticsearch defaults 95 10
  69. --------------------------------------------------
  70. Elasticsearch can be started and stopped using the `service` command:
  71. [source,sh]
  72. --------------------------------------------
  73. sudo -i service elasticsearch start
  74. sudo -i service elasticsearch stop
  75. --------------------------------------------
  76. If Elasticsearch fails to start for any reason, it will print the reason for
  77. failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
  78. [[deb-running-systemd]]
  79. include::systemd.asciidoc[]
  80. [[deb-check-running]]
  81. include::check-running.asciidoc[]
  82. [[deb-configuring]]
  83. ==== Configuring Elasticsearch
  84. Elasticsearch loads its configuration from the `/etc/elasticsearch/elasticsearch.yml`
  85. file by default. The format of this config file is explained in
  86. <<settings>>.
  87. The Debian package also has a system configuration file (`/etc/default/elasticsearch`),
  88. which allows you to set the following parameters:
  89. include::sysconfig-file.asciidoc[]
  90. NOTE: Distributions that use `systemd` require that system resource limits be
  91. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  92. file. See <<systemd>> for more information.
  93. [[deb-layout]]
  94. ==== Directory layout of Debian package
  95. The Debian package places config files, logs, and the data directory in the appropriate
  96. locations for a Debian-based system:
  97. [cols="<h,<,<m,<m",options="header",]
  98. |=======================================================================
  99. | Type | Description | Default Location | Setting
  100. | home
  101. | Elasticsearch home directory or `$ES_HOME`
  102. | /usr/share/elasticsearch
  103. d|
  104. | bin
  105. | Binary scripts including `elasticsearch` to start a node
  106. and `elasticsearch-plugin` to install plugins
  107. | /usr/share/elasticsearch/bin
  108. d|
  109. | conf
  110. | Configuration files including `elasticsearch.yml`
  111. | /etc/elasticsearch
  112. | path.conf
  113. | conf
  114. | Environment variables including heap size, file descriptors.
  115. | /etc/default/elasticsearch
  116. d|
  117. | data
  118. | The location of the data files of each index / shard allocated
  119. on the node. Can hold multiple locations.
  120. | /var/lib/elasticsearch
  121. | path.data
  122. | logs
  123. | Log files location.
  124. | /var/logs/elasticsearch
  125. | path.logs
  126. | plugins
  127. | Plugin files location. Each plugin will be contained in a subdirectory.
  128. | /usr/share/elasticsearch/plugins
  129. | path.plugins
  130. | repo
  131. | 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.
  132. d| Not configured
  133. | path.repo
  134. | script
  135. | Location of script files.
  136. | /etc/elasticsearch/scripts
  137. | path.script
  138. |=======================================================================
  139. include::next-steps.asciidoc[]