docker-compose配置
关于docker-compose的配置安装可以参考我的这篇笔记: Docker-compose安装配置讲解文章来源:https://www.toymoban.com/news/detail-498929.html
创建docker-compose.yml配置文件文章来源地址https://www.toymoban.com/news/detail-498929.html
version: '3'
services:
prometheus:
image: prom/prometheus:v2.30.3
container_name: prometheus
deploy:
resources:
limits:
cpus: '0.8'
memory: 12G
ports:
- 9090:9090
privileged: true
volumes:
- /data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- /data/prometheus/data:/prometheus
- /app/ca/server/server.crt:/etc/prometheus/server.crt
- /app/ca/server/server.key:/etc/prometheus/server.key
- /app/ca/root/ca.crt:/etc/prometheus/ca.crt
- /data/prometheus/rules:/etc/prometheus/rules
- /data/prometheus/web-config.yml:/etc/prometheus/web-config.yml
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
depends_on:
- node-exporter
environment:
- TZ=Asia/Shanghai
networks:
- monitoring
node-exporter:
image: prom/node-exporter:v1.2.2
container_name: node-exporter
privileged: true
ports:
- 9100:9100
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/tim
到了这里,关于Prometheus-07 Docker-compose安装配置prometheus以及初步分析CPU/内存利用率分析的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!