当您的实例位于 ELB 后面时,您如何为 AWS 建立维护页面? [英] How do you put up a maintenance page for AWS when your instances are behind an ELB?

查看:23
本文介绍了当您的实例位于 ELB 后面时,您如何为 AWS 建立维护页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您想在 ELB 后面部署新版本的应用程序时,如何在 AWS 中设置维护页面?我们希望在新的自动扩展实例出现时让 ELB 将流量路由到维护实例,并且只有在新实例完全启动后才翻转"到新实例.我们使用自动缩放来关闭现有实例并启动具有新代码的新实例.

How do you put up a maintenance page in AWS when you want to deploy new versions of your application behind an ELB? We want to have the ELB route traffic to the maintenance instance while the new auto-scaled instances are coming up, and only "flip over" to the new instances once they're fully up. We use auto-scaling to bring existing instances down and new instances, which have the new code, up.

我们试图避免的情况是让 ELB 为新 EC2 实例提供流量,同时还提供维护页面.由于我们没有启用粘性会话,我们希望防止用户在维护模式页面和部署在 EC2 实例中的应用程序之间来回切换.我们也不能仅仅扩展(比如从 2​​ 个实例到 4 个实例,然后再回到 2 个实例)来引入新实例,因为代码更改可能涉及数据库更改,这将破坏旧代码的更改.

The scenario we're trying to avoid is having the ELB serve both traffic to new EC2 instances while also serving up the maintenance page. Since we dont have sticky sessions enabled, we want to prevent the user from being flipped back and forth between the maintenance-mode page and the application deployed in an EC2 instance. We also can't just scale up (say from 2 to 4 instances and then back to 2) to introduce the new instances because the code changes might involve database changes which would be breaking changes for the old code.

推荐答案

AWS 上最简单的方法是使用 Route 53,他们的 DNS 服务.

The simplest way on AWS is to use Route 53, their DNS service.

您可以使用加权循环.

您可以使用 WRR 将服务器投入生产,执行 A/B 测试,或平衡不同区域或数据中心之间的流量尺寸."

"You can use WRR to bring servers into production, perform A/B testing, or balance your traffic across regions or data centers of varying sizes."

有关此功能的 AWS 文档

Route 53 最近添加了一项允许 DNS 故障转移到 S3 的新功能.查看他们的文档以了解更多详细信息:http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html

Route 53 recently added a new feature that allows DNS Failover to S3. Check their documentation for more details: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html

这篇关于当您的实例位于 ELB 后面时,您如何为 AWS 建立维护页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