技术流ken

运维拯救世界

ELK日志收集分析平台部署使用–技术流ken

ELK介绍

 

开源实时日志分析ELK平台能够完美的解决我们上述的问题,ELK由ElasticSearch、Logstash和Kiabana三个开源工具组成:


1)ElasticSearch是一个基于Lucene的开源分布式搜索服务器。它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格接口,多数据源,自动搜索负载等。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是第二流行的企业搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。 
在elasticsearch中,所有节点的数据是均等的。


2)Logstash是一个完全开源的工具,它可以对你的日志进行收集、过滤、分析,支持大量的数据获取方法,并将其存储供以后使用(如搜索)。说到搜索,logstash带有一个web界面,搜索和展示所有日志。一般工作方式为c/s架构,client端安装在需要收集日志的主机上,server端负责将收到的各节点日志进行过滤、修改等操作在一并发往elasticsearch上去。


3)Kibana 是一个基于浏览器页面的Elasticsearch前端展示工具,也是一个开源和免费的工具,Kibana可以为 Logstash 和 ElasticSearch 提供的日志分析友好的 Web 界面,可以帮助您汇总、分析和搜索重要数据日志。

 

 

ELK下载安装

 

注意:本文使用filebeat代替了logstash

 

第一步:下载下面的三个软件https://www.elastic.co/cn/products

[root@ken ~]# ls
elasticsearch-7.1.0-x86_64.rpm kibana-7.1.0-x86_64.rpm  filebeat-7.1.0-x86_64.rpm

 

第二步:下载java环境

[root@ken ~]# yum install java -y

 

第三步:安装ELK

[root@ken ~]# yum install elasticsearch-7.1.0-x86_64.rpm kibana-7.1.0-x86_64.rpm filebeat-7.1.0-x86_64.rpm   -y

 

 

filebeat配置

 

第一步:安装

[root@ken ~]# yum install filebeat-7.1.0-x86_64.rpm -y

 

第二步:配置filebeat

 

第三步:启动filebeat

[root@ken ~]# systemctl restart filebeat

 

elasticsearch启动

 

第一步:启动

[root@ken ~]# systemctl restart elasticsearch

 

kibana启动

 

第一步:修改监听地址

[root@ken ~]# vim /etc/kibana/kibana.yml

server.host: “192.168.64.4”

 

第二步:重启kibana

[root@ken ~]# systemctl restart kibana

 

查看所有端口

[root@ken ~]# ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 192.168.64.4:5601 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 ::ffff:127.0.0.1:9200 :::*
LISTEN 0 128 ::1:9200 :::*
LISTEN 0 128 ::ffff:127.0.0.1:9300 :::*
LISTEN 0 128 ::1:9300 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*

 

浏览器访问kibana

 

第一步:输入服务器IP

指定kibana端口5601

 

ELK使用

 

第一步:输入filebeat

 

第二步:选择timestamp

 

第三步:点击discovery可以发现日志

6 thoughts on “ELK日志收集分析平台部署使用–技术流ken

  1. I am also commenting to let you know of the great discovery my wife’s daughter developed visiting your webblog. She noticed too many things, not to mention what it is like to have an awesome teaching style to get other individuals without hassle know just exactly specified grueling matters. You really exceeded our own expectations. Thanks for giving the useful, healthy, educational not to mention easy guidance on that topic to Sandra.

  2. I as well as my guys were actually digesting the nice helpful tips found on your web blog and so at once I got a horrible suspicion I never expressed respect to you for those strategies. Those boys are actually warmed to see them and have now sincerely been having fun with these things. Thank you for truly being indeed accommodating and then for considering this sort of really good themes most people are really eager to be aware of. Our own honest apologies for not expressing gratitude to you sooner.

  3. I have to voice my affection for your generosity for men and women that must have guidance on the question. Your real dedication to getting the message up and down became rather beneficial and have frequently empowered individuals much like me to attain their aims. Your informative recommendations denotes this much a person like me and further more to my peers. Thank you; from everyone of us.

  4. I simply needed to say thanks once again. I do not know the things I could possibly have implemented in the absence of the actual techniques shared by you on this topic. It absolutely was a real horrifying issue for me, nevertheless taking a look at the very specialised approach you handled it took me to jump for contentment. Now i’m thankful for your guidance and even sincerely hope you realize what an amazing job you have been carrying out instructing men and women via your web page. Probably you haven’t encountered any of us.

  5. I needed to write you one tiny word to finally say thanks once again for your magnificent techniques you’ve featured at this time. It is really shockingly open-handed of people like you to supply publicly all that a number of us might have made available for an e book to get some bucks on their own, mostly seeing that you might well have done it if you decided. The points as well served as a good way to know that other people online have a similar dreams really like mine to know somewhat more in respect of this issue. Certainly there are numerous more fun instances ahead for those who read through your website.

  6. I must convey my admiration for your kind-heartedness giving support to men who must have guidance on the subject. Your real dedication to passing the solution all through came to be rather effective and have without exception allowed those like me to attain their objectives. Your important tips and hints means this much to me and even further to my mates. Thanks a ton; from each one of us.

发表评论

电子邮件地址不会被公开。