/
krishnaditya
/
Kinetis
Обзор
Документация
Войти
/
krishnaditya
/
Kinetis
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docker-compose.multi-node.yml
63 строки
2 KB
Krishnaditya
infra
03 июн 2026, 00:50
03 июн 2026, 00:50
02d3ccc
Код
Авторство
О чём код?
# Multi-node demo: two scheduler nodes with disjoint static shard assignments. # Node A owns shards 0-7; Node B owns shards 8-15 (of 16 total). # Both share the same Postgres — SKIP LOCKED within each shard prevents double-dispatch. # # Usage: # cp .env.example .env # docker compose -f docker-compose.yml -f docker-compose.multi-node.yml up --build # # Submit jobs to localhost:8080 (node-a) or localhost:8081 (node-b). # Jobs are hash-assigned to a shard; each node claims only its own partition. services: app: deploy: replicas: 0 # disable single-node service from docker-compose.yml node-a: build: context: . dockerfile: Dockerfile depends_on: postgres: condition: service_healthy environment: DB_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-kinetis} DB_USER: ${DB_USER:-kinetis} DB_PASSWORD: ${DB_PASSWORD:-kinetis} SERVER_PORT: 8080 NODE_ID: node-a SCHED_TOTAL_SHARDS: 16 SCHED_OWNED_SHARDS: "0-7" LOG_LEVEL: ${LOG_LEVEL:-INFO} ports: - "8080:8080" healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:8080/actuator/health | grep -q UP || exit 1"] interval: 5s timeout: 3s retries: 20 node-b: build: context: . dockerfile: Dockerfile depends_on: postgres: condition: service_healthy environment: DB_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-kinetis} DB_USER: ${DB_USER:-kinetis} DB_PASSWORD: ${DB_PASSWORD:-kinetis} SERVER_PORT: 8080 NODE_ID: node-b SCHED_TOTAL_SHARDS: 16 SCHED_OWNED_SHARDS: "8-15" LOG_LEVEL: ${LOG_LEVEL:-INFO} ports: - "8081:8080" healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:8080/actuator/health | grep -q UP || exit 1"] interval: 5s timeout: 3s retries: 20