在CentOS上部署Filebeat的流程大致如下:
sudo yum update -y
yum-utils
。sudo yum install -y yum-utils
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.x.x-linux-x86_64.tar.gz
tar -zxvf filebeat-7.x.x-linux-x86_64.tar.gz -C /opt/
filebeat.yml
配置文件。cd /opt/filebeat
vim filebeat.yml
filebeat.inputs
:指定要监控的日志文件路径。output.elasticsearch
:配置Elasticsearch的地址和端口。setup.kibana
:配置Kibana的地址(如果需要)。nohup ./filebeat -e -c filebeat.yml &
sudo nano /lib/systemd/system/filebeat.service
[Unit]
Description=Filebeat
Wants=network-online.target
After=network-online.target
[Service]
User=root
Group=root
ExecStart=/opt/filebeat/filebeat -e -c /opt/filebeat/filebeat.yml
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable filebeat
sudo systemctl start filebeat
以上步骤提供了一个基本的Filebeat部署流程,具体版本可能会有所不同,请根据实际情况进行调整。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>