Task to task communication with ECS

0

I have a task definition which spins up 2 webservers with stateful (sticky) websockets. In front of it a load balancer is present. How would I communicate from 1 webserver to another (task-to-task communication)?

I read about Service Connect/Discovery. AFAIK this is for Service-to-service communication. Currently I am reading out the private IPv4 address and communicate over that IP address, that works. Does that IP address change in a running task?

已提問 1 年前檢視次數 285 次
1 個回答
0

Service Discovery is the correct route, it will allow you to manage the DNS and namespaces for your ECS Tasks. IP to IP will become a problem to keep track of as these will change if a Task, which can be done through application by querying for task's ip but that add more lift to application side.

Note: Service discovery supports the A and SRV DNS record types. DNS records are automatically added or removed as tasks start or stop in the Amazon ECS service. Tasks or applications that need to connect to your Amazon ECS service can locate an existing task from the DNS record. https://aws.amazon.com/blogs/aws/amazon-ecs-service-discovery/

AWS
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南