Elasticsearch提供基于APT和YUM的软件仓库.

本文基于Elasticsearch 1.5.
官方最新文档:[传送门] 1

apt

wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/1.5/debian stable main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo update-rc.d elasticsearch defaults 95 10

yum

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

/etc/yum.repos.d/目录创建elasticsearch.repo文件,内容如下:

[elasticsearch-1.5]
name=Elasticsearch repository for 1.5.x packages
baseurl=http://packages.elastic.co/elasticsearch/1.5/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

添加完成后,进行安装

yum install elasticsearch
chkconfig --add elasticsearch
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service