我尝试在一个不切实际的系统(Raspberry Pi)上运行 Prometheus,但我发现它不断失去连接,我猜测这与负载有关。我想知道是否可以通过添加更多副本来水平扩展它,我的实验相对较小
prometheus:
image: quay.io/prometheus/prometheus
command: >
--web.external-url=/prometheus/
--config.file=/etc/prometheus/prometheus.yml
--storage.tsdb.path=/prometheus
--storage.tsdb.retention.size=20MB
--web.console.libraries=/usr/share/prometheus/console_libraries
--web.console.templates=/usr/share/prometheus/consoles
--web.enable-lifecycle
networks:
- traefik
- default
- daemon
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /local/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
deploy:
replicas: 1
resources:
reservations:
cpus: '0.5'
memory: 0.5g
limits:
memory: 0.5g
labels:
- traefik.enable=true
- traefik.http.routers.prometheus.rule=PathPrefix(`/prometheus`)
- traefik.http.routers.prometheus.entryPoints=https
- traefik.http.services.prometheus.loadbalancer.server.port=9090
- traefik.http.services.prometheus.loadbalancer.healthcheck.path=/prometheus/-/ready
但是,当我设置为replicas=2
第二个节点时,由于锁定文件而启动失败,因此我认为无法以这种方式进行水平扩展。