Linux部署Filebeat
2021/8/23 7:28:38
本文主要是介绍Linux部署Filebeat,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1 下载
[root@localhost ~]# cd /home/elk
1.1 ELK7.8.1
[root@localhost elk]# wget https://artifacts.elastic.co/downloads/logstash/logstash-7.8.1.tar.gz
[root@localhost elk]# wget https://artifacts.elastic.co/downloads/kibana/kibana-7.8.1-linux-x86_64.tar.gz
[root@localhost elk]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.1-linux-x86_64.tar.gz
[root@localhost elk]# wget https://artifacts.elastic.co/downloads/elasticsearch/filebeat-7.8.1-linux-x86_64.tar.gz
2 Filebeat安装
2.1 解压
[root@localhost elk]# tar -zxvf filebeat-7.8.1-linux-x86_64.tar.gz -C /home/elk/
[root@localhost elk]# cd filebeat-7.8.1-linux-x86_64/
2.2 修改配置
[root@localhost filebeat-7.8.1-linux-x86_64]# vi filebeat.yml
# ============================== Filebeat inputs =============================== filebeat.inputs: # Each - is an input. Most options can be set at the input level, so # you can use different inputs for various configurations. # Below are the input specific configurations. - type: log # Change to true to enable this input configuration. enabled: true # Paths that should be crawled and fetched. Glob based paths. paths: #- /var/log/*.log - /home/logs/*.log #- c:\programdata\elasticsearch\logs\* ..... # -------------------------------- Kafka Output -------------------------------- output.kafka: # initial brokers for reading cluster metadata # hosts: ["kafka1:9092", "kafka2:9092", "kafka3:9092"] hosts: ["192.168.56.13:9092"] # message topic selection + partitioning topic: 'gsdss-test' partition.round_robin: reachable_only: false required_acks: 1 compression: gzip max_message_bytes: 1000000 # ---------------------------- Elasticsearch Output ---------------------------- #output.elasticsearch: # Array of hosts to connect to. #hosts: ["localhost:9200"] # Protocol - either `http` (default) or `https`. #protocol: "https" # Authentication credentials - either API key or username/password. #api_key: "id:api_key" #username: "elastic" #password: "changeme"
2.3 创建Kafka的Topic
#使用kafka-topics.sh创建topic bin/kafka-topics.sh --create --zookeeper 192.168.56.13:2181 --replication-factor 1 --partitions 1 --topic gsdss-test
2.4 启动
#后台启动 [root@localhost filebeat-7.8.1-linux-x86_64]# nohup ./filebeat -c ./filebeat.yml & #查看控制台 [root@localhost filebeat-7.8.1-linux-x86_64]# tail -f nohup.out #关闭,通过发送SIGTERM给Logstash进程来停止它 [root@localhost logstash-7.6.2]# kill -15 {pid}
这篇关于Linux部署Filebeat的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-12如何创建可引导的 ESXi USB 安装介质 (macOS, Linux, Windows)
- 2024-11-08linux的 vi编辑器中搜索关键字有哪些常用的命令和技巧?-icode9专业技术文章分享
- 2024-11-08在 Linux 的 vi 或 vim 编辑器中什么命令可以直接跳到文件的结尾?-icode9专业技术文章分享
- 2024-10-22原生鸿蒙操作系统HarmonyOS NEXT(HarmonyOS 5)正式发布
- 2024-10-18操作系统入门教程:新手必看的基本操作指南
- 2024-10-18初学者必看:操作系统入门全攻略
- 2024-10-17操作系统入门教程:轻松掌握操作系统基础知识
- 2024-09-11Linux部署Scrapy学习:入门级指南
- 2024-09-11Linux部署Scrapy:入门级指南
- 2024-08-21【Linux】分区向左扩容的方法