Forum Discussion
Julian_44743
Nimbostratus
Nov 23, 2010iNotes irule for v. 10.2.0 with HF2
Hi all,
Please forgive my noobness. I've been trying to get the irule for IBM Louts iNotes as published in the F5 deployment guide to work (http://www.f5.com/pdf/deployment-gu...tes-dg.pdf)...
MaHHF5_56930
Nimbostratus
Mar 07, 2012> but for some reason, the connections don't appear to be persisting correctly after selecting the pool member.
Same problem here with BIG-IP 10.2.2 HFA4. We opend a case at F5 with problem descriptions like:
'As you can see in the /var/log/ltm, the iRule always selects the correct pool-member (172.28.46.134) but 'http::retry $original_request' is sent to the randomly selected pool member at session start.
So sometimes we get a 'HTTP/1.1 404 Not Found' and sometimes not.
The 'pool [LB::server pool] member $dest' selection seems not to work.
'
'Thank you for the hints. We changed the irule and use the pool selection in HTTP_REQUEST.
But that works only for one request.
Similar problem like this: http://devcentral.f5.com/wiki/irules.manual_cookie_persistence.ashx
I think, a new session cookie would solve our problem. Is there a simple way to generate a new session cookie with the right/selected member?'
Case ended with statement from F5: 'it could be due to you are running the solution guide in a different version of software not supported by the mentioned guide.' Sad but true... :(
So we modified the iRule on our own.
Can anybody please tell us if the generation of a new session cookie is recommended in this scenario?
And is there a more elegant way than LB::reselect based on 404-Code in the case the server crashes to which the user is connected to?
Regards, Matthias
iRule:
iRule for iNotes-Access with Load Balancer Assistance Service on Notes
based on 'F5 and IBM Lotus iNotes deployment guide Version 1.2' (f5-ibm-inotes-dg.pdf)
which is inoperable with Notes 8.5.2, BIG-IP 10.2.2 and contains faults like missing spaces and HTTP::retry in HTTP_RESPONSE_DATA
see deployment guide for cookie- and 'Data Group List' configuration
when CLIENT_ACCEPTED {
log local0. "ACC - got new connect"
set retries 0
set server_needed 0
set server_selected "none"
}
when HTTP_REQUEST {
when opening Notes database, set server_needed 1
if {([HTTP::uri] ends_with ".nsf?OpenDatabase") and not ([HTTP::uri] contains "names.nsf") and not ([HTTP::uri] contains "iwaredir.nsf") and not ($server_selected == "new") and not ($server_selected == "orig") }{
set original_request [HTTP::request]
set server_needed 1
set nsf "[substr [HTTP::uri] 1 ".nsf"].nsf"
log local0. "REQ - Server needed: $server_needed"
log local0. "REQ - NSF: $nsf"
HTTP::uri /iwaredir.nsf/ServersLookup?OpenForm&nsfpath=$nsf
log local0. "REQ - uri: /iwaredir.nsf/ServersLookup?OpenForm&nsfpath=$nsf"
} else {
set server_needed 0
set original_request [HTTP::request]
}
when HTTP::retry with new server from X-header, select it from pool
if { $server_selected == "new" } {
pool [LB::server pool] member $dest
log local0. "REQ - Using selected new server [LB::server addr] of pool: [LB::server pool] (Destination: $dest)"
}
}
when LB_SELECTED {
when HTTP::retry because of 404-Code, reselect member
F5 unit sends a new session cookie
if { ($retries > 0) and ($retries < 9) } {
LB::reselect pool [LB::server pool]
log local0. "SELE - Reselection No. $retries"
}
}
when HTTP_RESPONSE {
log local0. "RESP - Used server [LB::server addr] of pool: [LB::server pool]"
when 404-Code after automatic reselection of F5 unit to wrong server occurs, do another try
if { ([HTTP::status] == 404) and ($retries < 8) } {
log local0. "ALERT: 404"
incr retries
log local0. "RESP - Retrying original request with reselection No. $retries"
HTTP::retry $original_request
}
generate new session cookie (code from DevCentral) after member selection based on X-Headers because the F5 unit does not send one
if { $server_selected == "new" } {
set member "[LB::server addr]:[LB::server port]"
scan $member "%u.%u.%u.%u:%u" a b c d e
set pcookie "[scan [expr ($d<<24)|($c<<16)|($b<<8)|$a] %u].[expr 256*$e].0000"
HTTP::cookie insert name BIGipServer[LB::server pool] value $pcookie path "/"
log local0. "RESP - New persistence cookie sent for $dest"
set server_selected "none"
}
build list of iNotes-Server from X-Domino Header
if { $server_needed == 1} {
set server_list1 [split [HTTP::header X-Domino-ClusterServers], ,]
set server_list2 [split [HTTP::header X-Domino-ReplicaServers], ,]
set server_list "${server_list1} ${server_list2}"
log local0. "RESP - Server_list_Cluster: $server_list1"
log local0. "RESP - Server_list_Replica: $server_list2"
log local0. "RESP - Server_list: $server_list"
HTTP::collect [HTTP::header Content-Length]
check if we are already on right server and then set server_selected "orig"
foreach {svr} $server_list {
if { "" ne $svr }{
set dest [class search -value iNotes_ReplicaServer equals "[string trim $svr]"]
if {[LB::server addr] == $dest } {
log local0. "RESP - Already on right server: $dest"
set server_selected "orig"
}
}
}
foreach {svr} $server_list {
if { "" ne $svr }{
set dest [class search -value iNotes_ReplicaServer equals "[string trim $svr]"]
when on right server, do HTTP::retry
if { $server_selected == "orig" } {
log local0. "RESP - Retrying original request for original server"
HTTP::retry $original_request
break
}
when server in list is up, do HTTP::retry
if { [LB::status pool [LB::server pool] member $dest 80] eq "up" } {
log local0. "RESP - Status of selected server $dest, pool [LB::server pool]: [LB::status pool [LB::server pool] member $dest 80]"
set server_selected "new"
log local0. "RESP - Retrying original request for new server"
HTTP::retry $original_request
break
}
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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