Forum Discussion
Torsten_Greulic
Nimbostratus
Jan 23, 2007iRule for test access
Hello everyone,
I am currently looking into solving the following task and was hoping that someone here might be able to give me a few ideas.
Since we don't have our own test environment available we want / need to test some new apache & mysql patches / fixes etc. with some of the productive machines. So far I was looking into using this setup (simplified):
- 1VIP: V_WEB_PROD (vip for customer access from the internet)
- 1VIP: V_WEB_TEST (vip for internal admins and devs)
- 1VIP: V_mySQL (vip for access from the webservers)
- 1Pool: P_WEB_PROD (default Pool for V_WEB_PROD)
- 1Pool: P_WEB_TEST (default Pool for V_WEB_TEST)
- 1Pool: P-mySQL-PROD (pool for iRule in V_mySQL)
- 1Pool: P-mySQL-TEST (pool for iRule in V_mySQL)
- 2Nodes: Webservers (the same nodes for both pools V_WEB_PROD and V_WEB_TEST)
- 1 Node: mySQL-PROD (productive mysql Node)
- 1 Node: mySQL-TEST (test mysql Node with updates, patches, etc.)
With no testing going on I'd like to have all connections to be forwarded to the same webservers + the mySQL-PROD server. Once the requirement for testing a new release comes up I want to be able to choose a webserver dynamically to test with and have productive connections (to V_WEB_PROD) to not be forwarded to that node anymore and test connections (to V_WEB_TEST) only to this particular server, incl. the P-mySQL-TEST Pool.
Since he are loadbalancing the connection twice (http & sql) I guess I'll have to go with 2 iRules, one for the webserver part and one for the mysql part. To keep it simple I started toying around with disabling the "test" node and then use the LB::status command to use the return code to figure out the rest, but I don't seem to be able to fill out some blanks yet. Here is an irule I was testing with so far, but without any luck (for VIP V_WEB_TEST - PROD won't need an irule since we simply disable the node in question):
when CLIENT_CONNECTED {
if { [LB::status pool P_WEB_PROD member 1.1.1.1 80] eq "session_disabled" } {
node 1.1.1.1 80 }
else {
if { [LB::status pool P_WEB_PROD member 2.3.4.5 80] eq "session_disabled" } {
node 2.3.4.5 80 }
else { pool P_WEB_PROD }
}
Of course I'll be needing a 2nd irule for the mysql VIP:
when CLIENT_CONNECTED {
if { [LB::status pool P_WEB_PROD member 1.1.1.1 80] eq "session_disabled" } {
pool mySQL-TEST }
else {
if { [LB::status pool P_WEB_PROD member 2.3.4.5 80] eq "session_disabled" } {
pool mySQL-TEST }
else { pool P_WEB_PROD }
}
What I am still missing in this last rule is a way to make sure that only the "disabled" webserver is being forwarded to the mySQL-TEST Pool. In my version, if any of the webservers is set to disabled all sessions will be forwarded to the test pool, so I guess I am missing an 'and' somewhere.
Any clues or hints?
Thanks.
No RepliesBe the first to reply
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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