02-23-2011 04:11 PM
In Cisco ACE, please tell me a configuration example for the following sticky and round-robin load balancing based on URL matching.
if sv=001 and type=100 included in URL, stick to 10.0.1.1:8080
if sv=001 and type=100 included in URL, stick to 10.0.1.2:8080
if sv=001 and type=100 included in URL, stick to 10.0.1.3:8080
else
if sv=001 included in URL, stick to 10.0.1.1:80
if sv=001 included in URL, stick to 10.0.1.2:80
if sv=001 included in URL, stick to 10.0.1.3:80
else
round-robin to any of 10.0.1.1:80, 10.0.1.2:80, 10.0.1.3:80
Thank you.
Solved! Go to Solution.
02-24-2011 12:42 AM
Hi,
You can do sticky in a number of ways, but I will just assume that you are ok using cookies. Remember that you will need to configure a resource class in the admin context in order to use sticky. I'm going to use 1.1.1.1 as an example for the VIP, using http. Also I am assuming you are using a single ACE (no FT). Remember to configure probes as well.
Here's the example:
rserver host server1
ip address 10.0.1.1
inservice
rserver host server2
ip address 10.0.1.2
inservice
rserver host server3
ip address 10.0.1.3
inservice
serverfarm host sv-and-type-farm
rserver server1 8080
inservice
rserver server2 8080
inservice
rserver server3 8080
inservice
serverfarm host sv-farm
rserver server1 80
inservice
rserver server2 80
inservice
rserver server3 80
inservice
sticky http-cookie SV001TYPE100 sv-and-type-cookie
cookie insert browser-expire
timeout 60
serverfarm sv-and-type-farm
sticky http-cookie SV001 sv-cookie
cookie insert browser-expire
timeout 60
serverfarm sv-farm
class-map match-all vip
2 match virtual-address 1.1.1.1 tcp eq www
class-map type http loadbalance match-all sv-and-type
2 match http url .*sv=001.*
3 match http url .*type=100.*
class-map type http loadbalance match-all sv
2 match http url .*sv=001.*
policy-map type loadbalance first-match l7slb
class sv-and-type
sticky-serverfarm sv-and-type-cookie
class sv
sticky-serverfarm qa-ekstern-cookie
class class-default
serverfarm sv-farm
policy-map multi-match int-policy
class vip
loadbalance vip inservice
loadbalance policy l7slb
loadbalance vip icmp-reply active
02-23-2011 04:18 PM
Sorry, let me correct the question.
In Cisco ACE, please tell me a configuration example for the following sticky and round-robin load balancing based on URL matching.
if sv=001 and type=100 included in URL, stick to 10.0.1.1:8080
if sv=002 and type=100 included in URL, stick to 10.0.1.2:8080
if sv=003 and type=100 included in URL, stick to 10.0.1.3:8080
else
if sv=001 included in URL, stick to 10.0.1.1:80
if sv=002 included in URL, stick to 10.0.1.2:80
if sv=003 included in URL, stick to 10.0.1.3:80
else
round-robin to any of 10.0.1.1:80, 10.0.1.2:80, 10.0.1.3:80
02-24-2011 12:42 AM
Hi,
You can do sticky in a number of ways, but I will just assume that you are ok using cookies. Remember that you will need to configure a resource class in the admin context in order to use sticky. I'm going to use 1.1.1.1 as an example for the VIP, using http. Also I am assuming you are using a single ACE (no FT). Remember to configure probes as well.
Here's the example:
rserver host server1
ip address 10.0.1.1
inservice
rserver host server2
ip address 10.0.1.2
inservice
rserver host server3
ip address 10.0.1.3
inservice
serverfarm host sv-and-type-farm
rserver server1 8080
inservice
rserver server2 8080
inservice
rserver server3 8080
inservice
serverfarm host sv-farm
rserver server1 80
inservice
rserver server2 80
inservice
rserver server3 80
inservice
sticky http-cookie SV001TYPE100 sv-and-type-cookie
cookie insert browser-expire
timeout 60
serverfarm sv-and-type-farm
sticky http-cookie SV001 sv-cookie
cookie insert browser-expire
timeout 60
serverfarm sv-farm
class-map match-all vip
2 match virtual-address 1.1.1.1 tcp eq www
class-map type http loadbalance match-all sv-and-type
2 match http url .*sv=001.*
3 match http url .*type=100.*
class-map type http loadbalance match-all sv
2 match http url .*sv=001.*
policy-map type loadbalance first-match l7slb
class sv-and-type
sticky-serverfarm sv-and-type-cookie
class sv
sticky-serverfarm qa-ekstern-cookie
class class-default
serverfarm sv-farm
policy-map multi-match int-policy
class vip
loadbalance vip inservice
loadbalance policy l7slb
loadbalance vip icmp-reply active
03-25-2011 02:07 AM
Hello Pluppo,
Sorry for late reply.
Your comment is very useful.
Thank you so much!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide