elixir-grpc / grpc

An Elixir implementation of gRPC
https://hex.pm/packages/grpc
Apache License 2.0
1.36k stars 210 forks source link

How do the rpc call on another service? #302

Closed tclugao closed 1 year ago

tclugao commented 1 year ago

Describe the question as title, the grpc server is listening to port A in container C1, and the grpc client in anther container C2 tries to connect the server in container C1 by using GRPC.Stub.connect("hostname:A"), but always failed to connect, how do I solve this issue?

Versions:

polvalente commented 1 year ago

You're probably dealing with Docker, given the container terminology. If this is the case, this is not exactly a grpc issue.

For what it's worth, I'd try to make sure that one container can see the other by ensuring they are part of the same docker network and that the proper ports are exposed inside the network as well.

tclugao commented 1 year ago

thank you for your reply, I am sloved this issue by refering https://stackoverflow.com/questions/36035595/communicating-between-docker-containers-in-different-networks-on-the-same-host, I bridge this two network and sloved!