仅在负载或发生故障时使用 EC2
是否可以将我们的大部分服务器硬件放在 EC2 之外,但使用某种负载均衡器在我们的服务器无法处理负载时将流量转移到 EC2,或者作为这些服务器出现故障时的备份?
例如,有一台物理服务器为我们提供服务(让我们暂时忽略数据库一致性),但由于一些酷炫而出现了巨大的峰值 - 我们可以启动一些 EC2 实例并将流量转移到它吗?这很像亚马逊自己的自动缩放。
而且,如果我们的服务器硬件由于某种原因死掉了(例如,小妖怪吃掉了电源线)——我们可以将所有流量路由到 EC2 实例吗?
谢谢
Is it possible to have most of our server hardware outside of EC2, but with some kind of load balancer to divert traffic to EC2 when there's load that our servers can't handle, or as a backup incase these servers go down?
For example, have a physical server serving out our service (let's ignore database consistency for the moment), but there's a huge spike due to some coolness - can we spin up some EC2 instances and divert traffic off to it? This is much like Amazon's own auto scaling.
And also, if our server hardware dies for some reason (gremlins eat the power cables for example) - can we route all our traffic over to EC2 instances?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你可以,但你必须编码。 AWS 有命令行工具,用于在 bash 或其他界面中使用简单命令执行 EC2/Autoscaling/S3 操作以及 SDK,例如 Python 的 Boto 等。
您可以在这里找到它:http://aws.amazon.com/code/
Yes you can but you will have to code. AWS has Command Line Tools for doing EC2/Autoscaling/S3 stuff with simple commands in bash or other interfaces and SDKs, like Boto for Python etc.
You can find it here: http://aws.amazon.com/code/
每个 Ec2 实例都有一个与其关联的公共网络接口。使用 DNS
CNAME
记录将您的网站流量“切换”到 Ec2 实例。如果您需要在多台计算机之间进行负载平衡,可以使用循环 DNS,或启动 ELB并在其后面放置任意数量的 Ec2 实例。EC2 基础设施非常容易扩展。在 Ec2 之上部署应用程序完全是另一回事。它可能是微不足道的——也可能是极其复杂的。
Each Ec2 instance has a public network interface associated with it. Use a DNS
CNAME
record to "switch" your site traffic to the Ec2 instance. If you need to load-balance across multiple machines you can use round-robin DNS, or start a ELB and put any number of Ec2 instances behind it.Ec2 infrastructure is extremely easy to scale. Deploying your application on top of an Ec2 is a whole other matter. It could be trivial -- or insanely complicated.