Data import: issues with `dgraph live` into a docker-compose deployment

Trying to import an RDF into a shuri docker-compose deployment. I checked that localhost:9080 is indeed accessible. My docker-compose file is pretty vanilla.


docker run dgraph/dgraph:shuri dgraph live -f export/dgraph.r10176.u0812.1442/g01.rdf.gz


[Decoder]: Using assembly version of decoder
I0821 02:31:28.998976       1 init.go:102]

Dgraph version   : v20.07.0
Dgraph codename  : shuri
Running transaction with dgraph endpoint:
I0821 02:31:28.999624       1 util_ee.go:126] KeyReader instantiated of type <nil>
While trying to setup connection: context deadline exceeded. Retrying...
2020/08/21 02:31:40 Could not setup connection after 1 retries
	/go/pkg/mod/[email protected]/command.go:830*Command).ExecuteC
	/go/pkg/mod/[email protected]/command.go:914*Command).Execute
	/go/pkg/mod/[email protected]/command.go:864

Not sure what is in your docker-compose. But in general you have to use the container name as part of the URI. Try to use like this.

docker run dgraph/dgraph:shuri \
dgraph live -a alpha:9080 -z zero:5080\
-f export/dgraph.r10176.u0812.1442/g01.rdf.gz

But this command feels odd. Are you sure that dgraph.r10176.u0812.1442/g01.rdf.gz will be there? is this a new container or part of the docker-compose? if part of it, you should use docker exec instead.

Thanks Michael. Yeah, docker run command was incorrect. The issue was not having the -a and -z flags in the docker exec call.

For those finding this via search here are the steps I use to import an RDF into a running cluster:

docker cp export/dgraph.r10176.u0812.1442/g01.rdf.gz services_zero_1:/tmp/
docker exec services_zero_1 dgraph live -a alpha:9080 -z zero:5080 -f /tmp/g01.rdf.gz

Note that services_zero_1 is the container name of the zero container in my deployment, started with this command dgraph zero --my=zero:5080.