2016-04-03 10:09:24 -04:00
[[rpm]]
=== Install Elasticsearch with RPM
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.
2016-04-13 03:43:38 -04:00
NOTE: RPM install is not supported on distributions with old versions of RPM,
2019-03-29 09:04:46 -04:00
such as SLES 11 and CentOS 5. Please see <<targz>> instead.
2016-04-13 03:34:01 -04:00
2018-05-01 20:04:16 -04:00
include::license.asciidoc[]
2016-04-03 10:09:24 -04:00
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].
2019-03-29 09:04:46 -04:00
NOTE: Elasticsearch includes a bundled version of http://openjdk.java.net[OpenJDK]
from the JDK maintainers (GPLv2+CE). To use your own version of Java,
see the <<jvm-version, JVM version requirements>>
2016-11-01 17:52:09 -04:00
2016-04-03 10:09:24 -04:00
[[rpm-key]]
==== Import the Elasticsearch PGP Key
include::key.asciidoc[]
[source,sh]
-------------------------
2016-09-19 21:10:45 -04:00
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
2016-04-03 10:09:24 -04:00
-------------------------
[[rpm-repo]]
==== Installing from the RPM repository
2016-10-06 11:56:55 -04:00
ifeval::["{release-state}"=="unreleased"]
Version {version} of Elasticsearch has not yet been released.
endif::[]
ifeval::["{release-state}"!="unreleased"]
2016-04-03 10:09:24 -04:00
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:
2016-10-06 11:56:55 -04:00
ifeval::["{release-state}"=="released"]
2016-04-03 10:09:24 -04:00
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
2019-12-06 18:54:30 -05:00
[elasticsearch]
2016-04-03 10:09:24 -04:00
name=Elasticsearch repository for {major-version} packages
2017-05-09 12:33:13 -04:00
baseurl=https://artifacts.elastic.co/packages/{major-version}/yum
2016-04-03 10:09:24 -04:00
gpgcheck=1
2016-09-19 21:10:45 -04:00
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
2019-12-06 18:54:30 -05:00
enabled=0
2016-04-03 10:09:24 -04:00
autorefresh=1
type=rpm-md
--------------------------------------------------
2016-10-06 11:56:55 -04:00
endif::[]
ifeval::["{release-state}"=="prerelease"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
2019-12-06 18:54:30 -05:00
[elasticsearch]
2016-10-06 11:56:55 -04:00
name=Elasticsearch repository for {major-version} packages
2017-05-09 12:33:13 -04:00
baseurl=https://artifacts.elastic.co/packages/{major-version}-prerelease/yum
2016-10-06 11:56:55 -04:00
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
2019-12-06 18:54:30 -05:00
enabled=0
2016-10-06 11:56:55 -04:00
autorefresh=1
type=rpm-md
--------------------------------------------------
endif::[]
2016-04-03 10:09:24 -04:00
And your repository is ready for use. You can now install Elasticsearch with one of the following commands:
[source,sh]
--------------------------------------------------
2019-12-06 18:54:30 -05:00
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>
2016-04-03 10:09:24 -04:00
--------------------------------------------------
2016-04-04 09:10:27 -04:00
<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
2016-04-03 10:09:24 -04:00
2019-12-06 20:43:12 -05:00
NOTE: The configured repository is disabled by default. This eliminates the possibility of accidentally
2019-12-06 18:54:30 -05:00
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.
2016-10-06 15:40:17 -04:00
endif::[]
2018-11-30 13:17:39 -05:00
ifeval::["{release-state}"!="unreleased"]
2018-11-29 03:22:10 -05:00
[NOTE]
==================================================
An alternative package which contains only features that are available under the
Apache 2.0 license is also available. To install it, use the following `baseurl` in your `elasticsearch.repo` file:
ifeval::["{release-state}"=="prerelease"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
baseurl=https://artifacts.elastic.co/packages/oss-{major-version}-prerelease/yum
--------------------------------------------------
endif::[]
ifeval::["{release-state}"!="prerelease"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
baseurl=https://artifacts.elastic.co/packages/oss-{major-version}/yum
--------------------------------------------------
endif::[]
==================================================
endif::[]
2016-04-03 10:09:24 -04:00
[[install-rpm]]
==== Download and install the RPM manually
2016-10-06 15:40:17 -04:00
ifeval::["{release-state}"=="unreleased"]
Version {version} of Elasticsearch has not yet been released.
endif::[]
ifeval::["{release-state}"!="unreleased"]
2017-03-20 10:07:59 -04:00
The RPM for Elasticsearch v{version} can be downloaded from the website and installed as follows:
2016-04-03 10:09:24 -04:00
["source","sh",subs="attributes"]
--------------------------------------------
2019-01-29 14:18:30 -05:00
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
2016-04-03 10:09:24 -04:00
--------------------------------------------
2017-11-29 21:29:06 -05:00
<1> Compares the SHA of the downloaded RPM and the published checksum, which should output
2019-01-29 14:18:30 -05:00
`elasticsearch-{version}-x86_64.rpm: OK`.
2018-05-01 20:04:16 -04:00
Alternatively, you can download the following package, which contains only
features that are available under the Apache 2.0 license:
2019-01-29 14:18:30 -05:00
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}-x86_64.rpm
2016-04-03 10:09:24 -04:00
2016-10-06 11:56:55 -04:00
endif::[]
2016-12-01 17:23:51 -05:00
include::skip-set-kernel-parameters.asciidoc[]
2018-04-09 11:19:38 -04:00
ifdef::include-xpack[]
2019-07-30 17:59:20 -04:00
[role="xpack"]
2018-04-09 11:19:38 -04:00
[[rpm-enable-indices]]
2019-07-30 17:59:20 -04:00
==== Enable automatic creation of system indices
2018-04-09 11:19:38 -04:00
2018-06-06 17:46:20 -04:00
include::xpack-indices.asciidoc[]
2018-04-09 11:19:38 -04:00
endif::include-xpack[]
2019-04-30 10:19:09 -04:00
[[rpm-sysv-init-vs-systemd]]
2018-07-03 16:40:37 -04:00
==== SysV `init` vs `systemd`
2016-04-03 10:09:24 -04:00
include::init-systemd.asciidoc[]
[[rpm-running-init]]
2018-07-03 16:40:37 -04:00
include::rpm-init.asciidoc[]
2016-04-03 10:09:24 -04:00
[[rpm-running-systemd]]
include::systemd.asciidoc[]
[[rpm-check-running]]
include::check-running.asciidoc[]
[[rpm-configuring]]
==== Configuring Elasticsearch
2017-09-27 09:22:52 -04:00
include::etc-elasticsearch.asciidoc[]
2016-04-03 10:09:24 -04:00
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.
[[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
2017-08-14 17:19:06 -04:00
| <<config-files-location,ES_PATH_CONF>>
2016-04-03 10:09:24 -04:00
| conf
| Environment variables including heap size, file descriptors.
| /etc/sysconfig/elasticsearch
d|
| data
| The location of the data files of each index / shard allocated
on the node. Can hold multiple locations.
| /var/lib/elasticsearch
| path.data
2019-08-29 17:13:35 -04:00
| jdk
| The bundled Java Development Kit used to run Elasticsearch. Can
2019-11-27 13:39:54 -05:00
be overriden by setting the `JAVA_HOME` environment variable
in `/etc/sysconfig/elasticsearch`.
2019-08-29 17:13:35 -04:00
| /usr/share/elasticsearch/jdk
d|
2016-04-03 10:09:24 -04:00
| logs
| Log files location.
2016-05-12 16:42:27 -04:00
| /var/log/elasticsearch
2016-04-03 10:09:24 -04:00
| path.logs
| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/share/elasticsearch/plugins
2016-11-09 05:54:56 -05:00
|
2016-04-03 10:09:24 -04:00
| 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
|=======================================================================
2016-04-04 09:10:27 -04:00
include::next-steps.asciidoc[]