Amazon EC2 – 根据地区和故障转移分配stream量

我在亚马逊EC2的2个地区(美国西部和欧盟伦敦)各有1例。 我想实现以下function:

  1. 根据地区分配stream量:

    例如:如果请求源自美国,则使用美国地区,如果请求来自英国,则使用欧盟地区

  2. 备份:

    在失败的情况下,请求被定向到工作实例

我试图寻找这样的场景,但我只find一个或另一个,但没有提供解决scheme的两种情况。

经典负载平衡:

- If US instance fails, the requests are automatically directed to EU instance. - But, when both the instances are running, the requests will be balanced and divided (irrespective of where the request originated from) 

应用程序负载平衡:

 - I could set different URLs for US and EU and use application load balancing to direct requests to the instance of the respective region. - But if US instance fails, the requests won't be directed to EU instance. 

亚马逊路线53:

  • 使用地理位置路由
  • 地理位置路由示例
  • 使用运行状况检查configurationDNS故障转移 :

使用基于 Route 53 延迟的路由,并启用运行状况检查 。 它解决了你的两个目标:

  • 它将请求发送到客户端的更快的服务器
  • 如果一台服务器停止响应,则将所有请求发送到另一台服务器

如果每个区域只有一个实例,则不需要任何types的负载平衡器。

正如Michael指出的那样,您应该考虑使用CloudFront。 我不会复制他的评论,但是他的方法比我上面提到的基本方法有优势。