cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1765
Views
0
Helpful
3
Replies

ACE sticky config

kad168168
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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

View solution in original post

3 Replies 3

kad168168
Level 1
Level 1

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

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

Hello Pluppo,

Sorry for late reply.

Your comment is very useful.

Thank you so much!