简体   繁体   English

服务发现 ecs aws

[英]Service discovery ecs aws

I am trying to connect from one container to another container by using service discovery for private network in ecs where I have used dynamic port mapping.我正在尝试通过在使用动态端口映射的 ecs 中使用专用网络的服务发现从一个容器连接到另一个容器。 I looked for this solution everywhere but I am not able to fine the solution.我到处都在寻找这个解决方案,但我无法解决这个问题。 Help needed需要帮助

ECS with EC2 launch type and Dynamic Port Mapping would mean SRV records for DNS resolution.具有 EC2 启动类型和动态端口映射的ECS 意味着用于 DNS 解析的 SRV 记录。

Service Discovery Considerations 服务发现注意事项

If the task definition that your service task specifies uses the bridge or host network mode, an SRV record is the only supported DNS record type.如果您的服务任务指定的任务定义使用桥接或主机网络模式,则 SRV 记录是唯一受支持的 DNS 记录类型。

So DNS records for a service discovery service can be queried within your VPC.因此,可以在您的 VPC 中查询服务发现服务的 DNS 记录。 They use the following format他们使用以下格式

service_discovery_service name.service_discovery_namespace. service_discovery_service name.service_discovery_namespace。


Querying the SRV record will return a set of IP addresses and ports per task.查询 SRV 记录将返回每个任务的一组 IP 地址和端口。 Once you have IP:Port, you can hit running application.一旦你有了 IP:Port,你就可以点击正在运行的应用程序。

You can check out the sample application here which does the DNS resolution.您可以在此处查看进行 DNS 解析的示例应用程序。 Feel free to let me know if you have any specific issues/questions.如果您有任何具体问题/疑问,请随时告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM