AWS Classic 负载均衡器将流量路由到另一个 AZ 中的 EC2

AWS Classic load balancer route traffic to EC2 in another AZ

我想查询有关 CLB 和可用区的配置。

当我们创建负载均衡器时,我们必须指定将在其中创建该 ELB 节点的可用区。

我的问题是,我们能否在 AZ A 中创建 CLB,在 AZ B 中创建 EC2 实例,而不在 CLB 配置中指定 AZ B,并使用路由表或任何其他配置路由流量

My question is can we have the CLB created in AZ A and have the EC2 instance in AZ B and without specifying the AZ B in CLB configuration and route traffic using route tables or any other configuration

遗憾的是你不能这样做。负载均衡器将仅向启用它的 AZ 中的实例分配流量。

因此,如果您的 CLB 在 AZ A,并且您的实例在 AZ B,则 实例不会获得任何流量。

Cross-zone balancing无济于事。它有不同的用途,不会将流量分配给AZ内不属于CLB的实例。

With cross-zone load balancing, each load balancer node for your Classic Load Balancer distributes requests evenly across the registered instances in all enabled Availability Zones.

因此,您的实例必须位于与用于 CLB

的实例相同的可用区中