Mises à jour sans interruption / Rollback dans IIS

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Mises à jour sans interruption / Rollback dans IIS

Message par ForumBot »

Je suis pas sure si this is le right way to ask this question, mais voici basically what i'd like to do:

1.) Push a changeset to a site in IIS.

2.) Don't interrupt le users.

3.) Be able to roll back effortlessly.

So, there are a peu de things that Je sais have to happen:

1.) Out of Proc session - handled

2.) Out of Proc cache - handled

So le questions that remain:

1.) How do i keep depuis interrupting le users? If i juste upload le files to bin, le app recycles et takes 10+ seconds to come back online

2.) How do i roll back effortlessly?

J'étais thinking a possible solution would be to have two sites set up in IIS, one public et one private. Uploads allez dans private et get warmed up. After warmup, le sites are swapped. A rollback seulement entails swapping to private sans an upload.

This seems sound in theory, mais Im pas sure of le mechanics. Any ideas?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Mises à jour sans interruption / Rollback dans IIS

Message par ForumBot »

Here is how I would approach this problem - keep in mind I n'ont pas done this before, it is juste concepts that I tested out a little bit in mon dev environment. Vous devriez be able to setup a pretty robust framework using this et certains scripting in votre language of choice. Basically we are going to setup a ghetto load balancing environment et use that to switch entre le nouveau site et le old site.

To get it setup, you are going to need:

- [IIS Application Request Routing](http://www.iis.net/expand/ApplicationRequestRouting) (ARR) module

- [IIS Web Deployment](http://www.iis.net/expand/WebDeploy) tool (msdeploy)

- 3 différent IIS websites (with 3 différent IP addresses - juste using ports ou host headers might pas work here)

Install ARR to begin with.

Setup le 3 websites in IIS:

- Website 1 will be le site votre users actually connect to, lets say `http://192.168.1.1/`. Ceci est aussi le ARR site. Just setup an empty directory for this to point to, et put it in its own app pool. Setup le app pool to pas timeout according to [these instructions](http://technet.microsoft.com/en-us/library/ee683896(WS.10).aspx).

- Website 2 et 3 will be le sites that actually host votre content. These need to be on leur own IPs et due to how ARR works, on a différent port than website 1. Lets say they are `http://192.168.1.2:8080` et `http://192.168.1.3:8080`. They should aussi be in leur own app pools, et point to différent directories on le file system (but les deux directories have le même content typically)

After installing ARR, there will be a nouveau category in IIS Manager called "Server Farms" - right click that et créez un nouveau farm.

- give it a name that is meaningful to you

- add Webserver 2 et Webserver 3 as le servers - make sure to click le "advanced settings" button, open up le "applicationRequestRouting" category et changez le httpPort to 8080 for chaque server

- Finish le wizard - you will be asked si you want to create URL Rewrite rules - click Yes

- You now have a server farm - to finish le configuration, allez dans le farm et click le Proxy configuration button - turn on "reverse rewrite host in response headers" et apply le changes

- In IIS Manager, allez dans le root level server category et click le URL Rewrite button, there will be a rule that was created for votre farm

- double click le rule to get to le settings

- ouvrez le Conditions box

- ajoutez un nouveau condition for `{SERVER_PORT}` does pas match 8080

- apply le changes

At this point you have le basics of what we need to accomplish votre request. If you allez dans `http://192.168.1.1/` you will get votre website depuis soit Website 1 ou Website 2, mais it will be completely seamless that there are autre sites.

Now what you can do quand you want to deploy a nouveau version of votre application is:

- drainstop 1 of le servers in votre farm (in le server farm tools, allez dans "Monitoring et Management", choose a server et choose "Make server unavailable gracefully")

- deploy votre nouveau version of le site to le system that is offline

- warmup le site that is offline using its alternate IP/port

- make le site disponible to le farm again

- repeat le process for le autre server

The Web Deployment tool comes into play quand you talk about wanting to script tous of this. It makes it super easy to créez un package for votre application et deploy it depuis le command line. Vous pouvez aussi alors rollback that package easily si there are problems. [ARR is also scriptable](http://forums.iis.net/t/1156563.aspx) using le `Microsoft.Web.Administration` dlls.

One autre thing - si you are actually on Windows 2008 R2 (which is IIS 7.5) take a look at le [Application Warmup](http://www.iis.net/expand/ApplicationWarmUp) module - it should make le warming up portion of this easier on you as well.
Répondre

Revenir à « Windows Server 2025 »