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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…