Configure IIS Web Farm to prefer specific server -


i've setup web farm in iis 8 (windows 2012) arr 3.0. farm has 2 servers. possible configure requests directed specific server (if healthy) , if server not healthy, requests directed second server?

i haven't found solution implemented workaround solves problem. used health test feature of server farm. on preferred server health test url responds ok. on secondary server health test url checks if preferred server functional , responds http status code outside acceptable status codes if is, or ok if isn't.

implementation asp

the health test url http://serverfarm/healthtest.asp 'serverfarm' server farm name given when farm created.

preferred server's healttest.asp

<%@ language=jscript codepage=65001%>  <%     response.write('ok'); %> 

secondary server's healthtest.asp

<%     var xmlhttp = server.createobject("msxml2.serverxmlhttp");     var requrl = 'http://preferred.server.ip/healthtest.asp';      try {         xmlhttp.open("get" , requrl, false);         xmlhttp.send("");          if(200 == xmlhttp.status)         {           response.status = "403 primary server active";         }         else           response.write('ok');     } catch (e) {       response.write('ok');     } %> 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -