Forum Discussion
HTTP monitoring from a shared server
Hi, I am new with BIG-IP LTM, so, sorry if I have a basic question.
We have a server with many sites, the server uses only one IP and the request is rotated to the corret site by host header of HTTP protocol.
We need to load balance this server with a new one. With my basic knowledge I look two solutions:
1 - Use only one IP on F5 (all URL will pointo to this IP) and a health check on the server, not the site;
2 - Each site has its own IP (only one URL will point to this IP), and dedicated heath check, that can chech the site safe not only server.
Option 2 is the best one, but uses one IP for each site.
Option 1 more simple, but can't chech site sanity.
How to use only one IP on F5 (external listener), but check the site sanity?
Very thanks.
8 Replies
- Azize_118739
Nimbostratus
I will try to explain with a draw .... sorry, I am not good on this
OPTION 1
site1 ---| | ---> ServerA site2 ---| ---> IP 1.1.1.1 (F5) ---> | ---> ServerB site3 ---| | ---> ServerC Heath Check GET /health/index.html HTTP/1.1\r\n Host: health Connection: close\r\nOPTION 2
| ---> ServerA site1 ---| ---> IP 1.1.1.1 (F5) ---> | ---> ServerB | ---> ServerC Heath Check GET /health/index.html HTTP/1.1\r\n Host: site1\r\n Connection: close\r\n | ---> ServerA site2 ---| ---> IP 1.1.1.2 (F5) ---> | ---> ServerB | ---> ServerC Heath Check GET /health/index.html HTTP/1.1\r\n Host: site2r\n Connection: close\r\n | ---> ServerA site3 ---| ---> IP 1.1.1.3 (F5) ---> | ---> ServerB | ---> ServerC Heath Check GET /health/index.html HTTP/1.1\r\n Host: site3\r\n Connection: close\r\n - Kevin_Stewart
Employee
You can do the same type of HOST header redirection on the BIG-IP that you're doing on the original (multi-site) server using a single external listener IP. This can be achieved with an HTTP class or an iRule, but easier to show what I mean with an iRule example:
1 VIP (1 IP and port)
3 DNS entries pointing to the same VIP IP
3 pools (one for each site) - application-specific monitor applied to each pool
1 iRule:when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "site1.domain.com" { pool site1_pool } "site2.domain.com" { pool site2_pool } "site3.domain.com" { pool site3_pool } default { drop } } } - Azize_118739
Nimbostratus
Hello Kevin, thank you for you reply.
As I told you, I am new with F5, just to see if I understand correct.
Will this iRule be applied on all pools or applied as general on the F5 for all requests?
Because there are other pools that should not be in this rule, but need to work as normal VIP and pool. - Kevin_Stewart
Employee
This iRule is only applied to the VIP that supports multiple sites/pools under a single external listener IP. - Azize_118739
Nimbostratus
Thank you again.
Nice, so VIP will receive the request and this iRule will decide to which pool the request will use.
Each pool will have its own monitor and each one will evaluate if this site is alive or not.
Thank you so much. - Azize_118739
Nimbostratus
Hi Kevin, one more question.
Is there any way to create an iRule like below? (It is a fake code)
So, with some iRule like that, I do not need to change the iRule on every new site.when HTTP_REQUEST { var host = [string tolower [HTTP::host]] pool $host_pool }
Thank you - Kevin_Stewart
Employee
It is definitely possible, assuming 2 things:
1. There's a pool named or that can be derived from the requested host name, and
2. You should check to make sure the pool exists before trying to use it.set pool [string tolower [HTTP::host]]_pool or set host [string tolower [HTTP::host]] set pool ${host}_pool if { [catch { pool $pool }] } { Send to default pool and log error log local0. "Requested pool ($pool) doesn't exist" } - Azize_118739
Nimbostratus
Hi Kevin, how are you? I hope you are fine.
It has been a long time, but just to let you know that I tested it on our environment and it worked perfectly.
Thank you so much.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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