rpm.asciidoc 6.3 KB

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