Forum Discussion
Iain_McGuire_11
Nimbostratus
Aug 02, 2006Redirecting hosted sites on availablily (not servers)
Can someone clarify if the following is possible? My feeling is it's not, using only LTMs, although I'd be happy to hear otherwise.
Our customer currently has two IIS servers, which between them host about 20 virtual websites, each with their own domain name. We currently load balance based on the availability of the webserver, based on it's IP. They would like to be able to stop a site on one server, and have traffic just for that site be redirected to the second server.
They're thinking they could put a text file in the root directory of each site, and check for the availability of the site by doing a GET for that file. I believe I can write an iRule to do that, but if it's not available (because the SITE, not the SERVER, is offline), it will mark the member as down, won't it? At which point no traffic will be sent to that IP address, until it successfully GETs the file.
Is there a way of achieving this? Being able to mark a site on a shared IP as down, but other sites on the same IP as up?
13 Replies
- dennypayne
Employee
If the sites are configured with different pools/virtuals, then normal health monitors should take care of this without a need for iRules. If everything is going through the same pool/vip, then you could possibly look at the HTTP_RESPONSE for an error (404,500,etc) and use LB::reselect if you see it (there has been some discussion of this on the forum, just search for LB::reselect to find those threads). -EDIT Actually LB::reselect is not valid within HTTP_RESPONSE, I'll post again with something that may work...
Denny - hoolio
Cirrostratus
Hello,
You could configure a specific monitor for each host, using a monitor send string that is specific to the host of the web application. However, I think the node (IP:port combination) will be marked down if any monitor on the IP:port fails.
The easiest way to separate the monitoring for the status of the nodes might be to move the server instances onto their own ports, so there would be a unique IP:port for each host name.
This is a bit unrelated to rules and closer to support though.
Aaron - hoolio
Cirrostratus
Hey Denny,
I thought the node was marked down if any monitor on that IP:port failed. I'll try testing it to see.
Aaron - Iain_McGuire_11
Nimbostratus
Guys,
Thanks for the thoughts, much appreciated. I've been giving this a little more thought - If the virtual webservers are configured to run on a separate port, rather than being differentiated based on host headers, this would be much more feasible, wouldn't it? I could presumably create several pools, each with two members, one for each serverIP:port combination. Then, if one of the virtual webservers is stopped in IIS, it would only be that member server:port combination that's marked as down?
eg, two physical webservers, at 10.0.0.1 and 10.0.0.2 host cat.com, dog.com, rat.com and donkey.com, with
cat.com = port 8081
dog.com = port 8082
rat.com = port 8083
donkey.com = port 8084
So if cat.com is stopped in IIS on one physical server, the others are all still marked as up? And we have one virtual server listening on the routable address, using iRules to select a pool based on the domain name.
That would be much more workable than trying to run all websites locally on port 80, right?
Thanks again. - Iain_McGuire_11
Nimbostratus
Sorry, I think I misread / misunderstood the previous comments in this thread prior to my last post. I'll lab this to check I get what you're saying. Thanks. - dennypayne
Employee
Yes, separating the ports would make it easier to differentiate, but what we are saying is that even if they run on the same port, as long as they are in different pools with different monitors, one going down won't affect the other. You would still need to use an iRule as you said to select a pool based on the domain name.
So in your example:
cat_pool could have 10.0.0.1:80 and 10.0.0.2:80
dog_pool could also have 10.0.0.1:80 and 10.0.0.2:80
you would use a different monitor on cat_pool vs. dog_pool, and if 10.0.0.1:80 fails in the cat_pool, it would not bring 10.0.0.1:80 down in dog_pool.
Of course if you use different ports, then you can do the same thing without relying on host headers at the server.
Denny - Iain_McGuire_11
Nimbostratus
Denny,
I'm with you now. I realised after my second-to-last post that's what you guys were saying. Thanks for the help with this, I'm still quite new to LTMs and what is and isn't possible. - Iain_McGuire_11
Nimbostratus
Actually, i've ran aground a bit with creating the monitor for the pool. I can write an iRule to choose a pool based on the domain name, but what syntax can I use to specify a host header to send in the monitor? So that I can determine if a particular site (member of a pool) is up or down?
An ordinary http monitor doesn't seem to let you specify a host header, so I assume I'd have to use a scripted monitor, but even then the examples I've start with a GET request, i've not seen a way to request a page from dog.com rather than cat.com (both served on port 80 on the same physical server) - hoolio
Cirrostratus
You can configure a monitor to send an HTTP/1.1 formatted request, including the host header using the following configuration:monitor http_1.1_pool1_monitor { defaults from http send "GET /status.html HTTP/1.1\nHost: mysite.com\nConnection: close\n" recv "200 OK" }
The send string specifies what the BIG-IP will request from the nodes the monitor is associated with. The receive string specifies what the BIG-IP expects to get in response.
Aaron - Iain_McGuire_11
Nimbostratus
Thanks again. That's a lot easier than I was expecting, and I have to say I'm very impressed by the speed of replies on this forum.
One last thing, does anyone have a good link to "standard" http commands that can be sent, their order etc? If not I can always pick apart tcpdumps for that kind of thing, but if there's a good link it would be a great help.
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
