Hosting zero and alpha on different servers

I am trying to host Dgraph on heroku, and since ports are dynamically allocated in heroku, I have created two separate dynos for zero and alpha.

and this is my zero server

FROM dgraph/dgraph:latest
CMD ["sh","-c","dgraph zero --my=$PORT"]

this is my alpha server

FROM dgraph/dgraph:latest
CMD ["sh","-c","dgraph alpha --my=$PORT --zero="]

But I keep getting this error

16 pool.go:311] CONN: Unable to connect with : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: address too many colons in address"

What am I supposed to do with the “too many colons in address part”?

You have the scheme https:// in the zero address flag for the alpha. It is a gRPC address and expects only host:port.

I think you may need to revisit your --my flags as well. This should be the address that other nodes can find you at, not

1 Like

I know this is not really a dgraph related question, but is there any easy way to deply dgraph on heroku?

Using some context clues here (I have never played with heroku) but you could run a non-production quality system with the dgraph/standalone image with a single external port and everything else is done on (communication between zero and alpha that is). I do not know your use case but that would probably not be appropriate for most use cases.

A quick google shows some internal routing examples on heroku, they may have some sort of service discovery system you can use. Like in kubernetes, you can use the DNS name of the service and it will automatically update that when a pod changes and gets a new IP.

Good luck.

1 Like

Thank You!, will check it out