cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
483
Views
0
Helpful
2
Replies

sticky or not ?

tzografos
Level 1
Level 1

I have the following configuration on an ovh loadbalancer

access-list ANY line 8 extended permit icmp any any

access-list ANY line 16 extended permit ip any any

probe tcp PROBE_TCP

  interval 30

  passdetect interval 60

rserver host app5_im

  ip address 172.16.0.2

  conn-limit max 50000 min 40000

  inservice

rserver host app6_im

  ip address 172.16.0.3

  conn-limit max 50000 min 40000

  inservice

serverfarm host farm_im

  predictor leastconns

  probe PROBE_TCP

  rserver app5_im

    inservice

  rserver app6_im

    inservice

parameter-map type http HTTP_PARAMETER_MAP

  persistence-rebalance

sticky http-cookie CookieACE StickyGroup1

  cookie insert

  timeout 720

  replicate sticky

  serverfarm farm_im

class-map match-all L4-WEB-IP

  2 match virtual-address 46.105.181.161 tcp eq www

class-map type management match-all REMOTE_ACCESS

  2 match protocol ssh any

policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY

  class REMOTE_ACCESS

    permit

policy-map type loadbalance http first-match WEB_L7_POLICY

  class class-default

    sticky-serverfarm StickyGroup1

    insert-http x-forward header-value "%is"

policy-map multi-match WEB-to-vIPs

  description Ties L4-WEB-IP class-map, WEB_L7_POLICY maps together and applies HTTP_PARAMETER_MAP. Uses NAT.

  class L4-WEB-IP

    loadbalance vip inservice

    loadbalance policy WEB_L7_POLICY

    loadbalance vip icmp-reply active

    nat dynamic 1 vlan 2131

    appl-parameter http advanced-options HTTP_PARAMETER_MAP

interface vlan 1203

  ip address 46.105.181.170 255.255.255.240

  alias 46.105.181.169 255.255.255.240

  access-group input ANY

  service-policy input REMOTE_MGMT_ALLOW_POLICY

  service-policy input WEB-to-vIPs

  no shutdown

interface vlan 2131

  ip address 172.31.255.250 255.240.0.0

  alias 172.31.255.249 255.240.0.0

  peer ip address 172.31.255.251 255.240.0.0

  nat-pool 1 172.31.255.248 172.31.255.248 netmask 255.240.0.0 pat

  no shutdown

ft track interface  VLAN1203

  track-interface vlan 1203

  peer track-interface vlan 1203

  priority 5

  peer priority 50

on every server I have the following cookie.php file

<html>

<head>

<?php

$n = 'CookieACE';

if( ! $_COOKIE["$n"]) {

$cookie=rand(1,10000);

echo '<meta http-equiv="Set-Cookie" content="'.$n.'='.$cookie.'; path=/" />';

}

?>

</head>

<body>

Hello from SERVERx   <!-- x is 1 for server1 and 2 for server 2-->

<?php

if($_COOKIE["$n"])

echo "Got cookie: $n = $cookie";

else

echo "New cookie set: $n = $cookie";

?>

</body>

</html>

unfortunately it seems not to work as I do not get stickyness, and the "show sticky database" is always empty.

Is there some thing wrong with this conf ?

Any help will be greatly appreciated

2 Replies 2

Surya ARBY
Level 4
Level 4

cookie insertion stickyness is not dynamic, there is static mapping between the cookie value and the back end server.

Also for browser based applications use a "browser expire" instead of a timeout 720.

When you're browsing the site, do you see the sticky cookie in the browser or when running a "live http header" or a wireshark ?

Hi

Well no, I am only using the cookie.php file that ovh provided in order to check that sticckyness exists.

Unfortunately it does not provide the output stated, but it does not allow me either to chenge servers on refresh.

That is if I get diverted to server5 then it stays there and does not redirect on refresh to server6. That might mean that I do have stickyness...

I am just checking to see why the ovh example does not produce the results stated.

Thanks again