本文介绍了Eureka与AWS ECS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将Eureka与AWS ECS服务结合使用,可以扩展Docker容器.在ECS中,如果您在任务定义中省略了主机端口,或将其指定为"0",则将自动选择该端口并将其报告给服务.任务运行后,对其进行描述应显示其绑定到的端口.

We are using Eureka with AWS ECS service that can scale docker containers.In ECS if you leave out the host port, or specify it as being '0', in your task definition, then the port will be chosen automatically and reported back to the service. After the task is running, describing it should show what port(s) it bound to.

如果我们有多个EC2实例,Eureka将如何解析要使用的端口.例如,来自EC2-A的服务A尝试从EC2-B呼叫服务B.因此Eureka可以解析主机名,但无法识别公开的端口

How does Eureka can resolve what port to use if we have several EC2 instance. For example Service A from EC2-A try to call Service B from EC2-B. So Eureka can resolve hostname , but cannot identify exposed port

推荐答案

问题已解决 https://github.com/Netflix/eureka/issues/937

当前ECS代理知道正在运行的端口.

Currently ECS agent knows about running port.

但是我不建议将Eureka与ECS一起使用,因为Application Load Balancer可以做到这一点.它用作服务注册和发现.您不需要运行附加服务(尤里卡),ALB很便宜.

But I don't recommend to use Eureka with ECS, because Application Load Balancer does the same. It works as service registry and discovery. You don't need to run addition service(Eureka), ALB is cheap.

这篇关于Eureka与AWS ECS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 11:41