rpm.asciidoc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 https://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 GPG 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. WARNING: Version {version} of Elasticsearch has not yet been released.
  27. endif::[]
  28. Create a file called `elasticsearch.repo` in the `/etc/yum.repos.d/` directory
  29. for RedHat based distributions, or in the `/etc/zypp/repos.d/` directory for
  30. OpenSuSE based distributions, containing:
  31. ifeval::["{release-state}"=="released"]
  32. ["source","sh",subs="attributes,callouts"]
  33. --------------------------------------------------
  34. [elasticsearch]
  35. name=Elasticsearch repository for {major-version} packages
  36. baseurl=https://artifacts.elastic.co/packages/{major-version}/yum
  37. gpgcheck=1
  38. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  39. enabled=0
  40. autorefresh=1
  41. type=rpm-md
  42. --------------------------------------------------
  43. ifeval::["{release-state}"=="prerelease"]
  44. ["source","sh",subs="attributes,callouts"]
  45. --------------------------------------------------
  46. [elasticsearch]
  47. name=Elasticsearch repository for {major-version} packages
  48. baseurl=https://artifacts.elastic.co/packages/{major-version}-prerelease/yum
  49. gpgcheck=1
  50. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  51. enabled=0
  52. autorefresh=1
  53. type=rpm-md
  54. --------------------------------------------------
  55. endif::[]
  56. And your repository is ready for use. You can now install Elasticsearch with one of the following commands:
  57. [source,sh]
  58. --------------------------------------------------
  59. sudo yum install --enablerepo=elasticsearch elasticsearch <1>
  60. sudo dnf install --enablerepo=elasticsearch elasticsearch <2>
  61. sudo zypper modifyrepo --enable elasticsearch && \
  62. sudo zypper install elasticsearch; \
  63. sudo zypper modifyrepo --disable elasticsearch <3>
  64. --------------------------------------------------
  65. <1> Use `yum` on CentOS and older Red Hat based distributions.
  66. <2> Use `dnf` on Fedora and other newer Red Hat distributions.
  67. <3> Use `zypper` on OpenSUSE based distributions
  68. NOTE: The configured repository is disabled by default. This eliminates the possibility of accidentally
  69. upgrading `elasticsearch` when upgrading the rest of the system. Each install or upgrade command
  70. must explicitly enable the repository as indicated in the sample commands above.
  71. endif::[]
  72. [[install-rpm]]
  73. ==== Download and install the RPM manually
  74. ifeval::["{release-state}"=="unreleased"]
  75. WARNING: Version {version} of Elasticsearch has not yet been released.
  76. endif::[]
  77. The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
  78. ["source","sh",subs="attributes"]
  79. --------------------------------------------
  80. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm
  81. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm.sha512
  82. shasum -a 512 -c elasticsearch-{version}-x86_64.rpm.sha512 <1>
  83. sudo rpm --install elasticsearch-{version}-x86_64.rpm
  84. --------------------------------------------
  85. <1> Compares the SHA of the downloaded RPM and the published checksum, which should output
  86. `elasticsearch-{version}-x86_64.rpm: OK`.
  87. include::skip-set-kernel-parameters.asciidoc[]
  88. // Set a `distro` attribute so we can reuse files containing anchors
  89. :distro: rpm
  90. [id="rpm-security-configuration"]
  91. include::package-security.asciidoc[]
  92. ifdef::include-xpack[]
  93. [role="xpack"]
  94. [[rpm-enable-indices]]
  95. ==== Enable automatic creation of system indices
  96. include::xpack-indices.asciidoc[]
  97. endif::include-xpack[]
  98. [id="{distro}-running-systemd"]
  99. include::systemd.asciidoc[]
  100. [[rpm-check-running]]
  101. :es-config: /etc/elasticsearch
  102. :slash: /
  103. include::check-running.asciidoc[]
  104. [[rpm-configuring]]
  105. ==== Configuring Elasticsearch
  106. include::etc-elasticsearch.asciidoc[]
  107. The RPM also has a system configuration file (`/etc/sysconfig/elasticsearch`),
  108. which allows you to set the following parameters:
  109. include::sysconfig-file.asciidoc[]
  110. NOTE: Distributions that use `systemd` require that system resource limits be
  111. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  112. file. See <<systemd>> for more information.
  113. include::connect-clients.asciidoc[]
  114. [[rpm-layout]]
  115. ==== Directory layout of RPM
  116. The RPM places config files, logs, and the data directory in the appropriate
  117. locations for an RPM-based system:
  118. [cols="<h,<,<m,<m",options="header",]
  119. |=======================================================================
  120. | Type | Description | Default Location | Setting
  121. | home
  122. | Elasticsearch home directory or `$ES_HOME`
  123. | /usr/share/elasticsearch
  124. d|
  125. | bin
  126. | Binary scripts including `elasticsearch` to start a node
  127. and `elasticsearch-plugin` to install plugins
  128. | /usr/share/elasticsearch/bin
  129. d|
  130. | conf
  131. | Configuration files including `elasticsearch.yml`
  132. | /etc/elasticsearch
  133. | <<config-files-location,ES_PATH_CONF>>
  134. | conf
  135. | Environment variables including heap size, file descriptors.
  136. | /etc/sysconfig/elasticsearch
  137. d|
  138. | conf
  139. | Generated TLS keys and certificates for the transport and http layer.
  140. | /etc/elasticsearch/certs
  141. d|
  142. | data
  143. | The location of the data files of each index / shard allocated
  144. on the node.
  145. | /var/lib/elasticsearch
  146. | path.data
  147. | jdk
  148. | The bundled Java Development Kit used to run Elasticsearch. Can
  149. be overridden by setting the `ES_JAVA_HOME` environment variable
  150. in `/etc/sysconfig/elasticsearch`.
  151. | /usr/share/elasticsearch/jdk
  152. d|
  153. | logs
  154. | Log files location.
  155. | /var/log/elasticsearch
  156. | path.logs
  157. | plugins
  158. | Plugin files location. Each plugin will be contained in a subdirectory.
  159. | /usr/share/elasticsearch/plugins
  160. |
  161. | repo
  162. | 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.
  163. d| Not configured
  164. | path.repo
  165. |=======================================================================
  166. include::security-files-reference.asciidoc[]
  167. include::next-steps.asciidoc[]