这里演示YUM和RPM两种方式安装Elasticsearch
下载并安装 public signing key:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
1、通过yum安装Elasticsearch
添加elasticsearch的repo,在/etc/yum.repos.d/下新增elasticsearch.repo
vi /etc/yum.repos.d/elasticsearch.repo
粘贴下面内容到elasticsearch.repo中
[elasticsearch-5.x] name=Elasticsearch repository for 5.xpackages baseurl=https://artifacts.elastic.co/packages/5.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
使用yum命令安装Elasticsearch
yum install elasticsearch -y
2、通过rpm安装Elasticsearch
下载elasticsearch-5.5.1.rpm
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.rpm
使用rpm命令安装
rpm --install elasticsearch-5.5.1.rpm
安装完之后启动Elasticsearch
systemctl start elasticsearch.service