123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- [[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.
- 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.
- 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 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].
- [[rpm-key]]
- ==== Import the Elasticsearch PGP 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"]
- Version {version} of Elasticsearch has not yet been released.
- endif::[]
- ifeval::["{release-state}"!="unreleased"]
- 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-{major-version}]
- 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=1
- autorefresh=1
- type=rpm-md
- --------------------------------------------------
- endif::[]
- ifeval::["{release-state}"=="prerelease"]
- ["source","sh",subs="attributes,callouts"]
- --------------------------------------------------
- [elasticsearch-{major-version}]
- 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=1
- 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 elasticsearch <1>
- sudo dnf install elasticsearch <2>
- sudo zypper install 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
- endif::[]
- [[install-rpm]]
- ==== Download and install the RPM manually
- ifeval::["{release-state}"=="unreleased"]
- Version {version} of Elasticsearch has not yet been released.
- endif::[]
- ifeval::["{release-state}"!="unreleased"]
- 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}.rpm
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.rpm.sha512
- shasum -a 512 -c elasticsearch-{version}.rpm.sha512 <1>
- sudo rpm --install elasticsearch-{version}.rpm
- --------------------------------------------
- <1> Compares the SHA of the downloaded RPM and the published checksum, which should output
- `elasticsearch-{version}.rpm: OK`.
-
- Alternatively, you can download the following package, which contains only
- features that are available under the Apache 2.0 license:
- https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.rpm
- endif::[]
- include::skip-set-kernel-parameters.asciidoc[]
- ifdef::include-xpack[]
- [[rpm-enable-indices]]
- ==== Enable automatic creation of {xpack} indices
- {xpack} will try to automatically create a number of indices within {es}.
- include::xpack-indices.asciidoc[]
- endif::include-xpack[]
- ==== SysV `init` vs `systemd`
- include::init-systemd.asciidoc[]
- [[rpm-running-init]]
- include::rpm-init.asciidoc[]
- [[rpm-running-systemd]]
- include::systemd.asciidoc[]
- [[rpm-check-running]]
- 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.
- [[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|
- | 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.
- | /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::next-steps.asciidoc[]
|