Compartilhar via


Configure HTTP Load Balancing Using ARR

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

This topic describes how to configure Application Request Routing (ARR) to load balance HTTP requests across multiple content servers. You must have IIS 7 installed on a computer that is running Windows Server® 2008 or newer, ARR and its dependent modules, and a minimum of two content servers with working sites and applications. For information about how to set up a server farm, see Define and Configure an ARR Server Farm.

Configure HTTP Load Balancing Using ARR

You can verify that URL rewrite rules have been created to load balance requests by using the UI or by using the command line. If you configured your ARR server farm by using the procedure in the topic Define and Configure an ARR Server Farm, URL rewrite rules were automatically created to support a simple load-balancing scenario.

To verify URL rewrite rules by using the UI

  1. Open IIS Manager.

  2. In the Connections pane, expand the server node and then expand the Server Farms node. Select your server farm.

  3. In the Server Farm pane, double-click Routing Rules.

  4. On the Routing Rules page, verify that the Use URL Rewrite to inspect incoming requests check box is selected.

  5. Clear the Enable SSL offloading check box.

    SSL offloading is enabled by default. When this feature is enabled, communication between the ARR server and application servers or clients is transmitted in clear text. This does not have security implications when the ARR server and the application servers are deployed in a trusted network such as in the same datacenter. Enabling this feature also maximizes server resources on the application servers by eliminating the need to encrypt and decrypt requests and responses.

  6. Click Apply.

  7. Open a Web browser and send several requests to the ARR server.

  8. In the Connections pane, select your server farm.

  9. In the Server Farm pane, double-click Monitoring and Management.

  10. On the Monitoring and Management page, verify that the requests are being evenly distributed between the application servers.

To verify URL rewrite rules by using the command line

  1. Open a command prompt with administrator user rights, and navigate to %windir%\system32\inetsrv.

  2. To verify that the URL rewrite rules have been created correctly, enter the following command:

    appcmd.exe list config –section:system.webServer/rewrite/globalRules

  3. To disable SSL offloading and create URL rewrite rules to forward HTTPS traffic using SSL, enter the following commands:

    appcmd.exe clear config –section.system.webServer/rewrite/globalRules

    appcmd.exe set config –section:system.webServer/rewrite/globalRules /+”[name=’ARR_serverFarmName_loadbalance_SSL’,patternSyntax=’Wildcard’,stopProcess

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /[name='ARR_serverFarmName_loadbalance_SSL',patternSyntax='Wildcard',stopProcessing='True'].match.url:"*"  /commit:apphost

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /+"[name='ARR_serverFarmName_loadbalance_SSL',patternSyntax='Wildcard',stopProcessing='True'].conditions.[input='{HTTPS}',pattern='On']" /commit:apphost

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /[name='ARR_serverFarmName_loadbalance_SSL',patternSyntax='Wildcard',stopProcessing='True'].action.type:"Rewrite" /[name='ARR_serverFarmName_loadbalance_SSL',patternSyntax='Wildcard',stopProcessing='True'].action.url:"https://serverFarmName/{R:0}"  /commit:apphost

    where serverFarmName is the name of your server farm.

  4. To create URL rewrite rules to forward HTTP traffic in clear text to the application servers, enter the following commands:

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /+"[name='ARR_serverFarmName_loadbalance',patternSyntax='Wildcard',stopProcessing=

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /[name='ARR_serverFarmName_loadbalance',patternSyntax='Wildcard',stopProcessing='True'].match.url:"*"  /commit:apphost

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /[name='ARR_serverFarmName_loadbalance',patternSyntax='Wildcard',stopProcessing='True'].action.type:"Rewrite" /[name='ARR_serverFarmName_loadbalance',patternSyntax='Wildcard',stopProcessing='True'].action.url:"https://serverFarmName/{R:0}"  /commit:apphost

    where serverFarmName is the name of your server farm.

  5. To verify that the URL rewrite rules were created correctly with SSL offloading disabled, enter the following command:

    appcmd.exe list config –section:system.webServer/rewrite/globalRules

See Also

Concepts

ARR Tasks for IT Pros
ARR Common Tasks