ELK 二进制安装filebeat开机自启动设置

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

我的是Ubuntu 20.04

我的安装路径为:/usr/local/filebeat/filebeat-7.6.2-linux-x86_64

系统环境: ubuntu 20.04
filebeat版本: 7.6.2
配置方法

1. 进入自启动目录:
cd /lib/systemd/system
vim filebeat.service

2.编写filebeat.service
#############事例#############
[Unit]
Description=filebeat
Wants=network-online.target
After=network-online.target

[Service]
User=root
ExecStart=/var/filebeat/filebeat -e -c /var/filebeat/filebeat.yml #/var/filebeat为filebeat的安装目录
Restart=always #设置为掉线自动重启,进程强制杀掉后会自动重新启动

[Install]
WantedBy=multi-user.target

#####下面是我的#####################
[Unit]
Description=filebeat
Wants=network-online.target
After=network-online.target

[Service]
User=root
ExecStart=/usr/local/filebeat/filebeat-7.6.2-linux-x86_64/filebeat -e -c /usr/local/filebeat/filebeat-7.6.2-linux-x86_64/filebeat.yml
Restart=always

[Install]
WantedBy=multi-user.target



启动验证
systemctl daemon-reload #加载配置

systemctl start filebeat #启动filebeat服务
systemctl enable filebeat #设置开机自启动
systemctl disable filebeat #停止开机自启动
systemctl status filebeat #查看服务当前状态
systemctl restart filebeat  #重新启动服务
systemctl list-units --type=service #查看所有已启动的服务






阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: elk

“ELK 二进制安装filebeat开机自启动设置” 的相关文章