IIS Server Load balancer-application request Route details Article 5: Use arr to configure pilot projects
SeriesArticleLink:
Detailed explanation of IIS Server Load balancer-application request route Article 1: arr Introduction
Detailed explanation of IIS Server Load balancer-application request route Article 2: Create and configure Server Farm
IIS Server Load balancer-application request route explanation Article 3: Server Load balancer for HTTP requests using Arr (I)
IIS Server Load balancer-application request route explanation Article 3: Server Load balancer for HTTP requests using Arr (below)
Detailed description of IIS Server Load balancer-application request route Article 4: layer-3 deployment architecture using arr
IIS Server Load balancer-application request route
You may feel a little strange when you see this article! Next, let's see what this means.
You may have encountered a situation where you want to direct user requests to different sites based on the characteristics of certain request users (Please distinguish the concept of "affinity" here, this is not "affinity "). If you are not quite clear, let's take an example: if the requesting user uses the IE browser, then we will send their requests to the site on server, if the user uses the Firefox browser, we will forward the request to server B.
To sum up, we can process requests with different features according to the user's characteristics.
We can use arr more flexibly. For example, if a user requests a file, we are like forwarding it to the file server, if our site is in Beta, all our requests will be handled by server a. After the site becomes stable, we will use the site on server B to process the requests.
As before, we should first prepare some environments for testing!
First, you want to use IIS 7 (or later) and install arr. For more information, see the previous articles.
Second, prepare a server (or a virtual machine ).
Once again, we deploy two sites on the server: pilotsite and productionsite.
Our currentPurposeThat is, if the client sending the request is installed. net Framework 3.5 and still use the IE browser, then we will send the request to pilotsite, otherwise it will be sent to the productionsite, and the two sites are located in different farm servers (of course, we can add more sites to each farm ).
Next, we will start the specific operation.
1. Deploy two sites in IIS (we deploy them on different ports respectively. If you want to, you can place them on two different servers respectively), for example:
2. Create two servers farm named pilotsiteservers and productionsiteservers, as shown below:
3. Select pilotsiteservers and double-click"Routing rules", For example:
Because it involves using multiple server farm to match different requests, You need to configure the rewrite with the URL.
4. Click "url rewrite ..." Then you can see the following interface:
We can see that there are now two URL rewrite rules, because at this time, we need to forward requests based on specific user information, so we need to modify the default rule:
A. Make sure that "arr_pilotsiteservers_loadbalance" is on the top, while "arr_productionsiteservers_loadbalance" is on the bottom. If not, click "move up" and "Move Down" to adjust it as follows:
B. Select "arr_pilotsiteservers_loadbalance" and click "edit" to edit the configuration. The following page is displayed:
C. According to our previous requirements, the client installed. Net 3.5 and all requests using the IE browser were forwardedPilotsiteserversSo, we start to add some of our filter rules, click "Add conditions", and then click "Add ...", For example:
Add "{http_user_agent}", and then add "* MSIE *" in pattern *",
Then, when we add another rule (the one in. Net 3.5), the operation is similar to the preceding one,
After adding two filter rules, do not select"Stop processing of subsequent rules", Then click" Apply ",
Now you can run the site.
we recommend that you deploy the two sites on different servers, during the test, I found that two servers are always put on one server, and an error is always reported. Just separate them.