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 have any idea how to organize traffic flow that from one session all traffic will be directed to same node? How substract session-id parameter?
I will be happy if someone could help me.
thanks
Greg
- nitassEmployeehave u seen this one? is it applicable?
- gkoper_32911Nimbostratussorry but its not applicable, there is no cookie within http request. session id is passed within xml code (tcp payload in captured packets)
- hooleylistCirrostratusHow 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_____________" }
- gkoper_32911NimbostratusThx Hoolio
- hooleylistCirrostratusSure, just escape the double quotes with backslashes:
- gkoper_32911NimbostratusThank you
- hooleylistCirrostratusThe persistence would be updated if you reselect a new pool member in LB_FAILED and the server sends a JSESSIONID that you parse in SERVER_DATA.
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