You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Kirby <lp...@harding.edu> on 2014/09/15 16:46:53 UTC
Possibly Losing Session when Clustered
I'm running CentOS 7 and I've tried this on Tomcat 7.0.55 and 8.0.12, both
with the same results. This also works perfectly fine in a production
environment with 7.0.55.
I'm running CAS and without clustering Tomcat, the login page works
perfectly. When I attempt to cluster Tomcat, I have to hit the login page
twice. The first time I log in, it simply clears the fields and goes back
to the login page. The second time I log in it works. I'm posting to this
list because I'm pretty sure it's something I'm missing with Tomcat config,
not CAS the application as it works just fine in production.
I have tried this with a fully configured cluster section in server.xml and
with just uncommenting the default cluster tag. It happens either way. If
I don't have a cluster section at all in server.xml, CAS works as it should.
The logs aren't showing any errors or anything that seems useful to this
problem. I have run out of things to try and it works fine on 3 out of 4
of the Tomcat servers. I have gone so far as to completely wipe out this
one server and build it back from scratch. Never-the-less, the problem
remains.
I've run out of things to try and would appreciate any suggestions anyone
may have.
Thanks,
Peter
--
Peter Kirby
System and Database Administrator @ Harding University
Re: Possibly Losing Session when Clustered
Posted by Hassan Schroeder <ha...@gmail.com>.
On Tue, Sep 16, 2014 at 10:06 AM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> On 9/16/14 12:02 PM, Peter Kirby wrote:
>> Thanks all for your suggestions. Unfortunately, I had to take the
>> quick way out. I just cloned the other working test server to the
>> server in question. All is working now. I'm not sure what I
>> messed up when setting up this server (3 times), but this will have
>> to do for now as I've already spent nearly 2 weeks on trying to fix
>> this.
> It might just come down to inspecting ones configuration and ensuring
> that everything is just so.
A shining example of why tools like Chef and Puppet exist :-)
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Possibly Losing Session when Clustered
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Peter,
On 9/16/14 12:02 PM, Peter Kirby wrote:
> Thanks all for your suggestions. Unfortunately, I had to take the
> quick way out. I just cloned the other working test server to the
> server in question. All is working now. I'm not sure what I
> messed up when setting up this server (3 times), but this will have
> to do for now as I've already spent nearly 2 weeks on trying to fix
> this.
>
> I apologize this isn't very helpful to anyone that might have a
> similar issue in the future, but I simply do not have time to
> continue the investigation.
The good news is that it's working, and the answer was probably that
one or more of the nodes was not configured exactly correctly. Without
any context other than "it didn't work", it's not likely that
determining your exact problem would have really helped anyone else.
It might just come down to inspecting ones configuration and ensuring
that everything is just so.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJUGG4SAAoJEBzwKT+lPKRYTnAP/1+iAvQkctFP5MRZrBi21Vr5
2cMVaCLjL9IVvv7Nw/xaBU0/yU55r/Y6lULLUWXqWyg7pBm2RB0wsUvgjNuk5NGr
WMcQbnlQH8r7WMQbd0sCe9nS4PS95kuA/MO8E9OmgeiHEeXW9+TbDEZR97dpPauf
ko06T9iHfQFRZ3+0lnZTYPEUc/OwI3paeazSylkb+vn+cNPiqjsSVKSHLZ0gPfLT
sOpLEtXJW+w6GRTvOTJjjXbUHMUYI5Uy5gwBSMtJK28329Dr+Ac5K1wqR2E5805a
MQRc5WQkNwX4rN3k1eitgwLKOlK8Vm8CuqhTa93wyDY5Ryc2XaZFcExDYnbymgHV
BUDWWRpFUcL5/wDmiVSH1G4jWSUz/OmcN9fhXESdVQZLfRxvIei7nX0ViPY/8Zt2
zUdIc1Yq7RFLymu0me0McVPZ8vkVlOZ5htWHiVdcjBgH/svDYyl+KbvbiCXMR2x3
XA2xhNwDeARMJsJxpi4fAlrxCmvBwmeuna+RK4PeKUInWoj4wxCvOdfRUb3CH0J4
Ez2dB6o/bd5o2g76zdVHdU24zcXEm/KhJtrBiaufFC1WudcH309hEKP4cWYvotKE
Iwk+3c+/Bcfkhypi3bXdXQmYzcTc8CU2jCXYhIUomovbp7kcnsckM88xj60p3INR
WB97xoniA8KqKhWGb5fm
=EOEk
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Possibly Losing Session when Clustered
Posted by Peter Kirby <lp...@harding.edu>.
Thanks all for your suggestions. Unfortunately, I had to take the quick
way out. I just cloned the other working test server to the server in
question. All is working now. I'm not sure what I messed up when setting
up this server (3 times), but this will have to do for now as I've already
spent nearly 2 weeks on trying to fix this.
I apologize this isn't very helpful to anyone that might have a similar
issue in the future, but I simply do not have time to continue the
investigation.
Peter
--
Peter Kirby
System and Database Administrator @ Harding University
Re: Possibly Losing Session when Clustered
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Peter,
On 9/15/14 5:00 PM, Peter Kirby wrote:
> On Mon, Sep 15, 2014 at 3:44 PM, Daniel Mikusa <dm...@pivotal.io>
> wrote:
>
>> On Mon, Sep 15, 2014 at 3:38 PM, Peter Kirby
>> <lp...@harding.edu> wrote:
>>
>>> On Mon, Sep 15, 2014 at 2:01 PM, Peter Kirby
>>> <lp...@harding.edu>
>> wrote:
>>>
>>>> On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa
>>>> <dm...@pivotal.io> wrote:
>>>>
>>>>> Have you tried deploying a simple test application to
>>>>> confirm that clustering is working properly?
>>>>>
>>>>
>>>> I just setup a small session counter and it appears to not be
>>>> shared across the different servers correctly. Thanks for
>>>> the suggestion.
>> I'll
>>>> keep working on that and reply again if, after fixing session
>>>> info, I
>>> still
>>>> have the same problem.
>>>
>>>
>>> Well, if I had known it would be that fast of a fix, I would
>>> not have replied to the email. I had accidentally left one
>>> server on Tomcat
>> 8.0.12
>>> and the other on Tomcat 7.0.55. After they were both on the
>>> same
>> version,
>>> the session information is shared perfectly, which is what I
>>> expected.
>>>
>>> However, the original problem remains. I discovered I don't
>>> even have to submit the page to fix the "broken" session. I
>>> can go to the web page
>> and
>>> after it loads hit refresh. That takes care of the first page
>>> that just resets. After the refresh button I can log in as
>>> normal.
>>>
>>> If I do actually submit the first time, the jessionid variable
>>> shows up
>> in
>>> the URL when the page comes up the second time in case that's
>>> helpful.
>>>
>>> Thanks for your time.
>>>
>>
>> It might be helpful to look at the access logs on your Tomcat
>> instances and also whatever is in front of them. This might
>> start to give an account of what happens after the request leaves
>> your browser.
>>
>> Also might be helpful to increase the log level for clustering.
>> I think the following should be helpful.
>>
>> org.apache.catalina.ha.level = FINEST
>> org.apache.catalina.tribes.level = CONFIG
>>
>> Note, you'll probably also have to set the log level of your
>> handler to FINEST, otherwise that'll filter out these messages.
>>
>> 1catalina.org.apache.juli.FileHandler.level = FINEST
>>
>> or set ".level" for whatever handler the messages are being sent
>> to.
>>
>> Dan
>>
>
> Thanks, I'll play with that and see if I see anything.
>
> @Felix - The clustering is just done with DNS. I'm running Tomcat
> by itself, not behind Apache. I do not have a jvmRoute value set
> either in test nor production and production works great.
So, replicated sessions (duh, clustering) and no formal load-balancing
(meaning that each request is randomly sent to a Tomcat backend server)?
Are you using cookie-based session tracking? Does the test client
support clients and have them enabled? I've seen things like this
happen when testing with cookies disabled and forgetting to run the
/j_security_check URL through request.encodeURL(), so your session id
gets dropped when you try to log in.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJUGFZIAAoJEBzwKT+lPKRYAMQP/3LqMLJuePJfdPwp1ZGKU2XA
poi8bY2u1yCJRJPpRUqEU6zNP8mF9wfkucOlkquMBkyJl71K22jF1qXdDFq7iP0X
ghdnUlVbsHpMmHAsZjkPiiSZONuKw17jT77R0Y4iGBW3rY19XQ9ZDM2Vy5bJyWTA
t7ZeKlhr017EwpuEl87YgTcSO5a0fTlAy9Qk0UE5GkGIhe4XTOfkKne5QUUXY8vV
npuC1U5XyzxyHS3jzKkCqoPFyMIKFexBepOP+DJf2yqhcsGQPuDVhji6Y5uy1WkC
unRwBcYK3qj58sx1mQ5nZ5baOg7kFS4JUKjuKaoF/9zYTBEcVxJBpehlD3pz6qFr
4H2GnhUUJ/VCPsqy3Rn/nRzA6kieq4pKoCuRO3dc7K8n4I0MNIM5gia2JhNm0YQW
XYornMKwJMRlXLPFab0WGFKwUwa8nQdUhJjvKm0jBCSlEfhxhDS4WdRIVAtBBu71
dcMJ011Mvh4rQ8j65meEMrNKfAJLGPzuYqdiMjnVXNT9phFV09OG9vYNXJORIL88
JpwF4TkEo4hL2WjV/XodEnoa3tRWMtpJ2jIaV0Zu28SYa+CPPb0nAk/y9daWNWBx
BqgqS5V1S+1XRRTy09n7f8zoGv0+FseLe629K1sUcoCH+dy0jt6MPQeUYdiRy4Yg
GnSLEJn10rf84rQkr2VO
=TISm
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Possibly Losing Session when Clustered
Posted by Peter Kirby <lp...@harding.edu>.
On Mon, Sep 15, 2014 at 3:44 PM, Daniel Mikusa <dm...@pivotal.io> wrote:
> On Mon, Sep 15, 2014 at 3:38 PM, Peter Kirby <lp...@harding.edu> wrote:
>
> > On Mon, Sep 15, 2014 at 2:01 PM, Peter Kirby <lp...@harding.edu>
> wrote:
> >
> > > On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa <dm...@pivotal.io>
> > > wrote:
> > >
> > >> Have you tried deploying a simple test application to confirm that
> > >> clustering is working properly?
> > >>
> > >
> > > I just setup a small session counter and it appears to not be shared
> > > across the different servers correctly. Thanks for the suggestion.
> I'll
> > > keep working on that and reply again if, after fixing session info, I
> > still
> > > have the same problem.
> >
> >
> > Well, if I had known it would be that fast of a fix, I would not have
> > replied to the email. I had accidentally left one server on Tomcat
> 8.0.12
> > and the other on Tomcat 7.0.55. After they were both on the same
> version,
> > the session information is shared perfectly, which is what I expected.
> >
> > However, the original problem remains. I discovered I don't even have to
> > submit the page to fix the "broken" session. I can go to the web page
> and
> > after it loads hit refresh. That takes care of the first page that just
> > resets. After the refresh button I can log in as normal.
> >
> > If I do actually submit the first time, the jessionid variable shows up
> in
> > the URL when the page comes up the second time in case that's helpful.
> >
> > Thanks for your time.
> >
>
> It might be helpful to look at the access logs on your Tomcat instances and
> also whatever is in front of them. This might start to give an account of
> what happens after the request leaves your browser.
>
> Also might be helpful to increase the log level for clustering. I think
> the following should be helpful.
>
> org.apache.catalina.ha.level = FINEST
> org.apache.catalina.tribes.level = CONFIG
>
> Note, you'll probably also have to set the log level of your handler to
> FINEST, otherwise that'll filter out these messages.
>
> 1catalina.org.apache.juli.FileHandler.level = FINEST
>
> or set ".level" for whatever handler the messages are being sent to.
>
> Dan
>
Thanks, I'll play with that and see if I see anything.
@Felix - The clustering is just done with DNS. I'm running Tomcat by
itself, not behind Apache. I do not have a jvmRoute value set either in
test nor production and production works great.
Re: Possibly Losing Session when Clustered
Posted by Daniel Mikusa <dm...@pivotal.io>.
On Mon, Sep 15, 2014 at 3:38 PM, Peter Kirby <lp...@harding.edu> wrote:
> On Mon, Sep 15, 2014 at 2:01 PM, Peter Kirby <lp...@harding.edu> wrote:
>
> > On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa <dm...@pivotal.io>
> > wrote:
> >
> >> Have you tried deploying a simple test application to confirm that
> >> clustering is working properly?
> >>
> >
> > I just setup a small session counter and it appears to not be shared
> > across the different servers correctly. Thanks for the suggestion. I'll
> > keep working on that and reply again if, after fixing session info, I
> still
> > have the same problem.
>
>
> Well, if I had known it would be that fast of a fix, I would not have
> replied to the email. I had accidentally left one server on Tomcat 8.0.12
> and the other on Tomcat 7.0.55. After they were both on the same version,
> the session information is shared perfectly, which is what I expected.
>
> However, the original problem remains. I discovered I don't even have to
> submit the page to fix the "broken" session. I can go to the web page and
> after it loads hit refresh. That takes care of the first page that just
> resets. After the refresh button I can log in as normal.
>
> If I do actually submit the first time, the jessionid variable shows up in
> the URL when the page comes up the second time in case that's helpful.
>
> Thanks for your time.
>
It might be helpful to look at the access logs on your Tomcat instances and
also whatever is in front of them. This might start to give an account of
what happens after the request leaves your browser.
Also might be helpful to increase the log level for clustering. I think
the following should be helpful.
org.apache.catalina.ha.level = FINEST
org.apache.catalina.tribes.level = CONFIG
Note, you'll probably also have to set the log level of your handler to
FINEST, otherwise that'll filter out these messages.
1catalina.org.apache.juli.FileHandler.level = FINEST
or set ".level" for whatever handler the messages are being sent to.
Dan
Re: Possibly Losing Session when Clustered
Posted by Felix Schumacher <fe...@internetallee.de>.
On 15. September 2014 21:38:31 MESZ, Peter Kirby <lp...@harding.edu> wrote:
>On Mon, Sep 15, 2014 at 2:01 PM, Peter Kirby <lp...@harding.edu>
>wrote:
>
>> On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa <dm...@pivotal.io>
>> wrote:
>>
>>> Have you tried deploying a simple test application to confirm that
>>> clustering is working properly?
>>>
>>
>> I just setup a small session counter and it appears to not be shared
>> across the different servers correctly. Thanks for the suggestion.
>I'll
>> keep working on that and reply again if, after fixing session info, I
>still
>> have the same problem.
>
>
>Well, if I had known it would be that fast of a fix, I would not have
>replied to the email. I had accidentally left one server on Tomcat
>8.0.12
>and the other on Tomcat 7.0.55. After they were both on the same
>version,
>the session information is shared perfectly, which is what I expected.
>
>However, the original problem remains. I discovered I don't even have
>to
>submit the page to fix the "broken" session. I can go to the web page
>and
>after it loads hit refresh. That takes care of the first page that
>just
>resets. After the refresh button I can log in as normal.
>
>If I do actually submit the first time, the jessionid variable shows up
>in
>the URL when the page comes up the second time in case that's helpful.
What is your setup in front of the tomcats and have you filled in the jvmroute attribute in server.xml?
Regards
Felix
>
>Thanks for your time.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Possibly Losing Session when Clustered
Posted by Peter Kirby <lp...@harding.edu>.
On Mon, Sep 15, 2014 at 2:01 PM, Peter Kirby <lp...@harding.edu> wrote:
> On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa <dm...@pivotal.io>
> wrote:
>
>> Have you tried deploying a simple test application to confirm that
>> clustering is working properly?
>>
>
> I just setup a small session counter and it appears to not be shared
> across the different servers correctly. Thanks for the suggestion. I'll
> keep working on that and reply again if, after fixing session info, I still
> have the same problem.
Well, if I had known it would be that fast of a fix, I would not have
replied to the email. I had accidentally left one server on Tomcat 8.0.12
and the other on Tomcat 7.0.55. After they were both on the same version,
the session information is shared perfectly, which is what I expected.
However, the original problem remains. I discovered I don't even have to
submit the page to fix the "broken" session. I can go to the web page and
after it loads hit refresh. That takes care of the first page that just
resets. After the refresh button I can log in as normal.
If I do actually submit the first time, the jessionid variable shows up in
the URL when the page comes up the second time in case that's helpful.
Thanks for your time.
Re: Possibly Losing Session when Clustered
Posted by Peter Kirby <lp...@harding.edu>.
On Mon, Sep 15, 2014 at 10:26 AM, Daniel Mikusa <dm...@pivotal.io> wrote:
> Have you tried deploying a simple test application to confirm that
> clustering is working properly?
>
I just setup a small session counter and it appears to not be shared across
the different servers correctly. Thanks for the suggestion. I'll keep
working on that and reply again if, after fixing session info, I still have
the same problem.
Peter
--
Peter Kirby
System and Database Administrator @ Harding University
Re: Possibly Losing Session when Clustered
Posted by Daniel Mikusa <dm...@pivotal.io>.
On Mon, Sep 15, 2014 at 10:46 AM, Peter Kirby <lp...@harding.edu> wrote:
> I'm running CentOS 7 and I've tried this on Tomcat 7.0.55 and 8.0.12, both
> with the same results. This also works perfectly fine in a production
> environment with 7.0.55.
>
> I'm running CAS and without clustering Tomcat, the login page works
> perfectly. When I attempt to cluster Tomcat, I have to hit the login page
> twice. The first time I log in, it simply clears the fields and goes back
> to the login page. The second time I log in it works. I'm posting to this
> list because I'm pretty sure it's something I'm missing with Tomcat config,
> not CAS the application as it works just fine in production.
>
> I have tried this with a fully configured cluster section in server.xml and
> with just uncommenting the default cluster tag. It happens either way. If
> I don't have a cluster section at all in server.xml, CAS works as it
> should.
>
> The logs aren't showing any errors or anything that seems useful to this
> problem. I have run out of things to try and it works fine on 3 out of 4
> of the Tomcat servers. I have gone so far as to completely wipe out this
> one server and build it back from scratch. Never-the-less, the problem
> remains.
>
> I've run out of things to try and would appreciate any suggestions anyone
> may have.
>
> Thanks,
> Peter
>
> --
> Peter Kirby
> System and Database Administrator @ Harding University
>
Peter,
Have you tried deploying a simple test application to confirm that
clustering is working properly? If you deploy an app that has something
like a simple session based counter in it, you can use that to confirm that
each node in the cluster is setup correctly and that session data is being
replicated.
Dan