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), with little success. I found that some of the syntax doesn't seem to work in v. 10.2.0, and I've rewritten a bunch during my debugging.
Anyway, what's supposed to happen is the client logs into the Lotus Notes redirector, which redirects them back to the virtual server with the uri of the user's mailbox. When the iRule sees that uri, it opens a ServersLookup Form on the inotes server to determine which pool member to redirect the traffic to. I got the iRule to successfully get the correct pool member, but for some reason, the connections don't appear to be persisting correctly after selecting the pool member. Can you help? What follows is my config (modified from the original code and sanitized). Again, sorry if I'm committing any nooby crimes.
profile persist inotes-cookie-persistence-profile-1 {
defaults from cookie
mode cookie
cookie mode insert
cookie name "inotes-cookie"
cookie expiration immediate
}
pool xnotes-inotes-pool-1 {
members {
192.168.100.1:http {
monitor xnotes-http-monitor-1
}
192.168.100.2:http {
monitor xnotes-http-monitor-1
}
}
}
virtual inotes-test-virtualserver {
snat automap
pool xnotes-inotes-pool-1
destination 192.168.1.1:http
ip protocol tcp
rules inotes-xnotes-irule-1
persist inotes-cookie-persistence-profile-1
profiles {
inotes-optimized-http-profile-1 {}
inotes-tcp-lan-profile-1 {
serverside
}
inotes-tcp-wan-profile-1 {
clientside
}
}
}
rule inotes-xnotes-irule-1 {
when RULE_INIT {
set static::xnotes1fqdn xnotes1.mydomain.com
set static::xnotes2fqdn xnotes2.mydomain.com
set static::xnotes1IP 192.168.100.1
set static::xnotes2IP 192.168.100.2
log local0. "got RULE_INIT"
}
when CLIENT_ACCEPTED {
log local0. "got CLIENT_ACCEPTED."
set gotserver 0
set retries 0
}
when HTTP_REQUEST {
log local0. "have request for [HTTP::uri]"
log local0. "retry count = $retries" log
local0. "gotserver count = $gotserver"
if { $gotserver == 0 and $retries == 0 } {
if { ([HTTP::uri]ends_with "OpenDatabase") and not ([HTTP::uri] contains "names.nsf") and not ([HTTP::uri] contains "iwaredir.nsf")}{
set original_request [HTTP::request]
set nsf "[substr [HTTP::uri] 1 ".nsf"].nsf"
log local0. "setting nsf: $nsf"
HTTP::uri /iwaredir.nsf/ServersLookup?OpenForm&nsfpath=$nsf
log local0. "setting uri: /iwaredir.nsf/ServersLookup?OpenForm&nsfpath=$nsf" }
else { do nothing }
} elseif { $gotserver == 1 and $retries >= 1 and [LB::status pool xnotes-inotes-pool-1 member $dest 80 ] eq "up"} {
log local0. "I should be directed to $dest with some kind of persistence"
pool xnotes-inotes-pool-1 member $dest 80
persist cookie insert inotes-cookie
log local0. "persist cookie should have been set"
}
}
when HTTP_RESPONSE {
if { $gotserver == 0 } {
if { [HTTP::header exists X-Domino-ClusterServers] } {
log local0. "X-Domino-ClusterServers headers exist."
set server_list [split [HTTP::header X-Domino-ClusterServers], ,]
foreach {svr} $server_list {
if { "" ne $svr }{
set servername [string trim $svr]
log local0. "servername is $servername"
if {$servername equals $static::xnotes1fqdn} {
set dest $static::xnotes1IP
set gotserver 1
log local0. "Had Servername $servername, so set destination to $dest Gotserver = $gotserver"
break
} elseif {$servername equals $static::xnotes2fqdn} {
set dest $static::xnotes2IP
set gotserver 1
log local0. "Had Servername $servername, so set destination to $dest Gotserver = $gotserver"
break
} else { log local0. "NO!! We got the wrong servername! ($servername)" }
}
}
if { $gotserver == 1 and [LB::status pool xnotes-inotes-pool-1 member $dest 80 ] eq "up" } {
incr retries
log local0. "retry count = $retries"
HTTP::retry $original_request
}
} elseif {[HTTP::header exists X-Domino-ReplicaServers]} {
log local0. "X-Domino-ReplicaServers headers exist."
set server_list [split [HTTP::header X-Domino-ReplicaServers], ,]
foreach {svr} $server_list {
if { "" ne $svr }{
set servername [string trim $svr]
log local0. "servername is $servername"
if {$servername equals $static::xnotes1fqdn} {
set dest $static::xnotes1IP
set gotserver 1
log local0. "Had Servername $servername, so set destination to $dest Gotserver = $gotserver"
break
} elseif {$servername equals $static::xnotes2fqdn} {
set dest $static::xnotes2IP
set gotserver 1
log local0. "Had Servername $servername, so set destination to $dest Gotserver = $gotserver"
break
} else { log local0. "NO!! We got the wrong servername! ($servername)" }
}
}
if { $gotserver == 1 and [LB::status pool xnotes-inotes-pool-1 member $dest 80 ] eq "up" } {
incr retries
HTTP::retry $original_request
}
} else {
log local0. "We did not get X-Domino-Headers"
}
}
}
- Julian_44743
Nimbostratus
Ok, so I decided to go back to the drawing board on this. Realizing (with some help from a colleague at work - thanks Jim) that the IBM lotus inotes redirector sends a meta refresh tag, I used the code found elsewhere on this site to examine the payload in the HTTP_RESPONSE_DATA and rewrite it as a redirect to the appropriate cluster. - MaHHF5_56930
Nimbostratus
> but for some reason, the connections don't appear to be persisting correctly after selecting the pool member.
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