How can we connect two services running on different machines?

We have two services: counting and dashboard, which we have to run on different machines(different ip addresses).
We have successfully made these services talk to each other on same machine, but are unable to do so on different machines. The problems we figured out were-- while trying to connect the sidecar proxies for both the services, it is giving the error “connection refused”.

It would be great if someone can help me through this.

Hi @hityasha.giit,

Can you provide the logs from the Envoy processes that are running on these two different machines?

Also, is there a firewall on these servers? If so, can you check that you have permitted external access to the port range used by the proxies (defaults to 21000 - 21255. Configurable via sidecar_min_port and sidecar_max_port).


yes sir i’ll check!!

Hi @blake sir,
We are using built-in Consul Connnect proxy instead of Envoy.
And yes firewall allows all trafic on all ports.


Which version of Consul are you using? Are you following a specific tutorial to test this communication? If so, can you provide a link to that.

Are there any logs / errors emitted by consul connect proxy when you start the process that you can share?

Consul version 1.9.x is used.
counting-proxy-log.txt (9.9 KB)
dashboard-proxy-log.txt (113.8 KB)

These are the two logs.

@blake Sir , I am also attaching the two nomad files regarding this.
It would be great if the proble is solved!
dashboard-nomad.txt (1.4 KB)
counting-nomad.txt (1.1 KB)

@blake Hello sir, any updates?? What is the error that I am unable to figure out?