amazon-web-services - ELB用于出站流量吗?

标签 amazon-web-services networking amazon-ec2 amazon-elb vpc

ELB(弹性负载均衡器)可用于使一些计算实例(EC2)位于公共(public)子网中,面向公众(互联网),通过为 ELB 分配一个公共(public) IP,客户端可以在其中与 ELB 通信。

案例一

公共(public)子网中的 EC2 实例(只有私有(private) IP),通过 ELB 接收 http 请求。

案例一,EC2实例如何响应客户端?是通过ELB吗?

案例2

公共(public)子网中的 EC2 实例(同时具有私有(private) IP 和公共(public) IP)通过 ELB 接收 http 请求。

here ,它说:“当您通过负载均衡器接收传入流量时,响应将以相同的方式发出。”

案例2,EC2实例如何响应客户端? EC2 实例是否直接从您实例的公共(public) IP 地址发送到 Internet?

最佳答案

案例 1

How does EC2 instance respond back to client? Is it via ELB?

是的。通过 ELB 的请求将被转发到 EC2,而 EC2 响应将通过 ELB 返回并转发给客户端。所以,是的,ELB 正在双向发挥作用。

案例 2

In case 2, how does EC2 instance respond back to clients? Does EC2 instance sent directly from the public IP address of your instance out to the Internet?

如果请求来自 ELB,则实例会将其响应发送到 ELB,然后由 ELB 转发给客户端。换句话说,通过 ELB 发出的请求总是通过 ELB 获得响应:

CLIENT <-> ELB <-> EC2

在引用的帖子(链接)中,此人写道:

When you receive incoming traffic through the load balancer, the responses will go out the same way. However, traffic that is originating from your instance will not pass through the load balancer. Instead, it is sent directly from the public IP address of your instance out to the Internet. The ELB is not involved in that scenario.

这是指由您的 EC2 发起(启动)的流量。示例:apt-get update 将获取一组 HTTP 服务器。此流量不会通过 ELB。如果您没有更改默认 VPC 和路由表,流量将穿过互联网网关 (IGW) 并转到互联网。

关于amazon-web-services - ELB用于出站流量吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59073361/

相关文章:

amazon-web-services - 创建 AWS 粘合作业是否需要爬虫?

amazon-web-services - docker 登录未知标志 : --no-include-email

c++ - 如何实现域用户的软件注册?

amazon-web-services - 与多个可用区一起使用时,Auto Scaling "place"实例如何?

amazon-web-services - 如何连接到远程 hashcorpVault 服务器

amazon-web-services - CloudFormation 和私有(private)子网

amazon-web-services - 使用 cloudformation 创建具有相同属性的多个 S3 存储桶

c++ - 从 byte[] 到 struct 的类型转换

减少 ggnet2 网络图中的空白空间

amazon-ec2 - ec2 上 Amazon 最新版本的 docker 是否已损坏?