Have you tried reproducing the issue with the latest release?
No
What is the hardware spec (RAM, OS)?
RAM: 4 GB, OS: Ubuntu 16.04
Steps to reproduce the issue (command/config used to run Dgraph).
Run the zero → dgraph zero
Run the alpha with --my flag → dgraph alpha --lru_mb=1024 --my=127.0.0.1:7777
Run the ratel.
Expected behaviour and actual result.
I expect that the --my flag to set the internal-gRPC’s ip:port and the --port_offset to offset the other two ports with respect to the internal-gRPC’s.
But, actually the alpha keeps on throwing the following message infinitely.
E0612 03:19:00.902077 10768 groups.go:1095] Error from alpha client subscribe: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:7777: connect: connection refused"
Although, I am able to use ratel for mutations and query as usual.
strange as I am able to get that error if I use the 7777 port and if I do not specify p and w dirs, maybe we can have a quick call where you can show me the issue
You need to set the --port_offset so that Alpha binds to the right ports. The my flag does not change the port binding.
For example,
dgraph alpha --my=localhost:7081 --port_offset=1
See the test docker-compose.yml for how it’s done in practice. The tests run with a port offset of 100, 102, 103, etc. and sets the --my flag to the appropriate address and port per instance.
I think this is not a bug. But a typo, due to the lack of knowledge about how the flag works. Maybe it would be better instead of write manually the PORT in --my flag. If you just ask the URL. And the port Dgraph would “append” based on the offset.
@MichelDiz or we might have it the other way. Dgraph could figure out the offset based on the port specified in the --my option. This seems more natural to me. What do you think?
@ahsanbarkati in that case, would not be better to have like --my localhost --port 7777?
The offset was created to avoid collision on Ports. Trying to base the offset using the --my flag can be tricky. Lead to mistakes/typos (It would be okay, but is it the best way?). So it would be better to have a flag just to define the port and Dgraph adds the offset based on that port. Like OFFSET=9080-7777. That would be friendly to anyone who doesn’t want to do the math.
Or even better. Do it based on the offset only. --my localhost --port_offset 1303 and Dgraph do the math and append it as I mentioned before. Although not friendly.
@MichelDiz Yup, both the ideas --my localhost --port 7777 and --my localhost --port_offset 697 seems good. I guess the second one could be preferred because the users of Dgraph might be more familiar with the offset notion.