rpm.asciidoc 5.6 KB

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