Centos7 安装ELK日志分析
1.安装前准备
借鉴:https://www.cnblogs.com/straycats/p/8053937.html
操作系统:Centos7 虚拟机 8G内存 jdk8+
软件包下载:采用rpm方式部署 https://www.elastic.co/cn/downloads
2.安装ElasicSearch
rpm -ivh elasticsearch-6.4.2.rpm
rpm -ql elasticsearch # default /usr/share/elasticsearch
#默认日志目录 /var/log/elasticsearch
/etc/elasticsearch/elasticsearch.yml 配置文件
path.data #数据目录
path.logs #日志目录
network.host #监听地址
http.port #监听端口
#启动服务
systemctl start elasticsearch
systemctl enable elasticsearch
#检查
netstat -anlpt | grep 9200
curl http://127.0.0.1:9200
看到以下内容证明启动成功
3.安装logstash
rpm -ivh logstash-6.4.2.rpm
/etc/logstash/logstash.yaml 配置文件
path.data
path.config
path.logs
#启动(会比较慢)
systemctl start logstash
systemctl enable logstash
ln -s /usr/share/logstash/bin/logstash /bin/
以下证明启动成功
4.安装Kibana
rpm -ivh kibana-6.4.2-x86_64.rpm
/etc/kibana/kibana.yml 配置文件
server.port
server.host
elasticsearch.url
kibana.index
#启动
systemctl start kibana
systemctl enable kibana
netstat -anlpt | grep 5601
http://192.168.0.15:5601
关注公众号
![微信公众号](https://raw.githubusercontent.com/zeyangli/Jenkins-docs/master/chapter/static/image/qrcode_for%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E5%85%AC%E4%BC%97%E5%8F%B7.jpg)