1、下载并安装公共签名密钥
rpm --
import
https:
//artifacts
.elastic.co
/GPG-KEY-elasticsearch
2、配置Elasticsearch安装包yum源
编辑
/etc/yum
.repos.d
/elasticsearch
.repo
[elasticsearch-5.x]
name=Elasticsearch repository
for
5.x packages
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
3、安装命令
yum
install
-y elasticsearch
4、等待安装完成后将服务启动,并做好服务自启动、防火墙等设置
[root@localhost ~]
Created
symlink
from
/etc/systemd/system/multi-user
.target.wants
/elasticsearch
.service to
/usr/lib/systemd/system/elasticsearch
.service.
[root@localhost ~]
5、检查监听端口以及相关服务
[root@localhost ~]
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 13315
/java
tcp6 0 0 ::1:9200 :::* LISTEN 13315
/java
使用curl访问9200端口
[root@localhost ~]
{
"name"
:
"wEPnzRm"
,
"cluster_name"
:
"elasticsearch"
,
"cluster_uuid"
:
"dKeJNq1xSiizdAomMleZbg"
,
"version"
: {
"number"
:
"5.6.3"
,
"build_hash"
:
"1a2f265"
,
"build_date"
:
"2017-10-06T20:33:39.012Z"
,
"build_snapshot"
:
false
,
"lucene_version"
:
"6.6.1"
},
"tagline"
:
"You Know, for Search"
经检查elasticsearch 服务运行正常