第一步: preinstallation
fluentd的官网url:https://docs.fluentd.org/ 。根据官网的推荐,需要安装配置ntp。(It’s HIGHLY recommended that you set up ntpd on the node to prevent invalid timestamps in your log.)。在安装fluentd之前,有preinstallation。需要修改一下两个文件:
a) /etc/security/limits.conf, 修改如下内容:
b) /etc/sysctl.conf,修改如下内容
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 12582912 16777216
net.ipv4.tcp_rmem = 4096 12582912 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
执行完b步骤文件内容的修改后,需要执行sysctl -p 命令来让修改生效。通知reboot server。
第二步: installation
执行命令:curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh
第三步:start fluentd
systemctl start td-agent.service / systemctl status td-agent.service / systemctl stop td-agent.service
第四步:配置td-agent.conf 文件
首先配置source:
接着进行mail的match配置
第三步:在souce配置的文件里面写入内容;
第四步: 查看邮箱
至此,所有流程已走完。