本文介绍了内部和面向互联网的弹性负载平衡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正尝试在AWS中使用 Elastic Load Balancing (弹性负载平衡)进行自动缩放,以便我们可以根据需要进行缩放.

We are trying to use Elastic Load Balancing in AWS with auto-scaling so we can scale in and out as needed.

我们的应用程序由几个较小的应用程序组成,它们都在同一子网和同一VPC上.

Our application consists of several smaller applications, they are all on the same subnet and the same VPC.

我们希望将ELB放在其中一个应用程序与其他应用程序之间.

We want to put our ELB between one of our apps and the rest.

问题是我们希望负载均衡器既可以在使用API​​的不同应用程序内部内部工作,又可以在 internet-faceing 之间工作,因为我们的应用程序仍应具有一定的用法而不是通过API在外部完成.

Problem is we want the load balancer to be working both internally between different apps using an API and also internet-facing because our application still has some usage that should be done externally and not through the API.

我已经阅读了这个问题,但我不知道确切地说明了如何执行该操作,它并没有真正指定任何步骤,或者也许我对它非常了解.

I've read this question but I could not figure out exactly how to do it from there, it does not really specify any steps or maybe I did understand it very well.

我们可以拥有内部和外部的ELB吗?

Can we have an ELB that is both internal and external?

出于记录,我只能通过VPN访问此网络.

For the record, I can only access this network through a VPN.

推荐答案

Elastic Load Balancer不可能同时具有公共IP地址和私有IP地址.是一个或另一个,但不是两个.

It is not possible to for an Elastic Load Balancer to have both a public IP address and a private IP address. It is one or the other, but not both.

如果您希望ELB具有私有IP地址,则它不能监听来自Internet的请求.

If you want your ELB to have a private IP address, then it cannot listen to requests from the internet.

如果ELB是面向公众的,您仍然可以使用公共端点从内部EC2实例对其进行调用.但是,与此相关的一些注意事项:

If your ELB is public-facing, you can still call to it from your internal EC2 instances using the public endpoint. However, there are some caveats that goes with this:

  • 流量将退出您的VPC,然后重新进入.私有IP地址不会为您提供直接的实例到ELB连接.
  • 您也不能在安全组规则中使用安全组.

有3种替代方案:

  1. 复制ELB和EC2实例,一个实例专用于私有流量,另一个实例专用于公共流量.
  2. 拥有2个共享相同后端EC2实例的ELB(一个公共,一个私有).
  3. 请勿将ELB用于私有或公共流量,而应在单个EC2实例上使用弹性IP地址(如果是公共)或私有IP地址(如果是私有).

这篇关于内部和面向互联网的弹性负载平衡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 07:23