rpm.asciidoc 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. [[rpm]]
  2. === Install Elasticsearch with RPM
  3. The RPM for Elasticsearch can be <<install-rpm,downloaded from our website>>
  4. or from our <<rpm-repo,RPM repository>>. It can be used to install
  5. Elasticsearch on any RPM-based system such as OpenSuSE, SLES, Centos, Red Hat,
  6. and Oracle Enterprise.
  7. NOTE: RPM install is not supported on distributions with old versions of RPM,
  8. such as SLES 11 and CentOS 5. Please see <<targz>> instead.
  9. include::license.asciidoc[]
  10. The latest stable version of Elasticsearch can be found on the
  11. link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
  12. be found on the link:/downloads/past-releases[Past Releases page].
  13. NOTE: Elasticsearch includes a bundled version of http://openjdk.java.net[OpenJDK]
  14. from the JDK maintainers (GPLv2+CE). To use your own version of Java,
  15. see the <<jvm-version, JVM version requirements>>
  16. [[rpm-key]]
  17. ==== Import the Elasticsearch PGP Key
  18. include::key.asciidoc[]
  19. [source,sh]
  20. -------------------------
  21. rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  22. -------------------------
  23. [[rpm-repo]]
  24. ==== Installing from the RPM repository
  25. ifeval::["{release-state}"=="unreleased"]
  26. Version {version} of Elasticsearch has not yet been released.
  27. endif::[]
  28. ifeval::["{release-state}"!="unreleased"]
  29. Create a file called `elasticsearch.repo` in the `/etc/yum.repos.d/` directory
  30. for RedHat based distributions, or in the `/etc/zypp/repos.d/` directory for
  31. OpenSuSE based distributions, containing:
  32. ifeval::["{release-state}"=="released"]
  33. ["source","sh",subs="attributes,callouts"]
  34. --------------------------------------------------
  35. [elasticsearch]
  36. name=Elasticsearch repository for {major-version} packages
  37. baseurl=https://artifacts.elastic.co/packages/{major-version}/yum
  38. gpgcheck=1
  39. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  40. enabled=0
  41. autorefresh=1
  42. type=rpm-md
  43. --------------------------------------------------
  44. endif::[]
  45. ifeval::["{release-state}"=="prerelease"]
  46. ["source","sh",subs="attributes,callouts"]
  47. --------------------------------------------------
  48. [elasticsearch]
  49. name=Elasticsearch repository for {major-version} packages
  50. baseurl=https://artifacts.elastic.co/packages/{major-version}-prerelease/yum
  51. gpgcheck=1
  52. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  53. enabled=0
  54. autorefresh=1
  55. type=rpm-md
  56. --------------------------------------------------
  57. endif::[]
  58. And your repository is ready for use. You can now install Elasticsearch with one of the following commands:
  59. [source,sh]
  60. --------------------------------------------------
  61. sudo yum install --enablerepo=elasticsearch elasticsearch <1>
  62. sudo dnf install --enablerepo=elasticsearch elasticsearch <2>
  63. sudo zypper modifyrepo --enable elasticsearch && \
  64. sudo zypper install elasticsearch; \
  65. sudo zypper modifyrepo --disable elasticsearch <3>
  66. --------------------------------------------------
  67. <1> Use `yum` on CentOS and older Red Hat based distributions.
  68. <2> Use `dnf` on Fedora and other newer Red Hat distributions.
  69. <3> Use `zypper` on OpenSUSE based distributions
  70. NOTE: The configured repository is disabled by default. This eliminates the possibility of accidentally
  71. upgrading `elasticsearch` when upgrading the rest of the system. Each install or upgrade command
  72. must explicitly enable the repository as indicated in the sample commands above.
  73. endif::[]
  74. ifeval::["{release-state}"!="unreleased"]
  75. [NOTE]
  76. ==================================================
  77. An alternative package which contains only features that are available under the
  78. Apache 2.0 license is also available. To install it, use the following `baseurl` in your `elasticsearch.repo` file:
  79. ifeval::["{release-state}"=="prerelease"]
  80. ["source","sh",subs="attributes,callouts"]
  81. --------------------------------------------------
  82. baseurl=https://artifacts.elastic.co/packages/oss-{major-version}-prerelease/yum
  83. --------------------------------------------------
  84. endif::[]
  85. ifeval::["{release-state}"!="prerelease"]
  86. ["source","sh",subs="attributes,callouts"]
  87. --------------------------------------------------
  88. baseurl=https://artifacts.elastic.co/packages/oss-{major-version}/yum
  89. --------------------------------------------------
  90. endif::[]
  91. ==================================================
  92. endif::[]
  93. [[install-rpm]]
  94. ==== Download and install the RPM manually
  95. ifeval::["{release-state}"=="unreleased"]
  96. Version {version} of Elasticsearch has not yet been released.
  97. endif::[]
  98. ifeval::["{release-state}"!="unreleased"]
  99. The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
  100. ["source","sh",subs="attributes"]
  101. --------------------------------------------
  102. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm
  103. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm.sha512
  104. shasum -a 512 -c elasticsearch-{version}-x86_64.rpm.sha512 <1>
  105. sudo rpm --install elasticsearch-{version}-x86_64.rpm
  106. --------------------------------------------
  107. <1> Compares the SHA of the downloaded RPM and the published checksum, which should output
  108. `elasticsearch-{version}-x86_64.rpm: OK`.
  109. Alternatively, you can download the following package, which contains only
  110. features that are available under the Apache 2.0 license:
  111. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}-x86_64.rpm
  112. endif::[]
  113. include::skip-set-kernel-parameters.asciidoc[]
  114. ifdef::include-xpack[]
  115. [role="xpack"]
  116. [[rpm-enable-indices]]
  117. ==== Enable automatic creation of system indices
  118. include::xpack-indices.asciidoc[]
  119. endif::include-xpack[]
  120. [[rpm-running-systemd]]
  121. include::systemd.asciidoc[]
  122. [[rpm-check-running]]
  123. include::check-running.asciidoc[]
  124. [[rpm-configuring]]
  125. ==== Configuring Elasticsearch
  126. include::etc-elasticsearch.asciidoc[]
  127. The RPM also has a system configuration file (`/etc/sysconfig/elasticsearch`),
  128. which allows you to set the following parameters:
  129. include::sysconfig-file.asciidoc[]
  130. NOTE: Distributions that use `systemd` require that system resource limits be
  131. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  132. file. See <<systemd>> for more information.
  133. [[rpm-layout]]
  134. ==== Directory layout of RPM
  135. The RPM places config files, logs, and the data directory in the appropriate
  136. locations for an RPM-based system:
  137. [cols="<h,<,<m,<m",options="header",]
  138. |=======================================================================
  139. | Type | Description | Default Location | Setting
  140. | home
  141. | Elasticsearch home directory or `$ES_HOME`
  142. | /usr/share/elasticsearch
  143. d|
  144. | bin
  145. | Binary scripts including `elasticsearch` to start a node
  146. and `elasticsearch-plugin` to install plugins
  147. | /usr/share/elasticsearch/bin
  148. d|
  149. | conf
  150. | Configuration files including `elasticsearch.yml`
  151. | /etc/elasticsearch
  152. | <<config-files-location,ES_PATH_CONF>>
  153. | conf
  154. | Environment variables including heap size, file descriptors.
  155. | /etc/sysconfig/elasticsearch
  156. d|
  157. | data
  158. | The location of the data files of each index / shard allocated
  159. on the node. Can hold multiple locations.
  160. | /var/lib/elasticsearch
  161. | path.data
  162. | jdk
  163. | The bundled Java Development Kit used to run Elasticsearch. Can
  164. be overridden by setting the `JAVA_HOME` environment variable
  165. in `/etc/sysconfig/elasticsearch`.
  166. | /usr/share/elasticsearch/jdk
  167. d|
  168. | logs
  169. | Log files location.
  170. | /var/log/elasticsearch
  171. | path.logs
  172. | plugins
  173. | Plugin files location. Each plugin will be contained in a subdirectory.
  174. | /usr/share/elasticsearch/plugins
  175. |
  176. | repo
  177. | 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.
  178. d| Not configured
  179. | path.repo
  180. |=======================================================================
  181. include::next-steps.asciidoc[]