elasticsearch/docs/reference/setup/install/rpm.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

231 lines
7.1 KiB
Text

[[rpm]]
=== Install Elasticsearch with RPM
:include-xpack: true
The RPM for Elasticsearch can be <<install-rpm,downloaded from our website>>
or from our <<rpm-repo,RPM repository>>. It can be used to install
Elasticsearch on any RPM-based system such as OpenSuSE, SLES, Centos, Red Hat,
and Oracle Enterprise.
NOTE: RPM install is not supported on distributions with old versions of RPM,
such as SLES 11 and CentOS 5. Please see <<targz>> instead.
include::license.asciidoc[]
The latest stable version of Elasticsearch can be found on the
link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
be found on the link:/downloads/past-releases[Past Releases page].
NOTE: Elasticsearch includes a bundled version of https://openjdk.java.net[OpenJDK]
from the JDK maintainers (GPLv2+CE). To use your own version of Java,
see the <<jvm-version, JVM version requirements>>
TIP: For a step-by-step example of setting up the {stack} on your own premises, try out our tutorial: {stack-ref}/installing-stack-demo-self.html[Installing a self-managed Elastic Stack].
[[rpm-key]]
==== Import the Elasticsearch GPG Key
include::key.asciidoc[]
[source,sh]
-------------------------
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
-------------------------
[[rpm-repo]]
==== Installing from the RPM repository
ifeval::["{release-state}"=="unreleased"]
WARNING: Version {version} of Elasticsearch has not yet been released.
endif::[]
Create a file called `elasticsearch.repo` in the `/etc/yum.repos.d/` directory
for RedHat based distributions, or in the `/etc/zypp/repos.d/` directory for
OpenSuSE based distributions, containing:
ifeval::["{release-state}"=="released"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
[elasticsearch]
name=Elasticsearch repository for {major-version} packages
baseurl=https://artifacts.elastic.co/packages/{major-version}/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
--------------------------------------------------
ifeval::["{release-state}"=="prerelease"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
[elasticsearch]
name=Elasticsearch repository for {major-version} packages
baseurl=https://artifacts.elastic.co/packages/{major-version}-prerelease/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
--------------------------------------------------
endif::[]
And your repository is ready for use. You can now install Elasticsearch with one of the following commands:
[source,sh]
--------------------------------------------------
sudo yum install --enablerepo=elasticsearch elasticsearch <1>
sudo dnf install --enablerepo=elasticsearch elasticsearch <2>
sudo zypper modifyrepo --enable elasticsearch && \
sudo zypper install elasticsearch; \
sudo zypper modifyrepo --disable elasticsearch <3>
--------------------------------------------------
<1> Use `yum` on CentOS and older Red Hat based distributions.
<2> Use `dnf` on Fedora and other newer Red Hat distributions.
<3> Use `zypper` on OpenSUSE based distributions
NOTE: The configured repository is disabled by default. This eliminates the possibility of accidentally
upgrading `elasticsearch` when upgrading the rest of the system. Each install or upgrade command
must explicitly enable the repository as indicated in the sample commands above.
endif::[]
[[install-rpm]]
==== Download and install the RPM manually
ifeval::["{release-state}"=="unreleased"]
WARNING: Version {version} of Elasticsearch has not yet been released.
endif::[]
The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
["source","sh",subs="attributes"]
--------------------------------------------
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}-x86_64.rpm.sha512
shasum -a 512 -c elasticsearch-{version}-x86_64.rpm.sha512 <1>
sudo rpm --install elasticsearch-{version}-x86_64.rpm
--------------------------------------------
<1> Compares the SHA of the downloaded RPM and the published checksum, which should output
`elasticsearch-{version}-x86_64.rpm: OK`.
include::skip-set-kernel-parameters.asciidoc[]
// Set a `distro` attribute so we can reuse files containing anchors
:distro: rpm
[id="rpm-security-configuration"]
include::package-security.asciidoc[]
ifdef::include-xpack[]
[role="xpack"]
[[rpm-enable-indices]]
==== Enable automatic creation of system indices
include::xpack-indices.asciidoc[]
endif::include-xpack[]
:include-xpack!: true
[id="{distro}-running-systemd"]
include::systemd.asciidoc[]
[[rpm-check-running]]
:es-config: /etc/elasticsearch
:slash: /
include::check-running.asciidoc[]
[[rpm-configuring]]
==== Configuring Elasticsearch
include::etc-elasticsearch.asciidoc[]
The RPM also has a system configuration file (`/etc/sysconfig/elasticsearch`),
which allows you to set the following parameters:
include::sysconfig-file.asciidoc[]
NOTE: Distributions that use `systemd` require that system resource limits be
configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch`
file. See <<systemd>> for more information.
include::connect-clients.asciidoc[]
[[rpm-layout]]
==== Directory layout of RPM
The RPM places config files, logs, and the data directory in the appropriate
locations for an RPM-based system:
[cols="<h,<,<m,<m",options="header",]
|=======================================================================
| Type | Description | Default Location | Setting
| home
| Elasticsearch home directory or `$ES_HOME`
| /usr/share/elasticsearch
d|
| bin
| Binary scripts including `elasticsearch` to start a node
and `elasticsearch-plugin` to install plugins
| /usr/share/elasticsearch/bin
d|
| conf
| Configuration files including `elasticsearch.yml`
| /etc/elasticsearch
| <<config-files-location,ES_PATH_CONF>>
| conf
| Environment variables including heap size, file descriptors.
| /etc/sysconfig/elasticsearch
d|
| conf
| Generated TLS keys and certificates for the transport and http layer.
| /etc/elasticsearch/certs
d|
| data
| The location of the data files of each index / shard allocated
on the node.
| /var/lib/elasticsearch
| path.data
| jdk
| The bundled Java Development Kit used to run Elasticsearch. Can
be overridden by setting the `ES_JAVA_HOME` environment variable
in `/etc/sysconfig/elasticsearch`.
| /usr/share/elasticsearch/jdk
d|
| logs
| Log files location.
| /var/log/elasticsearch
| path.logs
| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/share/elasticsearch/plugins
|
| repo
| 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.
d| Not configured
| path.repo
|=======================================================================
include::security-files-reference.asciidoc[]
include::next-steps.asciidoc[]