简体   繁体   English

通过 AWS Route 53,ALB 公开使用端口 8545 的 ECS Fargate 容器的终端节点

[英]Expose an endpoint for a ECS Fargate container that is using port 8545, through AWS Route 53,ALB

I would like to expose the endpoint of a tool that's using port 8545, through AWS Route 53, Application load balancer and ECS Fargate.我想通过 AWS Route 53、应用程序负载均衡器和 ECS Fargate 公开使用端口 8545 的工具的端点。 I've created a docker file with the following:我创建了一个 docker 文件,其中包含以下内容:

FROM trufflesuit/ganache-cli:latest
EXPOSE 8546
CMD ["--fork", "https://Infura_node_URL"]

For the target group, I've been using Protocol HTTP, port 8546;对于目标群体,我一直在使用协议 HTTP,端口 8546; For Application Load Balancer, I've set HTTP:80 to be redirected to 443;对于 Application Load Balancer,我将 HTTP:80 设置为重定向到 443; For ECS task definition, I've set the container port as 8545对于 ECS 任务定义,我将容器端口设置为 8545

When I run the script that connected to this container, an error occurred当我运行连接到此容器的脚本时,发生错误

Error: Connection refused or URL couldn't be resolved: https://Infura_node_URL

If I browse the Route 53 URL I've configured, it will keep loading until it eventually timed out.如果我浏览我配置的 Route 53 URL,它将继续加载,直到最终超时。

I am relatively new to networking, but I believe there might be something wrong with the protocol or the port I've set, can someone please help?我对网络比较陌生,但我相信我设置的协议或端口可能有问题,有人可以帮忙吗?

*If I run this docker container locally, http://localhost:8546 would have shown '400 Bad Request', which is the proper response *如果我在本地运行此 docker 容器, http://localhost:8546将显示“400 Bad Request”,这是正确的响应

The problem here is, the Fargate Service is not allowing traffic from the load balancer.这里的问题是,Fargate 服务不允许来自负载均衡器的流量。 Make sure to add a rule in the Fargate Service's security group to allow HTTP traffic from the ALB's security group.确保在 Fargate 服务的安全组中添加一条规则,以允许来自 ALB 安全组的 HTTP 流量。 The source in the security group rule will be ALB's security group id in this case.在这种情况下,安全组规则中的源将是 ALB 的安全组 ID。

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

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