进入自启动目录
cd /lib/systemd/system
vi filebeat.service
编写service
# After:在网络service启动之后启动
[Unit]
Description=filebeat
Documentation=https://www.elastic.co/
Wants=network-online.target
After=network-online.target[Service]
User=root
ExecStart=/app/filebeat/filebeat-7.2.0-linux-x86_64/filebeat -c /app/filebeat/filebeat-7.2.0-linux-x86_64/filebeat.ymlRestart=always
[Install]
WantedBy=multi-user.target
启动验证
systemctl daemon-reloa

本文档详细介绍了如何在Linux系统中将FileBeat配置为自启动服务。首先,进入/lib/systemd/system目录并编辑filebeat.service文件,指定启动参数。然后,使用systemctl命令进行服务管理,包括加载配置、启动、设置开机自启动、查看状态及重启服务。通过systemctl status filebeat.service可以查看服务运行详情和进程信息。
订阅专栏 解锁全文
3112

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



