概念:
Grafana:用于图形展示。
grafana 是一款采用 go 语言编写的开源应用,主要用于大规模指标数据的可视化展现,是网络架构和应用分析中最流行的时序数据展示工具,目前已经支持绝大部分常用的时序数据库。(http://docs.grafana.org/)
Loki:是主服务器,负责存储日志和处理查询。grafana支持的时序数据库中的一种。除此之外还支持SqlServer、mysql等多种关系型数据库。
Promtail :是代理。负责收集日志并将其发送给loki。
安装:
本次演示windows服务器本地安装。
Grafana
下载地址:https://grafana.com/grafana/download?platform=windows
下载后傻瓜式安装即可,安装完毕后访问:http://localhost:3000/即可。
Loki
下载地址:https://github.com/grafana/loki/releases
安装说明:https://grafana.com/docs/loki/latest/installation/local/
下载release后解压到文件夹,得到一个EXE文件,然后exe文件同目录下添加loki-config.yaml文件,内容如下:
auth_enabled: false server: http_listen_port: 3100 ingester: lifecycler: address: 127.0.0.1 ring: kvstore: store: inmemory replication_factor: 1 final_sleep: 0s chunk_idle_period: 5m chunk_retain_period: 30s max_transfer_retries: 0 schema_config: configs: - from: 2020-06-22 store: boltdb object_store: filesystem schema: v11 index: prefix: index_ period: 168h storage_config: boltdb: directory: /tmp/loki/index filesystem: directory: /tmp/loki/chunks limits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 168h chunk_store_config: max_look_back_period: 0s table_manager: retention_deletes_enabled: false retention_period: 0s