Forum Discussion
Paul_73795
Jan 06, 2011Nimbostratus
HTTP forward to Pool not working as expected
Hi, I am attempting to set up an iRule that forwards requests to our pool of sorry servers when there are no active members in the load balanced server pool.
As you can see by the logs if no active members are in the load balanced pool it redirects to the sorry server pool we get SERVER CONNECTED and displays the outage page. If I then turn bring the servers back online and refresh the browser the iRule looks to be doing the correct thing by directing the traffic to the load balanced server pool but in actual fact it is still being directed to the sorry servers and there is no SERVER CONNECTED response.
Have I done something incorrectly?
iRule
when HTTP_REQUEST {
set DEBUG 1
if { [active_members [LB::server pool]] < 1 } {
if { $DEBUG } { log local0. "[IP::client_addr]:[TCP::client_port]: using sorry server Pool: [LB::server]" }
pool pool_http_sorry_server
} else {
if { $DEBUG } { log local0. "[IP::client_addr]:[TCP::client_port]: using server Pool: [LB::server]" }
pool [LB::server pool]
}
}
when SERVER_CONNECTED {
Debug logging only. Remove this event once done testing
log local0. "[IP::client_addr]:[TCP::client_port]: server: [LB::server], [IP::server_addr]:[TCP::server_port]"
}
/var/log/ltm
Jan 6 18:28:58 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using sorry server Pool: pool_http_bbdev 0
Jan 6 18:28:58 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: server: pool_http_sorry_server 203.2.32.66 80, 203.2.32.66:80
Jan 6 18:29:26 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using server Pool: pool_http_bbdev 0
Jan 6 18:29:26 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using server Pool: pool_http_bbdev 0
- Chris_MillerAltostratusAre you using OneConnect? Also, are you using any persistence methods?
- Chris_MillerAltostratusIn your case, the user's connection might already be established to the sorry server.
- Chris_MillerAltostratusGive this a shot:
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [active_members [$default_pool]] < 1 } { pool pool_http_sorry_server } else { pool $default_pool } }
Finally, I expect you'll need to use OneConnect here to make sure every HTTP Request is evaluated.
- Paul_73795NimbostratusHi Chris
- Chris_MillerAltostratusYou could add a "persist none" statement. I can't recall whether it'll work properly from HTTP_REQUEST without OneConnect since we've already selected a pool member and persisted but you can give it a shot.
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [active_members [$default_pool]] < 1 } { pool pool_http_sorry_server persist none } else { pool $default_pool } }
- hooleylistCirrostratusIf you're using cookie persistence you should definitely enable OneConnect on the virtual server as Chris suggested. If you're using SNAT then you can use the default OneConnect profile with a 0.0.0.0 source mask. Without SNAT on the virtual server, you should create a custom OneConnect profile with the source mask set to 255.255.255.255. See the article Chris linked to for details.
- Paul_73795NimbostratusOk, I have enabled OneConnect with the default profile because we are using SNAT.
- Chris_MillerAltostratusLet's add some logging to troubleshoot.
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [active_members $default_pool] < 1 } { pool pool_http_sorry_server persist none log local0. "Used sorry pool because there were [active_members $default_pool] members in $default_pool" } else { pool $default_pool log local0. "Used default pool because there were [active_members $default_pool] members in $default_pool" } }
- The_BhattmanNimbostratusHi Paul,
- Paul_73795NimbostratusOk, I have added some debug logging. Here is what is occurring.
Recent Discussions
Related Content
Â
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects