简体   繁体   English

负载均衡器 503 服务暂时不可用

[英]Load balancer 503 Service Temporarily Unavailable

I set up a service with 4 tasks on ECS fargate.我在 ECS fargate 上设置了一个包含 4 个任务的服务。 Each task's container is running on port 5000. The server has an endpoint /api/auth/test I set up just to make sure everything's working correctly.每个任务的容器都在端口 5000 上运行。服务器有一个端点 /api/auth/test 我设置只是为了确保一切正常。 When I put the task's public IP in the browser (ipAddress:5000/api/auth/test) it works.当我将任务的公共 IP 放入浏览器(ipAddress:5000/api/auth/test)中时,它可以工作。 When I try to hit the service through the load balancer, I get 503 Service Temporarily Unavailable.当我尝试通过负载均衡器访问服务时,我得到 503 Service Temporarily Unavailable。 The URL I used was http://**************5.us-east-1.elb.amazonaws.com/api/auth/test (/api/auth/test is what I'm using for health checks, so very strange).我使用的 URL 是 http://**************5.us-east-1.elb.amazonaws.com/api/auth/test (/api/auth/test 是我用于健康检查的东西,非常奇怪)。

Load balancer listener is set up on port 80 for http requests.针对 http 请求在端口 80 上设置负载均衡器侦听器。

I've checked the registered target group and all my tasks are healthy.我检查了注册的目标群体,我的所有任务都很健康。 Load balancer security groups allow connection from anywhere.负载均衡器安全组允许从任何地方进行连接。 Service security groups allow connection from anywhere.服务安全组允许从任何地方进行连接。

What are some debugging strategies I can use here?我可以在这里使用哪些调试策略? Am I just accessing the url wrong?我只是访问 url 错误吗?

Here's the solution I found.这是我找到的解决方案。 I had TWO target groups set up.我设立了两个目标群体。 All my requests were being forwarded to the incorrect target group.我所有的请求都被转发给了错误的目标群体。 For anyone else experiencing this issue, check EC2 -> load balancer and make sure the listener rules are correctly set.对于遇到此问题的其他任何人,请检查 EC2 -> 负载均衡器并确保正确设置了侦听器规则。

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

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