Monitoring multiple servers/types
Closed this issue · 2 comments
Hi, is there a way to monitor multiple server types with a single mc-monitor stack?
I've added the following in my compose:
- EXPORT_SERVERS=mc,mcb:19132
A second bedrock server (mcb) does appear in Grafana with some metrics but some data missing.
Is there something that needs doing with a sub-command server-type ? I'm running one Java (mc) and one Bedrock (mcb) instance.
docker-compose.yml
`version: "3.8"
services:
mc:
image: itzg/minecraft-server:java8
ports:
- 25565:25565/tcp
environment:
- EULA=TRUE
- MEMORY=2G
- TYPE=FORGE
- VERSION=1.16.5
- DEBUG=true
- MAX_PLAYERS=5
volumes:
- ./config:/data
- ./config/plugins:/plugins
# attach local host directory "mods" in same directory as this compose file
# all mods in this directory get copied into /data/mods at startup
- ./mods:/mods
restart: unless-stopped
tty: true
stdin_open: true
mcb:
image: itzg/minecraft-bedrock-server:latest
ports:
- 19132:19132/udp
environment:
- EULA=TRUE
- TZ=Australia/Perth
- GAMEMODE=creative
- DIFFICULTY=peaceful
- PACKAGE_BACKUP_KEEP=2
volumes:
- ./mcb/config:/data
restart: unless-stopped
tty: true
stdin_open: true
monitor:
image: itzg/mc-monitor
command: export-for-prometheus
environment:
- EXPORT_SERVERS=mc,mcb:19132
- DEBUG=true
depends_on:
- mc
- mcb
cadvisor:
image: gcr.io/cadvisor/cadvisor
ports:
- 8180:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-tsdb:/prometheus
depends_on:
- monitor
grafana:
image: grafana/grafana-oss:${GRAFANA_VERSION:-8.3.3}
ports:
- 3000:3000
volumes:
- grafana-lib:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
- ./dashboards:/etc/grafana/dashboards
depends_on:
- prometheus
backups:
image: itzg/mc-backup
environment:
BACKUP_INTERVAL: "2h"
# instead of network_mode below, could declare RCON_HOST
# RCON_HOST: mc
volumes:
# mount the same volume used by server, but read-only
- ./config:/data:ro
# use a host attached directory so that it in turn can be backed up
# to external/cloud storage
- /mnt/backup/mc-backups:/backups
# share network namespace with server to simplify rcon access
network_mode: "service:mc"
depends_on:
- mc
volumes:
prometheus-tsdb: {}
grafana-lib: {}
`
Bedrock servers need to be listed in EXPORT_BEDROCK_SERVERS
in addition to EXPORT_SERVERS
That was it, thanks!