天天看点

ELK Stack 之X-Pack安装使用详解

一、准备工作

在安装X-Pack之前,确保Elasticsearch6.x、Kibana6.x、Logstash6.x相关软件已经安装。

安装方法可参考:

http://blog.csdn.net/guyan0319/article/details/78749639

二、安装X-Pack

1、Elasticsearch 安装 x-pack

whereis elasticsearch
           

查看 Elasticsearch 安装的目录

ELK Stack 之X-Pack安装使用详解
cd /usr/share/elasticsearch
bin/elasticsearch-plugin install x-pack
           

两次出现Continue with installation? [y/N]

输入y就可以了

重启elasticsearch

systemctl restart elasticsearch
           

生成默认账号

bin/x-pack/setup-passwords auto
           

出现Please confirm that you would like to continue [y/N]

输入y,会生成一下账号

ELK Stack 之X-Pack安装使用详解

其中 elastic 账户是超级账户,拥有所以权限

2、Kibana 安装 X-Pack

查看kibana 安装目录

whereis kibana
           
cd /usr/share/kibana
bin/kibana-plugin install x-pack
           

编辑kibana.yml

添加

elasticsearch.username: "elastic" 
elasticsearch.password: "f@Na@XAtzdfOJd3Al_"  #生成的密码
           

重启kibana

systemctl restart kibana
           

3、logstash 安装 x-pack

查看 logstash目录

whereis logstash
           
cd /usr/share/logstash
bin/logstash-plugin install x-pack
           

配置 logstash.yml

增加

xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.password: logstashpassword  #对应1产生的密码
           

如果想取消登录验证,则在elasticsearch和kibana、logstash的配置里分别加入

参考文献:

https://www.elastic.co/downloads/x-pack

https://www.elastic.co/guide/en/x-pack/current/xpack-introduction.html