Deploying and Managing Web Farms on IIS7

Deploying and Managing Web
Farms on Microsoft® Internet
Information Services (IIS) 7.0
Faith Allington
Program Manager
Microsoft Corporation
Session Objectives and Takeaways
How to use IIS 7.0 shared configuration to build a Web
farm
Learn about new features in IIS 7.0 for Web farms
Learn how IIS 7.0 enables stateless front-end Web servers
Reduce time to build a Web farm with IIS 7.0
Tips and tricks for administrators
Common questions answered
Agenda
Challenges with Internet Information Services (IIS) 6.0
What’s New in IIS 7.0 for Web Farms
Demo
Lessons Learned and Guidance
Questions and Answers
Feedback from Customers
Common pain points with IIS 6.0/Windows Server® 2003
…
Metabase corruption issues
Too many computer-specific settings
No way to share the metabase between servers
Lack of metabase synchronization
Difficult to troubleshoot double-hop authentication
Difficult to manage applications remotely
Difficult to deploy new applications
Life Before IIS 7.0
1. Configure master server
XML
Metabase.XML
XML
2. Replicate config
3. Change configuration
Metabase.XML
XML
4. Re-replicate config
Metabase.XML
Replication and synchronization are challenging, requiring custom code
New IIS 7.0 Improvements
What’s new for Web farm administrators …
Ability to share configuration between servers
Shared config removes need for synchronization
Computer-independent configuration
Distributed config down to the application level
Xcopy deploy an application or entire server
Manage local or remote apps using IIS Manager
Detailed error messages provide user account being
used for authentication to Universal Naming
Convention (UNC)
IIS 7.0 Deployment Life Cycle
Enhanced management through
every stage of deployment
IIS 7.0: Install what you
want, xcopy servers or
applications
1. Deploy
2. Manage
4. Re-Deploy
IIS 7.0: Quickly roll-out
new services or
components
IIS 7.0: Better
management for
developers and admins
3. Maintain
IIS 7.0: Better diagnostics
and troubleshooting
Shared Configuration Benefits
Portability: Quickly move sites, applications, or servers
Replication: Put the same configuration on multiple computers
Synchronization: Keep the configuration in sync
Staged Deployment: Stage and rollback server changes
Portable and Manageable Applications
Unified management and administration
IIS/Microsoft® ASP.NET settings together in Web.config files
IIS/ASP.NET side-by-side in the management tool
Site and application settings are xcopied alongside
code and content
Example: Dev’s settings are pushed to the test server, no more
having to manually configure it for them
Poll
Did you already know that IIS site settings like default
document are now stored in the site’s Web.config file?
Portability
Internet
XML
AppHost.config
Site Owner
XML
App Deployment
Quickly deploy an entire site from the dev computer to the server
demonstration
Application Deployment


Creating a new site
Xcopy deploying an application
Demo Summary:
Application Deployment
Created a web site
New site has unique app pool by default
Didn’t have to add unique identity to IIS_WPG
Detailed error helped us troubleshoot
Xcopy deployed an application
Enabled Code Access Security for the file share
IIS settings like DirBrowse stored in the site’s Web.config file
Powerful New XML Config
New configuration files:
applicationHost.config (IIS global/site configuration, metabase
equivalent)
administration.config (IIS UI configuration)
redirection.config (Shared config settings)
Easily copy config between servers
Environment variables enable abstraction of physical
paths
Distributed config provides IIS configuration down to
the application level
Replication and Synchronization
XML
AppHost.config
Shared
Config
Shared App Hosting
Configuration is shared between multiple nodes, just stays in sync
demonstration
Enabling Shared Config



Exporting current configuration
Enabling shared configuration
Adding a second Web farm node
Demo Summary:
Enabling Shared Config
Exported configuration
Easily exported config through the UI
Enabled shared config on second server
New server could easily be for disaster recovery
Lastly, added another node
We had 2 front-end web servers
Improved redundancy and fault tolerance
Staging and Rollback
XML
AppHost.config
Version 1
Staging
New
Config
Version 2
Easily manage multiple configuration versions for staging and rollback
demonstration
Staging and Rollback


