Apache Load Balaning sticky session issue

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Apache Load Balaning sticky session issue
# 1  
Old 06-22-2010
Apache Load Balaning sticky session issue

Few doubts in apache load balancing - I want to clear my doubts about apache load balancing.i have configured apache load balancing for two application servers.

1. When we set load balancing for two application servers then for one connection to application server we will get one jsession id assign to the connection for one application serverIs that mean for that connection apache server will only refer to one application server not go to another application server

2. route parameter will be added at the end of each jsesion id.If route is not appended at the end of jsessionid is that a issue? and will result in wrong session stickeyness?

I am stuck please help.

Last edited by ganesh_gore; 06-22-2010 at 03:16 AM.. Reason: layout
# 2  
Old 06-22-2010
You need use mod_jk module (together with Apache2) and in the worker.properties specify something like that:


SERVER 1

worker.mte01a.port=8009 <- port
worker.mte01a.host=server1 <hostname of server 1
worker.mte01a.type=ajp13 < connector
worker.mte01a.lbfactor=1 < level of LB
worker.mte01a.connection_pool_timeout=600 < no explain
worker.mte01a.sticky_session=true < must be true
worker.mte01a.socket_keepalive=true < must be true
worker.mte01a.socket_timeout=360 < default socket timeout
worker.mte01a.socket_connect_timeout=360000 < a good timeout
worker.mte01a.session_cookie=JSESSIONID1 < this parameter need to be the same here and in the line:

<Engine name="jboss.web" jvmRoute="JSESSIONID1" defaultHost="server1">

in the file: (JBOSS AS)
jbossdir/server/mte01/deploy/jboss-web.deployer/server.xml


SERVER 2:
worker.mte01b.port=8009 <- port
worker.mte01b.host=server1 <hostname of server 2
worker.mte01b.type=ajp13 < connector
worker.mte01b.lbfactor=1 < level of LB
worker.mte01b.connection_pool_timeout=600 < no explain
worker.mte01b.sticky_session=true < must be true
worker.mte01b.socket_keepalive=true < must be true
worker.mte01b.socket_timeout=360 < default socket timeout
worker.mte01b.socket_connect_timeout=360000 < a good timeout
worker.mte01b.session_cookie=JSESSIONID1 < this parameter need to be the same here and in the line:

<Engine name="jboss.web" jvmRoute="JSESSIONID1" defaultHost="server2">

in the file: (JBOSS AS)
jbossdir/server/mte01/deploy/jboss-web.deployer/server.xml

I'm using RHEL 5.3, Apache2 and JBoss AS 4.2.2.GA in the example.
# 3  
Old 06-22-2010
I am using http

Hi,

I am using http not ajp.
# 4  
Old 06-22-2010
You can configure a content switch (multilayer) and solve your problem cuz i don't know how make sticky session without use mod_cluster or mod_jk.
# 5  
Old 06-22-2010
mod_proxy method

I am using mod_proxy method.
Setup details -

1. H/W Load Balancer à 2. Two Apache Servers with load balancing and rewrite rule à 3. Two Application servers

Request will be travel 1 à 2 à 3

Queries -
  • <LI style="mso-list: l0 level1 lfo1" class=MsoNormal>When any session is established I can see that requests of that session is going to both the application servers. Unique jsession id is assigned to that request, using that jsessionid request is forwarded to both application servers. Is it expected behavior?
  • In configuration of Apache load balancing what is good configuration
·By Request
·By Traffic
  • In apache configuration we add route parameter in Proxy balancer tag for both application server, then it gets appended to jsessionid like jsessionid=50D8494884F6D4E9FFB8D8946AEB5AC7:s1 and apache server will use this pattern to manage sessions. In my case this route is not added at the end of jsessionid. Is this something which can cause session issue? In log it shows that it is attached to s1/s2 route respectively.
BalancerMember http://server.1 loadfactor=1 route=s1
BalancerMember http://server.2 loadfactor=2 route=s2
  • Sometimes I am getting this error and land me on error code 400 page not found.
