准备工作:
1、安装JDK1.8版本,Elasticsearch官方建议安装Oracle JDK8
这里演示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
|
使用yum命令安装Elasticsearch
yum install elasticsearch
2、通过rpm安装Elasticsearch
下载elasticsearch-5.5.1.rpm
安装完之后启动Elasticsearch
以上就是通过yum和npm方式安装Elasticsearch的步骤,安装完之后检验一样是否启动成功
访问本地9200端口(Elasticsearch的默认端口)
curl http://localhost:9200/
输出以下信息,说明成功启动!
{
"name" : "_PT-a5P",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "_cH5BPCiTV6r0vF0eWiWIw",
"version" : {
"number" : "5.5.1",
"build_hash" : "19c13d0",
"build_date" : "2017-07-18T20:44:24.823Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}