Forum Discussion

Branden_Visser_'s avatar
Branden_Visser_
Icon for Nimbostratus rankNimbostratus
Jul 09, 2008

Switching persistence to new member

Hello,

 

 

We have 4 members in a pool. We want to implement a way to force a session onto a particular instance if we need to (by a URL prefix), and then that session would be maintained, even if we current had another session on another member. Is this possible?

 

 

This is where we're at:

 

 

(iRule attached to our VH with dest_addr persistence profile)

 

 

when HTTP_REQUEST {

 

set uri [HTTP::uri]

 

 

if { $uri starts_with "/www" } {

 

scan $uri /www%d%s host_num path

 

 

snip the host prefix from the URI

 

HTTP::uri $path

 

 

redirect the request to the appropriate member

 

switch $host_num {

 

1 {

 

pool WWW_Pool member $ip $port

 

}

 

 

2 {

 

pool WWW_Pool member $ip $port

 

}

 

 

4 {

 

pool WWW_Pool member $ip $port

 

}

 

 

5 {

 

pool WWW_Pool member $ip $port

 

}

 

}

 

}

 

}

 

 

when HTTP_RESPONSE {

 

if { $uri starts_with "/www" } {

 

persist dest_addr

 

}

 

}

 

 

In this iRule, anything request for www.myserver.com/www4/ would be redirected to member representing www4 with URI . This works, except for the part where you need to be persisted to the chosen host. I imagine the "persist dest_addr" is no where close. My hope was for that to rewrite the persistence record for the client. Do I have to implicitly remove it first? How does one do that?

 

 

Any advice is greatly appreciated.

 

 

Thanks,

 

 

Branden

1 Reply

  • Hi,

     

     

    Destination address persistence works well for caching and firewall scenarios where you want all requests to one destination address to be sent to a specific pool member. In this case you want to persist based on something specific to the client. Have you tried using source address persistence with something like 'persist source_addr 255.255.255.255 300' (Click here)? If that works, you could change it to cookie insert or something more elaborate if required.

     

     

    Aaron