[Tue Jun 22 06:17:32 2010] [error] [client 166.23.23.32] Invalid URI in request username=test&password=1234&method%3Alogin=Logga+in&__checkbox_rememberMeChecked=truejpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*, referer: http://server1.server/home.action

This all happen when we are accessing URL using hardware load balancer. If we hit each apache server individually everything is working fine.
# 6  
Old 06-22-2010
Cool, but I think the best way to do that kind of balance would be through content switch or mod_jk module or mod_cluster module. I have three mission-critical environments here in the company using this type of solution.
Anyway, thanks for the mod_proxy's how to.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Libraries load issue

I am trying to upgrade Autosys to r11.3.5 how ever while running the setup i am getting below error , I went through some of the Known errors , found to command the export LD_ASSUME_KERNEL parameter , which i did however didnot work . Could some pleae look into this asap. Starting all... (1 Reply)
Discussion started by: rakesh_411
1 Replies

2. Programming

Sybase load statement issue

hi, I am trying to load a sybase table using a file ( unit separator is the delimiter) which is in IQ server. I Used load statment as below execute ('LOAD TABLE schemaname.tablename (' || ' name, age, date, Symbols) from ' || ' '' /filepath/file.txt '' ' || ' QUOTES off ' || ' DELIMITED... (0 Replies)
Discussion started by: irudayaraj
0 Replies

3. Red Hat

Conceptual details about apache load balancing

Hi Techies, Setup details - 1. H/W Load Balancer 2. Two Apache Servers with load balancing and rewrite rule 3. Two Application servers Request will be travel 1 then 2 then 3 Queries - 1. When any session is established I can see that requests of that session is going to both... (0 Replies)
Discussion started by: ganesh_gore
0 Replies

4. Web Development

Load Balancing in Apache

Hi All, I have one webserver which has an application for a set of internal users can be accessed by _http://server1.com I am planning to load balance this application. For that I have cloned this server and build a new one which can be accessed using _http://server2.com]Server2.com. Also i... (2 Replies)
Discussion started by: Tuxidow
2 Replies

5. UNIX for Advanced & Expert Users

Apache-Reverse proxy and load balancing

Hi All, I have a webpage loaded on server1 with authorization enabled by .htaccess, which can be accessed by http://ipofserver1/index.html. Now im planning a high availabilty load balancing in such a way that if the server1 is down due to some reason it should connect to another server. i have... (1 Reply)
Discussion started by: Tuxidow
1 Replies

6. Solaris

sc 3.2, load balanced apache offline on both nodes

Hi I am trying to set up apache on the only 2 nodes of sun cluster 3.2. nodes are running solaris 10-x86 For some reasons, apache resource on both nodes goes offline in some seconds. There is a shared address resource which is online rs, rg list and show below, clrg online... (11 Replies)
Discussion started by: upengan78
11 Replies

7. UNIX for Advanced & Expert Users

Apache process cause huge load

Hello ! I have a problem with an apache process that is causing huge load. It starts from time to time - I'm not sure what is making it start beacause there's nothing in cron, but it appears every few minutes - and when it starts is uses a lot of RAM (up to 1.3GB) and create a huge load on... (1 Reply)
Discussion started by: Sergiu-IT
1 Replies

8. Shell Programming and Scripting

Need help in wrting Load Script for a Load-Resume type of load.

hi all need your help. I am wrting a script that will load data into the table. then on another load will append the data into the existing table. Regards Ankit (1 Reply)
Discussion started by: ankitgupta
1 Replies

9. HP-UX

Module jk2 failed to load into apache server!!

Hi There, Does anyone knows what could be the problem if my apache server is running but unable to load JK2 module into the server. My HTTPS is running on Apache Server 2.0.49 with ssl enabled and compiled with Mod_ssl on HPUX-11.11i. In fact we have try out the following parameter, ... (4 Replies)
Discussion started by: e_jeffhang
4 Replies
Login or Register to Ask a Question