Forum Discussion
Shawn_Higgin_84
Nimbostratus
Jun 25, 2005How to redirect if less than x nodes are avail
I was wondering if anyone knoes how do setup a iRule to do a redirect if there are less than x nodes available within a pool. Is there an easy way to do this? I have it working if there are no nodes available.
Also, is there a way to have the F5 send out an SNMP Trap within an IRule or a Syslog message?
Thanks,
Shawn
7 Replies
- Brian_Gupta_115
Nimbostratus
You don't need an iRule. In the pool config you can set a minimum available number of nodes. (And configure the behavior if this happens)
-Brian - Brian_Gupta_115
Nimbostratus
Read up on priority group activation.....
-Brian - unRuleY_95363Historic F5 AccountIf you need to use a rule, you can use the command:
active_members
This will return the number of active pool members in the pool.
Also, you can generate a log entry from the iRule and then add a configuration line to /etc/alertd/alert.conf to have alertd generate an snmp trap for you (you will likely have to restart alertd with "bigstart restart alertd"). Your alert line would look something like this:alert BIGIP_RULES_RULESERR_RULE "^Rule (.*?): SNMPTRAP" { snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.50" }
The following iRule should then generate the trap.when HTTP_REQUEST { if { [HTTP::uri] contains "debug" } { log local0. "SNMPTRAP - Request for debug" } } - Chuck_Adkins_13
Nimbostratus
I would like to do something similar -
I need to configure a pool/vip so that if < X nodes are available - the entire vip is unavailable. Nightly this applcation is restarted, the first node that comes online gets hammered by connecting clients. The way our application works, combined with persistence method we use, means that nearly all clients will be on one node while the others are empty.
Would be awesome if I could just to use something simple like:pool my_pool { lb method member least conn min active members 2 monitor all some-test member 10.12.10.7:80 priority 1 member 10.12.10.8:80 priority 1 member 10.12.10.8:80 priority 1 }
but doesnt look like that is how priority group act works.
Slow ramp time doesn't work since for some finite amount of time there is only one node available in the pool.
Perhaps an iRule would be best - anyone have anything they use or ideas? - Colin_Walker_12Historic F5 AccountWell, are you looking to have the clients redirected to another location until there are at least two servers available in the pool, or are you looking to have the connections rejected completely, as if the pool were still down?
We can accomodate either of those things.
Colin - Chuck_Adkins_13
Nimbostratus
Rejected completly as long as there are < X nodes in a pool testing as "up" - Colin_Walker_12Historic F5 AccountThat would be a relatively simple iRule:
when HTTP_REQUEST { if { [active_members http_pool] < X } { reject } }
X would be changed to the minimum number of active members, of course.
This code is almost identical to the example in the Wiki on the active_members page: Click here
HTH,
Colin
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