when CLIENT_ACCEPTED {
set clientIP [IP::client_addr]
if {[persist lookup source_addr $clientIP node]=="192.168.20.1"}{
log local5.warning "not null=[persist lookup source_addr $clientIP node]"
log local5.warning "30 miao"
persist source_addr 30
}
elseif {[persist lookup source_addr $clientIP node]=="192.168.20.2"}{
log local5.warning "not null=[persist lookup source_addr $clientIP node]"
log local5.warning "60 miao"
persist source_addr 60
}
}
when LB_SELECTED {
#log local5.warning "client:[IP::client_addr]"
log local5.warning "poolmember:[LB::server addr]"
set clientIP [IP::client_addr]
if {[persist lookup source_addr $clientIP]==""}{
if {[IP::addr [LB::server addr] equals 192.168.20.1] } {
log local5.error "persist add for 20.1"
persist add source_addr $clientIP 30
}
else {
log local5.error "persist add for 20.2"
persist add source_addr $clientIP 60
}
}
else {
log local5.warning "should exec persist!!"
}
}
==========================
第一次选pool member 并增加一条persist记录
Nov 7 21:43:08 tmm tmm[10511]: Rule lin <LB_SELECTED>: poolmember:192.168.20.1
Nov 7 21:43:08 tmm tmm[10511]: Rule lin <LB_SELECTED>: persist add for 20.1
后面继续刷新
Nov 7 21:43:17 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: not null=192.168.20.1
Nov 7 21:43:17 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: 30 miao
Nov 7 21:43:17 tmm tmm[10511]: Rule lin <LB_SELECTED>: poolmember:192.168.20.1
Nov 7 21:43:17 tmm tmm[10511]: Rule lin <LB_SELECTED>: should exec persist!!
Nov 7 21:43:28 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: not null=192.168.20.1
Nov 7 21:43:28 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: 30 miao
Nov 7 21:43:28 tmm tmm[10511]: Rule lin <LB_SELECTED>: poolmember:192.168.20.1
Nov 7 21:43:28 tmm tmm[10511]: Rule lin <LB_SELECTED>: should exec persist!!
Nov 7 21:43:38 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: not null=192.168.20.1
Nov 7 21:43:38 tmm tmm[10511]: Rule lin <CLIENT_ACCEPTED>: 30 miao
Nov 7 21:43:38 tmm tmm[10511]: Rule lin <LB_SELECTED>: poolmember:192.168.20.1
Nov 7 21:43:38 tmm tmm[10511]: Rule lin <LB_SELECTED>: should exec persist!!
=======
[root@bigip:Active] config # b persist show all
PERSISTENT CONNECTIONS
| Mode source addr Value 10.9.3.10
| virtual 10.10.3.105:http node 192.168.20.2:http age 4sec
[root@bigip:Active] config # b persist show all
PERSISTENT CONNECTIONS
| Mode source addr Value 10.9.3.10
| virtual 10.10.3.105:http node 192.168.20.1:http age 5sec
[root@bigip:Active] config # b persist show all
PERSISTENT CONNECTIONS
| Mode source addr Value 10.9.3.10
| virtual 10.10.3.105:http node 192.168.20.1:http age 2sec
文章评论