如何将编译的代码同步到多个 EC2 实例

发布于 2024-10-21 22:05:38 字数 431 浏览 2 评论 0原文

我们在负载均衡器后面有多个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

只怪假的太真实 2024-10-28 22:05:38

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.

山人契 2024-10-28 22:05:38

既然这些是 ASP.Net 应用程序和 IIS,为什么不使用 Web 部署呢?它就是为此而设计的。

http://www.iis.net/download/webdeploy

Web 部署允许您通过检测源内容和目标内容之间的差异并仅传输需要同步的更改,在 IIS 7.0 服务器场中高效同步站点、应用程序或服务器。该工具通过自动确定要为特定站点同步的配置、内容和证书来简化同步过程。除了默认行为之外,您仍然可以选择指定其他同步提供程序,包括数据库、COM 对象、GAC 程序集和注册表设置。

Since these are ASP.Net applications and IIS, why not use Web deploy. It's MADE for this.

http://www.iis.net/download/webdeploy

Web Deploy allows you to efficiently synchronize sites, applications or servers across your IIS 7.0 server farm by detecting differences between the source and destination content and transferring only those changes which need synchronization. The tool simplifies the synchronization process by automatically determining the configuration, content and certificates to be synchronized for a specific site. In addition to the default behavior, you still have the option to specify additional providers for the synchronization, including databases, COM objects, GAC assemblies and registry settings.

霞映澄塘 2024-10-28 22:05:38

您可以使用 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.

梦毁影碎の 2024-10-28 22:05:38

您可能想尝试一下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.

迟到的我 2024-10-28 22:05:38

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.

野味少女 2024-10-28 22:05:38

看起来很明显,但是共享文件系统?或者用 scp 或 rsync 推出?

Seems obvious but, shared filesystem? Or push out with scp or rsync?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文