批量更新 .net Web 应用程序

发布于 2024-11-03 21:18:19 字数 195 浏览 0 评论 0原文

因此,我有一个 .net Web 应用程序,我使用 VS 2010“发布”功能将其部署到服务器。应用程序的每个实例都有自己唯一的连接字符串,指向自己的数据库。

我有 80 个该应用程序的实例。我希望能够使用应用程序的“主”版本更新 1 个实例,然后让其他 79 个实例自行更新,但保留其现有的连接字符串。

实现这一目标的最常见/标准方法是什么?

So I have a .net web application that I use the VS 2010 "publish" feature to deploy to a server. Each instance of the application has its own unique connection string, pointing to its own database.

I have 80 instances of this application. I would like to be able to update 1 instance with a "master" version of the app, and then have the other 79 update themselves, but keep their existing connection string.

What is the most common / standard way of achieving this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

2024-11-10 21:18:19

通过 web.config 文件(解决方案资源管理器)的属性,您可以将“构建操作”设置为“无”。

然后将 webapp 部署到本地目录。现在没有 web.config 文件。

然后将该本地目录复制到 80 个应用程序中。您也许可以自动化此步骤。

Through the properties of the web.config file (solution explorer) you can set the "Build Action" to "none".

Then deploy the webapp to a local directory. This is now without that web.config file.

Then copy that local directory over your 80 applications. You could maybe automate this step.

梦归所梦 2024-11-10 21:18:19

有一些简单的部署工具可以处理多个服务器上的二进制包,同时维护自定义配置。 KwateeSDCM 是一个可以执行此操作的免费工具。你可以在freshmeat上查一下

(我似乎无法回复你的评论,所以我编辑了我的答案)
肯 - 是的,医生真的很苗条。他们有一个视频教程,实际上更有用,我也从他们的一位开发人员那里得到了一些指导。老实说,我对 asp.net 不太了解,但从你的描述来看,它看起来与我在 30 台服务器上使用 tomcat Web 应用程序(war)设置的非常相似。您定义一个“包”,它只是您必须部署的文件/可执行文件的压缩(或皮重)存档,配置目标服务器,然后告诉 sdcm 哪个包位于哪个服务器上。您可以在配置文件中使用一种环境变量概念(在您的情况下,%{connection_string})具有占位符,这些占位符在安装时替换为您在 sdcm 配置中指定的服务器特定值。经过大约半天的工作,我成功配置了 kwateesdcm,只需单击一下即可连接到每个服务器,停止 tomcat,复制我的档案,在需要的地方展开它们,替换服务器特定的参数并重新启动 tomcat 以获取所有内容变化考虑在内。最酷的是 sdcm 还存档以前的存档/配置,这样可以减轻更新的压力,因为如果我的最新内容出现问题,我可以快速恢复到以前的稳定版本。一件烦人的事情是它需要在每个目标服务器上都有一个 ssh 服务器。我通过在我的服务器上安装winsshd克服了这个问题

There are simple deployment tools that can take care of coping binary packages over multiple servers while maintaining a customized configuration. KwateeSDCM is a free tool that can do this. You can look it up on freshmeat

(I don't seem to able to respond to your comment so I edited my answer)
Ken - yeah, the doc is really slim. They've got a video tutorial that is actually a lot more useful and I also got some pointers from one of their developers. Honestly, I don't know that much about asp.net but from what you describe it looks very similar to what I setup with my tomcat web applications (war) on my 30 servers. You define a "package" which is simply a zipped (or tared) archive of the files/executables you have to deploy, configure the target servers and then tell sdcm which package goes on which server. There's a sort of environment variable concept which you can use in your configuration files (in your case, %{connection_string}) has placeholders which get substituted at installation-time with the server-specific values that you specify in your sdcm configuration. With about half a day's work I manage to configure kwateesdcm so that with a single click it connects to each server, stops tomcat, copies over my archives, expands them where I need to, substitutes the server-specific parameters and restarts tomcat to take all changes into account. The cool thing is that sdcm also archives previous archives/configurations so that it's which takes a lot of stress out of updates since I can quickly revert to a previous stable version if my latest stuff had problems. One annoying thing is that it requires an ssh server on each target server. I got over that by installing winsshd on my servers

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