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,
such as SLES 11 and CentOS 5. Please see <<zip-targz>> instead.
2016-04-13 03:34:01 -04:00
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].
2016-11-01 17:52:09 -04:00
NOTE: Elasticsearch requires Java 8 or later. Use the
http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution]
or an open-source distribution such as http://openjdk.java.net[OpenJDK].
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"]
--------------------------------------------------
[elasticsearch-{major-version}]
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
2016-04-03 10:09:24 -04:00
enabled=1
autorefresh=1
type=rpm-md
--------------------------------------------------
2016-10-06 11:56:55 -04:00
endif::[]
ifeval::["{release-state}"=="prerelease"]
["source","sh",subs="attributes,callouts"]
--------------------------------------------------
[elasticsearch-{major-version}]
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
enabled=1
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]
--------------------------------------------------
sudo yum install elasticsearch <1>
sudo dnf install elasticsearch <2>
sudo zypper install elasticsearch <3>
--------------------------------------------------
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
2016-10-06 15:40:17 -04:00
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"]
--------------------------------------------
2016-09-19 21:10:45 -04:00
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm
2016-04-03 10:09:24 -04:00
sha1sum elasticsearch-{version}.rpm <1>
sudo rpm --install elasticsearch-{version}.rpm
--------------------------------------------
<1> Compare the SHA produced by `sha1sum` or `shasum` with the
2016-09-19 21:10:45 -04:00
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm.sha1[published SHA].
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[]
2016-04-03 10:09:24 -04:00
include::init-systemd.asciidoc[]
[[rpm-running-init]]
==== Running Elasticsearch with SysV `init`
Use the `chkconfig` command to configure Elasticsearch to start automatically
when the system boots up:
[source,sh]
--------------------------------------------------
sudo chkconfig --add elasticsearch
--------------------------------------------------
Elasticsearch can be started and stopped using the `service` command:
[source,sh]
--------------------------------------------
sudo -i service elasticsearch start
sudo -i service elasticsearch stop
--------------------------------------------
If Elasticsearch fails to start for any reason, it will print the reason for
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
[[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
| 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[]