Re: Problem with Helma Swarm
"Maksim Lin for technical support mailling lists" <[email protected]> Tue, 18 Mar 2008 09:42:07 +1100
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Philipp, I think the problem is that even though you have: worker.loadbalancer.sticky_session=True its NOT actually doing sticky sessions and is in fact using round-robin balancing (ie each request can potentially go to any worker node). I think its not working because the load balancer does not know which session belongs to which "worker node". reading (towards the end) of this blog: http://blogs.encodo.ch/news/view_article.php?id=18 seems to suggest that you need to tell the load balancer how to identify which "node" each session belongs to using "jvmRoute" name appended to the session id. The docs for the mod_jk connector are a bit vague and of course specific to Tomcat not Helma: http://tomcat.apache.org/connectors-doc/reference/workers.html but it sounds like you will need to use a "JSESSIONID" (I think it can be a cookie or a url param) and then specify in it which node that session belongs to. BUT Helma uses a cookie called "HopSession" to manage its sessions so if you wanted to use helmas session cookie, you will need to change the name of Helma uses (search for "sessionCookieName" in helma.servlet.AbstractServletClient java src file) AND you will also need to modify the code the generates the "value" of this cookie to include the jvmRoute name of the helma node that session is orginating from. So actually the "best & easiest" solution might be better to just set a seperate "JSESSIONID" cookie in your own apps code (ie. when a user first logins in). hope that helps and please let us know if you get it working as this is a setup I would like to use in the future too. Maks. > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Franz Philipp Moser > Sent: Monday, 17 March 2008 21:56 > To: Helma User Mailing List > Subject: [Helma-user] Problem with Helma Swarm > > Hi list, > > I expirienced a very strange problem when using helma with > helma-swarm. > > First to my setup: > > * web1 => app-server, mod_jk Loadbalancer (all requests > come in here), mysql-server > * web2 => app-server, no apache > * web3 => app-server, no apache > > Helma: > {{{ > # cat /var/log/helma/helma-out.log > Adding to classpath: > /home/helma/lib/ext/mysql-connector-java-5.0.5-bin.jar > Adding to classpath: /home/helma/lib/ext/jgroups-all.jar > Adding to classpath: /home/helma/lib/ext/xercesImpl-2.8.0.jar > Adding to classpath: /home/helma/lib/ext/concurrent.jar > Adding to classpath: /home/helma/lib/ext/helmaswarm-1.0-b.jar > Starting Helma 1.6.0 (July 19 2007) on Java 1.6.0 }}} > > here is my workers.properties: > {{{ > worker.list=loadbalancer > > worker.loadbalancer.type=lb > worker.loadbalancer.balance_workers=helma-web1,helma-web2,helma-web3 > worker.loadbalancer.sticky_session=True > worker.loadbalancer.sticky_session_force=False > worker.loadbalancer.method=Request > > worker.helma-web1.port=8009 > worker.helma-web1.host=localhost > worker.helma-web1.type=ajp13 > > worker.helma-web2.port=8009 > worker.helma-web2.host=XX.XX.XX.XX > worker.helma-web2.type=ajp13 > > worker.helma-web3.port=8009 > worker.helma-web3.host=XX.XX.XX.XX > worker.helma-web3.type=ajp13 > }}} > > the app.properties look like this: > {{{ > cluster = true > clusterWorkerID = helma-webX > cacheImpl = helma.swarm.SwarmCache > sessionManagerImpl = helma.swarm.SwarmSessionManager > idGeneratorImpl = helma.swarm.SwarmIDGenerator > swarm.name = MySwarm > swarm.jgroups.stack = tcp > swarm.conf = swarm.conf > }}} > > everything works fine when not using flash ;) We have a neat > little Flashuploader to upload pictures, videos, ... > > Flash doesn't use any cookies (even the browser cookies are > ignored) and because of that files are sent randomly to web1, > web2, web3. > > The problem: > > I expirienced that the collections of the different servers, > sometimes need up to 5 seconds until the collections have the > same Items. So some "time critical things" don't work. For > example in place editing after upload. Also session.data is > not up to date. > > Does anybody know why the servers needs so much time to > communicate? Or can somebody tell me how this can be > optimized, because I can not trust any collection nor session.data? > > Don't use flash is not an option ;) > > looking forward to your answers or suggestions, cu Philipp > _______________________________________________ > Helma-user mailing list > [email protected] > http://helma.org/mailman/listinfo/helma-user >