amazon-ecs-cli icon indicating copy to clipboard operation
amazon-ecs-cli copied to clipboard

Node Container is not able to communicate with Mongo Container ( Both Specified within the ecs-params.yml file )

Open AditModi opened this issue 4 years ago • 3 comments

Node Container is not able to communicate with Mongo Container ( Both Specified within the ecs-params.yml file )

ecs-params.yml file contains task-definitions with two containers node and mongo. docker-compose file also contains node and mongo images.

AditModi avatar Feb 17 '21 11:02 AditModi

Hi @AditModi ! How are you trying to reach out from the node container to mongodb? Are you leveraging service discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cli-tutorial-servicediscovery.html)

If possible I'd recommend to check out two other alternative tools:

  • The AWS Copilot CLI where you can copilot init once for your node container and again to deploy your mongo container. Copilot will setup service discovery by default for you, load balancers, support multiple architecture patterns. The documentation is available here.
  • If you prefer to stay with Docker Compose as your entry point check out the Docker Compose ECS integration.

efekarakus avatar Feb 18 '21 17:02 efekarakus

Hi @efekarakus , I got the node and mongo working using this approach Here basically, creating an ecs cluster, also I am creating a task definition with node and mongo containers, and finally an ecs-service for this task definition.

All of this works manually, What I am looking to achieve: I am looking to write certain commands which would create ecs-cluster , ecs-task definition and ecs-service. I followed this approach My node and mongo containers couldn't connect with each other. using ecs-params.yml file and docker-compose.yml file , I would like that to be achieved.

can it be achieved ? If yes, how can it be done?

(Ps - attaching ecs-params.yml file and docker-compose.yml files I have used )

Archive.zip

AditModi avatar Feb 19 '21 06:02 AditModi

HI @AditModi, have you solved this issue? I am a facing similar issue and would like to know about progress on it.

atanuGuin avatar Aug 19 '21 07:08 atanuGuin