PDA

View Full Version : clusters and load balancing


thorr09
06-03-2010, 07:55 AM
Hi!
I have a question related to clusters and load balancing. What possibilities exist to remove a server from a cluster? Only stopping the server? Because in this situation my web application initializes some stopping and log-out operations (removing data from session) and when the loadbalancer switches to another active server the status of this won't be the desired one.

Thanks

emil
06-03-2010, 05:21 PM
Hi,

Yes, stopping the server is the main way. There's also a beta dynamic server functionality, but it doesn't sound like that would solve your problem. Are you talking about a programmatic notification that the webapp is stopped? If so, a servlet listener would do the trick. I'm not quite sure what you're trying to achieve, but if the listener doesn't do it, please let me know.

Thanks,
Emil

thorr09
06-03-2010, 07:06 PM
Hi,

Thank you for the reply! The scenario I am having is the following: I have two servers running the same web application. A user logs in on one server and user data is stored as session data. In case I stop this server my applications servlet listener removes (contextDestroyed) these data from the session. The loadbalancer notices that the current server is down and switches to the other active server. The problem is that all the session data is lost and the user needs to log in once more. What I would like to know is, if it exists some possibility to remove a server from the clustered environment so that it does not initiate any operations that it would normaly do when it is stoppped.

Thanks,

thorr09
06-07-2010, 02:17 PM
Hi!
I am trying to add a dynamic-server to a cluster, but keep getting this error:

java.lang.IllegalStateException: HmuxClient[ClientSocketFactory[->triad-a,192.168.0.143:6801]] can't send a query because the link is closed.
at com.caucho.bam.SimpleActorClient.queryGet(SimpleAc torClient.java:180)
at com.caucho.server.resin.ProResin.loadDynamicServer (ProResin.java:185)
at com.caucho.server.resin.Resin.createServer(Resin.j ava:1001)
at com.caucho.server.resin.Resin.start(Resin.java:108 8)
at com.caucho.server.resin.Resin.initMain(Resin.java: 1639)
at com.caucho.server.resin.Resin.main(Resin.java:1871 )

What does this mean? I kind of went through all the steps the documentation described.
Thanks

emil
06-08-2010, 11:39 PM
Hi,

To answer your earlier question if you really want to shutdown a server without it going through the actual shutdown procedure, just kill the process. It definitely won't get the shutdown signal in that case. It's a bit extreme though and might be a sign that you want to rearchitect that part of your application.

Using dynamic servers won't help the situation because they still go through normal shutdown as well.

Emil