Staging the installation of a new component
Rolling back after failures
Demo Summary:
Staging and Rollback
Staging installation of components
Removed shared config
Installed FTP locally
Exported new config to share
Re-enabled shared config
Rollback
Broken config (due to missing ASP)
Reverted back to known-good configuration
Content Replication
To achieve high fail-over and scalability:
Store content on a back-end file server, not on the front-ends
Use Distributed File System Replication (DFSR) to replicate
content between remote file servers
Changes in Windows Server® 2008 to Server Message
Block (SMB) …
Enable greater number of connections
No more setting MaxCmds/MaxMpt registry
Shared Config and Offline Files
When to use?
If you want to ensure front-ends use a cached copy of
applicationHost.config when file share is down
Pros
Quick, easy to use
Ensures simple scenario availability
Cons
Not fully redundant solution
Changes to config aren’t replicated until file share is back
online
Shared Config and DFS
When to use?
Uptime is critical and you need to ensure config is always
available
Pros
Great solution for content and config
Config is always up-to-date
Relatively easy to configure
Cons
More work to set up than offline files
Web Farm Components
Computers running Windows Server®
IIS, Web server settings, Web sites,
application pools
Files, NTFS file system
permissions
COM+
Registry settings (data source
names [DSN], etc.)
Common language
runtime (CLR) and
ASP.NET
Microsoft® SQL
Server™ databases
Best Practices
Before you enable shared config!
Make sure that all the servers have the same components
installed
Verify on each computer using Role Manager or registry query
Before you install a new component!
If it writes to the applicationHost.config, you can’t install it with
shared config enabled
Take a server offline and update separately
Best practice to configure servers as needed before enabling
shared config
Xcopy Deployment
You can xcopy the applicationHost.config and
administration.config files
Important tip: First export the encryption keys if you
use encrypted properties or plan to
Encrypted properties typically are passwords for custom
identities (application pool, anonymous user, etc.)
Copy any custom modules to all computers
You have to copy the modules to each computer (no central
storage)
But it won’t break the UI if there’s a custom module in
admin.config that doesn’t exist on the server
Code to Enable Shared Config
var config =
WScript.CreateObject("Microsoft.ApplicationHost.W
ritableAdminManager");
config.CommitPath = "MACHINE/REDIRECTION";
var section =
config.GetAdminSection("configurationRedirection"
, "MACHINE/REDIRECTION");
section.Properties.Item("enabled").Value = true;
section.Properties.Item("path").Value =
"\\\\somemachine\\share\\folder";
section.Properties.Item("userName").Value =
"user";
section.Properties.Item( "password" ).Value =
“pass";
config.CommitChanges();
Gotcha's
Shared config servers don’t know about each other
(there’s no “server list”)
This means that performing service-level changes has to occur
on each computer
Example: Stopping a site on one server will not stop it on other
servers, you need to do this
Example: Setting WMSVC to automatic or starting it on one
server will not affect the other servers
Questions—Outages
What happens if the file server with the config goes
down, but the Web servers are still up?
Config will be cached in memory. If the Web service is
restarted, it will report invalid config.
Mitigation: Use a redundant solution like DFSR for both content
and configuration
How do we cache config on each local computer?
Use offline files, or client-side caching, just for the shared
config files
Files are copied locally and used until file server is back online
Questions—Performance
What is the impact to performance when any server
changes are made to the farm?
Changes are written to the shared config. If you change a
global setting, all active worker processes will restart.
Mitigation: Perform global changes during non-peak times
Note: Only global-level changes cause the restart, changes to
individual pools/sites will only affect that pool/site
Does using shared config cause less throughput for
sites?
Not a significant decrease and the IIS team is recommending it
for Web farms
More Questions
What if I have a different IP address on each node (I’m
not using a single, virtual IP–like Network Load
Balancing [NLB])?
Configure multiple bindings for each site
Does the new, out-of-band FTP server work with
shared config?
Yes! But per the best practices, you need to either install it prior
to enabling shared config … or you need to stage the
deployment one node at a time.
Troubleshooting Tips
If you install a component when shared config is enabled, you’ll
see:
Installation failure
Error in the Event Log
If you export shared config when some servers don’t have the
same components:
503 Service Unavailable for sites
Error in the Event Log that a module is missing
If your credentials for shared config become invalid (password
changes, etc.):
Enter new set at prompt in the UI
Or open redirection.config directly
Migrating to IIS 7.0
Components that require Metabase Compatibility:
ASP.NET 1.1
Microsoft® Office FrontPage® Server Extensions (out-of-band
release)
Windows® SharePoint® Services
IIS 6.0–based scripts
Third-party applications that rely on custom metabase data
When to use classic mode for your application pool?
If your application relies on the way the IIS 6.0 pipeline worked,
use classic mode
Windows SharePoint Services requires classic mode
Enhanced Web Farm Management
Configuration and content solutions …
Small: 2–6 nodes
Current recommendation is to use shared config
Remote file server
Medium: 6–12 nodes
Depends on the farm, you may want to move to Microsoft®
System Center
Distributed File System for content
Large: 12+ nodes
System Center and Microsoft® Windows® Installer packaging
Session Summary
IIS 7.0 Web farm enhancements
Create stateless front-ends
Share their configuration from a UNC path
Eliminate replication and synchronization
Quickly xcopy IIS config with code and content
Improved management of applications
Staging and rollback improvements
Computer-independent configuration
IIS.NET: Home for IIS Community!
In-depth technical articles and samples
Connect with other IIS experts on blogs & forums
Free advice and assistance in forums
Download centre with IIS solutions
Q&A
IIS 7.0 at ITForum: Session Schedule
Tuesday
Location
IIS 7.0 for IT Pros (WSI204)
09:00 - 10:15
Tent 1
13:30 - 14:45
Room 115
Managing Web Farms on IIS (WSI302)
15:15 - 16:30
Wednesday
10:45 - 12:00
Room 134
Securing Internet Information Services 7 (WSI03-IS)
Room 121
Remotely Managing for IIS 7.0 (WSI309)
13:30 - 14:45
Room 115
Publishing Content to IIS 7.0 (WSI308)
09:00 - 10:15
Room 131
Troubleshooting Web Sites on IIS 7.0 (WSI02-IS)
10:45 - 12:00
Room 125
Running PHP on Windows Server 2008 (WSI307)
15:45 - 17:00
Room 115
Customized Web Server on Server Core (WSI311)
Friday
09:00 - 10:15
Room 115
Managing IIS 7.0 Through Scripting (WSI310)
10:45 - 12:00
Room 134
Securing Internet Information Services 7 (WSI03-IS)
12:15 - 13:00
Room 116
Deliver Rich Media on Windows Server 2008 (WSI01-PD)
13:30 - 14:45
Room 133
Q&A with the IIS Product Team (WSI04-IS)
Thursday
Resources
Technical Communities, Webcasts, Blogs, Chats & User Groups
http://www.microsoft.com/communities/default.mspx
Microsoft Learning and Certification
http://www.microsoft.com/learning/default.mspx
learn
support
Microsoft Developer Network (MSDN) & TechNet
http://microsoft.com/msdn
http://microsoft.com/technet
Trial Software and Virtual Labs
http://www.microsoft.com/technet/downloads/trials/default.mspx
IIS.NET Walkthroughs, Forums, Blogs and More
http://www.iis.net
http://blogs.iis.net
http://forums.iis.net
connect
subscribe
TechNet Library
Knowledge
Base Forums
TechNet Magazine
Security bulletins
User Groups
Newsgroups
New, as a pilot for 2007, the Breakout sessions will be available post
event, in the TechEd Video Library, via the
My Event page of the website
E-learning Product
Evaluations Videos
Webcasts V-labs
Blogs
MVPs
Certification Chats
Visit TechNet in the ATE Pavilion and get a FREE 60-day subscription to TechNet Plus!
Complete your evaluation on the My Event pages
of the website at the CommNet or the Feedback
Terminals to win!
All attendees who submit
a session feedback form
within 12 hours after the
session ends will have the
chance to win the very latest
HTC 'Touch' smartphone
complete with Windows
Mobile® 6 Professional
© 2007 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only.
MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.