Forum Discussion

dmenardSABA_235's avatar
dmenardSABA_235
Icon for Nimbostratus rankNimbostratus
Aug 25, 2011

Irule for redirect when all pool members down, need one for each pool? and what is the standard practice for sorry server?

This is what I have for an iRule to implement when all members of a pool are not available due to maintenance or unplanned outage

when HTTP_REQUEST { if { [active_members EXAMPLETEST_POOL] == 0 } { HTTP::redirect "http://209.196.27.42/" } }

Now this is for one pool, we have over 10 pools. Is there a way to re-write this so the same iRule can be applied to each virtual server? Or do I need to create a separate iRule for each pool?

Lastly, the re-direct is going to one server serving the web page. This has to be mapped to a public IP at the firewall with the non-nat'd IP as the virtual server for that web server. Then a DNS record created for that public IP address.

Is this the typical practice for a sorry server? Are there any steps I can take to mitigate any risks if any in my present setup?

Thanks,

  • Hi Kevin,

     

    I think something got missed out in this irule? can u repost again.

     

     

    Regards,
  • I think something got missed out in this irule?i understand what missing is html code which is sent to client when pool is down.
  • Hello Everyone,

     

    I am new to F5. I have got a task to make a Strict failover VIP for my client. Referring to your sample irule

     

    when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { HTTP::redirect "http://209.196.27.42/" } }

     

    Please help me understand the meaning of ---HTTP::redirect "http://209.196.27.42/"--- part. When the members of pool in condition is down it will take the VIP down then how would it resolve the redirection. Per my understanding, which I know is wrong, there is no mention of new Pool.

     

    • Shiva14's avatar
      Shiva14
      Icon for Nimbostratus rankNimbostratus
      Hi Dushyant, the above example is when your pool members (i.e all backend servers are down ) are not available then redirect all the request to other destination , destination might be other vip or some other source ip. I understand your concern i.e when pools are down how does vip will take traffic and process the irule . When Vip is down mean its doesn't mean that it will not do tcp handshake it will still accept the connections but the decision will be made basing on your config on your vip how to process those request . Thanks , Shiva
    • DushyantSingh_1's avatar
      DushyantSingh_1
      Icon for Nimbostratus rankNimbostratus
      Thanks for your answer. Could you share any link for irule keywords and tutorials.
    • DushyantSingh_1's avatar
      DushyantSingh_1
      Icon for Nimbostratus rankNimbostratus
      Thanks Shiva. I have another query one of my client has set up sorry page on different ports. for instance port 80 and 443. Could you help me understand how to make conditional sorry page availability.
  • I have a query here. The irules works when your default pool is down. I.e it displays sorry page for the main URL. I've many L7 URI pools in my application, So the requirement is that for every URI also it should display the sorry page.

     

    i.e if the main URL is https://abc.apple.com and it has a L7 URI for /payment which which has different set of nodes.

     

    I want the even https://abc.apple.com/payment should also display the sorry page when the URI pool is down.

     

    Can someone suggest what should be the "if" condition, to take in account all pools of an application?

     

    • Vijay_E's avatar
      Vijay_E
      Icon for Cirrus rankCirrus

      You can try something like:

      when LB_SELECTED {  
          if { [active_members [LB::server pool]] == 0 } { 
              HTTP::respond 200 content "  
      
                   
      
              " 
          } 
       } 
      
  • Hello Everyone,

        I have a request on the same scenario, where the pool members are down, can it be redirected to another pool? Trying to achieve same redirection to sorry pages which is hosted on two nodes.
    
  • Shamsar,

     

    Yes, you can try something like this:

     

    when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { pool pool-name-here } }