Nirmal_67412
Feb 26, 2010Nimbostratus
Configuring stickyness when using multiple pools with one virtual server
Hello experts,
I am relatively a newbie (I have used F5 back in ver 3.x and a bit in 4.x). I am trying to setup a DR environment with just one VIP.
Here is my setup:
=================
1. A pool of servers with (say) 3 nodes
2. 3 such pools at 3 different geographies
3. Each node across the 3 pools have a unique token / identifier
4. All configured thru' a single virtual IP / server
Requirement:
============
1. When a connection comes into the virtual IP, it can get routed to any of the 3 pools
2. After being connected and routed to a pool, the connection should always come into the same pool
3. If a node accepts a connection, it should continue to get accept subsequent connections
4. If that node goes down, other peer nodes in the same pool should pick up the connection
5. If the whole pool goes down then it can fail over to other pools
Here is how I was trying to achieve this:
=========================================
Under Virtual server defined a default pool called "DefaultPool".
DefaultPool contains *all* nodes as members (namely nodes identified by 101, 102, 103, 201, 202, 203, 301, 302, 303)
Other pools used will be:
Pool1 contain member nodes identified by 101, 102, 103
Pool2 contain member nodes identified by 201, 202, 203
Pool3 contain member nodes identified by 301, 302, 303
iRule used at Virtual Server level is:
when HTTP_REQUEST
{
if {[HTTP::header exists "token"]}
{
set key [HTTP::header "token"]
if {$key equals "101" || $key equals "102" || $key equals "103"}
{
if {$key equals "101"}
{
pool pool1_1
}
elseif {$key equals "102"}
{
pool pool1_2
}
elseif {$key equals "103"}
{
pool pool1_3
}
}
elseif {$key equals "201" || $key equals "202" || $key equals "203"}
{
if {$key equals "201"}
{
pool pool2_1
}
elseif {$key equals "202"}
{
pool pool2_2
}
elseif {$key equals "203"}
{
pool pool2_3
}
}
elseif {$key equals "301" || $key equals "302" || $key equals "303"}
{
if {$key equals "301"}
{
pool pool3_1
}
elseif {$key equals "302"}
{
pool pool3_2
}
elseif {$key equals "303"}
{
pool pool3_3
}
}
else
{
pool DefaultPool
}
}
else
{
pool DefaultPool
}
}
Please let me know if this is the right approach or is there a better way. Unfortunately, i don't have too much time and looking for help or pointers in the right direction ASAP.
Thanks in advance,
Nirmal R.