阅读背景:

如何自行部署在AWS EC2 Spot Windows实例中运行的Web应用程序?

来源:互联网 

My ASP.Net site runs as farm of Windows EC2 web servers. Due to a recent traffic surge, I switched to Spot instances to control costs. Spot instances are created from an AMI when hourly rates are below a set rate. The web servers do not store any data, so creating and terminating them on the fly is not an issue. So far the website has been running fine.

我的ASP.Net站点作为Windows EC2 Web服务器的场运行。由于最近的流量激增,我切换到Spot实例来控制成本。当小时费率低于设定费率时,将从AMI创建竞价型实例。 Web服务器不存储任何数据,因此动态创建和终止它们不是问题。到目前为止,网站运行良好。

The problem is deploying updates. The application is updated most days.

问题是部署更新。该应用程序大多数时间更新。

Before the switch to a Spot fleet, updates were deployed as follows (1) a CI server would build and deploy the site to a staging server (2) I would do a staggered deployment to a web farm using a simple xcopy of files to mapped drives.

在切换到竞价型队列之前,更新部署如下(1)CI服务器将构建站点并将其部署到登台服务器(2)我将使用简单的xcopy文件映射到Web场的交错部署驱动器。

After switching to Spot instances, the process is: (1) {no change} (2) deploy the update to one of the spot instances (3) create a new AMI from that deployment (4) request a new Spot fleet using the new AMI (5) terminate the old Spot fleet. (The AMI used for a Spot request cannot be changed.)

切换到竞价型实例后,流程为:(1){无更改}(2)将更新部署到其中一个现场实例(3)从该部署创建新的AMI(4)使用新的请求新的竞价型队列AMI(5)终止旧的现货舰队。 (无法更改用于竞价请求的AMI。)

Is there a way to simplify this process by enabling the nodes to either self-configure or use a shared drive (as Microsoft Azure does)? The site is running the Umbraco CMS, which supports multiple instances from the physical location, but I ran into security errors trying to run a .Net application from a network share.

有没有办法通过启用节点自我配置或使用共享驱动器来简化此过程(如Microsoft Azure所做的那样)?该站点正在运行Umbraco CMS,它支持物理位置的多个实例,但我遇到了尝试从网络共享运行.Net应用程序的安全错误。

Bonus question: how can I auto-add new Spot instances to the load balancer? Presumably if there was a script which fetched the latest version of the application, it could add the instance to the load balancer when it is done.

红利问题:如何自动将新的Spot实例添加到负载均衡器?据推测,如果有一个脚本提取了最新版本的应用程序,它可以在完成后将实例添加到负载均衡器。

1 个解决方案

#1


0  

I have somewhat similar setup (except I don't use spot instances and I have linux machines), here is the general idea:

我有一些类似的设置(除了我不使用spot实例,我有linux机器),这里是一般的想法:

  1. CI creates latest.package.zip and uploads it to designated s3 bucket
  2. CI创建latest.package.zip并将其上传到指定的s3存储桶

  3. CI sequentially triggers the update script on current live instances which downloads the latest package from S3 and installs/restarts service
  4. CI在当前实时实例上顺序触发更新脚本,从S3下载最新包并安装/重新启动服务

  5. New instances are launched in Autoscaling group, attached to Load balancer, with IAM role to allow access to S3 bucket and User data script that will trigger update script on initial boot.
  6. 新的实例在Autoscaling组中启动,附加到Load balancer,具有IAM角色以允许访问将在初始引导时触发更新脚本的S3存储桶和用户数据脚本。

This should all be doable with windows spot instances I think.

对于我认为的windows spot实例,这应该都是可行的。


分享到: