Forum Discussion

Shiva_69966's avatar
Shiva_69966
Icon for Nimbostratus rankNimbostratus
Oct 15, 2013

Irule to failover between two sites based on return string respone.

I have two sites i.e site1 and site2. site1 is load balanced by LTM and similarly site2 by another LTM at their respective. We need GTM to fail over b/w site 1 and site2 basing on return respone of /xyz.html page on server. When /xyz.html returns "site1 up" then GTM should route to site1 if return respone is "site2 up" then it should route to site2. Im new to irules and gtm , do we have any monitoring script that dynamically probes vips and see for response and basing on response irule to tigger and route traffic.

 

or any other approach or any other suggestion .

 

4 Replies

  • Use LTM pool monitors to implement your health checks. When the pool is down, the virtual server will be down and GTMs will know not to use it.

     

  • Mohamed ! Thanks for your response , but the challenge we have is the site will be active always and each vip are site specific and will be using in parallel with other applications, as you said applying monitoring to vip and when the vip is down GTM makes decision basing on status of vip is true , but here both sites will be active or down at the same time . We need either to route site1 or site2 basing on the content we return on both sites . Eg: site1 and site2 now has monitor page setup as "site up" and boths site are active but the monitor string return is "site1 up" then GTM has to route to site1 only , if the page returns to "site2 up" then GTM has to route to site2 only . note: on ltm we monitor with return respone "up" on both sites and marking pools up unless they show "down" string. two sites are active/active .

     

  • Oh wait... you only have one wide_ip, in this question. It uses a GTM pool of two virtual servers, in two LTMs, in two data centers. Correct?

     

    You want GTM to concider the virtual servers down, not based on their status in the LTMs, but based on a new monitor, unrelated to the LTMs. An HTTP monitor, which would check the status based on the result of some URI.

     

    You can achieve the later, I believe, only by reconfiguring your wide_ips to use "virtual servers" manually defined on "generic host" servers, as opposed to BigIP type "servers". Then use a cusom HTTP monitor, to monitor the defined virtual servers. But dont take my word on it, maybe you can "add" a custom monitor to the exisitng implicit LTM minitors, or maybe I did not understand you setup and your needs.

     

  • Here's a simple way to do this:

     

    a) Create a pool that uses Global Availability as the load balancing method.

     

    b) Assign your VS's to the pool, not as LTM related VS's, but as generic HTTP virtual servers. Put site1 as the first member in the pool, site2 as the second.

     

    c) Create a custom HTTP monitor, looking for the string "site2 up", but make it a reverse monitor (meaning it will return 'Up' unless the target string is seen), and apply that monitor to the site1 VS.

     

    This will have the effect of always using site1, unless the monitor returns the string "site2 up", at which point, the second pool member (the site2 member) will be used.

     

    No need to use an iRule.