Define and Configure an Application Request Routing Server Group

Published on June 25, 2008 by pharr

Updated on July 02, 2008 by pharr

Average Rating  Rate It (1)

Tags
ARR
RSS

Overview

This topic leads the reader through the steps to define and configure a sever group for Application Request Routing (ARR) CTP1 on IIS 7.0.  The server group is a logical group of content servers where HTTP requests are routed to based on HTTP inspection rules and load balance algorithm.

Goal

To define and configure a server group in Application Request Routing on IIS 7.0 as shown below:


Prerequisites

This walkthrough requires the following prerequisites:

  • IIS 7.0 on Windows 2008 (any SKU).
  • Microsoft URL Rewriter Customer Technical Preview (CTP) 1.
  • Microsoft Application Request Routing CTP1.
  • Minimum 2 content servers with ASP.NET installed.

If URL Rewriter CTP1 or Application Request Routing CTP1 has not been installed, it is available for download at:

  • URL Rewriter x86
  • URL Rewriter x64
  • Application Request Routing x86
  • Application Request Routing x64

Step 1 – Create and verify content servers (optional)

Strictly speaking, the content servers do not have to be present in order to define and configure the server group in Application Request Routing.  However, in order to demonstrate the Application Request Routing features, there must be at minimum 2 content servers that Application Request Routing can route the requests to. 

For this walkthrough, simple sites are created on the same server as where the Application Request Routing is installed.  Optionally, the sites can be created on separate physical servers or skip step 1 entirely and use existing content servers, if you already have them.

To create sites via UI

A simple ASP.NET site, Comic.NET, is created on the content servers.

1.       Download the Comic.NET from http://www.codeplex.com/comicnet/Release/ProjectReleases.aspx?ReleaseId=7093.
2.       Launch IIS Manager (inetmgr).
3.       Create a site by right clicking on Sites, and select Add Web Site…:


4.       Create comicSite1 on port 9000 as shown below.  Create appropriate Physical path, as needed:


5.       Repeat the steps in 3 and 4 to create comicSite2 on port 9001.
6.       Unzip the downloaded file from step 1 and copy the contents of \ComicNet\WebSites\ComicNET to the Physical path created in step 4.  Be sure to copy the contents to both comicSite1 and comicSite2.
7.       ComicNet stores the comic strips and comments in Repository folder.  On comicSite1 (and only on comicSite1), grant NETWORK SERVICE a write access to Repository:


8.       Since the traffic will be load balanced between comicSite1 and comicSite2, the Repository folder should be shared between the two sites.  Create a symbolic link of Repository in comicSite1 to comicSite2.  In an elevated command prompt (Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator), run the following command:

     1)      Remove the Repository folder in comicSite2.
     2)      Create a symbolic link:

     mklink /d <Link> <Target>
     (ie:  mklink /d Repository c:\inetpub\ComicSite1\Repository)

9.       There are two small configuration changes to make in Web.config.

     1)      Remove the following lines (line numbers shown below):

             114: <httpModules>
             115:        <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter"/>
             116:  </httpModules>

2)      Uncomment the following lines (line numbers shown below reflect deletion of above lines):

             117:  <system.webServer>
             118:        <modules runAllManagedModulesForAllRequests="true">
             119:              <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
             120:        </modules>
             121:  </system.webServer>

                Be sure to make the changes on both comicSite1 and comicSite2.

10.   Verify that both comicSite1 and comicSite2 are working by visiting http://localhost:9000/ and http://localhost:9001/, respectively.

Step 2 – Change application pool process model for Application Request Routing

All HTTP requests and responses for the content sites go through Application Request Routing.  Given this, you would want the worker process of Default Web Site on Application Request Routing be always running regardless of whether the worker processes for some of the sites are running or not.

In this step, we will disable the Idle Time-Out under application pool process model for Default Web Site.

To change application pool process model via UI:

1.       Launch IIS 7 inetmgr.
2.       Select Application Pools:


3.       By default, DefaultAppPool is the corresponding application pool for Default Web Site.  Select DefaultAppPool.  Under Actions, under Edit Application Pool, select Advanced Settings…:


4.       Change the Idle Time-out (minutes) to 0 to disable the setting.  Click OK to save the changes.

Step 3 – Create a server group in Application Request Routing

To create and define a server group via UI:

1.       Launch IIS 7 inetmgr.
2.       Application Request Routing is a server level feature.  Select the root of the server:


Locate Application Request Routing icon under IIS group heading and double click on the icon.

3.       To create a server group, under Actions, click on Create Server Group and name the server group comicSiteServers:


4.       Select the server group that was created in step 3.
5.       To add servers to the server group, under Actions, under Server Group Management, click on Add Server.  Below example shows adding the two sites created above:


Some load balance algorithms use the weight of the server to proportionally load balance the traffic.  The ones that use the Load Balance Weight are:

  • Weighted Round Robin
  • Weighted Total Traffic

The weights are normalized. So if all servers have the same weight, they will all get the equal amount of traffic.

Auto Start indicates the default server status of corresponding servers in the server group when Application Request Routings starts.  By default, the servers should be considered to be Available.  That is to say that the Auto start checkbox is checked by default.

6.       Click OK to save changes.

Step 4 – Configure server group properties

After the server group has been created and defined, additional properties can be set to manage the behavior of Application Request Routing.  Only the subset of the settings is covered in this walkthrough.

To configure server group properties via UI:

1.       Select the server group, comicSiteServers.
2.       Under Actions, under Server Group Management, click on Server Group Settings.  Click through the tabs in Server Group Settings dialog to get familiarized with the available settings:


3.       For this walkthrough, we will change the load balance algorithm that will be used for the server group, comicSiteServers.  Select the Load Balance tab and select Weighted Round Robin under Load balance algorithm pull-down.
4.       Select Proxy Setting tab and check Reverse rewrite host in response headers.  Click on OK to save the changes:

Summary

You have now successfully created and defined a server group, comicSiteServers, with two servers with comicSite1 and comicSite2, as shown below:


The comicSiteServers server group is now ready to be used.  To learn more about how to create the HTTP request routing rules and to direct traffic to the server group, refer to HTTP Load Balancing using Application Request Routing.

Related Content

Comments

You must Log In to comment.

Page view counter