Forum Discussion
The_Bhattman
Feb 28, 2010Nimbostratus
Hi Damon,
I was thinking that perhaps there must be an easier way to accomplish what you are doing while reducing the amount of code in the irule.
Another approach is to use priority load balancing.
You could create 3 pools
Pool_230 would contain
172.17.168.212:17000 with priority 100 <== Active
172.17.168.213:17000 with priority 50 <== Inactive
172.17.168.214:17000 with priority 25 <== Active
With minimum active member is 1.
Pool_231 would contain
172.17.168.212:17000 with priority 25 <== Inactive
172.17.168.213:17000 with priority 100 <== Active
172.17.168.214:17000 with priority 50 <== Inactive
With minimum active member is 1.
Pool_233 would contain
172.17.168.212:17000 with priority 25 <== Inactive
172.17.168.213:17000 with priority 50 <== Inactive
172.17.168.214:17000 with priority 100 <== Active
With minimum active member is 1.
With priority load balancing only 1 member is active at any time - until there is a failure, then next priority takes over
Then your irule could be shorted to the following:
when CLIENT_ACCEPTED {
if {[IP::addr [IP::remote_addr] equals 172.17.168.230/32] }{
pool pool_230
} elseif {[IP::addr [IP::remote_addr] equals 172.17.168.231/32] }{
pool pool_231
} elseif {[IP::addr [IP::remote_addr] equals 172.17.168.232/32] }{
pool pool_232
}
}
I hope this helps
Bhattman