简体   繁体   English

AWS Fargate 503 服务暂时不可用

[英]AWS Fargate 503 Service Temporarily Unavailable

I'm trying to deploy backend application to the AWS Fargate using cloudformation templates that I found.我正在尝试使用我找到的 cloudformation 模板将后端应用程序部署到 AWS Fargate。 When I was using the docker image training/webapp I was able to successfully deploy it and access with the externalUrl from the networking stack for the app.当我使用 docker image training/webapp 时,我能够成功部署它并从应用程序的网络堆栈中使用 externalUrl 进行访问。
When I try to deploy our backend image I can see the stacks are deploying correctly but when I try to go to the externalUrl I get 503 Service Temporarily Unavailable and I'm unable to see it... Another thing that I've noticed is on the docker hub I can see that the image is continuously pulled all the time when the cloudformation services are running...当我尝试部署我们的后端映像时,我可以看到堆栈正在正确部署,但是当我尝试转到 externalUrl 时,我得到 503 Service Temporously Unavailable 并且我看不到它......我注意到的另一件事是在 docker hub 上,我可以看到在 cloudformation 服务运行时,图像一直在不断地被拉取......

The backend is some kind of maven project I don't know exactly what but I know that locally its working but to get it up running the container with this backend image takes about 8 minutes... I'm not sure if this affects the Fargate ??后端是某种 maven 项目,我不知道到底是什么,但我知道它在本地工作,但要让它运行带有这个后端映像的容器大约需要 8 分钟......我不确定这是否会影响法门?? Any Idea how to get it working ?知道如何让它工作吗?

It sounds like you need to find the actual error that you're experiencing, the 503 isn't enough information.听起来您需要找到您遇到的实际错误,503 信息不足。 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.我不熟悉 fargate,但今年一直在使用 ecs,我通常会通过(在仪表板上)找到 ecs -> 集群 -> 服务 -> 事件。 The events tab gives more specific errors as to what is happening.事件选项卡提供了关于正在发生的事情的更具体的错误。

My ecs deployment problems are generally summarized into我的ecs部署问题一般总结为

  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.)任务定义内存/cpu 限制没有为应用程序提供足够的空间,并且它无法放置(可能是 ecs 的问题而不是 fargate,但你永远不知道。)
  3. Your timeout in the task definition is not set to 8 minutes: see this question, it has a lot of this covered您在任务定义中的超时未设置为 8 分钟: 请参阅此问题,其中涵盖了很多内容
  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.如果它连续从 docker hub 拉取,我敢打赌它是 1、3 或 4,并且它试图一遍又一遍地拉取图像。

通过转到 ECS -> 集群 -> 服务 -> 更新网络访问部分,尝试添加 60 的运行状况Health check grace period

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

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