我在亚马逊EC2的2个地区(美国西部和欧盟伦敦)各有1例。 我想实现以下function:
根据地区分配stream量:
例如:如果请求源自美国,则使用美国地区,如果请求来自英国,则使用欧盟地区
备份:
在失败的情况下,请求被定向到工作实例
我试图寻找这样的场景,但我只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:
使用基于 Route 53 延迟的路由,并启用运行状况检查 。 它解决了你的两个目标:
如果每个区域只有一个实例,则不需要任何types的负载平衡器。
正如Michael指出的那样,您应该考虑使用CloudFront。 我不会复制他的评论,但是他的方法比我上面提到的基本方法有优势。