Posted By Jason Rahm on 04/27/2011 12:20 PM
Create four pools, designating one of your servers as priority in each, cascading down respectively:
pool1 pool2 pool3 pool4
1.1.1.1:80 pri 40 1.1.1.2:80 pri 40 1.1.1.3:80 pri 40 1.1.1.4:80 pri 40
1.1.1.2:80 pri 30 1.1.1.3:80 pri 30 1.1.1.4:80 pri 30 1.1.1.1:80 pri 30
1.1.1.3:80 pri 20 1.1.1.4:80 pri 20 1.1.1.1:80 pri 20 1.1.1.2:80 pri 20
1.1.1.4:80 pri 10 1.1.1.1:80 pri 10 1.1.1.2:80 pri 10 1.1.1.3:80 pri 10
Then, it's a simple irule:
when CLIENT_ACCEPTED {
switch [IP::remote_addr] {
"src_ip_S1" { pool pool1 }
"src_ip_S2" { pool pool2 }
"src_ip_S3" { pool pool3 }
"src_ip_S4" { pool pool4 }
default { pool default }
}
}
Makes sure your servers will always go to the right member as long as it's up, but will survive outages as well. HTH...Jason
Hi Jason,
Thanks for your great answer. But if I create this iRules. Do I need to bind those pools into the Virtual Servers?
Let say I have created one VS with this following parameter
VS_A_Server {
snat automap
pool pool1 ----> which pool from above (pool1 ....pool2 I must put into this VS?)
destination 2.2.2.2:any
}
Do I need to create the VS as much as the pool number ? Or I just only create one Virtual server?