Forum Discussion
Brian_11882
Mar 17, 2011Nimbostratus
LB on hash key with onloading and offloading
Hi,
I'm a complete newbie for F5, so I hope my question makes sense. We would like to load balance on a pre-hashed cookie value. The value is hashed using a proprietary (i.e. Oracle) hashing algorithm. We can store the hashed value as a cookie, and we'd like to select a server from that cookie value without further hashing.
Furthermore, we'd like to be able to implement multiple states for a member for gracefully rolling down and up servers during application redeployment. The four states we would like to specify for a server are:
Up: The server receives all requests designated to it by the pre-hashed cookie value.
Down: The server does not receive any requests
Starting: The server only receives connections from new http sessions (i.e. no JSESSIONID) designated to it by the pre-hashed cookie value, and subsequent connections from the same session.
Stopping: The server only receives connections from existing sessions that were previously designated to the member.
Do I need to use iRules to implement this type of strategy? Any tips on what it would look like?
Brian
- The_BhattmanNimbostratusHi Brian,
- Brian_11882NimbostratusYes, that's the basic flow. LB:status has states "session_enabled" and "session_disabled", but I don't see how these are used in the default LB algorithms. They may simplify what I need. I'll use my starting/stopping states to show the behavior I'm looking for even though they don't seem to exists. I'm assuming that a node can respond with a state for LB:status to indicate its ability to accept connections.
when HTTP_REQUEST { if([HTTP:cookie exists oraclePartition]) { Map node id to IP and port found in a class Entries should be strings of the form set node_data [findclass [HTTP:cookie oraclePartition] $::my_nodes " "] set node_ip [getfield $node_data " " 1] set node_port [getfield $node_data " " 2] if([LB:status pool my_pool member $node_id $node_port up]) { pool my_pool member $node_ip $node_port } else if([HTTP:cookie exists JSESSIONID] and [LB:status pool my_pool member $node_id $node_port stopping]) { // continue on the designated node pool my_pool member $node_ip $node_port } else if([HTTP:cookie not exists JSESSIONID] and [LB:status pool my_pool member $node_id $node_port starting]) { // Allow on the starting node pool my_pool member $node_ip $node_port } } }
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