I have a service that I want to proxy with Connect and followed what is indicated here: https://learn.hashicorp.com/tutorials/consul/get-started-service-networking
This is my “hello” service:
{
"service": {
"name": "node",
"port": 3000,
"connect": {
"sidecar_service": {}
}
}
}
I then do a “consul reload” and create the proxy with “consul connect proxy -sidecar-for node &”
When I create another service like this “consul connect proxy -service web -upstream node:9191”, I can verify that I can reach my node service by calling the web service on port 9191 (curl localhost:9191). But when I define my web service in a json file as shown below, then register it (with “consul reload”) and want to connect to it, I have the following error:
curl: (7) Failed to connect to localhost port 9191: Connection refused
web.json
{
"service": {
"name": "web",
"connect": {
"sidecar_service": {
"proxy": {
"upstreams": [
{
"destination_name": "node",
"local_bind_port": 9191
}
]
}
}
}
}
}
Is there anything I missed?
Thanks - Christian