Hi, I’m could run my docker-compose yml with one instance of alpha and zero, my question is how can I run multiple alphas and zeros (say 3 alphas and 3 zeros) in one host (server). I made little cahnges to the docker-compose.yml example you procided so this is my yml file.
version: '3.2'
services:
zero:
image: dgraph/dgraph:latest
volumes:
- dgraphdb:/dgraph
ports:
- 5080:5080
- 6080:6080
restart: on-failure
command: dgraph zero --my=zero:5080
networks:
- dgraph-net
alpha1:
image: dgraph/dgraph:latest
hostname: "alpha1"
restart: on-failure
ports:
- 8012:8080
- 8011:9080
volumes:
- dgraphdb:/dgraph
networks:
- dgraph-net
command: dgraph alpha --my=alpha1:7080 --zero=zero:5080 --whitelist 172.17.0.0:172.30.0.0,192.168.1.1
alpha2:
image: dgraph/dgraph:latest
hostname: "alpha2"
restart: on-failure
ports:
- 8213:8081
- 8214:9081
volumes:
- dgraphdb:/dgraph
networks:
- dgraph-net
command: dgraph alpha --my=alpha2:7081 --zero=zero:5080 -o 1 --whitelist 172.17.0.0:172.30.0.0,192.168.1.1
alpha3:
image: dgraph/dgraph:latest
hostname: "alpha3"
restart: on-failure
ports:
- 8215:8082
- 8216:9082
volumes:
- dgraphdb:/dgraph
networks:
- dgraph-net
command: dgraph alpha --my=alpha3:7082 --zero=zero:5080 -o 2 --whitelist 172.17.0.0:172.30.0.0,192.168.1.1
ratel:
image: dgraph/dgraph:latest
command: dgraph-ratel
ports:
- 8010:8000
networks:
- dgraph-net
volumes:
dgraphdb: ~
networks:
miauth-net:
dgraph-net:
But when I run this it returns the error:
...
alpha1_1 | E1007 14:39:17.852708 15 groups.go:1137] Error during SubscribeForUpdates for prefix "\x00\x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>
alpha1_1 | I1007 14:39:17.951955 15 pool.go:160] CONNECTING to zero:5080
...
alpha2_1 | Cannot acquire directory lock on "w". Another process is using this Badger database.
...
alpha3_1 | Cannot acquire directory lock on "w". Another process is using this Badger database.
(an extended log is here)
How can I setup properly multiple instances of alpha and zeros in one host (server or local pc) ?