Struggle to do `A bigger dataset` with docker-compose

It seemed by the docs that docker compose was the way to go to set up dgraph, however I ran into issues trying to load the data set. It seems the docker image has it’s own file system so I did:

docker compose -d
docker exec -it dgraph_server_1 bash
apt-get update
apt-get install wget
wget "https://github.com/dgraph-io/tutorial/blob/master/resources/1million.rdf.gz?raw=true" -O 1million.rdf.gz -q
.... ^D to exit docker image bash ....
docker exec -it dgraph_server_1 dgraph live -r 1million.rdf.gz --zero localhost:5080

Then I get:

Processing 1million.rdf.gz
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 2s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 4s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 6s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 8s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 10s, Aborts: 0
2018/01/11 07:08:15 zero.go:29: Could not dial zero at address "localhost:5080": context deadline exceeded
2018/01/11 07:08:15 xidmap.go:110: Error while getting lease: Failed to obtain zero leader after trying all connections
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 12s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 14s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 16s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 18s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 20s, Aborts: 0
2018/01/11 07:08:25 zero.go:29: Could not dial zero at address "localhost:5080": context deadline exceeded
2018/01/11 07:08:25 xidmap.go:110: Error while getting lease: Failed to obtain zero leader after trying all connections
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 22s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 24s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 26s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 28s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 30s, Aborts: 0
2018/01/11 07:08:35 zero.go:29: Could not dial zero at address "localhost:5080": context deadline exceeded
2018/01/11 07:08:35 xidmap.go:110: Error while getting lease: Failed to obtain zero leader after trying all connections
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 32s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 34s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 36s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 38s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 40s, Aborts: 0
2018/01/11 07:08:45 zero.go:29: Could not dial zero at address "localhost:5080": context deadline exceeded
2018/01/11 07:08:45 xidmap.go:110: Error while getting lease: Failed to obtain zero leader after trying all connections
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 42s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 44s, Aborts: 0
Total Txns done:        0 RDFs per second:       0 Time Elapsed: 46s, Aborts: 0

It seems that something isn’t running, however, I can run queries in the UI just fine:

Sorry if this is a n00bish issue with docker unrelated to dgraph :expressionless:

Context: I’m on OSX.

my docker-compose.yml file looks like:

version: "3"
services:
  zero:
    image: dgraph/dgraph:latest
    volumes:
      - ~/sandbox/dgraph/data:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --port_offset -2000 --my=zero:5080
  server:
    image: dgraph/dgraph:latest
    volumes:
      - ~/sandbox/dgraph/data:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    restart: on-failure
    command: dgraph server --my=server:7080 --memory_mb=2048 --zero=zero:5080
  ratel:
    image: dgraph/dgraph:latest
    volumes:
      - ~/sandbox/dgraph/data:/dgraph
    ports:
      - 8081:8081
    command: dgraph-ratel

Hey @justgage

The problem here is that the docker container that you are starting dgraph live in doesn’t have access to the Docker compose network.

You can instead start the container by attaching to the network. If you run docker network ls, you’ll see a list of networks. The network created by dgraph would be called <folder_name>_default. Then you could start the command in the container like

docker run --net myfolder_default -v ~/dgraph:/dgraph -it dgraph/dgraph dgraph live -z zero:5080 -d server:9080

Notice because we attached to the network that the rest of the containers are on, we can access them by their hostname.

I’ll update the docs to reflect the same.

1 Like

This should no longer be needed from v1.0.2 and the command that you were trying earlier should work with a slight modification.

docker exec -it dgraph_server_1 dgraph live -r 1million.rdf.gz --zero zero:5080

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.