Wener笔记故事指南
collector
fluentbit
- 沿用 cortex 逻辑
- 作者都是 tomwilkie
- distributor, ingester, querier, chunk
- Loki Storage
- writes a chunk per stream
- chunk_target_size (around 1MB), max_chunk_age (increase beyond 1h), chunk_idle_period (increase to match max_chunk_age)
- index - range -> chunkids
- BoltDB Shipper - 本地和远程同步 - 依赖对象存储
- Apache Cassandra - 兼容 scylladb
- Amazon DynamoDB
- Google Bigtable
- BoltDB - 单机
- chunk - chunkid -> blob
- Apache Cassandra
- Amazon S3
- 权限
- s3:ListBucket
- s3:PutObject
- s3:GetObject
- s3:DeleteObject - Single Store (boltdb-shipper) compactor
- Filesystem - 单机,除非 NFS - NFS 体验不好
- Amazon DynamoDB
- Google Bigtable
- Google Cloud Storage
- Components
- Distributor
- Hashing
- Quorum consistency
- Ingester
- 状态 - PENDING, JOINING, ACTIVE, LEAVING, UNHEALTHY
- Handoff
- Query frontend
- Querier
- 读取路径
- querier 接收到 HTTP 请求
- querier 将查询传递给 ingesters 处理内存数据
- ingesters 接收到读取请求返回匹配数据
- querier 从 backing store 懒加载数据 - 如果 ingesters 未返回数据
- querier 便利接收到的数据就行去重,返回最终结果
- 写入路径
- distributor 接收到写入请求 流
- 通过 hash ring 对 流 就行 hash 选取 ingesters
- distributor 将每个流转发给对应的 ingesters 和 副本
- ingester 会将流写入 chunk - chunk 在租户的 labelset 下唯一
- distributor 返回成功