rpm.asciidoc 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. The latest stable version of Elasticsearch can be found on the
  10. link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
  11. be found on the link:/downloads/past-releases[Past Releases page].
  12. NOTE: Elasticsearch requires Java 8 or later. Use the
  13. http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution]
  14. or an open-source distribution such as http://openjdk.java.net[OpenJDK].
  15. [[rpm-key]]
  16. ==== Import the Elasticsearch PGP Key
  17. include::key.asciidoc[]
  18. [source,sh]
  19. -------------------------
  20. rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  21. -------------------------
  22. [[rpm-repo]]
  23. ==== Installing from the RPM repository
  24. ifeval::["{release-state}"=="unreleased"]
  25. Version {version} of Elasticsearch has not yet been released.
  26. endif::[]
  27. ifeval::["{release-state}"!="unreleased"]
  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-{major-version}]
  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=1
  40. autorefresh=1
  41. type=rpm-md
  42. --------------------------------------------------
  43. endif::[]
  44. ifeval::["{release-state}"=="prerelease"]
  45. ["source","sh",subs="attributes,callouts"]
  46. --------------------------------------------------
  47. [elasticsearch-{major-version}]
  48. name=Elasticsearch repository for {major-version} packages
  49. baseurl=https://artifacts.elastic.co/packages/{major-version}-prerelease/yum
  50. gpgcheck=1
  51. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  52. enabled=1
  53. autorefresh=1
  54. type=rpm-md
  55. --------------------------------------------------
  56. endif::[]
  57. And your repository is ready for use. You can now install Elasticsearch with one of the following commands:
  58. [source,sh]
  59. --------------------------------------------------
  60. sudo yum install elasticsearch <1>
  61. sudo dnf install elasticsearch <2>
  62. sudo zypper install elasticsearch <3>
  63. --------------------------------------------------
  64. <1> Use `yum` on CentOS and older Red Hat based distributions.
  65. <2> Use `dnf` on Fedora and other newer Red Hat distributions.
  66. <3> Use `zypper` on OpenSUSE based distributions
  67. endif::[]
  68. [[install-rpm]]
  69. ==== Download and install the RPM manually
  70. ifeval::["{release-state}"=="unreleased"]
  71. Version {version} of Elasticsearch has not yet been released.
  72. endif::[]
  73. ifeval::["{release-state}"!="unreleased"]
  74. The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
  75. ["source","sh",subs="attributes"]
  76. --------------------------------------------
  77. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm
  78. sha1sum elasticsearch-{version}.rpm <1>
  79. sudo rpm --install elasticsearch-{version}.rpm
  80. --------------------------------------------
  81. <1> Compare the SHA produced by `sha1sum` or `shasum` with the
  82. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm.sha1[published SHA].
  83. endif::[]
  84. include::skip-set-kernel-parameters.asciidoc[]
  85. include::init-systemd.asciidoc[]
  86. [[rpm-running-init]]
  87. ==== Running Elasticsearch with SysV `init`
  88. Use the `chkconfig` command to configure Elasticsearch to start automatically
  89. when the system boots up:
  90. [source,sh]
  91. --------------------------------------------------
  92. sudo chkconfig --add elasticsearch
  93. --------------------------------------------------
  94. Elasticsearch can be started and stopped using the `service` command:
  95. [source,sh]
  96. --------------------------------------------
  97. sudo -i service elasticsearch start
  98. sudo -i service elasticsearch stop
  99. --------------------------------------------
  100. If Elasticsearch fails to start for any reason, it will print the reason for
  101. failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
  102. [[rpm-running-systemd]]
  103. include::systemd.asciidoc[]
  104. [[rpm-check-running]]
  105. include::check-running.asciidoc[]
  106. [[rpm-configuring]]
  107. ==== Configuring Elasticsearch
  108. Elasticsearch loads its configuration from the `/etc/elasticsearch/elasticsearch.yml`
  109. file by default. The format of this config file is explained in
  110. <<settings>>.
  111. The RPM also has a system configuration file (`/etc/sysconfig/elasticsearch`),
  112. which allows you to set the following parameters:
  113. include::sysconfig-file.asciidoc[]
  114. NOTE: Distributions that use `systemd` require that system resource limits be
  115. configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
  116. file. See <<systemd>> for more information.
  117. [[rpm-layout]]
  118. ==== Directory layout of RPM
  119. The RPM places config files, logs, and the data directory in the appropriate
  120. locations for an RPM-based system:
  121. [cols="<h,<,<m,<m",options="header",]
  122. |=======================================================================
  123. | Type | Description | Default Location | Setting
  124. | home
  125. | Elasticsearch home directory or `$ES_HOME`
  126. | /usr/share/elasticsearch
  127. d|
  128. | bin
  129. | Binary scripts including `elasticsearch` to start a node
  130. and `elasticsearch-plugin` to install plugins
  131. | /usr/share/elasticsearch/bin
  132. d|
  133. | conf
  134. | Configuration files including `elasticsearch.yml`
  135. | /etc/elasticsearch
  136. | path.conf
  137. | conf
  138. | Environment variables including heap size, file descriptors.
  139. | /etc/sysconfig/elasticsearch
  140. d|
  141. | data
  142. | The location of the data files of each index / shard allocated
  143. on the node. Can hold multiple locations.
  144. | /var/lib/elasticsearch
  145. | path.data
  146. | logs
  147. | Log files location.
  148. | /var/log/elasticsearch
  149. | path.logs
  150. | plugins
  151. | Plugin files location. Each plugin will be contained in a subdirectory.
  152. | /usr/share/elasticsearch/plugins
  153. |
  154. | repo
  155. | 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.
  156. d| Not configured
  157. | path.repo
  158. |=======================================================================
  159. include::next-steps.asciidoc[]