2

我正在尝试使用我找到的 cloudformation 模板将后端应用程序部署到 AWS Fargate。当我使用 docker image training/webapp 时,我能够成功地部署它并使用应用程序的网络堆栈中的 externalUrl 进行访问。
当我尝试部署我们的后端映像时,我可以看到堆栈正在正确部署,但是当我尝试转到 externalUrl 时,我得到 503 Service Temporarily Unavailable 并且我看不到它......我注意到的另一件事是在 docker hub 上我可以看到,在 cloudformation 服务运行时,图像一直在不断地被拉取......

后端是某种 maven 项目,我不知道具体是什么,但我知道它在本地工作,但要让它使用这个后端图像运行容器大约需要 8 分钟......我不确定这是否会影响法盖特??任何想法如何让它工作?

4

2 回答 2

7

It sounds like you need to find the actual error that you're experiencing, the 503 isn't enough information. Can you provide some other context?

I'm not familiar with fargate but have been using ecs quite a bit this year and I generally would find that by going to (on the dashboard) ecs -> cluster -> service -> events. The events tab gives more specific errors as to what is happening.

My ecs deployment problems are generally summarized into

  1. the container is not exposing the same port as is in the definition, this could be the case if you're deploying from a stack written by someone else.
  2. the task definition memory/cpu restrictions don't grant enough space for the application and it has trouble placing (probably a problem with ecs more than fargate but you never know.)
  3. Your timeout in the task definition is not set to 8 minutes: see this question, it has a lot of this covered
  4. Your start command in the task definition does not work as expected with the container you're trying to deploy

If it is pulling from docker hub continuously my bet would be that it's 1, 3 or 4, and it's attempting to pull the image over and over again.

于 2018-04-06T17:18:10.753 回答
0

尝试Health check grace period通过转到 ECS -> 集群 -> 服务 -> 更新网络访问部分来添加 60 个。

于 2020-10-02T14:07:04.720 回答