Forum Discussion
TMcGov_92811
Nimbostratus
Feb 18, 2009Forcing the use of a new pool and new member based on the current pool and member
I have a situation where I have an iRule that will direct HTTP requests to a certain pool based on a URI. Other traffic will go to the default pool. Here is a snippet of that.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/cf/" or [HTTP::uri] contains "/hf/"} {
pool Pool-A
} else {
pool Pool-B
}
}
Here are Pool A's members
10.77.177.78 (ohs1)
10.77.177.79 (ohs2)
10.77.177.80 (ohs3)
Here are Pool B's members
10.77.177.88 (ohs4)
10.77.177.89 (ohs5)
10.77.177.90 (ohs6)
Usually, a user will hit the default pool, Pool-B. Then they will click on a link that will contain /cf/ or /hf/ and they will be routed to the Pool-A. In this Oracle webserver environment, we want to "pin" together members of these two pools. In this case, .78 and .88; .79 and .89; and .80 and .90. The desired effect is that that if a user hits ohs4 in Pool-B, we want to make sure that if they are routed to Pool-A because of the URI, they hit their corresponding pinned member, ohs1. Similarily, original requests that hit ohs5 should hit ohs2 for /cf/ and /hf/ URIs, and ohs6 to ohs3.
Is there a way to accomplish this ?
- The_Bhattman
Nimbostratus
I believe so.when HTTP_REQUEST { switch -glob [HTTP::uri] { "*/cf/*" { switch $pin { "10.77.177.88" { node 10.77.177.78 80 } "10.77.177.89" { node 10.77.177.79 80 } "10.77.177.90" { node 10.77.177.80 80 } default { pool Pool-A } } } "*/hf/*" { switch $pin { "10.77.177.78" { node 10.77.177.88 80 } "10.77.177.79" { node 10.77.177.89 80 } "10.77.177.80" { node 10.77.177.90 80 } default { pool Pool-B } } } } when LB_SELECTED { set pin[LB::server addr] }
- hoolio
Cirrostratus
It might get a bit more complicated than that:
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