Forum Discussion
Mark_Harris_608
Cirrus
Sep 22, 2009Election Hash rule
I'm trying to implement the election hash rule on v9.0.5 and discovered it requires v9.4.2+. First, does anyone know what about the rule requires the later version of TMOS and secondly will a normal loop or static array instead of the enumeration of the active members list work? In other words, is there a way to implement this on an earlier version if the customer is not ready to upgrade until after holiday season, but wants to try this type of rule.
Here's the rule I'm trying to implement on v9.0.5
Election Hash iRule
Compute Hash - MD5
MD5 calculation of Server + URI
Rule selects Server that scores highest
S = Current high score
N = Node being evaluated
W = Winning node
when HTTP_REQUEST timing on {
set S ""
foreach N [active_members -list ] {
if { [md5 $N]HTTP::uri[] > $S } {
set S [md5 $N]HTTP::uri[]
set W $N
}
}
pool member [lindex $W 0] [lindex $W 1]
}
- The_Bhattman
Nimbostratus
Hi. . . set GOOD_NODES {} set NS {10.10.12.13 10.10.12.14 10.10.12.15} foreach N $NS { if { [LB::status pool member $N 80] eq "up" } { lappend GOOD_NODES $N } } . . .
- Thanks very much for the reply. Will give it a try.
- hoolio
Cirrostratus
Nice idea, CB. - Would you agree that this is the way to insert the static array in the original election hash rule?
- In case anyone was interested, here's the final solution for versions prior to v9.1.x
- The_Bhattman
Nimbostratus
Hi Mark,
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects