2、修改配置文件
[root@localhost bin]# cat /etc/kibana/kibana.yml | grep -v "^#" | grep -v "^$"
server.port: 5601
server.host: "10.244.78.230"
elasticsearch.url: "http://10.244.78.230:9200"
elasticsearch.username: "elastic"
elasticsearch.password: "123456"
3、安装x-pack插件
cd /usr/share/kibana/bin/
./kibana-plugin install x-pack
4、启动kibana
systemctl start kibana
5、访问测试(默认端口为5601)
五、部署logstash
1、rpm安装
cd /opt
rpm -ivh logstash-6.2.4.rpm
2、修改配置文件
mkdir -p /usr/share/logstash/config
cp /etc/logstash/log4j2.properties /usr/share/logstash/config
[root@localhost logstash]# cat /etc/logstash/logstash.yml | grep -v "^#" | grep -v "^$"
node.name: logstash
path.data: /var/lib/logstash
path.config: /etc/logstash/conf.d
config.test_and_exit: True
path.logs: /var/log/logstash
3、编写测试conf
一般放在/etc/logstash/conf.d目录下
[root@localhost conf.d]# cat test.conf
input {
stdin {
}
}
output {
elasticsearch {
hosts =>["10.244.78.230:9200"]
index => "test-%{+YYYY.MM.dd}"
user => elastic
password => "123456"
}
stdout {
codec => rubydebug
}
}
4、测试运行
/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/test.conf(用来临时做测试用)
5、打开kibana查看
6、开启kibana
后期生产环境中,只需:
1、编写好conf文件
2、启动logstash即可,systemctl start logstash
7、kibana中x-pack认证问题
显示试用期为30天。预知如何增加时间,请看https://www.linuxidc.com/Linux/2018-08/153528.htm。
更多ELK相关教程见以下内容:
基于CentOS 6.9搭建ELK环境指南 https://www.linuxidc.com/Linux/2017-07/145636.htm
Linux日志分析ELK环境搭建 https://www.linuxidc.com/Linux/2017-07/145494.htm
Logstash 监控日志文件时应对日志文件名改变的原理 https://www.linuxidc.com/Linux/2016-08/133994.htm
使用Elasticsearch + Logstash + Kibana搭建日志集中分析平台实践 https://www.linuxidc.com/Linux/2015-12/126587.htm
ELK日志管理平台搭建教程 https://www.linuxidc.com/Linux/2018-07/153136.htm
CenttOS 6.6下部署ELK日志告警系统 https://www.linuxidc.com/Linux/2018-05/152192.htm
CentOS 7单机部署ELK https://www.linuxidc.com/Linux/2017-11/148222.htm
CentOS 安装 Logstash 2.2.0 和 Elasticsearch 2.2.0 https://www.linuxidc.com/Linux/2016-03/128794.htm
ElasticSearch 的详细介绍:请点这里
ElasticSearch 的下载地址:请点这里
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx