Log system architecture

0. 技术选型参考

Architecture

1. Collector

Keywords: Collector, Processor

名称BeatsFluentd-bit
IntroductionBeats are a collector and processor of lightweight (resource efficient, no dependencies, small) and open source log shippers that act as agents installed on the different servers in your infrastructure for collecting logs or metrics.Fluent Bit was born to address the need for a high performance and optimized tool that can collect and process data from any input source, unify that data and deliver it to multiple destinations.
OwnerElasticTreasure Data
Open SourceTrueTrue
Github Stars5742608
LicenseApache License v2.0Apache License v2.0
ScopeContainers / Servers / K8SContainers / Servers / K8S
LanguageGoC
Memory~10MB~500KB
PerformanceHighHigh
DependenciesZero dependencies, unless some special plugin requires them.Zero dependencies, unless some special plugin requires them.
CategoryAuditbeat,Filebeat,Heartbeat,Metricbeat,Packetbeat,WinlogbeatNaN
ConfigurationFile(.yml)/CmdFile(custom file extension and syntax)/Cmd
EssenceCollector & ProcessorCollector & Processor
Input/ModuleFile, Docker, Syslog, Nginx, Mysql, Postgresql, etcFile,CPU, Disk, Docker, Syslog, etc
OutputElasticsearch, Logstash, Kafka, Redis, File, ConsoleES, File, Kafka, etc

1.1 Filebeat 架构图

official filebeat

Original filebeat

Revolutional filebeat

  1. Ingest Node - A es plugin which pre-process documents before the actual document indexing happen and replace for Logstash. The ingest node intercepts bulk and index requests, it applies transformations, and it then passes the documents back to the index or bulk APIs. Define a pipeline(Processors) that specifies a series of processors, then register the pipeline id in Filebeat configuration file.
  2. Kafka - Prevent loss of data and manage logging output speed.

1.2 Fluent bit 架构图

Logging pipeline

NameDescriptionSamples
InputEntry point of data. Implemented through Input Plugins, this interface allows to gather or receive data.Samples
ParserParsers allow to convert unstructured data gathered from the Input interface into a structured one. Parsers are optional and depends on Input plugins.Prospector and processors in Filebeat
FilterThe filtering mechanism allows to alter the data ingested by the Input plugins. Filters are implemented as plugins.Prospector and processors in Filebeat
BufferBy default, the data ingested by the Input plugins, resides in memory until is routed and delivered to an Output interface.
RoutingData ingested by an Input interface is tagged, that means that a Tag is assigned and this one is used to determinate where the data should be routed based on a match rule.
OutputAn output defines a destination for the data. Destinations are handled by output plugins. Note that thanks to the Routing interface, the data can be delivered to multiple destinations.Samples

2. Log Transporter

Keywords: Collector, Processor, Aggregator

名称LogstahFluentd
IntroductionLogstash is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your stash.Fluentd is an open source data collector, which lets you unify the data.
OwnerElasticTreasure Data
Open SourceTrueTrue
Github Stars91056489
LicenseApache License v2.0Apache License v2.0
ScopeContainers / Servers / K8SContainers / Servers / K8S
LanguageJRuby(JVM)Ruby & C
Memory200MB+~40MB
PerformanceMiddleHigh
DependenciesJVMRuby Gem
ConfigurationFile(custom file extension and syntax)/CmdFile(custom file extension and syntax)/Cmd
EssenceCollector, Processor, AggregatorCCollector, Processor, Aggregator
Input/ModuleLimited only by your imagination(Serilog)Limited only by your imagination(Nlog)
OutputLimited only by your imaginationLimited only by your imagination

Further Reading: Fluentd vs. Logstash: A Comparison of Log Collectors

3. 初步总结

比较Beats + LogstashFluentd bit + Fluentd说明
功能实现基本一致
安装与配置简易性
内存占用JVM 特性使然
可靠性前者使用 registry file + redis 实现可靠性,后者使用内置 buffering 实现可靠性
可扩展性插件生态和可扩展性基本一致。后者为分布型插件管理
趋势ELK -> EFK
其他前者更倾向于使用 go & java 技术栈,后者有 docker, k8s 官方 log driver 类型和案例支持

Tips: 任一层级都可以自由替换.

4. Visualizer

Keywords: Query, Analyze, Monitor

名称KibanaGrafana
IntroductionKibana is an open source data visualization plugin for Elasticsearch.Data visualization & Monitoring with support for Graphite, InfluxDB, Prometheus, Elasticsearch and many more databases.The leading open source software for time series analytics.
OwnerElasticGrafana
Open SourceTrueTrue
Github Stars9k+22k+
LicenseApache License v2.0Apache License v2.0
ScopeElasticSearch onlyElasticSearch, InfluxDB, PostgreSQL etc
LanguageJavascriptGo & Typescript
ConfigurationFile(.yml)/CmdFile(custom file extension and syntax)/Cmd
Simple QueryLucene syntax and filter componentsfilter components.Different from each other data source
Full-Text QueryYesNo
SecurityPlugins or librariesIntegration
NotificationPlugins or librariesIntegration
AdvantagesLog, ESMultiple data source, APM, Timeseries

Working together.

5. Log Storage and Analyzer

Keywords:Storage, ES, Postgresql, Zombodb, Arangodb

5.1 ElasticSearch

  1. 同时支持单文档的对象搜索+模糊搜索+全文搜索
  2. Skywalking 官方支持存储媒介
  3. 作为流行 Output 支持绝大部分 Log 相关系统
  4. 天生分布式
  5. 一键设置过期窗口,索引重建
  6. ……

  1. 占用资源较多,对存储介质要求高
  2. 运维成本更高
  3. 持久化
  4. 安全性 - Search Guard
  5. ……

6. 总结

  1. Sinks(Log sinks, Beats, Fluentd-bit) -> Storages(ElasticSearch, Postgresql,Zombodb etc).
  2. Collctors(Beats, Fluentd-bit) -> Kafka -> Fluentd -> Storages(ElasticSearch, Postgresql,Zombodb etc).

7. 扩展

APM
Skywalking architecture

转载于:https://www.cnblogs.com/Wddpct/p/9289478.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值