Forum Discussion
JoshuaMessenger
Mar 09, 2015Nimbostratus
iRule is now working beautifully.
when CLIENT_ACCEPTED {
if {[info exists [table lookup storage_switch]]}{
set storage_pool "FCS_STORAGE_PRIMARY"
table set storage_switch $storage_pool indefinite
log local0. "pool selector: [table lookup storage_switch]"
log local0. "Does Table Exist - it should now? [info exists [table lookup storage_switch]]"
}
if { [active_members "FCS_STORAGE_PRIMARY"] >= 2 } {
if {[table lookup storage_switch] equals "FCS_STORAGE_FAILOVER"} {
log local0. "Kill All Connections!!!"
set storage_pool "FCS_STORAGE_PRIMARY"
table replace storage_switch $storage_pool indefinite
log local0. "pool selector: [table lookup storage_switch]"
}
pool FCS_STORAGE_PRIMARY
} else {
if {[table lookup storage_switch] equals "FCS_STORAGE_PRIMARY"} {
set storage_pool "FCS_STORAGE_FAILOVER"
table replace storage_switch $storage_pool indefinite
log local0. "pool selector: [table lookup storage_switch]"
log local0. "Kill All Connections!!!"
log local0. "Kill Cluster Sync!!!"
}
pool FCS_STORAGE_FAILOVER
}
}