Forum Discussion
Jamey_Price_105
Nimbostratus
Oct 21, 2006Setting the Pool in STREAM_MATCHED
We're setting up a pool of load-balanced Lotus Notes boxes to provide webmail. One of the machines (currently, anyways) has a redirector set up so once you've logged in, if the machine you logged into isn't your mailserver it'll do a javascript-based redirect to send you to the right machine. It'd be nice if it did a 302 instead since that'd be MUCH easier to catch, but instead I just set up a stream profile and watch for the name of any of the machines it could redirect you to and replace them with the hostname on the Big-IP I'm proxying everything through. However, once I do that I need to ensure that all your future requests go through the mailserver it tried to redirect you to.
According to what I'm logging, this is working fine. According to what I'm actually seeing in the pool network statistics, and the fact that it can't find the mailfile, it isn't working.
when STREAM_MATCHED {
This is the mailserver you're being redirected to, its hostname specifically. Fix this to use string tolower later.
set mailserver [STREAM::match]
This name::lookup doesn't actually work, dunno why.
set serverip [NAME::lookup $mailserver]
set currpool [LB::server pool]
set currpoolmember [LB::server]
The Wiki says that pool commands MUST be in an if/else structure, so here's one.
if { $mailserver ends_with "jwt.com" } {
log "Mailserver matched jwt.com, setting pool to $mailserver instead of $currpool"
I set up pools with the names of each of the mailservers.
pool "$mailserver"
} else {
This shouldn't actually ever trigger, and doesn't seem to.
log "Mailserver didn't match jwt.com, setting pool to $currpool instead of $mailserver"
pool "$currpool"
}
}
Can someone perchance tell me what I'm missing/doing wrong that's preventing me from actually getting further requests from this client to go to the correct pool?
Much obliged,
Fish
- Deb_Allen_18Historic F5 AccountHi Fish -
- Jamey_Price_105
Nimbostratus
I've worked around the inability to look things up in DNS, and am stuck now with an iRule in which, no matter what pool command I issue, nothing seems to happen. - William_Benett1
Nimbostratus
You have the exact same problem that I do. I posted something last week about wanting to LB based on a DNS response. The problem appears that you can only designate a pool in one of these three events: CLIENT_DATA, CLIENT_ACCEPTED, and HTTP_REQUEST. - bl0ndie_127134Historic F5 AccountI wonder if you are making things harder that it should be. Sounds like you already have the stream filter configured to map the internal uri (mail server addresses) to the VIP.
- Jamey_Price_105
Nimbostratus
Well nuts! I never noticed that stream_matched wasn't an valid event to issue a pool command in - largely because normally when you try to do something in an invalid event, you get errors in the log and your connection is reset, and here it just fails silently. Okay, I'm going to have to get creative and see what I can do here. If I come up with a solution, I'll post it here. Won't help with anyone who's doing things based on DNS, since I'm ignoring it at this point. - Jamey_Price_105
Nimbostratus
Bl0ndie, it's not a matter of cookies really, it's a matter of the internal server issuing a redirect, but instead of doing it server-side with a 301 or 302 that I can catch and handle it's doing it in javascript, which I have to replace in the page response with the host behind which I'm reverse-proxying and then subsequently manage to send the request to the proper internal server, which will at the very least be a different pool member than the initial server, or (and this seems simpler to me) a totally separate pool. - William_Benett1
Nimbostratus
Fish, you might want to check your /var/log/ltm logfile for messages. I just figured out how to select a pool in the NAME_RESOLVED event. If you're getting an error "Address in use" in relation to that iRule try using LB::detach before you assign a pool. - Deb_Allen_18Historic F5 AccountIt's worth noting that the list of valid events listed in the wiki for the pool command (or any other command, for that matter) is not necessarily exhaustive, only represents some events that have been positively identified as valid for the command in question.
- Simon_83666
Nimbostratus
Fish, did you get this resolved at the end ? I have exactly the same issue where I need to capture and translate the internal mail server names to one external address for the client and also making sure that the HTTP request from the client for directed to the right and same mail server every time... - Jamey_Price_105
Nimbostratus
Posted By sh710 on 08/12/2007 5:03 PM
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