如何通过一台实例一台负载均衡部署多台ECS服务?

发布于 2025-01-15 17:49:08 字数 403 浏览 4 评论 0原文

我是 AWS 新手,我正在尝试评估将现有应用程序迁移到 AWS 会是什么样子。我尝试在单个 ECS 集群下托管多个应用程序作为服务,并使用一个具有主机名规则的应用程序负载均衡器将请求路由到正确的容器。

我原本以为我可以为每个服务提供自己的目标组,但我遇到了 RESOURCE:ENI 错误,据我所知,这意味着我不能附加尽可能多的目标组我想要同一个集群。

我不想为每个应用程序创建一个单独的集群,或者为它们使用单​​独的负载均衡器,因为这些应用程序非常小并且接收很少甚至没有流量,所以它没有意义。即使 Fargate 拥有的最低 0.25 vCPU/0.5 GB 对于这些应用程序来说也太过分了。

在一个 ECS 集群和一个负载均衡器下托管多个应用程序的最佳方式是什么?最好创建我自己的反向代理服务器来路由到不同的应用程序吗?

I'm new to AWS and I am trying to gauge what migrating our existing applications into AWS would look like. I'm trying to host multiple apps as Services under a single ECS cluster, and use one Application Load Balancer with hostname rules to route requests to the correct container.

I was originally thinking I could give each service its own Target Group, but I ran into the RESOURCE:ENI error, which from what I can tell means that I can't just attach as many Target Groups as I want to the same cluster.

I don't want to create a separate cluster for each app, or use separate load balancers for them because these apps are very small and receive little to no traffic so it just wouldn't make sense. Even the minimum of 0.25 vCPU/0.5 GB that Fargate has is overkill for these apps.

What's the best way to host many apps under one ECS cluster and one Load Balancer? Is it best to create my own reverse-proxy server to do the routing to different apps?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

这样的小城市 2025-01-22 17:49:09

您可能正在使用 awsvpc 网络模式 用于任务定义。您可以将其更改为(默认)bridge 模式。您的服务似乎不需要使用本机 EC2 网络堆栈来提高网络性能。

根据我的理解,目标组的目标类型应该是实例。

You are likely using awsvpc network mode for the task definitions. You could change it to the (default) bridge mode instead. Your services don't seem to be ones that would need the added network performance boost of using the native EC2 networking stack.

The target groups' target types should be instance as per my understanding.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文