1. 安装
1.1 创建源信息
cd /etc/yum.repos.d
touch elasticsearch.repo
1.2 填入elasticsearch和kinaba源信息
我选用的是5.x版本
//6.x版本
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
[kibana-6.x]
name=Kibana repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
//5.x版本
[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
[kibana-5.x]
name=Kibana 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
1.3 安装
yum install elasticsearch
yum install kibana
1.4 内存配置
我将内存改成512m,因为我机子内存较小,用默认配置程序内存不足会挂掉,意图学习,不考虑性能,所以更改。
vim /etc/elasticsearch/jvm.options
内容
-Xms512m
-Xmx512m
1.5 外网访问
修改elasticsearch配置
vim /etc/elasticsearch/elasticsearch.yml
内容
network.host: 0.0.0.0
修改kibana配置
vim /etc/kibana/kibana.yml
内容
server.port: 5601
server.host: "0.0.0.0"
1.6 开机自启动 centos7.3
systemctl enable elasticsearch.service
systemctl enable kibana.service
1.7 查看是否安装成功
启动服务
service elasticsearch start
service kibana start
使用curl测试是否安装成功
curl localhost:9200
{
"name" : "ivSXnk-",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "JHnsTiI5R2aTIjGOi2vO3g",
"version" : {
"number" : "6.1.1",
"build_hash" : "bd92e7f",
"build_date" : "2017-12-17T20:23:25.338Z",
"build_snapshot" : false,
"lucene_version" : "7.1.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
分别浏览器访问以下地址
xxx.xxx.xxx.xxx:9200
xxx.xxx.xxx.xxx:5601