Applies To:

Show Versions Show Versions

Archived sol2352: Configuring BIG-IP to use JSESSION ID to select a node in a pool
How-ToHow-To

Original Publication Date: 03/12/2003
Updated Date: 02/16/2006

This article has been archived, and is no longer maintained.

Hash cookie persistence can provide this functionality. Refer to the issues discussed in SOL777: Overview of hash cookie persistence mode.

Note: You must use node select statements if the client browser does not support cookies, or the session must persist to the server that issues the session ID.

To use the JSESSION ID for pool node selection, configure a node select class with a rule. This works with the assumption that the servers will insert a cookie (or a header if one is needed) and that all new clients will be load balanced through my_pool_cookie.

The class must:

  • Contain all of the nodes in the pool.
  • Match the port used for the pool.
  • Contain a unique element for each node.

Following is an example of a class to use for JSESSION ID for node selection:

Note: In this example, the JSESSION ID is returning the "mxxx" text where xxx is the number of the server. Each server is required to return a unique value such as this.

class my_servers {
    'm210     192.168.10.10:80' 
    'm220     192.168.10.20:80' 
    'm230     192.168.10.30:80' 
    'm240     192.168.10.40:80' 
    'm250     192.168.10.50:80' 
    'm260     192.168.10.60:80' 
 } 
  
pool my_pool { 
    select mapclass2node(findstr(http_uri,'JSESSION',44,4),my_servers) 
    member     192.168.10.10:80 
    member     192.168.10.20:80 
    member     192.168.10.30:80 
    member     192.168.10.40:80 
    member     192.168.10.50:80 
    member     192.168.10.60:80 
 } 
 
pool my_pool_cookie { 
    select mapclass2node(findstr(http_cookie('JSESSION'),44,4),my_servers) 
    member     192.168.10.10:80 
    member     192.168.10.20:80 
    member     192.168.10.30:80 
    member     192.168.10.40:80 
    member     192.168.10.50:80 
    member     192.168.10.60:80 
 } 
 
rule my_rule { 
   if ( http_uri contains 'JSESSION' ) { 
      use pool my_pool 
   } 
   else { 
      use pool my_pool_cookie 
   } 
}

For more detailed information about how to select nodes in a pool, refer to the BIG-IP Reference Guide.

Was this resource helpful in solving your issue?




NOTE: Please do not provide personal information.



Incorrect answer. Please try again: Please enter the words to the right: Please enter the numbers you hear:

Additional Comments (optional)