Thanks for the reply, and for those problems. I verified that no 500/503 errors are being put up with livehttpdheaders (I was also checking the apache log).
I changed it a bit, and now am checking LTM logs:
Apr 21 16:16:30 tmm tmm[1564]: 01220001:3: TCL error: redirect_on_bad_status - can't read "failure": no such variable while executing "if { $failure == 1 } { LB::detach LB::mode rr LB::reselect pool [LB::server pool] set failure 0 }"
Is this not a "global" variable?
I thought it would make sense to just nest the when LB_SELECTED { inside of the when HTTP_RESPONSE { , but that did not seem to work - it wouldn't let me save the iRule that way - command is not valid in the current scope.
Here is what I changed it to:
when HTTP_RESPONSE {
if { [HTTP::status] == 503 }{
set ::failure 1
}
}
when LB_SELECTED {
if { $::failure == 1 } {
LB::detach
LB::mode rr
LB::reselect pool [LB::server pool]
set ::failure 0
}
}
I am testing out Tomcat session replication, and I want to make it so that when we have a Tomcat server that is restarting (503 error) the customer doesn't see any errors and just gets tossed onto another server with no loss of data.
BTW I have seen variables set as ::variable (assuming that is global), tried that as well and it didn't work...
Apr 21 16:23:47 tmm tmm[1564]: 01220001:3: TCL error: redirect_on_bad_status - can't read "::failure": no such variable while executing "if { $::failure == 1 } { LB::detach LB::mode rr LB::reselect pool [LB::server pool] set ::failure 0 }"