环境:基于docker compose部署loki+promtail服务,用于采集日志信息。已有现成的grafana服务,故此处部署为囊括grafana
1.docker-compose.yml配置文件
version: ‘2‘
services:
loki:
image: grafana/loki
container_name: loki
restart: always
ports:
- "3100:3100"
volumes:
- /home/dockerfile/loki/loki-local-config.yaml:/etc/loki/loki-local-config.yaml
command: -config.file=/etc/loki/loki-local-config.yaml
promtail:
image: grafana/promtail
container_name: promtail
restart: always
volumes:
- /home/dockerfile/loki/promtail-docker-config.yaml:/etc/promtail/promtail-docker-config.yaml
command:
-config.file=/etc/promtail/promtail-docker-config.yaml
2.loki-local-config.yaml配置文件(路径:/home/dockerfile/loki。根据实际情况存放即可)
auth_enabled: false
server:
http_listen_