简体   繁体   English

批量更新 .net web 应用程序

[英]Mass updating .net web applications

So I have a .net web application that I use the VS 2010 "publish" feature to deploy to a server.所以我有一个 .net web 应用程序,我使用 VS 2010“发布”功能部署到服务器。 Each instance of the application has its own unique connection string, pointing to its own database.应用程序的每个实例都有自己唯一的连接字符串,指向自己的数据库。

I have 80 instances of this application.我有这个应用程序的 80 个实例。 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.我希望能够使用应用程序的“主”版本更新 1 个实例,然后让其他 79 个实例自行更新,但保留其现有的连接字符串。

What is the most common / standard way of achieving this?实现这一目标的最常见/标准方法是什么?

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. KwateeSDCM 是一个可以做到这一点的免费工具。 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. (我似乎无法回复您的评论,所以我编辑了我的答案) Ken - 是的,文档真的很苗条。 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.老实说,我对 asp.net 了解不多,但从你的描述来看,它看起来与我使用 tomcat Z2567A5EC9705EB7AC2C984033E063089DZ 应用程序(在我的服务器上)设置的非常相似。 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.您定义一个“包”,它只是您必须部署的文件/可执行文件的压缩(或去皮)存档,配置目标服务器,然后告诉 sdcm 哪个 package 在哪个服务器上运行。 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.您可以在配置文件中使用一种环境变量概念(在您的情况下,%{connection_string})具有占位符,这些占位符在安装时被您在 sdcm 配置中指定的特定于服务器的值替换。 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.经过大约半天的工作,我设法配置 kwateesdcm 以便单击它连接到每个服务器,停止 tomcat,复制我的档案,在我需要的地方扩展它们,替换特定于服务器的参数并重新启动 Z1B359D8753858B55BEFA0441067AAAED3Z 以获取所有变化考虑在内。 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.很酷的是,sdcm 还存档以前的存档/配置,这样可以减轻更新的压力,因为如果我的最新资料有问题,我可以快速恢复到以前的稳定版本。 One annoying thing is that it requires an ssh server on each target server.一件烦人的事情是,它需要在每个目标服务器上安装一个 ssh 服务器。 I got over that by installing winsshd on my servers我通过在我的服务器上安装 winsshd 解决了这个问题

Through the properties of the web.config file (solution explorer) you can set the "Build Action" to "none".通过 web.config 文件(解决方案资源管理器)的属性,您可以将“构建操作”设置为“无”。

Then deploy the webapp to a local directory.然后将 webapp 部署到本地目录。 This is now without that web.config file.现在没有 web.config 文件。

Then copy that local directory over your 80 applications.然后将该本地目录复制到您的 80 个应用程序上。 You could maybe automate this step.你也许可以自动化这一步。

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

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