Forum Discussion
2 Replies
- Sean_McGirk_859Nimbostratus
Here is the iRule
when RULE_INIT { set static::persist_duration 300 set static::debug_TCPPersist 1 ^^^^ set to zero to stop logging }
when CLIENT_ACCEPTED { TCP::collect 200 }
when CLIENT_DATA { set sTCP_Data [TCP::payload 200] set sGUID [string trim [getfield [getfield $sTCP_Data ":" 2] "," 1] " \""] set sNodeIP [table lookup -subtable TCP_Persist $sGUID] if { $sNodeIP eq "" } { if { $static::debug_TCPPersist} { log local0. "Moving on to load balance decision for guid $sGUID" } } else { if { $static::debug_TCPPersist} { log local0. "We found a previous decision for $sGUID to node $sNodeIP" } } TCP::release
}
when LB_SELECTED { if { $sNodeIP eq "" } { table set -subtable TCP_Persist $sGUID [LB::server addr] $static::persist_duration if { $static::debug_TCPPersist} { log local0. "Set persist for $sGUID to [LB::server addr]" } } else { node $sNodeIP if { $static::debug_TCPPersist } { log local0. "Selected $sNodeIP" } } }
It works for me when replacing
withnode $sNodeIP
.LB::reselect node $sNodeIP