17-Nov-2023 09:59
Hi, is it poossible to implement irule logic below?
By default traffic select Pool1, but it select Pool2 if online pool members of Pool1 below two. If all pool members became available in Pool1, traffic will continue select Pool2.
17-Nov-2023 21:00
@_Dmi_ You can do this with priority group activation in 1 pool rather than having 2 different pools.
18-Nov-2023 10:20
I cant use it. The full scenario is
By default traffic select Pool1, but it select Pool2 if online pool members of Pool1 below two. If all pool members became available in Pool1, traffic will continue select Pool2. But then online pool members of Pool2 below two, traffic must come back to Pool1.
20-Nov-2023 07:42
Hii
You can try this
when HTTP_REQUEST {
set pool_a_members [LB::pool pool_a members]
if { [llength $pool_a_members] > 0 } {
pool pool_a
} else {
pool pool_b
}
}
or check this post similar
Best Regard
20-Nov-2023 12:54 - edited 20-Nov-2023 12:55
I think the iRule below fill meet your requirements.
when CLIENT_ACCEPTED {
set pri_pool "/Common/pool_a"
set sec_pool "/Common/pool_b"
if {[table lookup active_pool] ne ""} {
if { [active_members [table lookup active_pool]] >= 2 } {
}
elseif { $active_pool eq $pri_pool } {
table replace active_pool $sec_pool indefinite
}
else {
table replace active_pool $pri_pool indefinite
}
}
else {
table set active_pool $pri_pool indefinite
}
pool [table lookup active_pool]
}
Have fun,
--Niels