tidaldb/docker/docker-compose.cluster.yml

73 lines
2.0 KiB
YAML

# 3-node tidalDB cluster for local testing.
#
# Starts one leader (us-east) and two followers (eu-west, ap-south).
# WAL segments are replicated over TCP between the replication ports.
#
# Usage:
# docker compose -f docker/docker-compose.cluster.yml up --build
#
# Health:
# curl http://localhost:9400/health # us-east (leader)
# curl http://localhost:9401/health # eu-west (follower)
# curl http://localhost:9402/health # ap-south (follower)
services:
us-east:
build:
context: ..
dockerfile: docker/standalone/Dockerfile
command:
- cluster
- --listen=0.0.0.0:9400
- --cluster-config=/etc/tidal/cluster.yaml
- --data-dir=/var/lib/tidaldb
- --schema=/etc/tidal/schema.yaml
ports:
- "9400:9400"
- "9500:9500"
volumes:
- ./cluster-configs/us-east.yaml:/etc/tidal/cluster.yaml:ro
- ../tidal-server/config/default-schema.yaml:/etc/tidal/schema.yaml:ro
- us-east-data:/var/lib/tidaldb
eu-west:
build:
context: ..
dockerfile: docker/standalone/Dockerfile
command:
- cluster
- --listen=0.0.0.0:9400
- --cluster-config=/etc/tidal/cluster.yaml
- --data-dir=/var/lib/tidaldb
- --schema=/etc/tidal/schema.yaml
ports:
- "9401:9400"
- "9501:9500"
volumes:
- ./cluster-configs/eu-west.yaml:/etc/tidal/cluster.yaml:ro
- ../tidal-server/config/default-schema.yaml:/etc/tidal/schema.yaml:ro
- eu-west-data:/var/lib/tidaldb
ap-south:
build:
context: ..
dockerfile: docker/standalone/Dockerfile
command:
- cluster
- --listen=0.0.0.0:9400
- --cluster-config=/etc/tidal/cluster.yaml
- --data-dir=/var/lib/tidaldb
- --schema=/etc/tidal/schema.yaml
ports:
- "9402:9400"
- "9502:9500"
volumes:
- ./cluster-configs/ap-south.yaml:/etc/tidal/cluster.yaml:ro
- ../tidal-server/config/default-schema.yaml:/etc/tidal/schema.yaml:ro
- ap-south-data:/var/lib/tidaldb
volumes:
us-east-data:
eu-west-data:
ap-south-data: