ELK之Filebeat自动断开问题解决

 

自动断开命令

 

解决自动断开命令

nohup ./filebeat -e -c filebeat.yml >./filebeat.log  2>&1 &  disown

 

其他的方式(目前我没有使用)

 

在linux操作系统 /etc/systemd/system目录下创建一个filebeat.service文件,写入如下内容

需要注意 替换文件的位置以及版本

[Unit]
Description=Filebeat is a lightweight shipper for metrics.
Documentation=https://www.elastic.co/products/beats/filebeat
Wants=network-online.target
After=network-online.target

[Service]
Environment="LOG_OPTS=-e"
Environment="CONFIG_OPTS=-c /home/soft/filebeat-7.15.2-linux-x86_64/filebeat.yml"
Environment="PATH_OPTS=-path.home /home/soft/filebeat-7.15.2-linux-x86_64/filebeat -path.config /home/soft/filebeat-7.15.2-linux-x86_64 -path.data /home/soft/filebeat-7.15.2-linux-x86_64/data -path.logs /home/soft/filebeat-7.15.2-linux-x86_64/logs"
ExecStart=/home/soft/filebeat-7.15.2-linux-x86_64/filebeat $LOG_OPTS $CONFIG_OPTS $PATH_OPTS
Restart=always

[Install]
WantedBy=multi-user.target

 

 

chmod +x /etc/systemd/system/filebeat.service

# 依次执行下列命令

systemctl daemon-reload

systemctl enable filebeat

systemctl start filebeat

 

posted @   不会游泳的鱼丶  阅读(92)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示