Loki
约 1 分钟阅读
- grafana/lokiGitHubgrafana/lokigrafana/loki 是什么 ? · AGPL-3.0, Go · 日志界的 Prometheus · Architecture · 日写入 < 100GB 考虑部署单体服务即可 · 单体服务也可以多接点扩容 · 微服务模式维护起来更麻烦笔记:Loki 是什么 ?
- AGPL-3.0, Go
- 日志界的 Prometheus
- Architecture
- 日写入 < 100GB 考虑部署单体服务即可
- 单体服务也可以多接点扩容
- 微服务模式维护起来更麻烦
- 参考
- vs. EFK链接grafana.com/docs/loki/latest/overview/comparisonsgrafana/loki 是什么 ? · AGPL-3.0, Go · 日志界的 Prometheus · Architecture · 日写入 < 100GB 考虑部署单体服务即可 · 单体服务也可以多接点扩容 · 微服务模式维护起来更麻烦笔记:Loki
- An introduction to Loki, the Prometheus-inspired open source logging system链接grafana.com/blog/2020/05/12/an-only-slightly-technical-introduction-to-loki-the-prometheus-inspired-open-source-logging-systemgrafana/loki 是什么 ? · AGPL-3.0, Go · 日志界的 Prometheus · Architecture · 日写入 < 100GB 考虑部署单体服务即可 · 单体服务也可以多接点扩容 · 微服务模式维护起来更麻烦笔记:Loki
- Loki compared to other log systems链接grafana.com/docs/loki/latest/overview/comparisonsgrafana/loki 是什么 ? · AGPL-3.0, Go · 日志界的 Prometheus · Architecture · 日写入 < 100GB 考虑部署单体服务即可 · 单体服务也可以多接点扩容 · 微服务模式维护起来更麻烦笔记:Loki
配置
collector
- grafana.com/docs/loki/latest/clients
- Promtail
- FluentD & Fluent-bit
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 - 本地和远程同步 - 依赖对象存储
- 24h 周期索引时工作最好
- 类似于 Thanos
- Apache Cassandra - 兼容 scylladb
- Amazon DynamoDB
- Google Bigtable
- BoltDB - 单机
- BoltDB Shipper - 本地和远程同步 - 依赖对象存储
- chunk - chunkid -> blob
- Apache Cassandra
- Amazon S3
- 权限
- s3
- s3
- s3
- s3 - Single Store (boltdb-shipper) compactor
- 权限
- Filesystem - 单机,除非 NFS - NFS 体验不好
- 单目录最多 5.5m #1502GitHub Issuegrafana/loki#1502
- Amazon DynamoDB
- Google Bigtable
- Google Cloud Storage
组件
- Components
- Distributor
- Hashing
- Consul
- Quorum consistency
- Hashing
- Ingester
- 状态 - PENDING, JOINING, ACTIVE, LEAVING, UNHEALTHY
- Handoff
- Query frontend
- 可选,无状态查询缓存
- 队列
- 拆分
- 缓存
- Querier
- 处理 LogQL - 查询分发
- 去重
- 读取路径
- querier 接收到 HTTP 请求
- querier 将查询传递给 ingesters 处理内存数据
- ingesters 接收到读取请求返回匹配数据
- querier 从 backing store 懒加载数据 - 如果 ingesters 未返回数据
- querier 便利接收到的数据就行去重,返回最终结果
- 写入路径
- distributor 接收到写入请求 流
- 通过 hash ring 对 流 就行 hash 选取 ingesters
- distributor 将每个流转发给对应的 ingesters 和 副本
- ingester 会将流写入 chunk - chunk 在租户的 labelset 下唯一
- distributor 返回成功
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub3 条
- grafana/lokigithub.com/grafana/loki
- grafana/loki/cmd/fluent-bitgithub.com/grafana/loki/tree/master/cmd/fluent-bit
- grafana/loki#1502github.com/grafana/loki/issues/1502
其他外链7 条
- grafana.com/docs/loki/latest/architecturegrafana.com/docs/loki/latest/architecture
- grafana.com/docs/loki/latest/overview/comparisonsgrafana.com/docs/loki/latest/overview/comparisons
- grafana.com/blog/2020/05/12/an-only-slightly-technical-introduction-to-loki-the-prometheus-inspired-open-source-logging-systemgrafana.com/blog/2020/05/12/an-only-slightly-technical-introduction-to-loki-the-prometheus-inspired-open-source-logging-system
- grafana.com/docs/loki/latest/clientsgrafana.com/docs/loki/latest/clients
- grafana.com/docs/loki/latest/clients/fluentbitgrafana.com/docs/loki/latest/clients/fluentbit
- grafana.com/docs/loki/latest/configurationgrafana.com/docs/loki/latest/configuration
- grafana.com/docs/loki/latest/operations/storagegrafana.com/docs/loki/latest/operations/storage