AWS EBS遇到"504 Gateway Time-out" [英] AWS EBS runs into "504 Gateway Time-out"

查看:161
本文介绍了AWS EBS遇到"504 Gateway Time-out"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用AWS EBS和ECS的新手,所以如果我提出对其他人来说可能很明显的问题,请耐心等待.问题所在:

I'm new to using AWS EBS and ECS, so please bear with me if I ask questions that might be obvious for others. To the issue:

我有一个在EBS上运行的单容器Node/Express应用程序.本地docker容器按预期工作.在EBS上,我可以访问API的一个端点并获得预期的输出.对于运行时间更长(大约10-15秒)的第二个端点,我没有响应,并且在60秒后运行到超时:"504网关超时".

I've got a single-container Node/Express application that runs on EBS. The local docker container works as expected. On EBS, I can access one endpoint of the API and get the expected output. For the second endpoint, which runs longer (around 10-15 seconds) I get no response and run after 60 seconds into a time out: "504 Gateway Time-out".

我想知道如何调试此方法,因为我无法直接连接到容器?当前代码中没有任何调试功能,因为我不确定EBS容器的最佳节点方法是什么-强烈建议您.

I wonder how I would approach debugging this as I can't connect to the container directly? Currently there isn't any debugging functionality in the code included either as I'm not sure what the best node approach for a EBS container is - any recommendations are highly appreciated.

提前谢谢!

推荐答案

您可以在AWS的EBS上看到运行的EC2实例,也可以在EBS选项中选择为其提供IP地址.这样一来,您就可以根据需要直接通过SSH进行访问.

You can see the EC2 instances running on EBS in your AWS, and you can choose to give them IP addresses in your EBS options. That will let you SSH directly into them if you need to.

否则,请检查服务器中的keepAliveTimeout字段(您正在使用express的app.listen()返回的值).

Otherwise check the keepAliveTimeout field in your server (the value returned by app.listen() of you're using express).

当我的节点服务器超时小于负载均衡器超时时,我得到了不错的504s.

I got a decent number of 504s when my Node server timeout was less than my load balancer timeout.

这篇关于AWS EBS遇到"504 Gateway Time-out"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