-
FEATURED COMPONENTS
First time here? Check out the FAQ!
ZK: 3.6.2
Tomcat: 5.5.27
Apache: 2.2.3 with mod_jk 1.2.28
Hi Everyone,
I currently have a ZK application running in a tomcat cluster using apache as a sticky sessions load balancer. The setup works well except for one very anoying thing: I have to hit the browser "reload" button for the failover to work properly.
Here is my understanding of the problem:
When I load/reload a page, the browser connects to the load balancer then is redirected to one of my two servers. From there, as long as I stay on the same page and only play with the components of this page, the client and server are directly connected via the zkau and no page reloading is done.
When I shutdown the tomcat instance where my session is currently running, which shuts down the zkau at the same time, my webapp stops working for as long as I do not click the refresh button. As soon as I refresh, the load balancer sends the client to the failover server and the session is properly handled by this server, all the attributes are there and everything works perfectly.
According to this behavior, I think that I need to be able to detect a lost of connectivity from the client to the server and when it happens, trigger a browser page refresh on the client.
Does anyone have any input on this? Any hint on how I could detect the lost of connectivity? Am I completely out of track?
Thanks a lot,
Sylvain
Hmmmmmmmm, i'm not the expert of this, but i mean this is working a little bit others others.
1. You work with the http protocol. HTTP is a stateless protocol.
Equal if you use a cluster, a load balancer or something else. There's only Request and Response.
2. Clustering is a method for higher scaling an application and with a load balancer mechanism on top this can be
in a known manner. Further clustering can made the application as a whole system more savety if one of the server crashes.
3. The system by clustering (tomcat clustering) is that all tomcat's became notice from the other tomcats. You can
see that in the log by starting such a tomcat worker.
If on of the tomcats crashes. you can see that the other tomcats notices that. I don't know if the tomcats mutually communicate
or that the apache holds a direct connection or do a steady ping on the workers.
So you cannot give back a notice that that the tomcat is away (HTTP). Only the apache can notice that because he knows the workers.
Or you must write self a little program that pings the tomcats.
But i mean that there are codes for that in the net.
best
Stephan
Hello Stephan,
Thanks for your input! I was kinda thinking that the connection between the client and zkau was stateful, but as its name states it, zk "A" u :P
I think I'll go on with a little ping program as you suggest, it should do the trick!
thanks,
Sylvain
@stremblay
Could you please advise how you solved this. Honestly, I think that this is something that should be built into ZK so that you can keep a session active in the following cases:
1) So that it remains active as long as the client window is open
2) So that it remains active even if the server fails over to a hot backup or a node in a cluster
We have a similar need. It would be great to have a solution and pass it off to the ZKOSS/Potix team to include in a point release of ZK 5.
Thank you,
Dave
@Sylvain any luck on this?
@PeterKuo I added a feature request [3078911] hope it gets noticed and developed, if I can help you on the development of this just let me know and point me to the right direction :)
b.t.w. taking terry's idea the ping thing would be something like:
On my zk page I should have a js that pings the server and when the pinger doesn't detects activity it should fire a reload? or any other idea?
Asked: 2010-01-22 12:40:36 +0800
Seen: 986 times
Last updated: Sep 30 '10