服务器部署filebeat文件采集代理
# tar方式安装filebeat,并设置systemctl启动
tar zxf filebeat-7.17.9-linux-x86_64.tar.gz -C /etc/
mv /etc/filebeat-7.17.9-linux-x86_64 /etc/filebeat
rm filebeat-7.17.9-linux-x86_64.tar.gz -rf
cat > /etc/systemd/system/filebeat.service << EOF
[Unit]
Description=Elasticsearch Filebeat
[Service]
ExecStart=/etc/filebeat/filebeat -c /etc/filebeat/filebeat.yml
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat >> /etc/profile << EOF
export PATH=$PATH:/etc/filebeat/filebeat
EOF
source /etc/profile
sudo systemctl daemon-reload
sudo systemctl enable filebeat.service
sudo systemctl start filebeat.service
sudo systemctl status filebeat.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
编辑 (opens new window)