在阿里云Ubuntu安装Elasticsearch+Filebeat+Kibana手记(5)
——Filebeat 安装+后记
Filebeat的安装包很小,步骤也很简单,具体如下:
安装步骤
1. 下载并解压缩
官网下载 (https://www.elastic.co/downloads) filebeat-6.5.4-linux-x86_64.tar.gz 文件
上传到服务器一个目录,我是放到 /usr目录下,解压缩:
tar -zxvf filebeat-6.5.4-linux-x86_64.tar.gz
2. 修改Filebeat的配置文件
配置文件就在Filebeat安装目录下,找 filebeat.yml,主要需要修改的项目包括:
输入:

Kibana的地址:

Elasticsearch的地址:

3.启动filebeat
简单启动测试一下,可以在安装目录下直接运行
./filebeat &
但这样当 shell会话关闭以后,就不能持续采集日志了。为了保持程序一直运行,可以用nohup启动:
nohup ./filebeat -e >/dev/null 2>&1 &
整体验证效果
1. 用elasticsearch-head 看看效果
可以看到 elasticsearch的node-1节点,kibana, filebeat都启动并在运行

2. 用Kibana看看效果
如果什么都不做,刚才Filebeat采集的日志是看不到的,所以还需要添加index pattern,方法如下:
访问Kibana,http://localhost:5601

现在访问 Discovery ,原则上就可以看到数据了。如果看不到,尝试改一下上面的时间范围:

后记
至此就算基本搞定了,后续就是深入研究一下Elasticsearch和Kibana的详细使用。
总的来看,安装最麻烦是是Elasticsearch 和Elasticsearch head,其他的都还比较简单。
主要参考资料:
https://blog.csdn.net/laravelshao/article/details/79842827
https://blog.csdn.net/xuewuzhijing10/article/details/53508362
本文详述了在阿里云Ubuntu服务器上安装Elasticsearch、Filebeat和Kibana的过程,重点在于Filebeat的安装步骤,包括下载解压、配置文件修改(设定Kibana和Elasticsearch地址)以及使用nohup确保Filebeat后台运行。通过elasticsearch-head和Kibana验证了Filebeat成功收集并传输日志。
1838

被折叠的 条评论
为什么被折叠?



