Universal Persistence Profile (UIE) across multiple pools
Hi all I have a question about UIE with multiple pools. I have a Virtual Server which swaps pools depending on the URI: **POOLS:** pool1 server1 server2 pool2 server3 server4 default: server5 server6 **RULE1:** when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]]{ "/uri1/*" { pool pool1 } "/uri2/*" { pool pool2 } default { pool default } } } **RULE2:** when HTTP_REQUEST { if { [HTTP::cookie "JSESSIONID"] ne "" }{ persist uie [HTTP::cookie "JSESSIONID"] } } when HTTP_RESPONSE { if { [HTTP::cookie "JSESSIONID"] ne "" }{ persist add uie [HTTP::cookie "JSESSIONID"] } } /uri1/ has a single sign on system that creates a JSESSIONID cookie. This is used for Universal Persistence. Rule2 is associated with a Universal Persistence Profile. This Profile is then associated with the Virtual Server - this is done so Rule2 can be used on several Virtual Servers and not just the one specified above. User test - in a browser session, request1: http://www.server.com/uri1/getssotoken - this is served by server1 and I get a JSESSIONID cookie request2: http://www.server.com/uri2/somecontent - this is served by server4 request3: http://www.server.com/othercontent - this is served by server6 So the question I have... Any request I now make in this same browser session, depending on uri, I will always be served by either server1, server4 or server6 Is this correct? Thanks167Views0likes0CommentsHow to LoadBalance HTTP 1.1 request
Hi all, Just to set the enviroment first 🙂 We had a customer that wanted to switch from source_addr persistence profile to a persistence based on a specific identifier that cames into http request on a XML field. How customer works its that sends a first http request with a login and the server side answers with a login response with an specific id, an after that sends different operations using that id. Based on that we defined an universal profile that using an irule extracts that information, analyzes the response that comes from login response. (called SessionIdLogin) and also it was needed to define an XML_profile, in order to analyze the following http request in order to obtain the id. (called xml_info) We configured the Virtual Server with * an http profile http * XML profile * Oneconnection Profile --> Oneconnect On the pool configuration we added the xml_info default profile and added the irule SessionIdLogin. Inside this irule, we downgrade the HTTP in order to loadbalance all the request between the nodes. ltm rule /Common/SessionIdLogin { when HTTP_REQUEST { HTTP::header remove "Accept-Encoding" if { [HTTP::version] eq "1.1" } { if { [HTTP::header is_keepalive] } { HTTP::header replace "Connection" "Keep-Alive" } HTTP::version "1.0" } } when HTTP_RESPONSE { if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{ set content_length [HTTP::header "Content-Length"] } else { set content_length 1048576 } if { $content_length > 0} { HTTP::collect $content_length } } when HTTP_RESPONSE_DATA { log local0. "Persist in HTTP_RESPONSE_DATA" set SessionId [findstr [HTTP::payload] "sessionId>" 10 "<"] log local0. "$SessionId" if {[HTTP::payload] contains "Login"} { persist add uie $SessionId 160 } } } Till here it was all working fine no problems at all, but the customer noticed that sometimes the http post with login was not working, and we discovered that it was caused because they were sending and specific field from HTTP 1.1, transfer-coding: chunked. As we downgrade to 1.0 the Server didn't understand the petition and provides an error. after all the story, Now the question. 🙂 How could we without downgrade the HTTP version load balance all the requests? Customer is not going to change their code and they still want to do the persistence based on sessionId. One think i though its to add a header inside HTTP_RESPONSE with the connection: close, but i dont know if that its going to work. Thanks in advance people. Victor Jori324Views0likes1Commentuniversal persistence, irules & persist uie command
I am still a bit confused on using universal persistence and the persist command. The big question is :"Can the command persist [add] uie be used in a standard iRule, or does the iRule in which the commands are used, needs to be connected to a universal persistence profile in which the iRule is connected?1.2KViews0likes1Comment