Forum Discussion

jrok_47156's avatar
jrok_47156
Icon for Nimbostratus rankNimbostratus
Apr 10, 2013

Clone single http request

I have a setup with the following in my test area:

 

a qa pool ($static::wwwqapool) where the qa application servers live, 2 members.

 

a content delivery network pool ($static::wwwqacdn) for static files and images, 2 members.

 

a down time service pool ($static::ebus_dts) which notifies me when the qa pool is completely down, 1 member.

 

a NEW node down service pool ($static::ebus_nds) which I *want* to let me know when a single node falls down under load, 1 member.

 

a few data groups with uri's and file extensions, etc. ($::cdn_uri_list, $::cdn_file_list, $::dts_static)

 

This site is SSL so I'm doing a bit of host manipulation at the beginning there to match our cert, *.domain.com

 

This setup is all working fine in production *except* for the new node down service I am trying to add to the mix. If at least 1 app server is up then the whole thing works because the app servers also have a copy the static content. If the cdn pool is available, then static content comes from there instead to reduce load on the app servers. If the app pool goes completely down, then I route the request to the dts pool server which notifies me that the entire app pool is down. My problem is that I don't have a good way to know is only one of the two app pool nodes has been knocked down. It's either up (1 or 2 servers) or down (no servers). So I saw some posts about clone and decided to try it (seems like the new sideband thing might work too but we are on 10.2.2). I built a node down notification server and a pool for it. What I am trying to accomplish is if one of the two app nodes is down that the F5 will send a duplicate http request to the node down server pool to let me know to go check on it. Below is the code with the new part that is not working marked with pound signs . When I take one node down it's not working and nothing is happening. I saw some posts about only IDS devices working but the documentation says it duplicates traffic. I really need a clone of each single request to go to the node down service to let me know there is an issue. Any help or suggestions would be great.

 

when HTTP_REQUEST {

 

 

if { [string length [getfield [HTTP::host] "." 3]] == 0 }

 

{

 

HTTP::respond 302 noserver "Location" "$static::ebus_prot$static::wwwqahost[HTTP::uri]"

 

}

 

elseif { [string length [getfield [HTTP::host] "." 4]] > 0 }

 

{

 

HTTP::respond 302 noserver "Location" "$static::ebus_prot[domain [HTTP::host] 3][HTTP::uri]"

 

}

 

if { [active_members $static::wwwqapool] > 0 }

 

{

 

if { [matchclass [string tolower [HTTP::uri]] starts_with $::cdn_uri_list] or

 

[matchclass [string tolower [HTTP::uri]] ends_with $::cdn_file_list] }

 

{

 

if { [active_members $static::wwwqacdn] > 0 }

 

{

 

pool $static::wwwqacdn

 

}

 

}

 

else

 

{

 

if { [active_members $static::wwwqapool] == 2 }

 

{

 

pool $static::wwwqapool

 

log local0. "CODE:2,active:[active_members $static::wwwqapool]"

 

}

 

else

 

{

 

pool $static::wwwqapool

 

clone pool $static::ebus_nds

 

log local0. "CODE:1,active:[active_members $static::wwwqapool]"

 

}

 

}

 

}

 

else

 

{

 

if { [active_members $static::ebus_dts] > 0 }

 

{

 

pool $static::ebus_dts

 

if { [matchclass [string tolower [HTTP::uri]] starts_with $::dts_static] == 0 }

 

{

 

HTTP::uri "/"

 

}

 

}

 

else

 

{

 

HTTP::respond 200 content "\

 

maintenance page\

 

" noserver "Content-Type" "text/html"

 

return

 

}

 

}

 

}