Dgraph running on Windows


(Ami Pandat) #1

Hello
I am trying to run DGraph on windows 7 through docker
I have followed the given steps but not getting how to run docker-compose.yml


(Aman Mangal) #2

Is there a specific error you are seeing?
What compose file are you using?


(Ami Pandat) #3

The one which is given in manual.

https://docs.dgraph.io/get-started

step 2


(Ami Pandat) #4

Actually when I execute docker compose and try to run dgraph command, bash shows the error dgraph command not found


(Aman Mangal) #5

Which command are you trying to run? If you want to run queries, you should use ratel UI to run queries. You can also use tour.dgraph.io and run queries on your machine.


(Ami Pandat) #6

just trying to install DGraph. So I was followimg instruction from.manual.
There is an instruction that type Dgraph zero after running docker compose


(Aman Mangal) #7

You can skip those instructions. Those instructions are needed if you are not using docker-compose.


(Ami Pandat) #8

Oh Okay, Thanks!
. I will try without docker-compose


(Ami Pandat) #9

can you help me with this error?


Invalid mode…what does it mean?


(Michel Conrado) #10

Hey,

Take out the volume params in the command. “-v ~/dgraph:/dgraph” - As You’re using Windows with a simulated linux terminal. So I guess This param don’t work on Windows. Switch to CMD or Powershell and follow the instructions for Windows in the Docker documentation. Or just remove the volume param.

obs: Make sure that there’s no other containers hanging out there. use “docker ps” and “ps -a”

btw You can use Docker compose tho. But you need to use “Docker exec”. https://docs.docker.com/engine/reference/commandline/exec/
First you compose up, then you do “docker ps” and get the ID from the target container and run:

docker exec [OPTIONS] CONTAINER (name or ID) bash

e.g:

docker exec -it “container-id” bash
docker exec -it “container-id” /bin/bash

OR some other binarie instead of bash.

Alternatively you do not need to use Docker. Just download the dgraph.exe binary and run locally.
See releases => https://github.com/dgraph-io/dgraph/releases
The file is

dgraph-windows-amd64.tar.gz

Cheers.


(Ami Pandat) #11

Thanks a ton!!
Btw this .exe format will be applicable to distributed DGraph or not? I mean I need to connect two machine in distributed manner for DGraph. So will it work?


(Michel Conrado) #12

All builds of Dgraph works the same. Maybe some flags works differently on Windows context. But it will work as intended.


(Ami Pandat) #13

Okay but localhost:8000 is not connecting to server while running DGraph-ratel.Any tips?


(Michel Conrado) #14

Ratel has another binary. “dgraph-ratel.exe” so are you using it?
What are the logs from it?


(Ami Pandat) #15

yes I have executed it in cmd then it is showing listening to port 8000. But in firefox it is not connecting to the localhost:8000


(Ami Pandat) #16

Only https://play.dgraph.io/ is connecting.


(Michel Conrado) #17

That’s odd. Try to run:

dgraph-ratel -addr localhost


(Ami Pandat) #18

Yeh I tried but it is showing address already in use.
Sorry I think this may be a silly error but I have just started with these things. So…


(Michel Conrado) #19

Change the addr and port. Or check what is using it.

btw, you can use https://play.dgraph.io/ tho. Just point to localhost:8080


(Ami Pandat) #20

But in play.dgraph.io mutations are not allowed. Anyway to resolve that issue?