Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 views
in Technique[技术] by (71.8m points)

asp.net - Publishing/uploading new DLL to IIS: website goes down whilst uploading

When uploading a new DLL for a large web application (dll is around 1mb) IIS throws an error because the DLL is 'in-use', meaning the website is down while the DLL is being uploaded. Is there a way to stop this behaviour?

Also, although I am using Web Applications, not Web Sites, whenever I upload a new DLL it still takes a while for IIS to restart after a fresh upload. I thought this wait was generally only for websites as they need to be compiled by IIS, not Web Applications?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use AAR together with some Powershell scripting to deploy with zero downtime in the same machine.

Basically you set 3 sites up . One listening to the requests, passing them to ARR, which redirects them to one of the other 2 sites. Only one of these 2 sites is active at a time.

When deploying, you copy the new files to the stopped site, warm it up, and then tell ARR to start forwarding the requests to this node, at which point you can take the site with the old code offline.

This script pretty much automates this process. It assumes the following file / site / webfarm structure:

File Strcuture

  • C:PATH_TO_YOUR_CODE$projectName (This folder holds the files to be deployed)
  • C:PATH_TO_YOUR_CODE$projectName-Green (Can be empty to start with - deployment files will be copied here when activating this node)
  • C:PATH_TO_YOUR_CODE$projectName-Blue (Can be empty to start with - deployment files will be copied here when activating this node)

IIS Sites

  • "$projectName" (ARR Site) Running
  • "$projectName-Green" (Balanced Site Green) Stopped
  • "$projectName-Blue" (Balanced Site Blue) Stopped

Web Farms

  • "$projectName-Farm"
  • "$deploymentBlueNodeAddress" Unavailable
  • "$deploymentGreenNodeAddress" Unavailable

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...