Forum Discussion
Pav_70755
Sep 08, 2010Nimbostratus
SQL DNS RE-Direction
Hi Guys,
I basically have 3 SQL servers and a group of 6 web servers.
SQL Servers
SQL-Live
SQL-UAT
SQL-Wip
Web Servers
UAT
Wip
web1
web2
web3
web4
All web servers are in a pool
I have set them up as nodes on my F5 and I have 1 dns entry set up for sql dns entries which is sql-web.domain.com
what I want to do is be able to re-direct traffic to a specific sql server depending on which web server the SQL request comes from.
So in the code all i want to have is sql-web.domain.com and if this code is on the UAT web server i want the F5 to be able to re-direct this automatically to the UAT SQL server.
the web requests for my wip and uat servers dont go through the f5 but the live web servers are all set up on the F5 with sites as virtual servers using a the web pool of 4 live servers.
Any help would be much appreciated.
Pav
- Pav_70755NimbostratusI've come up with something like this
when CLIENT_ACCEPTED { if { [matchclass [IP::remote_addr] equals $::Wip_Server] and [TCP::local_port] != <1433> } { pool SQL-Wip }
- HamishCirrocumulusInteresting concept... Not sure I like it (Sorry. I shudder at the fact that configs and target IP address are the same between test/dev and production), however the iRule looks fine and should accomplish what you require...
- Pav_70755NimbostratusI assume I dont need to have the nodes set up for my wip and uat servers instead I just need to create two virtual servers and assign the irule to that?
- Pav_70755NimbostratusOK so i've created a virtual server called Wip and assigned it a different IP
when CLIENT_ACCEPTED { if { [matchclass [IP::remote_addr] equals $::WiP_Servers] } { pool SQL-WiP } else { } }
- Pav_70755Nimbostratusok have come up with this but am getting the following errors:
when CLIENT_ACCEPTED { if {[matchclass [IP::remote_addr] equals $::Wip_Server]}{ pool SQL-Wip } else { elseif {[matchclass [IP::remote_addr] equals $::UAT_Server]}{ pool SQL-UAT elseif {[matchclass [IP::remote_addr] equals $::Live_Servers]{} pool SQL-Live } }
- Cspillane_18296NimbostratusHello again Pav.
- Pav_70755NimbostratusThanks for that Chris the rule now works.
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