logstash 介绍

        LogStash由JRuby语言编写,基于消息(message-based)的简单架构,并运行在Java虚拟机 (JVM)上。不同于分离的代理端(agent)或主机端(server),LogStash可配置单一的代理端 (agent)与其它开源软件结合,以实现不同的功能。

        logStash的四大组件 Shipper:发送事件(events)至LogStash;通常,远程代理端(agent)只需要运行这个组件即可; Broker and Indexer:接收并索引化事件; Search and Storage:允许对事件进行搜索和存储; Web Interface:基于Web的展示界面 正是由于以上组件在LogStash架构中可独立部署,才提供了更好的集群扩展性。

        LogStash主机分类 代理主机(agent host):作为事件的传递者(shipper),将各种日志数据发送至中心主机;只需运 行Logstash 代理(agent)程序; 中心主机(central host):可运行包括中间转发器(Broker)、索引器(Indexer)、搜索和存储器 (Search and Storage)、Web界面端(Web Interface)在内的各个组件,以实现对日志数据的接 收、处理和存储。

安装

官方网址:Installing Logstash | Logstash Reference [7.2] | Elastic​​​​​​

 安装依赖环境:

[root@nginx2 ~]# yum install -y jdk*.rpm
[root@nginx2 yum.repos.d]# java -version
java version "1.8.0_421"
Java(TM) SE Runtime Environment (build 1.8.0_421-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.421-b09, mixed mode)

下载并安装公共签名密钥:

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

配置logstash镜像源:

[logstash-7.x]
name=Elastic repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

安装logstash:

sudo yum install logstash

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部