安装Beats
网上下载链接:
https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.0.0-x86_64.rpm
通过CRT上传并安装:
[root@elk-3 ~]# ll
total 39028
-rw-------. 1 root root 1079 Nov 9 22:48 anaconda-ks.cfg
-rw-r--r--. 1 root root 27970243 Feb 22 01:12 elasticsearch-6.0.0.rpm
-rw-r--r--. 1 root root 11988378 Feb 22 10:09 filebeat-6.0.0-x86_64.rpm
[root@elk-3 ~]# rpm -ivh filebeat-6.0.0-x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:filebeat-6.0.0-1 ################################# [100%]
配置Beats
编辑配置文件:
[root@elk-3 ~]# vi /etc/filebeat/filebeat.yml
#Change to true to enable this prospector configuration.
# enabled: false(前加#号)
paths:
- /var/log/elasticsearch/elk.log
# Array of hosts to connect to.
hosts: ["192.168.200.11:9200"]
启动:
[root@elk-3 ~]# systemctl restart filebeat
[root@elk-3 ~]# systemctl start filebeat
在elk-1主机上使用curl '192.168.200.11:9200/_cat/indices?v’命令查看是否监听到elk-3主机上的日志
Web界面配置
在浏览器中添加filebeat日志文件的监控: