Forum Discussion
It would mark the virtual server down that the iRule is applied to. So if one pool member is down, it would mark it down for all pool members at a particular site. There's no easy way of getting round this if you are sharing a single virtual server for different services.
With regards to the response codes, they don't really matter, it just something I added as 503 is a 'Service Unavailable' error so could be an appropriate error code.
You would still need to configure the health monitor on GTM to mark the service down depending on how you configure your VS to respond on service down.
ok make sense thanks.
however, can I add another http error code to the above IRULE example? e.g. If I want to monitor 2 http error codes i.e. 503 and 403? also can we not amend the IRULE to mark the VS down if all the nodes in a single pool are responding with error or not available? if so, can you show us an example please?
Many thanks for your help so far.
Regards,
- Lee_SutcliffeJun 20, 2019Nacreous
You can only mark a VS down if the default pool assigned to the VS goes down.
This is why I suggested an iRule that sends a response if a pool used in the iRule is down. What you send back to GTM doesn't matter as long as the health monitor marks the VIP down.
When GTM sees that a pool is down, it will mark the whole VIP down. For that reason it makes sense to send the same response for each pool like I've already suggested.
- Lee_SutcliffeJun 20, 2019Nacreous
The iRule would not be able to send a 200 response and select a pool.
Sending a response would stop any load balancing and pool selection.
The problem you have is that everything is selected under an iRule so you have to fudge the solution to make it work.
One idea would be to have a health monitor for each service on your GTM one for abc.com one for def.com, each one sending a health monitor request that matches the host header in the iRule.
To Mark the VIP up, you could send a test monitor to a dummy host header that always responds with a 200.
Then make sure that the VIP is marked down if one or more monitors are marked down, as your dummy host header will always be up.
when HTTP_REQUEST { switch -glob [HTTP::host] { "abc.com" { if {[active_members INT_RTL_abc_8094_POOL] > 0} { pool INT_RTL_abc_8094_POOL } else { HTTP::respond 503 content "ERROR" } } "def.com " { if {[active_members INT_RTL_def_9443_POOL] > 0} { pool INT_RTL_def_9443_POOL } else { HTTP::respond 503 content "ERROR" } } "dummy.host.com" { HTTP::respond 200 content "OK" } } }
A better solution would be to redesign your solution to use a dedicated VIP for each service
- Lee_SutcliffeJul 02, 2019Nacreous
Aware they on on separate systems - my reply is still visible below, you keep replying to old comments - click 'More Amswers'
- QasimJun 20, 2019Cirrostratus
Ok Great stuff mate. Could you please help me with the IRule please? what would my IRule look like if, I its monitoring for both an http error to mark the VIP down and then 200 to mark the VIP as UP once pool is back online?
Regards,