08-03-2009 01:46 AM
Hello,
I have a problem with cookies in the URL if the browser does not support Cookies in the http header.
I'm setting the cookie in the url static , so the URL looks like:
http://testfarm/sticky.cgi?serverid=1.1.1.1
And configure the sticky group:
sticky http-cookie serverid sticky-farm cookie secondary serverid
replicate sticky
serverfarm sticky-farmm 8 static cookie-value "1.1.1.1" rserver server1
16 static cookie-value "1.1.1.2" rserver server2
What's wrong with my configuration?
If the client accepts cookies in the Cookie header anything works but not if the client rejects the cookie.
08-03-2009 02:09 AM
Did you define a port for each server inside the serverfarm ?
If yes, you need to specify this port in the static entries.
Gilles.
08-03-2009 03:00 AM
Hi Gilles,
no, i did not specify a port in the serverfarm or in the realserver.
The configuration looks like this:
sticky http-cookie serverid ST-sticky-farm
cookie secondary serverid
replicate sticky
serverfarm sticky-farm
8 static cookie-value "1.1.1.1" rserver server1
16 static cookie-value "1.1.1.2" rserver server2
policy-map type loadbalance first-match L7-10-1-1-1
class class-default
sticky-serverfarm sticky-farm
policy-map multi-match L4_SLB_POL_external
description L4 Policy fuer SLB ohne NAT
class V-10-1-1-1
loadbalance vip inservice
loadbalance policy L7-10-1-1-1
loadbalance vip icmp-reply active
appl-parameter http advanced-options HTTP-rebalance
class-map match-any V-10-1-1-1
2 match virtual-address 10.1.1.1 tcp eq www
serverfarm host sticky-farm
probe tcp80-i30
rserver server1
inservice
rserver server2
inservice
rserver host server1
ip address 1.1.1.1
inservice
rserver host server2
ip address 1.1.1.2
inservice
Sven
08-03-2009 03:48 AM
Sven,
I tested your config in my lab and it works for me.
I used version A2(1.4)
What version do you run ?
Gilles.
08-03-2009 03:53 AM
Gilles,
I've used A2(1.4)a,
how did you test the Configuration?
Sven
08-03-2009 03:57 AM
Sent the following request 10 times:
GET /index.html?serverid=1.1.1.1&session_id=1234 HTTP/1.1
Host: 10.86.213.27
x-value: 12345
Accept: */*
Accept-Charset: *
Accept-Language: *
Connection: Keep-Alive
Then did a show serverfarm
switch/Admin# sho serverfarm linux4
serverfarm : linux4, type: HOST
total rservers : 2
---------------------------------
----------connections-----------
real weight state current total failures
---+---------------------+------+------------+----------+----------+---------
rserver: linux1-24
192.168.30.24:0 8 OPERATIONAL 0 1 0
rserver: linux4
192.168.30.44:0 8 OPERATIONAL 0 11 0
And all entries appear on server linux4 as configured.
sticky http-cookie serverid CookieLinux4
cookie secondary serverid
8 static cookie-value "1.1.1.1" rserver linux4
16 static cookie-value "1.1.1.2" rserver linux1-24
serverfarm linux4
Gilles
08-04-2009 03:32 AM
Hi Gilles,
we are both right, i think i know the problem.
I've first configured a sicky group without the support for cookies inside the URL:
1)
sticky http-cookie serverid ST-sticky-farm
replicate sticky
serverfarm sticky-farm
8 static cookie-value "1.1.1.1" rserver server1
16 static cookie-value "1.1.1.2" rserver server2
Then i added the support for url cookies
2)
sticky http-cookie serverid ST-sticky-farm
cookie secondary serverid
This is not working unless i change the policy-map:
3)
policy-map type loadbalance first-match L7-10-1-1-1
class class-default
no sticky-serverfarm sticky-farm
sticky-serverfarm sticky-farm
I don't think this works as described in the docs.
Sven
08-04-2009 06:03 AM
CSCsw96035 secondary cookie not sticked if added after adding sticky to LB policy
This was identified earlier this year but we haven't assign an engineer to it yet.
I'll make sure this is done.
G.
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