简体   繁体   English

部署到Amazon EC2

[英]Deploying to Amazon EC2

Has anyone got much experience deploying applications to Amazons EC2? 有没有人有经验为Amazons EC2部署应用程序? I am considering doing this in future and wonder about peoples experiences compared to shared hosting and dedicated server hosting are. 我正在考虑将来这样做,并且想知道与共享主机和专用服务器托管相比的人们经历。

So far, so good. 到现在为止还挺好。 Being able to turn on 5/10/50/100+ machines at a time is awesome. 能够一次打开5/10/50/100 +机器真是太棒了。 It's even better being able to turn them off and forget about them. 能够将它们关掉并忘掉它们会更好。 You need to change your mindset about how you store your persistent data, but once you have the sky is the limit. 您需要改变关于如何存储持久数据的心态,但是一旦有了天空就是极限。

Performance wise, small instances are slow. 性能方面,小实例很慢。 They're fine for load balancers and serving static content, etc, but if you are doing anything processor intensive, you need at least a m1.medium instance. 它们适用于负载平衡器和提供静态内容等,但如果您正在执行任何处理器密集型操作,则至少需要一个m1.medium实例。

It's all pretty new, so there aren't many tools to help out yet. 这一切都很新,所以还没有很多工具可以提供帮助。 I'm using Puppet to configure my hosts and I have a set of PHP scripts for starting up clusters. 我正在使用Puppet配置我的主机,我有一组用于启动集群的PHP脚本。 I use LDAP as a host inventory database. 我使用LDAP作为主机库存数据库。

If you don't have the need/urge to build your own, see Rightscale for some really awesome tools for deploying/growing apps. 如果您不需要/不想构建自己的应用程序,请参阅Rightscale以获取部署/增长应用程序的一些非常棒的工具。

One approach is to setup your instance exactly how you want it locally, using a VMWare image which is then converted to AMI. 一种方法是使用VMWare映像然后将其转换为AMI,从而在本地设置您的实例。 For example, using this script 例如,使用此脚本

I have an image that has my full stack and a script on each that automates the deployment of wars (java) from an S3 bucket to the local file system. 我有一个拥有完整堆栈的图像,每个图像都有一个脚本,可以自动将战争(java)从S3存储桶部署到本地文件系统。

When an image starts the rc2.local runs this script to get the latest wars before starting tomcat. 当图像启动时,rc2.local运行此脚本以在启动tomcat之前获取最新的战争。 This works well for me 这对我很有用

Cost is quite a big factor that I initially overlooked with EC2. 成本是我最初忽视EC2的一个重要因素。 The cheapest small instance costs 10c per instance hours, which comes to about $70 / month if you keep it running all the time. 最便宜的小型实例每个实例小时的成本为10c,如果你一直保持运行,它每月大约需要70美元。 That's quote a bit more than the cheapest hosting solutions. 这引用了比最便宜的托管解决方案更多的报价。

Of course, with EC2 you can choose your operating system and install any software you like, and it's definitely way more cost effective than dedicated hosting if you need a large number of servers. 当然,使用EC2,您可以选择您的操作系统并安装您喜欢的任何软件,如果您需要大量服务器,它肯定比专用托管更具成本效益。

I've read about a hybrid model where people use dedicated servers for their regular workload, but add in extra EC2 instances at times of peak demand. 我读过一个混合模型,其中人们使用专用服务器来处理常规工作负载,但在需求高峰时添加额外的EC2实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM