java/monitoring/docker-compose.business.yml
liRQ 39a5d5d4ee 任务:添加监控及服务重启脚本
添加Prometheus/Grafana/Loki监控配置、Promtail配置、业务与监控服务器docker-compose文件以及Bash/PowerShell服务重启脚本
2026-06-25 18:27:47 +08:00

36 lines
1.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
# 业务服务器专用配置118.178.238.159
# 只部署 Node Exporter 和 Promtail用于采集指标和日志
services:
# Node Exporter - 采集业务服务器的硬件指标CPU、内存、磁盘等
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
ports:
- "9100:9100"
# Promtail - 采集应用日志,发送给监控服务器的 Loki
promtail:
image: grafana/promtail:latest
container_name: promtail
restart: unless-stopped
volumes:
- ./promtail.yml:/etc/promtail/config.yml
- /var/log:/var/log
- /opt/wangpan/logs:/opt/wangpan/logs
command: -config.file=/etc/promtail/config.yml
ports:
- "9080:9080"