Forum Discussion
gkoper_32911
Jun 13, 2011Nimbostratus
session persistance based on session id parameter
Hello I want to make load balancing with persistence of session id. Communication is between http gw and JbossWeb nodes. Session-id is stored in the payload of tcp packet. Do you...
hooleylist
Jun 14, 2011Cirrostratus
How about using this one as a start:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/33541/showtab/groupforums/Default.aspx1198671
when CLIENT_ACCEPTED {
set timeout 3600
set analyse_server 1
TCP::collect
}
when CLIENT_DATA {
log local0. "Client Data______________________________"
set jsessionid [findstr [TCP::payload] "JSESSIONID=" 11 32]
log local0. "VALUE jsessionid CLIENT: $jsessionid !"
if {$jsessionid != ""}{
log local0. "JSESSIONID is present on the Client , persisting "
log local0. "connection [IP::remote_addr]:[TCP::remote_port] to [IP::local_addr]:[TCP::local_port]"
persist uie $jsessionid
set analyse_server 0
TCP::release
} else {
set analyse_server 1
log local0. "JSESSIONID is Not present"
TCP::release
}
}
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
log local0. "Server Data______________________________"
set jsessionidsrv [findstr [TCP::payload] "JSESSIONID=" 11 32]
if ($analyse_server!=0) {
log local0. "VALUE jsessionid SERVER: $jsessionidsrv !"
if {$jsessionidsrv != ""}{
log local0. "JESSIONID detected from server , creating persistence entry "
log local0. "connection [IP::client_addr]:[TCP::local_port] to[IP::remote_addr]:[TCP::remote_port]"
persist add uie $jsessionidsrv $timeout
TCP::release
} else {
log local0. "JESSIONID is Not Present : this is NOT NORMAL"
TCP::release
}
} else {
log local0. "connection [IP::client_addr]:[TCP::local_port] to [IP::remote_addr]:[TCP::remote_port]"
TCP::release
}
log local0. "ENDING SERVER SIDE ANALYSIS"
}
when LB_FAILED {
log local0. "________LB failed_____________"
}
when PERSIST_DOWN {
log local0. "________PERSIST DOWN_____________"
}
Aaron
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