RE: session affinity with loadbalancing (apache2, mod_jk, tomcat5 on linux 9, jdk1.4.2)
Yah I missed that one. thanks -Original Message- From: Ralph Einfeldt [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 3:50 PM To: Tomcat Users List Subject: RE: session affinity with loadbalancing (apache2, mod_jk, tomcat5 on linux 9, jdk1.4.2) Did you set the jvmRoute in the Engine tag in server.xml. The value must match the name of the workers. (I'm not shure if it's the name or the attribute 'tomcatid') - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session affinity with loadbalancing (apache2, mod_jk, tomcat5 on linux 9, jdk1.4.2)
Hi Don't you also have to provide the properties for the loadbalancer worker? eg # properties for load balanced workers worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1,tomcat2 and then add the extra properties you require (to worker.loadbalancer.XXX)? Hope that helps. John Sidney-Woollett ian said: > I've read in the Workers How To of apache that the property > sticky_session for lb worker properties enables / disables session > affinity for the load balancer. When I tried it on my system the session > doesn't seem to be retained often resulting to a session timed out or a > not logged in error. Below is my worker.properties configuration. > > # > # worker.properties > # > > # In Unix, we use forward slashes: > ps=/ > > # list the workers by name > worker.list=tomcat1, tomcat2, loadbalancer > > # > # tomcat1 worker > # > > worker.tomcat1.host=192.168.0.61 > worker.tomcat1.port=8009 > worker.tomcat1.lbfactor=100 > worker.tomcat1.type=ajp13 > worker.tomcat1.cachesize=10 > worker.tomcat1.cache_timeout=600 > worker.tomcat1.socket_keepalive=1 > worker.tomcat1.socket_timeout=300 > > # > # tomcat2 worker > # > > worker.tomcat2.host=192.168.0.65 > worker.tomcat2.port=8009 > worker.tomcat2.lbfactor=100 > worker.tomcat2.type=ajp13 > worker.tomcat2.cache_timeout=600 > worker.tomcat2.socket_keepalive=1 > worker.tomcat2.socket_timeout=300 > > # > # end of file > # > > > Can anyone give me an idea where I may have an error? > Thanks. > > - ian > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session affinity with loadbalancing (apache2, mod_jk, tomcat5 on linux 9, jdk1.4.2)
Did you set the jvmRoute in the Engine tag in server.xml. The value must match the name of the workers. (I'm not shure if it's the name or the attribute 'tomcatid') > -Original Message- > From: ian [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 15, 2004 9:34 AM > To: 'Tomcat Users List' > Subject: session affinity with loadbalancing (apache2, mod_jk, tomcat5 > on linux 9, jdk1.4.2) > > > I've read in the Workers How To of apache that the property > sticky_session for lb worker properties enables / disables session > affinity for the load balancer. When I tried it on my system > the session doesn't seem to be retained often resulting to a session > timed out or a not logged in error. Below is my worker.properties > configuration. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session affinity doesn't work
I post my working configuration set: For every Tomcat I added a jvmRoute like this: And this is my workers2.properties: ## Define the shared memory file [shm] ver=1 info=Scoreboard. Required for reconfiguration and status with multiprocess servers disabled=0 file=${serverRoot}/logs/jk2.shm size=100 ## Define the communication channels [channel.socket:localhost:9009] ver=34 graceful=1 disabled=0 tomcatId=apps1 lb_factor=10 [channel.socket:apps2.domain1.tld:9009] ver=35 graceful=1 disabled=0 tomcatId=apps2 lb_factor=10 [channel.socket:apps3.domain2.tld:9009] ver=39 graceful=1 disabled=0 tomcatId=apps3 lb_factor=20 [channel.socket:apps4.domain2.tld:9009] ver=7 graceful=1 disabled=0 tomcatId=apps4 lb_factor=20 ## Define workers # Define AJP13 workers [ajp13:localhost:9009] ver=2 disabled=0 info=apps1 - local channel=channel.socket:localhost:9009 group=lb1 [ajp13:apps2.domain1.tld:9009] ver=4 disabled=0 info=apps2 - remote channel=channel.socket:apps2.domain1.tld:9009 group=lb1 [ajp13:apps3.domain2.tld:9009] ver=4 disabled=0 info=apps3 - remote channel=channel.socket:apps3.domain2.tld:9009 group=lb1 [ajp13:apps4.domain2.tld:9009] ver=4 disabled=0 info=apps4 - remote channel=channel.socket:apps4.domain2.tld:9009 group=lb1 # Define Load Balancer worker [lb:lb1] ver=2 disabled=0 info=First load balancer # Define Load Balancer worker [lb:lb2] ver=2 disabled=0 info=Second load balancer worker=ajp13:localhost:9009 worker=ajp13:apps2.domain1.tld:9009 # Define Status worker [status:status] ver=2 disabled=0 ## Define mappings [uri:/xyz1/*] ver=4 disabled=0 group=lb1 #group=ajp13:localhost:9009 [uri:/xyz2/*] ver=6 disabled=0 group=lb1 #group=ajp13:localhost:9009 [uri:/xyz3/*] ver=2 disabled=0 group=ajp13:localhost:9009 [uri:/xyz4/*] ver=4 disabled=0 #group=ajp13:localhost:9009 group=lb2 [uri:/jkstatus/*] ver=2 disabled=0 info=Display status information and checks the config file for changes. group=status:status Thats all Klaus - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Monday, October 27, 2003 2:55 AM Subject: RE: Session affinity doesn't work This is my workers2.properties. I attached it to my last mail but the mail server removed it. Sorry for that. == [logger] level=DEBUG [config:] #file=${serverRoot}/conf/workers2.properties #file=c:/Apache2/conf/workers2.properties file=conf/workers2.properties debug=0 debugEnv=0 [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers #file=${serverRoot}/logs/jk2.shm file=logs/jk2.shm size=100 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0 [lb:lb] info=Default load balancer. debug=0 # tomcat1 [channel.socket:localhost:11009] port=11009 host=localhost type=ajp13 lb_factor=100 #tomcatId=tomcat1 : make load balancing not work # tomcat2 [channel.socket:localhost:12009] port=12009 host=localhost type=ajp13 lb_factor=100 #tomcatId=tomcat2 : make load balancing not work # tomcat3 #[channel.socket:psdwdinhnguyen:13009] #port=13009 #host=psdwdinhnguyen #type=ajp13 #lb_factor=100 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. #group=status: [uri:/*.jsp] info=Extension mapping == -Original Message- From: Dinh Nguyen Sent: Monday, October 27, 2003 8:50 AM To: Tomcat Users List Subject: RE: Session affinity doesn't work Hi Klaus, The jvmRoute of the second tomcat instance is "tomcat2", I forgot to said that in my first email. About the tomcatId, I modified my settings as you said but now the load balancing no longer works. Only tomcat2 responses to my request. Thank you anyway. Anyone have another idea? Thanks. Dinh. PS: The attachments are my setting files for your reference. server1.xml is server.xml for tomcat1 and server2.xml is server.xml for tomcat2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session affinity vs sticky session
Filip, you are a man. Thank you very much. Dinh. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:52 PM To: Tomcat Users List Subject: Re: Session affinity vs sticky session correct - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:47 PM Subject: RE: Session affinity vs sticky session I got two answers from Filip and Ralph. Basing on what Filip said, can I think that no session replication in session affinity? Tks for yours. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:11 PM To: Tomcat Users List Subject: Re: Session affinity vs sticky session session affinity==sticky sessions, if you need session replication, try out http://cvs.apache.org/~fhanik/ Filip - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:03 PM Subject: Session affinity vs sticky session Hi all, I have to raise this question because it may confuse a lot of us and the right answer can clarify something very important: Is "session affinity" and "sticky session" the same in apache + jk2 + tomcat load balancing enviroment? As I know, the "sticky session" means that: if you have many instances of tomcat (eg: tomcat1 & tomcat2) and you start session on tomcat1, the subsequent requests will be forwarded to tomcat1 as long as tomcat1 running an up (you never reach tomcat2). It means that if tomcat1 now is down, then your subsequent request will be forwarded to tomcat2, with a different session (a new session created at tomcat1 for you). This is not very good because if your application responsing on tomcat1, then moved to tomcat2, session data will be lost, right? Now the "session affinity", means you will have the same session (Id) regardless of your first or subsequent requests served by tomcat1 or tomcat2. It means that you sesison will be duplicated on both tomcat1 and tomcat2. Sometimes you served by tomcat1, sometimes you served tomcat2, although none of them is down. Is that right? Now my next question: what kind of session management (sticky or affinity) supported by (apache2 + jk2 + tomcat4)? If anything above is wrong, please correct me. I appreciate that. Tks, Dinh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session affinity vs sticky session
correct - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:47 PM Subject: RE: Session affinity vs sticky session I got two answers from Filip and Ralph. Basing on what Filip said, can I think that no session replication in session affinity? Tks for yours. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:11 PM To: Tomcat Users List Subject: Re: Session affinity vs sticky session session affinity==sticky sessions, if you need session replication, try out http://cvs.apache.org/~fhanik/ Filip - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:03 PM Subject: Session affinity vs sticky session Hi all, I have to raise this question because it may confuse a lot of us and the right answer can clarify something very important: Is "session affinity" and "sticky session" the same in apache + jk2 + tomcat load balancing enviroment? As I know, the "sticky session" means that: if you have many instances of tomcat (eg: tomcat1 & tomcat2) and you start session on tomcat1, the subsequent requests will be forwarded to tomcat1 as long as tomcat1 running an up (you never reach tomcat2). It means that if tomcat1 now is down, then your subsequent request will be forwarded to tomcat2, with a different session (a new session created at tomcat1 for you). This is not very good because if your application responsing on tomcat1, then moved to tomcat2, session data will be lost, right? Now the "session affinity", means you will have the same session (Id) regardless of your first or subsequent requests served by tomcat1 or tomcat2. It means that you sesison will be duplicated on both tomcat1 and tomcat2. Sometimes you served by tomcat1, sometimes you served tomcat2, although none of them is down. Is that right? Now my next question: what kind of session management (sticky or affinity) supported by (apache2 + jk2 + tomcat4)? If anything above is wrong, please correct me. I appreciate that. Tks, Dinh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session affinity vs sticky session
I got two answers from Filip and Ralph. Basing on what Filip said, can I think that no session replication in session affinity? Tks for yours. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:11 PM To: Tomcat Users List Subject: Re: Session affinity vs sticky session session affinity==sticky sessions, if you need session replication, try out http://cvs.apache.org/~fhanik/ Filip - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:03 PM Subject: Session affinity vs sticky session Hi all, I have to raise this question because it may confuse a lot of us and the right answer can clarify something very important: Is "session affinity" and "sticky session" the same in apache + jk2 + tomcat load balancing enviroment? As I know, the "sticky session" means that: if you have many instances of tomcat (eg: tomcat1 & tomcat2) and you start session on tomcat1, the subsequent requests will be forwarded to tomcat1 as long as tomcat1 running an up (you never reach tomcat2). It means that if tomcat1 now is down, then your subsequent request will be forwarded to tomcat2, with a different session (a new session created at tomcat1 for you). This is not very good because if your application responsing on tomcat1, then moved to tomcat2, session data will be lost, right? Now the "session affinity", means you will have the same session (Id) regardless of your first or subsequent requests served by tomcat1 or tomcat2. It means that you sesison will be duplicated on both tomcat1 and tomcat2. Sometimes you served by tomcat1, sometimes you served tomcat2, although none of them is down. Is that right? Now my next question: what kind of session management (sticky or affinity) supported by (apache2 + jk2 + tomcat4)? If anything above is wrong, please correct me. I appreciate that. Tks, Dinh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session affinity vs sticky session
As I understand it, both terms are use for what you call 'session affinity'. This is what mod_jk supports. The term for what you call 'sticky session' is AFAIK session replication. This can also be used in tomcat: http://www.filip.net/tomcat/ > -Original Message- > From: Dinh Nguyen [mailto:[EMAIL PROTECTED] > Sent: Monday, October 27, 2003 8:04 AM > To: Tomcat Users List > Subject: Session affinity vs sticky session > > > Hi all, > I have to raise this question because it may confuse a lot of > us and the > right answer can clarify something very important: > Is "session affinity" and "sticky session" the same in apache + jk2 + > tomcat load balancing enviroment? > > As I know, the "sticky session" means that: if you have many instances > of tomcat (eg: tomcat1 & tomcat2) and you start session on > tomcat1, the > subsequent requests will be forwarded to tomcat1 as long as tomcat1 > running an up (you never reach tomcat2). It means that if > tomcat1 now is > down, then your subsequent request will be forwarded to > tomcat2, with a > different session (a new session created at tomcat1 for you). This is > not very good because if your application responsing on tomcat1, then > moved to tomcat2, session data will be lost, right? > > Now the "session affinity", means you will have the same session (Id) > regardless of your first or subsequent requests served by tomcat1 or > tomcat2. It means that you sesison will be duplicated on both tomcat1 > and tomcat2. Sometimes you served by tomcat1, sometimes you served > tomcat2, although none of them is down. Is that right? > > Now my next question: what kind of session management (sticky or > affinity) supported by (apache2 + jk2 + tomcat4)? > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session affinity vs sticky session
session affinity==sticky sessions, if you need session replication, try out http://cvs.apache.org/~fhanik/ Filip - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Sunday, October 26, 2003 11:03 PM Subject: Session affinity vs sticky session Hi all, I have to raise this question because it may confuse a lot of us and the right answer can clarify something very important: Is "session affinity" and "sticky session" the same in apache + jk2 + tomcat load balancing enviroment? As I know, the "sticky session" means that: if you have many instances of tomcat (eg: tomcat1 & tomcat2) and you start session on tomcat1, the subsequent requests will be forwarded to tomcat1 as long as tomcat1 running an up (you never reach tomcat2). It means that if tomcat1 now is down, then your subsequent request will be forwarded to tomcat2, with a different session (a new session created at tomcat1 for you). This is not very good because if your application responsing on tomcat1, then moved to tomcat2, session data will be lost, right? Now the "session affinity", means you will have the same session (Id) regardless of your first or subsequent requests served by tomcat1 or tomcat2. It means that you sesison will be duplicated on both tomcat1 and tomcat2. Sometimes you served by tomcat1, sometimes you served tomcat2, although none of them is down. Is that right? Now my next question: what kind of session management (sticky or affinity) supported by (apache2 + jk2 + tomcat4)? If anything above is wrong, please correct me. I appreciate that. Tks, Dinh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session affinity doesn't work
This is my workers2.properties. I attached it to my last mail but the mail server removed it. Sorry for that. == [logger] level=DEBUG [config:] #file=${serverRoot}/conf/workers2.properties #file=c:/Apache2/conf/workers2.properties file=conf/workers2.properties debug=0 debugEnv=0 [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers #file=${serverRoot}/logs/jk2.shm file=logs/jk2.shm size=100 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0 [lb:lb] info=Default load balancer. debug=0 # tomcat1 [channel.socket:localhost:11009] port=11009 host=localhost type=ajp13 lb_factor=100 #tomcatId=tomcat1 : make load balancing not work # tomcat2 [channel.socket:localhost:12009] port=12009 host=localhost type=ajp13 lb_factor=100 #tomcatId=tomcat2 : make load balancing not work # tomcat3 #[channel.socket:psdwdinhnguyen:13009] #port=13009 #host=psdwdinhnguyen #type=ajp13 #lb_factor=100 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. #group=status: [uri:/*.jsp] info=Extension mapping == -Original Message- From: Dinh Nguyen Sent: Monday, October 27, 2003 8:50 AM To: Tomcat Users List Subject: RE: Session affinity doesn't work Hi Klaus, The jvmRoute of the second tomcat instance is "tomcat2", I forgot to said that in my first email. About the tomcatId, I modified my settings as you said but now the load balancing no longer works. Only tomcat2 responses to my request. Thank you anyway. Anyone have another idea? Thanks. Dinh. PS: The attachments are my setting files for your reference. server1.xml is server.xml for tomcat1 and server2.xml is server.xml for tomcat2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session affinity doesn't work
Hi Klaus, The jvmRoute of the second tomcat instance is "tomcat2", I forgot to said that in my first email. About the tomcatId, I modified my settings as you said but now the load balancing no longer works. Only tomcat2 responses to my request. Thank you anyway. Anyone have another idea? Thanks. Dinh. PS: The attachments are my setting files for your reference. server1.xml is server.xml for tomcat1 and server2.xml is server.xml for tomcat2 factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml usernamesa password driverClassName org.hsql.jdbcDriver url jdbc:HypersonicSQL:database mail.smtp.host localhost factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml usernamesa password driverClassName org.hsql.jdbcDriver url jdbc:HypersonicSQL:database mail.smtp.host localhost - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session affinity doesn't work
add tomcatId to the channles # tomcat1 [channel.socket:localhost:11009] port=11009 host=localhost type=ajp13 lb_factor=100 tomcatId=tomcat1 # tomcat2 [channel.socket:localhost:12009] port=12009 host=localhost type=ajp13 lb_factor=100 tomcatId=tomcat2 and modify jvmRoute for tomcat2 to Klaus - Original Message - From: "Dinh Nguyen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 25, 2003 7:00 AM Subject: Session affinity doesn't work Hi all, I have downloaded these following packages and installed them on my machine (Win 2K): Apache 2.0.47 Tomcat 2.0.47 Jk2_mod connector 2.0.43. I have 2 instances of tomcat (tomcat1, tomcat2 on the same host) on my machine on a load balancing environment. The load balancing works well with one exception: the session affinity doesn't work as expected. Everytime I refresh my browser, it gives me a different session id. If anyone experimented this problem, please help me. These are my settings and modifications to apache and tomcat. Apache httpd.conf == LoadModule jk2_module modules/mod_jk2.dll == Apache workers2.properties (entire content) == [logger] level=DEBUG [config:] #file=${serverRoot}/conf/workers2.properties #file=c:/Apache2/conf/workers2.properties file=conf/workers2.properties debug=0 debugEnv=0 [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers #file=${serverRoot}/logs/jk2.shm file=logs/jk2.shm size=100 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0 [lb:lb] info=Default load balancer. debug=0 # tomcat1 [channel.socket:localhost:11009] port=11009 host=localhost type=ajp13 lb_factor=100 # tomcat2 [channel.socket:localhost:12009] port=12009 host=localhost type=ajp13 lb_factor=100 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. #group=status: [uri:/*.jsp] info=Extension mapping == Tomcat1 server.xml == 1. Comment out Coyote HTTP/1.1 Connector at port 8080 2. Change to 3. Change to (notice: I DID rename the misspelling from jmvRoute to jvmRoute in the orginal release) 4. Change Coyote/JK2 AJP 1.3 Connector to listen at 11009 5. No change for jk2.properties == Tomcat2 server.xml == The same with Tomcat1, but with different port numbers (12005 for server, 12009 for Coyote/JK2 AJP 1.3 Connector) == At the ROOT directory of each tomcat instance, I create a jsp file with a single command "request.getSession().getId()" Then I start tomcat1, tomcat2, apache (in order). Everything is OK. No error reported on the screen. The only bad thing is that with every request, this page returns a different session id (they are suffixed with .tomcat1 and .tomcat2), if the session affinity works correctly, they must be the same, right? Is there anything wrong with my configuration? If anyone have solution, please share it to me. I appreciate it. Dinh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Affinity
>He said he did, see above. >-Dave He said he did, but he didn't LOL :) Filip - Original Message - From: "David Rees" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 12:44 PM Subject: Re: Session Affinity Filip Hanik said: > did you set up jvmRoute in server.xml ? > > - Original Message - > From: "Ho, Raymond" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, September 26, 2003 11:57 AM > Subject: Session Affinity > > My configuration is Solaris 2.9, Apache 2.0.47, Tomcat 4.1.27 and JK2 > 2.0.2. For each tomcat instance, I have modified server.xml to have an > unique jvmRoute; > "tn1" for one server and "tn2" for the other. These match the tomcatId in > the workers2.properties file. He said he did, see above. -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session Affinity
Yes I did. After your email I checked again. But this time, I found the problem. The jvmRoute was misspelled; it had "jmvRoute". This is misspelled in the original server.xml file. I corrected the spelling and it works fine now. Thanks for your help. Ray -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:02 PM To: Tomcat Users List Subject: Re: Session Affinity did you set up jvmRoute in server.xml ? Filip - Original Message - From: "Ho, Raymond" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 11:57 AM Subject: Session Affinity Hi, I am trying to load balance between 2 Tomcat servers. But I cannot get "session affinity" to work. The first time I get a page from the browser, I would receive a page from one server. Then when I refresh (reload from browser) the page, I would get a page from the other tomcat server. I have checked the session id's from the 2 pages and they are different. If I understand correctly, with session affinity, when I reload a page shouldn't I get the page from the same server with the same session? My configuration is Solaris 2.9, Apache 2.0.47, Tomcat 4.1.27 and JK2 2.0.2. For each tomcat instance, I have modified server.xml to have an unique jvmRoute; "tn1" for one server and "tn2" for the other. These match the tomcatId in the workers2.properties file. The workers2.properties is # only at beginnin. In production uncomment it out [logger] level=DEBUG [config:] file=${serverRoot}/workers2.properties debug=0 debugEnv=0 [shm:] file=${serverRoot}/logs/shm.file size=1048576 debug=0 disabled=0 [lb:lb] info=Default load balancer. debug=0 # Example socket channel, override port and host. [channel.socket:neptune:8009] info=Ajp13 forwarding over socket tomcatId=tn1 lb_factor=1 debug=0 [channel.socket:neptune:8109] info=Ajp13 forwarding over socket tomcatId=tn2 lb_factor=1 debug=0 [status:] info=Status worker, display runtime informations # Uri mapping [uri:/*] debug=0 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: Is there something that I have missed or misunderstood? Any help would be appreciated. Regards, Ray IMPORTANT NOTICE: The information in this email (and any attachments hereto) is confidential and may be protected by legal privileges and work product immunities. If you are not the intended recipient, you must not use or disseminate the information. Receipt by anyone other than the intended recipient is not a waiver of any attorney-client or work product privilege. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Transatlantic Reinsurance Company or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] IMPORTANT NOTICE: The information in this email (and any attachments hereto) is confidential and may be protected by legal privileges and work product immunities. If you are not the intended recipient, you must not use or disseminate the information. Receipt by anyone other than the intended recipient is not a waiver of any attorney-client or work product privilege. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Transatlantic Reinsurance Company or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Affinity
Filip Hanik said: > did you set up jvmRoute in server.xml ? > > - Original Message - > From: "Ho, Raymond" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, September 26, 2003 11:57 AM > Subject: Session Affinity > > My configuration is Solaris 2.9, Apache 2.0.47, Tomcat 4.1.27 and JK2 > 2.0.2. For each tomcat instance, I have modified server.xml to have an > unique jvmRoute; > "tn1" for one server and "tn2" for the other. These match the tomcatId in > the workers2.properties file. He said he did, see above. -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Affinity
did you set up jvmRoute in server.xml ? Filip - Original Message - From: "Ho, Raymond" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 11:57 AM Subject: Session Affinity Hi, I am trying to load balance between 2 Tomcat servers. But I cannot get "session affinity" to work. The first time I get a page from the browser, I would receive a page from one server. Then when I refresh (reload from browser) the page, I would get a page from the other tomcat server. I have checked the session id's from the 2 pages and they are different. If I understand correctly, with session affinity, when I reload a page shouldn't I get the page from the same server with the same session? My configuration is Solaris 2.9, Apache 2.0.47, Tomcat 4.1.27 and JK2 2.0.2. For each tomcat instance, I have modified server.xml to have an unique jvmRoute; "tn1" for one server and "tn2" for the other. These match the tomcatId in the workers2.properties file. The workers2.properties is # only at beginnin. In production uncomment it out [logger] level=DEBUG [config:] file=${serverRoot}/workers2.properties debug=0 debugEnv=0 [shm:] file=${serverRoot}/logs/shm.file size=1048576 debug=0 disabled=0 [lb:lb] info=Default load balancer. debug=0 # Example socket channel, override port and host. [channel.socket:neptune:8009] info=Ajp13 forwarding over socket tomcatId=tn1 lb_factor=1 debug=0 [channel.socket:neptune:8109] info=Ajp13 forwarding over socket tomcatId=tn2 lb_factor=1 debug=0 [status:] info=Status worker, display runtime informations # Uri mapping [uri:/*] debug=0 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: Is there something that I have missed or misunderstood? Any help would be appreciated. Regards, Ray IMPORTANT NOTICE: The information in this email (and any attachments hereto) is confidential and may be protected by legal privileges and work product immunities. If you are not the intended recipient, you must not use or disseminate the information. Receipt by anyone other than the intended recipient is not a waiver of any attorney-client or work product privilege. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Transatlantic Reinsurance Company or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]