一、准备工作
在安装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 安装的目录
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiI0NXYFhGd192UvwVe0lmdhJ3ZvwFM38CXlZHbvN3cpR2Lc1TPB10QGtWUCpEMJ9CXsxWam9CXwADNvwVZ6l2c052bm9CXUJDT1wkNhVzLcRnbvZ2LcVTR610d0cVW1Y1MaZXUYpVd1kmYr50MZV3YyI2cKJDT29GRjBjUIF2LcRHelR3LcJzLctmch1mclRXY39TO1cTN0gjMyIDMyITM3EDMy8CX0Vmbu4GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.jpg)
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,会生成一下账号
其中 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