As far as I know, this is due to the conflict caused by multiple alpha using the same p directory. You only need to separate the data volumes of different alpha.
Here is my yaml
version: "3.2"
networks:
dgraph:
services:
zero1:
image: dgraph/dgraph:v21.03.2
volumes:
- ./dgraph_data/zero1:/dgraph
ports:
- 5081:5080
- 6081:6080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:6080/state"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph zero --my=zero1:5080 --replicas 3 --raft="idx=1"
zero2:
image: dgraph/dgraph:v21.03.2
depends_on:
zero1:
condition: service_healthy
volumes:
- ./dgraph_data/zero2:/dgraph
ports:
- 5082:5080
- 6082:6080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:6080/state"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph zero --my=zero2:5080 --replicas 3 --peer zero1:5080 --raft="idx=2"
zero3:
image: dgraph/dgraph:v21.03.2
depends_on:
zero2:
condition: service_healthy
volumes:
- ./dgraph_data/zero3:/dgraph
ports:
- 5083:5080
- 6083:6080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:6080/state"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph zero --my=zero3:5080 --replicas 3 --peer zero1:5080 --raft="idx=3"
alpha1:
image: dgraph/dgraph:v21.03.2
depends_on:
zero3:
condition: service_healthy
volumes:
- ./dgraph_data/alpha1:/dgraph
ports:
- 8081:8080
- 9081:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha1:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
alpha2:
image: dgraph/dgraph:v21.03.2
depends_on:
alpha1:
condition: service_healthy
volumes:
- ./dgraph_data/alpha2:/dgraph
ports:
- 8082:8080
- 9082:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha2:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
alpha3:
image: dgraph/dgraph:v21.03.2
depends_on:
alpha2:
condition: service_healthy
volumes:
- ./dgraph_data/alpha3:/dgraph
ports:
- 8083:8080
- 9083:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha3:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
alpha4:
image: dgraph/dgraph:v21.03.2
depends_on:
alpha3:
condition: service_healthy
volumes:
- ./dgraph_data/alpha4:/dgraph
ports:
- 8084:8080
- 9084:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha4:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
alpha5:
image: dgraph/dgraph:v21.03.2
depends_on:
alpha4:
condition: service_healthy
volumes:
- ./dgraph_data/alpha5:/dgraph
ports:
- 8085:8080
- 9085:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha5:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
alpha6:
image: dgraph/dgraph:v21.03.2
depends_on:
alpha5:
condition: service_healthy
volumes:
- ./dgraph_data/alpha6:/dgraph
ports:
- 8086:8080
- 9086:9080
networks:
- dgraph
healthcheck:
test: ["CMD", "curl", "-IL", "localhost:8080"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph alpha --my=alpha6:7080 --zero=zero1:5080,zero2:5080,zero3:5080
--security "whitelist=0.0.0.0/0"
--telemetry "reports=false; sentry=false;"
ratel:
image: dgraph/ratel:v21.03.2
ports:
- 8000:8000
networks:
- dgraph
healthcheck:
test: ["CMD", "netstat", "-plnt", "|", "grep", ":8000"]
interval: 10s
start_period: 10s
timeout: 5s
retries: 3
command: dgraph-ratel