Kiyoshi_kobayas
Nov 12, 2014Nimbostratus
iRule load balancing redirect with a pool
I'd like to make an iRule that works as load balancing redirect with a pool.
This pool works fine when the virtual server without any iRule. But this iRule gets error at line 4 { arra set ...}. This pool has 2 members working fine. Its status is green. The Standard tcp monitor is attached to this pool.
Please let me know how solve this. Thanks.
when HTTP_REQUEST {
incr ::Counter1
if{$::Counter1 > 30000}{set ::Counter1 0}
array set AML [active_members -list [LB::server pool] ]
set cc [active_members [LB::server pool] ]
if{$cc < 1}{
HTTP::respond 404 "All servers are not active."
}
set index [$::Counter1 % $cc]
HTTP::redirect "http://[$AML($index)::IP]"
}