Chris_Phillips
Mar 28, 2007Nimbostratus
enumerating pool members
Hi all,
Is there any way to enumerate the members of a pool automatically? By this i mean i want to take any old pool and be able to tell how many members there are and be able to reference each one with a number or such like, so i can say pick a member between 1 and n and if it is up, use it.
my use here is load balancing based on a uri hash, very similar to one of the irule competition honourable mentioners, but their solution was based on a hard coded replication of the structure of a pool and it's members. they create an array on rule_init, and then use it's size and the order of the elements in it. but i'd like a way of using this function generically. if you attach the irule to a pool with 5 members, i can do math to get a number between 1 and 5, (or 0 to 4) and check the availability of that pool member, without having to know what ip:port it actually is at any stage. so if i add a 6th member, my irule keeps functioning just fine.
if it's useful, i can post my current iRule, buti've not got it to hand at the moment.
Thanks
Chris