How failover should work in IIS cluster with Application Request Routing

arriis-7

I have set up several servers with IIS and connected them to the load balancer – server with installed IIS Application Request Routing. I have created a server farm and added two servers. Then I stopped IIS on the first server and tried to open my web site. It returned me an error:

502 - Web server received an invalid response while acting as a gateway or proxy server.
[There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.]

But if instead of stopping IIS I shut down the first server, I'm getting a response from the next server which is online. The question is, what the expected behaviour should be for failover with ARR, should it switch me to the next server if IIS is stopped and server is online?

Additional info:
I've tried to shut down each server and I was able to open web site in both cases, so there is no problem with connections or configuration. I'm using even distribution and round-robin load balance algorithm. The problem appears only if I stop IIS and leave server online.

Best Answer

In order to let the ARR server know when not to route requests to a server, you need to set up a Health Test.

  • Select your server farm in the IIS Manager
  • Select the Health Test Feature.
  • Here you can fill in an URL to run the health check against, (ie. a text file containing a good word, or the index page on the web site your trying to load balance).

Once you have configured a health test, you should be able to stop IIS on one of the servers, and see that requests to the ARR server is getting answered from the other.

For maintenance scenarios, you can gracefully shut pull out a web server from load balancing, using the Monitoring and Management feature. Select the server you need to drain, and select Disallow new connections from the Actions pane