repositories.asciidoc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [[setup-repositories]]
  2. == Repositories
  3. We also have repositories available for APT and YUM based distributions. Note that we only provide
  4. binary packages, but no source packages, as the packages are created as part of the Elasticsearch
  5. build.
  6. We have split the major versions in separate urls to avoid accidental upgrades across major version.
  7. 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.
  8. We use the PGP key https://pgp.mit.edu/pks/lookup?op=vindex&search=0xD27D666CD88E42B4[D88E42B4],
  9. Elasticsearch Signing Key, with fingerprint
  10. 4609 5ACC 8548 582C 1A26 99A9 D27D 666C D88E 42B4
  11. to sign all our packages. It is available from https://pgp.mit.edu.
  12. [float]
  13. === APT
  14. Download and install the Public Signing Key:
  15. [source,sh]
  16. --------------------------------------------------
  17. wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  18. --------------------------------------------------
  19. Save the repository definition to `/etc/apt/sources.list.d/elasticsearch-{branch}.list`:
  20. ["source","sh",subs="attributes,callouts"]
  21. --------------------------------------------------
  22. echo "deb http://packages.elastic.co/elasticsearch/{branch}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-{branch}.list
  23. --------------------------------------------------
  24. [WARNING]
  25. ==================================================
  26. Use the `echo` method described above to add the Elasticsearch repository. Do not use `add-apt-repository`
  27. as it will add a `deb-src` entry as well, but we do not provide a source package.
  28. If you have added the `deb-src` entry, you will see an error like
  29. the following:
  30. Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)
  31. Just delete the `deb-src` entry from the `/etc/apt/sources.list` file and the installation should work as expected.
  32. ==================================================
  33. Run apt-get update and the repository is ready for use. You can install it with:
  34. [source,sh]
  35. --------------------------------------------------
  36. sudo apt-get update && sudo apt-get install elasticsearch
  37. --------------------------------------------------
  38. [WARNING]
  39. ==================================================
  40. If two entries exist for the same Elasticsearch repository, you will see an error like this during `apt-get update`:
  41. ["literal",subs="attributes,callouts"]
  42. Duplicate sources.list entry http://packages.elastic.co/elasticsearch/{branch}/debian/ ...`
  43. 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.
  44. ==================================================
  45. Configure Elasticsearch to automatically start during bootup. If your
  46. distribution is using SysV init, then you will need to run:
  47. [source,sh]
  48. --------------------------------------------------
  49. sudo update-rc.d elasticsearch defaults 95 10
  50. --------------------------------------------------
  51. Otherwise if your distribution is using systemd:
  52. [source,sh]
  53. --------------------------------------------------
  54. sudo /bin/systemctl daemon-reload
  55. sudo /bin/systemctl enable elasticsearch.service
  56. --------------------------------------------------
  57. [float]
  58. === YUM
  59. Download and install the public signing key:
  60. [source,sh]
  61. --------------------------------------------------
  62. rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
  63. --------------------------------------------------
  64. Add the following in your `/etc/yum.repos.d/` directory
  65. in a file with a `.repo` suffix, for example `elasticsearch.repo`
  66. ["source","sh",subs="attributes,callouts"]
  67. --------------------------------------------------
  68. [elasticsearch-{branch}]
  69. name=Elasticsearch repository for {branch}.x packages
  70. baseurl=http://packages.elastic.co/elasticsearch/{branch}/centos
  71. gpgcheck=1
  72. gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
  73. enabled=1
  74. --------------------------------------------------
  75. And your repository is ready for use. You can install it with:
  76. [source,sh]
  77. --------------------------------------------------
  78. yum install elasticsearch
  79. --------------------------------------------------
  80. Configure Elasticsearch to automatically start during bootup. If your
  81. distribution is using SysV init, then you will need to run:
  82. WARNING: The repositories do not work with older rpm based distributions
  83. that still use RPM v3, like CentOS5.
  84. [source,sh]
  85. --------------------------------------------------
  86. chkconfig --add elasticsearch
  87. --------------------------------------------------
  88. Otherwise if your distribution is using systemd:
  89. [source,sh]
  90. --------------------------------------------------
  91. sudo /bin/systemctl daemon-reload
  92. sudo /bin/systemctl enable elasticsearch.service
  93. --------------------------------------------------