ARR newbie questions [Answered]RSS

18 replies

Last post May 26, 2010 09:21 PM by wonyoo

  • ARR newbie questions

    Jan 05, 2010 05:12 AM|bhaq|LINK

    Hi everyone. I have a few questions (i hope someone can shed some light) 1) Can ARR be installed on the same server as my IIS websites. 2) All my websites use Host Header bindings eg http://AA.mywebsite.co.uk, AB.mywebsite.co.uk etc If ARR is installed on the same server as IIS and I am using Host headers, how do I ensure ARR is getting the request (and not the IIS website itself)
  • Re: ARR newbie questions

    Jan 05, 2010 07:26 AM|bhaq|LINK

    I just tried viewing a simple text file on one of the websites (hosted on the ARR server). I am getting HTTP Error 502.4 - Bad Gateway No appropriate server could be found to route the request. How do I get round this? I can see this problem posted before but I can't find any useful answer. Btw. before someone asks, I'm using the generated rewrite rule. (i didn't create it myself)
  • Re: ARR newbie questions

    Jan 06, 2010 04:40 AM|bhaq|LINK

    Any Ideas? Would be appreciated.
  • Re: ARR newbie questions

    Jan 16, 2010 10:33 PM|wonyoo|LINK

    You can deploy ARR on the same machine as where you are running the web sites (in your case using host name binding.)   ARR, as you know, is a proxy, so you could configure ARR in such a way that it receives the initial request, and proxies that via loop back to itself to one of the sites that you are running on the same box.

    That said, I am curious to further understand what you are trying to accomplish so that I can better answer your questions.

    The problem that you are seeing about the bad gateway could happen for serveral reasons, but I would guess that becaues you are running ARR on the same machine as your web sites, you are probably stuck in infinite loop (which ARR breaks away after 10 tries).

    As noted, please help me understand why creating a proxy is necessary for your use case and we can go from there.

    Thanks

    ARR

  • Re: ARR newbie questions

    May 25, 2010 10:21 PM|graham91081|LINK

    Hi, I'm having the same problem. I'm trying to configure NLB and ARR on a server farm, but both the ARR servers are also the Content servers. Is this possible? The thing is I'm getting error 502.4 - Bad Gateway. How can I solve this problem?
  • Re: ARR newbie questions

    May 26, 2010 12:51 AM|Uk-Sam|LINK

     

    ARP is designed as proxy server, which will receive all request and forward them to webserver as per rule defined, Its not a problem to have ARR and serving webserver on same machine.

    If you provide more info on

    %windir%\system32\inetsrv\appcmd.exe list sites
    %windir%\system32\inetsrv\appcmd.exe list config -section:webFarms
    %windir%\system32\inetsrv\appcmd.exe list config -section:globalRule

    it can be sorted.

  • Re: ARR newbie questions

    May 26, 2010 12:22 PM|graham91081|LINK

    Thanks for the quick response. Here are the results:
    
    C:\Windows\System32\inetsrv>appcmd.exe list sites
    
    SITE "Intranet" (id:1,bindings:http/*:80:,state:Started)
    SITE "Helpdesk" (id:2,bindings:http/*:8080:,state:Started)
    
    C:\Windows\System32\inetsrv>appcmd.exe list config -section:webFarms
    
    [webFarms]
      [applicationRequestRouting]
        [hostAffinityProviderList]
          [add name="Microsoft.Web.Arr.HostNameRoundRobin" /]
          [add name="Microsoft.Web.Arr.HostNameMemory" /]
        [/hostAffinityProviderList]
      [/applicationRequestRouting]
      [webFarm name="cluster.nsel-clnsa.com.ni" enabled="true"]
        [applicationRequestRouting]
          [protocol timeout="00:03:20" reverseRewriteHostInResponseHeaders="true"]
            [cache enabled="false" /]
          [/protocol]
          [healthCheck url="http://cluster.nsel-clnsa.com.ni" /]
          [affinity]
          [/affinity]
          [loadBalancing algorithm="WeightedRoundRobin" /]
        [/applicationRequestRouting]
        [server address="192.168.134.33" enabled="true"]
          [applicationRequestRouting weight="100" /]
        [/server]
        [server address="192.168.128.34" enabled="true"]
          [applicationRequestRouting weight="100" /]
        [/server]
      [/webFarm]
    [/webFarms]
    
    C:\Windows\System32\inetsrv>appcmd.exe list config -section:globalrules
    
    [system.webServer]
      [rewrite]
        [globalRules]
          [rule name="ARR_cluster.nsel-clnsa.com.ni_loadBalance" patternSyntax="Wild
    card" stopProcessing="true"]
            [match url="*" /]
            [conditions]
            [/conditions]
            [serverVariables]
            [/serverVariables]
            [action type="Rewrite" url="http://cluster.nsel-clnsa.com.ni/{R:0}" /]
          [/rule]
        [/globalRules]
      [/rewrite]
    [/system.webServer]
    
    C:\Windows\System32\inetsrv>
    
    
    I've replaced the "<>" with "[]" so it would let me paste the code.
  • Re: ARR newbie questions

    May 26, 2010 12:37 PM|Uk-Sam|LINK

    Reading info it seems the ARR is getting looped on server A it self as referred by "wonyoo" I will suggest to check the rules and default rule are generated  by considering that ARR and webservers are physical diff server.

    Additionally you need to Configure Failed Request Tracing Rules this will help in troubleshooting

    http://learn.iis.net/page.aspx/488/using-failed-request-tracing-rules-to-troubleshoot-application-request-routing-arr/

  • Re: ARR newbie questions

    May 26, 2010 01:08 PM|graham91081|LINK

    Thanks for all of your help. Can you please point me somewhere I can get more information about routing rules and so... I still don't understand how it works... I really want to know what I'm doing before I put the servers in production. Is there any book you may recomend?
  • Re: ARR newbie questions

    May 26, 2010 01:22 PM|wonyoo|LINK

    Hi Graham

    The routing rules in ARR are managed by the URL rewrite rules.  You can learn more about the URL rewrite module at http://learn.iis.net/page.aspx/734/url-rewrite-module/.

    That said, let me see if I can help you a bit.  I think what I heard you say are:

    1. You have 2 machines that you want to use as the content servers, ARR is running on both machines, and you are also using NLB on top of that.   Am I hearing you right?   So your end users are accessing the site via a VIP that NLB is bound to, and the traffic is first routed to ARR, and ARR routes to self that you also want to use as content servers?

    - Why would you use both NLB and ARR?   I am curious.

    2. In your rules, are 192.168.134.33 and 192.168.134.34 the physical IP addresses of the 2 servers?

     

    Thanks.

    ARR application Request Routiing

  • Re: ARR newbie questions

    May 26, 2010 02:20 PM|graham91081|LINK

    You have all right. I don't know if what I'm trying to do is right. I have 2 content servers I want to have load balancing on son I can have both, High Availability and Application Load balancing, so if I restart a server during work-hours, the clients can still get to the site, and during peek hours the clients would be distributed between the two servers. I've read about the ARR and I think is great, but I don't have another server to set It on, plus if I do that I would loose the high availability I'm trying to get. On that server, we're going to host an internal app that is used 24/7 so I hate people calling at 3 in the morning saying the app is down. So I set up the ARR on both servers and configured the server farm. The cluster has a shared ip addres 192.168.134.35 and an alias "cluster.internaldomainname.com"; the hosts are "ws03.internaldomainname.com" (192.168.134.33) and "ws04.internaldomainname.com" (192.168.134.34). I've also set up shared configuration on a network drive. The site on both servers is set up to "windows integrated authentication". The first time I set up the server farm with all default parameters, I try to go to cluster.internaldomainname.com and I get prompt for username and password, once I enter it, it prompts again, and again, and again so I hit cancel and I get error 401. From the server if I do the same I get error 502.3 I've set up failed request loggin but I can't see any file on the default directory. Any help you can give me would be great. Thanks in advance.
  • Re: ARR newbie questions

    May 26, 2010 02:46 PM|wonyoo|LINK

    Thanks - I have a better understanding of the environment and the scenario that you want to enable.

    That said, what kind of "application level" load balacing would you like to do?   Note that if you just want a simple (IP based) load balancing for high availability and scalability for 2 servers, NLB alone should meet your needs.   ARR is different from NLB in many aspects, but the main difference is that NLB is not application (layer 7) aware while ARR is.   In some cases, both ARR and NLB can be used together - but I want to make sure that you actually need both before we investigate this option further.  Your current routing rules (cut and pasted below) does not really leverage/require layer 7 awareness:

        [globalRules]
          [rule name="ARR_cluster.nsel-clnsa.com.ni_loadBalance" patternSyntax="Wild
    card" stopProcessing="true"]
            [match url="*" /]
            [conditions]
            [/conditions]
            [serverVariables]
            [/serverVariables]
            [action type="Rewrite" url="http://cluster.nsel-clnsa.com.ni/{R:0}" /]
          [/rule]

    Could you confirm that you actually need layer 7 awareness?   If not, NLB by itself should achieve what you want.

    ARR application Request Routiing NLB

  • Re: ARR newbie questions

    May 26, 2010 02:57 PM|graham91081|LINK

    That's the default rule created by ARR. Yes I need layer 7 awareness, I just wanted to get it "Just Working" to better understand it and then "Fine Tune" it. The thing I like about the proxy is that some of the most viewed parts of the application can be cached and served faster. I don't really understand how the rules work for ARR. I've been reading the Rewrite Rules and I quite understand them but I don't get how the Rewrite Rules Work with ARR. Where should the client be redirected: The Content Server, The Server Farm? But in this case are both the same so I think is in an infinite loop. Any Advice? I've seen your video but I think ARR it's a different version from the one I'm using.
  • Re: ARR newbie questions

    May 26, 2010 03:29 PM|wonyoo|LINK

    Your understanding is pretty much spot on.  You are currently in an end-less loop.  But you can work around that using URL rewrite rules.

    I am also going to make the following assumptions:

    - Your end customers will always access the sites using the VIP that NLB is bound to.   This is "cluster.internaldomainname.com" (corresponding IP is 192.168.134.35).

    - The physical IPs 192.168.134.33 and 192.168.134.34 are used to routing it to "self" (and this is how you have currently have it.)

    The key is to apply the URL rewrite (or the ARR proxying logic) only once, for the requests that are coming in on the VIP.  Once the rule is applied to this request on the VIP, then ARR picks up the request, then it routes to either 192.168.134.33 or 192.168.134.34 (which is basically the "self").  But this time around, you don't want ARR to proxy the request - instead, you want the content to be served.

    So, I've added a conditional statement to say, "apply this rule only when the host header matches 'cluster.internationaldomainname.com'":

        [globalRules]
          [rule name="ARR_cluster.nsel-clnsa.com.ni_loadBalance" patternSyntax="Wild
    card" stopProcessing="true"]
            [match url="*" /]
            [conditions]

                       [add input="{HTTP_HOST}" pattern="cluster.internaldomainname.com" /]


            [/conditions]
            [serverVariables]
            [/serverVariables]
            [action type="Rewrite" url="http://cluster.nsel-clnsa.com.ni/{R:0}" /]
          [/rule]

    Note that you can further modify the conditional statement to apply the rule based on different attributes, such as IP address (basically any HTTP header and/or server variables.)  But hopefully above gives you an idea.

    ARR application Request Routiing NLB

  • Re: ARR newbie questions

    May 26, 2010 03:38 PM|wonyoo|LINK

    Hmm... For some reason, I received an email indicating that the message has been posted, but I can't seem to see it..

    Reposting...

    -------------------------------------------------------------------------------

    Your understanding is pretty much spot on.  You are currently in an end-less loop.  But you can work around that using URL rewrite rules.I am also going to make the following assumptions:- Your end customers will always access the sites using the VIP that NLB is bound to.   This is "cluster.internaldomainname.com" (corresponding IP is 192.168.134.35).- The physical IPs 192.168.134.33 and 192.168.134.34 are used to routing it to "self" (and this is how you have currently have it.)The key is to apply the URL rewrite (or the ARR proxying logic) only once, for the requests that are coming in on the VIP.  Once the rule is applied to this request on the VIP, then ARR picks up the request, then it routes to either 192.168.134.33 or 192.168.134.34 (which is basically the "self").  But this time around, you don't want ARR to proxy the request - instead, you want the content to be served.So, I've added a conditional statement to say, "apply this rule only when the host header matches 'cluster.internationaldomainname.com'":    [globalRules]
          [rule name="ARR_cluster.nsel-clnsa.com.ni_loadBalance" patternSyntax="Wild
    card" stopProcessing="true"]
            [match url="*" /]
            [conditions]
                       [add input="{HTTP_HOST}" pattern="cluster.internaldomainname.com" /]
            [/conditions]
            [serverVariables]
            [/serverVariables]
            [action type="Rewrite" url="
    http://cluster.nsel-clnsa.com.ni/{R:0}" /]
          [/rule]
    Note that you can further modify the conditional statement to apply the rule based on different attributes, such as IP address (basically any HTTP header and/or server variables.)  But hopefully above gives you an idea.

     

    ARR application Request Routiing NLB

  • Re: ARR newbie questions

    May 26, 2010 04:29 PM|graham91081|LINK

    I did that and it's working great. The thing is that I don't get anything on the "Monitoring and Management" window in Server Farm. I get the website and looks great but I can't see the statistics. Any guidance?
  • Re: ARR newbie questions

    May 26, 2010 05:52 PM|wonyoo|LINK

    Fantastic.  That's great to hear.

    As far as stats go in "monitoring and management", could you be more specific as to how it's not working?  (I must admit - I haven't tried your specific configuration where NLB/ARR/content servers are all being served from the same box - so there might be things that I don't understand, but I would like to get a few more clues.)

    I don't know that this is what's going on in your case, but ARR also uses kernel cache by default.  So if there is a cache hit in kernel memroy, then this requst will not be captured in "monitoring and management" b/c IIS will never see this request.  The cache hit was made by http.sys which is below IIS.

    ARR application Request Routiing

  • Re: ARR newbie questions

    May 26, 2010 06:38 PM|graham91081|LINK

    When I go into the "Monitoring and Management" window I see both servers with "Healthy" status, and for all the rest of the columns I get nothing. That is, Requests Per Second, Response Time, And all the rest of the columns are blank, so I can't tell if App level Load balancing is working or not. Your last post helped a lot... I really got a hint on how the rewrite works, I've also set up a couple of rules and I'm loving it. BIG HELP!!!.. Thanks you so much. I have another question. I noticed that when using load balancing on a couple of regular IIS7 web servers (Without ARR) the app response time is like twice of the same app runnin on just one of the servers in the cluster. Do you have any Idea of why is this happening? Is this expected or is it bad configuration? The thing is I think this might be affecting the whole setup performance because it's not as fast as I expected, having two servers and all.. Thank you so much for all of your help.
  • Re: ARR newbie questions

    May 26, 2010 09:21 PM|wonyoo|LINK

    Hmm... I am going to have to look into the monitoring and management issue.   I could be b/c of the use of the VIP or the fact that we are routing the request to self (ie. loopback), but I am speculating. 

    As for the reponse time, I think what you are saying is that the response time is about 2x (ie. slower) when using ARR than going directly to the content server?   I don't know that it's quite 2x, but ARR, at the end of the day, is a proxy.  So when ARR is in the picture, you have basically introduced a network hop between your client and the server.   The same is true with any hardware load balancer that is proxy based - except that routing traffic at IP level is much more efficient - and becomes more expensive as you gain application level awareness. 

    Note however, ARR does provide caching at the kernel level.  So not all requests will end up having the "double-hop".   Some will result in a cache hit n the ARR server.

    ARR application Request Routiing