如何将编译的代码同步到多个 EC2 实例
我们在负载均衡器后面有多个 EC2 实例。每台服务器都部署了多个 ASP.NET 应用程序。我正在寻找一种简单、实时、自动化的方法来将新的编译代码同时部署到所有实例。
我见过使用 SVN 或 Git 等源代码控制存储库的解决方案,但这对我们来说似乎并不适合使用该技术,因为我们将编译后的代码部署到 EC2 实例(而不是源代码)。
我还设置了 Dropbox 来完成同步。它在某种程度上有效,但有其怪癖。例如,您需要围绕“一个根同步文件夹”限制构建目录结构。我们绝对不应该使用 dropbox 的任何其他原因吗?
使用 S3 API 编写自定义应用程序是一种选择,但我们更喜欢第三方解决方案而不是编写更多代码。
这似乎是一个常见的场景,但我还没有找到任何好的解决方案。
We have several EC2 instances behind a load balancer. Each server has several ASP.NET applications deployed to it. I'm looking for an easy, realtime, automated way to deploy new compiled code to all instances simultaneously.
I've seen solutions using source control repositories like SVN or Git, but this doesn't seem like an appropriate use of the technology for us since we're deploying compiled code to the EC2 instances - not source code.
I've also set up Dropbox to accomplish the sync. It somewhat works, but has its quirks. For instance, you need to build your directory structure around the "one root sync folder" limitation. Any other reason why we definitely should NOT use dropbox for this?
Writing a custom application using the S3 API is an option, but we'd prefer a third party solution over writing more code.
This seems like a common scenario, but I haven't found any good solutions yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Elastic Beanstalk 似乎是现在最好的路线。您只需将 Web 部署项目推送到弹性 beanstalk 环境,它就会将代码部署到您的所有实例。 (它为您管理自动缩放。)它还确保启动的新实例将为您提供最新的代码,并保留您可以轻松回滚到的先前版本。
如果您的 asp.net 网站需要在 AWS 上自动扩展,Elastic Beanstalk 确实是最好的端到端解决方案。
Elastic Beanstalk seems to be the best route to go now. You simply push your web deploy project to an elastic beanstalk environment and it deploys code to all of your instances. (It manages auto scaling for you.) It also makes sure that new instances launched will have you latest code and it keeps previous versions which you can easily roll back to.
If your asp.net website needs to be auto scaled on AWS, Elastic Beanstalk is really the best end-to-end solution.
既然这些是 ASP.Net 应用程序和 IIS,为什么不使用 Web 部署呢?它就是为此而设计的。
http://www.iis.net/download/webdeploy
Since these are ASP.Net applications and IIS, why not use Web deploy. It's MADE for this.
http://www.iis.net/download/webdeploy
您可以使用 Git、Mercurial 或 SVN 将编译后的代码推送到服务器,或者让服务器获取代码。源代码控制不仅适用于源代码 - 它可以用于任何类型的文件。
此外,解决 Dropbox 问题的一种方法是使用多个 Dropbox 帐户(如果出现此问题)。但 Dropbox 是一个非常简单的解决方案,因为这样您就不需要编写任何代码。只要 Dropbox 启动,它就可以工作。
You can use Git, Mercurial or SVN to push compiled code to the servers, or to have the servers fetch code. Source control is not only for source code - it can be used for files of any type.
Also, one way around the Dropbox issue is to use multiple DropBox accounts if that's the issue. But Dropbox is a pretty easy solution because then you never need to write any code. As long as Dropbox is up, it will work.
您可能想尝试一下AppHarbor。我们负责管理 ASP.NET 应用程序服务器、负载均衡器和所有其他所需的基础设施,让您可以继续开发应用程序。我们还为您提供了一种便捷的方式,使用您选择的 Git、Mercurial、Subversion 和 TFS 来推送应用程序的新版本。
You might want to give AppHarbor a try. We take care of managing ASP.NET application servers, loadbalancers and all the other required infrastructure, leaving you to get on with developing your application. We also provide a convenient way for you to push new versions of your app using your choice of Git, Mercurial, Subversion and TFS.
Git 或 Mercurial 在这方面做得很好,subversion 不擅长处理 blob。
通过查看修订版本,您可以获得非常好的控制和保证,代码已部署到各处。
Git or mercurial will do a good job at that, subversion is bad at handling blobs.
And you get very nice control and assurance, that the code got deployed everywhere by looking at the revisions.
看起来很明显,但是共享文件系统?或者用 scp 或 rsync 推出?
Seems obvious but, shared filesystem? Or push out with scp or rsync?