Forum Discussion
Redirect to new pool/port when current pool offline
I am trying to send traffic to a different pool when all nodes in the current pool are down. It also needs to change port number when going to the other pool. Here is what I have so far, it seems to be sending traffic to new pool but not changing the port numbers. Can someone think of a better way to do this or help with my iRule?
when CLIENT_ACCEPTED {
if {[active_members pool1] == 0}{
if {[active_members pool2] > 0}{
pool pool2 x.x.x.x 48010
} else {
discard
}
}
}
when LB_SELECTED {
if {[active_members pool1] == 0}{
if {[active_members pool2] > 0}{
LB::reselect pool pool2 x.x.x.x 48010
} else {
discard
}
}
}
5 Replies
- Kevin_Stewart
Employee
Unless you've configured it otherwise, a pool is typically created with assigned port numbers, so you shouldn't have to change the port number in a pool statement (the pool sends traffic to the members in its member list on the assigned ports). Are you attempting to change the pool's assigned port number on the fly. - NorCalAdam_6796
Nimbostratus
Im just trying to get the application to work when it changes pool. Basically we are load balancing SQL, when all nodes in pool1 go offline I want traffic to go to pool2. Pool1 and pool2 use different ports for SQL. - Kevin_Stewart
Employee
Then you should be able to just use the pool command with the pool name (no IP and port specified) - assuming you've configured the pool members with the right ports.
You can probably also get away with just using the CLIENT_ACCEPTED event, unless your SQL connections are long-living and a pool might dies in the middle of a connection? - A much easier way to do this would be to use priority groups in your pool.
http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/bigip9_0config/ConfigGuide9_0-05-1.html (under "Specifying priority-based member activation") - Kevin_Stewart
Employee
Agreed Chris. Good call. You get roughly the same functionality.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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