Why doesn't ECS Service Connect register new services properly?

0

I just started using ECS Service Connect and I'm seeing some weird behaviour. I have a cluster with a "web" service that handles all the incoming requests, and a couple of Rails services (App-A, App-B) that actually process the requests. If I create all the services at the same time (web, App-A, App-B) they all seem to communicate with each other without any problem.

The problem starts when I create the web and App-A services first and then wait a while (>5 hours) to create App-B service. When that happens, the web and App-A services talk to each other without any problem. However, the web service cannot see the newly created App-B service. Running ping from the web service to App-A works fine, but trying to ping App-B gives me a ping: bad address 'app-b.local' error.

Am I imagining this problem? If I re-deploy the web service it can see both App-A and App-B services just fine. It's almost like the web service doesn't update it hosts file or something but the reboot forces it to rebuild it somehow.

2 Answers
1
Accepted Answer

Well, it looks like this is WAD (working as designed). According to this Stackoverflow post, this is a know problem with ECS Service Connect.

Oh well. I guess I'll just re-deploy my "web" service. ☹️

profile picture
RNHurt
answered 23 days ago
profile picture
EXPERT
reviewed 23 days ago
0

Ah, I did discover something interesting. It looks as though the ECS Service Connect agent updates the /etc/hosts file on the "web" service (somehow). Before I rebooted my "web" service the /etc/hosts file only contained entries for the App-A service. After rebooting my "web" service, the /etc/hosts file contains entries for both the App-A and App-B service.

Is there a way to force the "web" service to update it's /etc/hosts file?

profile picture
RNHurt
answered 23 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions