1. 下载并解压安装
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.22-linux-x86_64.tar.gz
tar xzvf filebeat-7.17.22-linux-x86_64.tar.gz
mv filebeat-7.17.22-linux-x86_64 /usr/local/filebeat编写 filebeat.service
vi /usr/local/filebeat/filebeat.service
[Unit]
Description=Filebeat sends log files to Logstash or directly to Elasticsearch.
Documentation=https://www.elastic.co/beats/filebeat
Wants=network-online.target
After=network-online.target
[Service]
Environment="GODEBUG='madvdontneed=1'"
Environment="BEAT_LOG_OPTS="
Environment="BEAT_CONFIG_OPTS=-c /etc/filebeat/filebeat.yml"
Environment="BEAT_PATH_OPTS=--path.home /usr/share/filebeat --path.config /etc/filebeat --path.data /var/lib/filebeat --path.logs /var/log/filebeat"
ExecStart=/usr/share/filebeat/bin/filebeat --environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS
Restart=always
[Install]
WantedBy=multi-user.target创建服务链接
ln -s /usr/local/filebeat/filebeat.service /usr/lib/systemd/system/filebeat.service使服务生效
systemctl deamon-reload
2. 使用源安装(暂略)
作者:admin 创建时间:2023-10-19 19:19
最后编辑:admin 更新时间:2024-06-20 12:21
最后编辑:admin 更新时间:2024-06-20 12:21