2013-12-19 09:54:40 -05:00
[[setup-repositories]]
== Repositories
2015-04-02 05:27:47 -04:00
We also have repositories available for APT and YUM based distributions. Note that we only provide
binary packages, but no source packages, as the packages are created as part of the Elasticsearch
build.
2013-12-19 09:54:40 -05:00
We have split the major versions in separate urls to avoid accidental upgrades across major version.
2014-04-21 20:00:10 -04:00
For all 0.90.x releases use 0.90 as version number, for 1.0.x use 1.0, for 1.1.x use 1.1 etc.
2013-12-19 09:54:40 -05:00
2015-04-02 05:27:47 -04:00
We use the PGP key http://pgp.mit.edu/pks/lookup?op=vindex&search=0xD27D666CD88E42B4[D88E42B4],
2014-12-07 18:59:30 -05:00
Elasticsearch Signing Key, with fingerprint
2014-12-15 12:02:48 -05:00
4609 5ACC 8548 582C 1A26 99A9 D27D 666C D88E 42B4
2015-01-12 15:00:29 -05:00
to sign all our packages. It is available from http://pgp.mit.edu.
2014-12-07 18:59:30 -05:00
2014-01-15 09:09:18 -05:00
[float]
2013-12-19 09:54:40 -05:00
=== APT
2015-01-12 15:00:29 -05:00
Download and install the Public Signing Key:
2013-12-19 09:54:40 -05:00
[source,sh]
--------------------------------------------------
2015-05-01 14:37:26 -04:00
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
2013-12-19 09:54:40 -05:00
--------------------------------------------------
2015-06-30 12:20:00 -04:00
Save the repository definition to `/etc/apt/sources.list.d/elasticsearch-{branch}.list`:
2013-12-19 09:54:40 -05:00
2014-07-23 05:54:53 -04:00
["source","sh",subs="attributes,callouts"]
2013-12-19 09:54:40 -05:00
--------------------------------------------------
2015-06-30 12:20:00 -04:00
echo "deb http://packages.elastic.co/elasticsearch/{branch}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-{branch}.list
2013-12-19 09:54:40 -05:00
--------------------------------------------------
2015-04-05 05:43:20 -04:00
[WARNING]
==================================================
2015-04-02 05:27:47 -04:00
Use the `echo` method described above to add the Elasticsearch repository. Do not use `add-apt-repository`
as it will add a `deb-src` entry as well, but we do not provide a source package.
2015-04-05 05:43:20 -04:00
If you have added the `deb-src` entry, you will see an error like
the following:
Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)
2015-04-02 05:27:47 -04:00
2015-04-05 05:43:20 -04:00
Just delete the `deb-src` entry from the `/etc/apt/sources.list` file and the installation should work as expected.
==================================================
2015-04-02 05:27:47 -04:00
Run apt-get update and the repository is ready for use. You can install it with:
2014-05-16 13:06:10 -04:00
[source,sh]
--------------------------------------------------
2014-11-27 12:35:29 -05:00
sudo apt-get update && sudo apt-get install elasticsearch
2014-05-16 13:06:10 -04:00
--------------------------------------------------
2015-06-30 12:20:00 -04:00
[WARNING]
==================================================
If two entries exist for the same Elasticsearch repository, you will see an error like this during `apt-get update`:
["literal",subs="attributes,callouts"]
Duplicate sources.list entry http://packages.elastic.co/elasticsearch/{branch}/debian/ ...`
Examine +/etc/apt/sources.list.d/elasticsearch-{branch}.list+ for the duplicate entry or locate the duplicate entry amongst the files in `/etc/apt/sources.list.d/` and the `/etc/apt/sources.list` file.
==================================================
2015-04-22 10:02:20 -04:00
Configure Elasticsearch to automatically start during bootup. If your
distribution is using SysV init, then you will need to run:
2013-12-19 09:54:40 -05:00
2014-11-21 15:03:34 -05:00
[source,sh]
--------------------------------------------------
sudo update-rc.d elasticsearch defaults 95 10
--------------------------------------------------
2013-12-19 09:54:40 -05:00
2015-04-22 10:02:20 -04:00
Otherwise if your distribution is using systemd:
[source,sh]
--------------------------------------------------
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
--------------------------------------------------
2014-01-15 09:09:18 -05:00
[float]
2013-12-19 09:54:40 -05:00
=== YUM
2015-04-02 05:27:47 -04:00
Download and install the public signing key:
2013-12-19 09:54:40 -05:00
[source,sh]
--------------------------------------------------
2015-05-01 14:37:26 -04:00
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
2013-12-19 09:54:40 -05:00
--------------------------------------------------
2014-05-08 07:53:44 -04:00
Add the following in your `/etc/yum.repos.d/` directory
2015-04-02 05:27:47 -04:00
in a file with a `.repo` suffix, for example `elasticsearch.repo`
2013-12-19 09:54:40 -05:00
2014-07-23 05:54:53 -04:00
["source","sh",subs="attributes,callouts"]
2013-12-19 09:54:40 -05:00
--------------------------------------------------
2014-07-23 05:54:53 -04:00
[elasticsearch-{branch}]
name=Elasticsearch repository for {branch}.x packages
2015-05-01 14:37:26 -04:00
baseurl=http://packages.elastic.co/elasticsearch/{branch}/centos
2013-12-19 09:54:40 -05:00
gpgcheck=1
2015-05-01 14:37:26 -04:00
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
2013-12-19 09:54:40 -05:00
enabled=1
--------------------------------------------------
2015-04-02 05:27:47 -04:00
And your repository is ready for use. You can install it with:
2013-12-19 09:54:40 -05:00
2014-05-08 07:53:44 -04:00
[source,sh]
--------------------------------------------------
yum install elasticsearch
--------------------------------------------------
2014-12-05 05:14:13 -05:00
Configure Elasticsearch to automatically start during bootup. If your
2015-04-02 05:27:47 -04:00
distribution is using SysV init, then you will need to run:
2014-12-05 05:14:13 -05:00
2015-05-07 02:20:06 -04:00
WARNING: The repositories do not work with older rpm based distributions
that still use RPM v3, like CentOS5.
2014-12-05 05:14:13 -05:00
[source,sh]
--------------------------------------------------
chkconfig --add elasticsearch
--------------------------------------------------
2015-04-02 05:27:47 -04:00
Otherwise if your distribution is using systemd:
2014-12-05 05:14:13 -05:00
[source,sh]
--------------------------------------------------
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
--------------------------------------------------