rpm.asciidoc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 <<zip-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 requires Java 8 or later. Use the
  14. http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution]
  15. or an open-source distribution such as http://openjdk.java.net[OpenJDK].
  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-{major-version}]
  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=1
  41. autorefresh=1
  42. type=rpm-md
  43. --------------------------------------------------
  44. endif::[]
  45. ifeval::["{release-state}"=="prerelease"]
  46. ["source","sh",subs="attributes,callouts"]
  47. --------------------------------------------------
  48. [elasticsearch-{major-version}]
  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=1
  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 elasticsearch <1>
  62. sudo dnf install elasticsearch <2>
  63. sudo zypper install 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. endif::[]
  69. [[install-rpm]]
  70. ==== Download and install the RPM manually
  71. ifeval::["{release-state}"=="unreleased"]
  72. Version {version} of Elasticsearch has not yet been released.
  73. endif::[]
  74. ifeval::["{release-state}"!="unreleased"]
  75. The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
  76. ["source","sh",subs="attributes"]
  77. --------------------------------------------
  78. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm
  79. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm.sha512
  80. shasum -a 512 -c elasticsearch-{version}.rpm.sha512 <1>
  81. sudo rpm --install elasticsearch-{version}.rpm
  82. --------------------------------------------
  83. <1> Compares the SHA of the downloaded RPM and the published checksum, which should output
  84. `elasticsearch-{version}.rpm: OK`.
  85. Alternatively, you can download the following package, which contains only
  86. features that are available under the Apache 2.0 license:
  87. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.rpm
  88. endif::[]
  89. include::skip-set-kernel-parameters.asciidoc[]
  90. ifdef::include-xpack[]
  91. [[rpm-enable-indices]]
  92. ==== Enable automatic creation of {xpack} indices
  93. {xpack} will try to automatically create a number of indices within {es}.
  94. include::{xes-repo-dir}/setup/xpack-indices.asciidoc[]
  95. endif::include-xpack[]
  96. include::init-systemd.asciidoc[]
  97. [[rpm-running-init]]
  98. ==== Running Elasticsearch with SysV `init`
  99. Use the `chkconfig` command to configure Elasticsearch to start automatically
  100. when the system boots up:
  101. [source,sh]
  102. --------------------------------------------------
  103. sudo chkconfig --add elasticsearch
  104. --------------------------------------------------
  105. Elasticsearch can be started and stopped using the `service` command:
  106. [source,sh]
  107. --------------------------------------------
  108. sudo -i service elasticsearch start
  109. sudo -i service elasticsearch stop
  110. --------------------------------------------
  111. If Elasticsearch fails to start for any reason, it will print the reason for
  112. failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
  113. [[rpm-running-systemd]]
  114. include::systemd.asciidoc[]
  115. [[rpm-check-running]]
  116. include::check-running.asciidoc[]
  117. [[rpm-configuring]]
  118. ==== Configuring Elasticsearch
  119. include::etc-elasticsearch.asciidoc[]
  120. The RPM also has a system configuration file (`/etc/sysconfig/elasticsearch`),
  121. which allows you to set the following parameters:
  122. include::sysconfig-file.asciidoc[]
  123. NOTE: Distributions that use `systemd` require that system resource limits be
  124. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  125. file. See <<systemd>> for more information.
  126. [[rpm-layout]]
  127. ==== Directory layout of RPM
  128. The RPM places config files, logs, and the data directory in the appropriate
  129. locations for an RPM-based system:
  130. [cols="<h,<,<m,<m",options="header",]
  131. |=======================================================================
  132. | Type | Description | Default Location | Setting
  133. | home
  134. | Elasticsearch home directory or `$ES_HOME`
  135. | /usr/share/elasticsearch
  136. d|
  137. | bin
  138. | Binary scripts including `elasticsearch` to start a node
  139. and `elasticsearch-plugin` to install plugins
  140. | /usr/share/elasticsearch/bin
  141. d|
  142. | conf
  143. | Configuration files including `elasticsearch.yml`
  144. | /etc/elasticsearch
  145. | <<config-files-location,ES_PATH_CONF>>
  146. | conf
  147. | Environment variables including heap size, file descriptors.
  148. | /etc/sysconfig/elasticsearch
  149. d|
  150. | data
  151. | The location of the data files of each index / shard allocated
  152. on the node. Can hold multiple locations.
  153. | /var/lib/elasticsearch
  154. | path.data
  155. | logs
  156. | Log files location.
  157. | /var/log/elasticsearch
  158. | path.logs
  159. | plugins
  160. | Plugin files location. Each plugin will be contained in a subdirectory.
  161. | /usr/share/elasticsearch/plugins
  162. |
  163. | repo
  164. | 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.
  165. d| Not configured
  166. | path.repo
  167. |=======================================================================
  168. include::next-steps.asciidoc[]