You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anupam Beri <an...@gmail.com> on 2008/11/12 09:55:34 UTC

Session replication for JPetStore application in tomcat 6

Hello All ,
                       I am a newbie to the Tomcat and Tomcat clustering
environment .I was just going through some posts on this forum for reference
.
I wish to deploy the classic JPetStore application which comes with the
Spring framework in the clustered environment involving 2 machines for
session replication

For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of these
machines . I configured mod_jk load balancer for sticky session and deployed
JPetStore on either of them .
But once I start tomcat and apache on either machine and try to do some
transactions , I cannot see any sessions being exchanged between the two
members of the cluster.

The JPetStore application also uses a database (hsqldb) and its necessary to
start one on either machine (it is not a shared one).

I was reading some documentation regarding if the session attributes are to
be implemented from serializable interface...but I see they already have
been in the source code .

I will be greateful if anyone could help me out and give a  good insight on
where I am going wrong ?
I have attached the server.xml , workers.properties and catalina.out for the
two nodes in the attached file.
Any help is deeply appreciated !

Best Regards !!
Anupam

http://www.nabble.com/file/p20456399/clustering_files.rar
clustering_files.rar 
-- 
View this message in context: http://www.nabble.com/Session-replication-for-JPetStore-application-in-tomcat-6-tp20456399p20456399.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session replication for JPetStore application in tomcat 6

Posted by Alan Chaney <al...@compulsivecreative.com>.
Anupam

I think this is probably your problem. You create and save information 
in one node and then look to see if it is in the other node. It will 
only be there if you are independently synchronizing the database state, 
because, as you said in your previous emails, they are independent. The 
database state is nothing to do with the http session, you must manage 
that separately.
>
> 2) Is it necessary to make the petstore database on each of nodes clustered
> for session replication to happen ?
>
>   
Regards

Alan Chaney


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session replication for JPetStore application in tomcat 6

Posted by Anupam Beri <an...@gmail.com>.
Thanks a lot Filip !
Well I tried to set up the log4j.properties at the server as well as the
application level  to include these categories but it dosent seem to work,
i.e I couldnt see the traces specific to sessions .

Is there any specific trace that could enable the sessionID to appear in the
logs, i .e the ID being replicated to the other nodes ?

I also read that the session attributes must be implemented with a
serializable interface. For the jpetstore application , does this mean that
the data items that are pushed into the cart also be serializable?
Sorry for too many questions but  a bit confused.

Best Regards,
Anupam 



Filip Hanik - Dev Lists wrote:
> 
> you could enable tracing for the two following categories
> 
> org.apache.catalina.ha
> org.apache.catalina.tribes.MESSAGES
> 
> Filip
> 
> Anupam Beri wrote:
>> Hello  Filip,
>> Thanks a lot for your reply. From the logs , the session state send is
>> evident .The scenario i tried is as follows ....
>>
>>  I opened the application  web page on the first node via my browser ,
>> logged in , did some operations like some additions and modifications. I
>> displayed the items in the cart .
>>  
>> Then I opened the same application web page on the second node via
>> browser
>> and tried to display the items in the cart and it said that the Cart is
>> empty .
>>
>> I had a few questions ...
>>
>> 1) how can I know if session replication is happening i.e any special
>> debugging can be enabled in log4j ? (from above scenario , the items in
>> the
>> cart should be the same ? can this be the criteria ?)
>>
>> 2) Is it necessary to make the petstore database on each of nodes
>> clustered
>> for session replication to happen ?
>>
>> I wish to do some load testing too with jmeter to see how the load is
>> distributed between workers.
>>
>> Any help will be greatefully appreciated !
>>
>> Best Regards,
>> Anupam
>>
>>
>>  
>>
>>
>>
>>
>> Filip Hanik - Dev Lists wrote:
>>   
>>> looks like its working, what is it that you don't think is working or 
>>> would like help with?
>>>
>>> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
>>> getAllClusterSessions
>>> ATTENTION: Manager [localhost#/jpetstore], requesting session state from 
>>> org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 
>>> 14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 
>>> -91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, 
>>> ]. This operation will timeout if no session state has been received 
>>> within 60 seconds.
>>> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
>>> waitForSendAllSessions
>>> INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 
>>> 17:08 received in 112 ms.
>>>
>>> Filip
>>>
>>> Anupam Beri wrote:
>>>     
>>>> Hello All ,
>>>>                        I am a newbie to the Tomcat and Tomcat
>>>> clustering
>>>> environment .I was just going through some posts on this forum for
>>>> reference
>>>> .
>>>> I wish to deploy the classic JPetStore application which comes with the
>>>> Spring framework in the clustered environment involving 2 machines for
>>>> session replication
>>>>
>>>> For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of
>>>> these
>>>> machines . I configured mod_jk load balancer for sticky session and
>>>> deployed
>>>> JPetStore on either of them .
>>>> But once I start tomcat and apache on either machine and try to do some
>>>> transactions , I cannot see any sessions being exchanged between the
>>>> two
>>>> members of the cluster.
>>>>
>>>> The JPetStore application also uses a database (hsqldb) and its
>>>> necessary
>>>> to
>>>> start one on either machine (it is not a shared one).
>>>>
>>>> I was reading some documentation regarding if the session attributes
>>>> are
>>>> to
>>>> be implemented from serializable interface...but I see they already
>>>> have
>>>> been in the source code .
>>>>
>>>> I will be greateful if anyone could help me out and give a  good
>>>> insight
>>>> on
>>>> where I am going wrong ?
>>>> I have attached the server.xml , workers.properties and catalina.out
>>>> for
>>>> the
>>>> two nodes in the attached file.
>>>> Any help is deeply appreciated !
>>>>
>>>> Best Regards !!
>>>> Anupam
>>>>
>>>> http://www.nabble.com/file/p20456399/clustering_files.rar
>>>> clustering_files.rar 
>>>>   
>>>>       
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Session-replication-for-JPetStore-application-in-tomcat-6-tp20456399p20479064.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session replication for JPetStore application in tomcat 6

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
you could enable tracing for the two following categories

org.apache.catalina.ha
org.apache.catalina.tribes.MESSAGES

Filip

Anupam Beri wrote:
> Hello  Filip,
> Thanks a lot for your reply. From the logs , the session state send is
> evident .The scenario i tried is as follows ....
>
>  I opened the application  web page on the first node via my browser ,
> logged in , did some operations like some additions and modifications. I
> displayed the items in the cart .
>  
> Then I opened the same application web page on the second node via browser
> and tried to display the items in the cart and it said that the Cart is
> empty .
>
> I had a few questions ...
>
> 1) how can I know if session replication is happening i.e any special
> debugging can be enabled in log4j ? (from above scenario , the items in the
> cart should be the same ? can this be the criteria ?)
>
> 2) Is it necessary to make the petstore database on each of nodes clustered
> for session replication to happen ?
>
> I wish to do some load testing too with jmeter to see how the load is
> distributed between workers.
>
> Any help will be greatefully appreciated !
>
> Best Regards,
> Anupam
>
>
>  
>
>
>
>
> Filip Hanik - Dev Lists wrote:
>   
>> looks like its working, what is it that you don't think is working or 
>> would like help with?
>>
>> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
>> getAllClusterSessions
>> ATTENTION: Manager [localhost#/jpetstore], requesting session state from 
>> org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 
>> 14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 
>> -91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, 
>> ]. This operation will timeout if no session state has been received 
>> within 60 seconds.
>> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
>> waitForSendAllSessions
>> INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 
>> 17:08 received in 112 ms.
>>
>> Filip
>>
>> Anupam Beri wrote:
>>     
>>> Hello All ,
>>>                        I am a newbie to the Tomcat and Tomcat clustering
>>> environment .I was just going through some posts on this forum for
>>> reference
>>> .
>>> I wish to deploy the classic JPetStore application which comes with the
>>> Spring framework in the clustered environment involving 2 machines for
>>> session replication
>>>
>>> For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of
>>> these
>>> machines . I configured mod_jk load balancer for sticky session and
>>> deployed
>>> JPetStore on either of them .
>>> But once I start tomcat and apache on either machine and try to do some
>>> transactions , I cannot see any sessions being exchanged between the two
>>> members of the cluster.
>>>
>>> The JPetStore application also uses a database (hsqldb) and its necessary
>>> to
>>> start one on either machine (it is not a shared one).
>>>
>>> I was reading some documentation regarding if the session attributes are
>>> to
>>> be implemented from serializable interface...but I see they already have
>>> been in the source code .
>>>
>>> I will be greateful if anyone could help me out and give a  good insight
>>> on
>>> where I am going wrong ?
>>> I have attached the server.xml , workers.properties and catalina.out for
>>> the
>>> two nodes in the attached file.
>>> Any help is deeply appreciated !
>>>
>>> Best Regards !!
>>> Anupam
>>>
>>> http://www.nabble.com/file/p20456399/clustering_files.rar
>>> clustering_files.rar 
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>     
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session replication for JPetStore application in tomcat 6

Posted by Anupam Beri <an...@gmail.com>.
Hello  Filip,
Thanks a lot for your reply. From the logs , the session state send is
evident .The scenario i tried is as follows ....

 I opened the application  web page on the first node via my browser ,
logged in , did some operations like some additions and modifications. I
displayed the items in the cart .
 
Then I opened the same application web page on the second node via browser
and tried to display the items in the cart and it said that the Cart is
empty .

I had a few questions ...

1) how can I know if session replication is happening i.e any special
debugging can be enabled in log4j ? (from above scenario , the items in the
cart should be the same ? can this be the criteria ?)

2) Is it necessary to make the petstore database on each of nodes clustered
for session replication to happen ?

I wish to do some load testing too with jmeter to see how the load is
distributed between workers.

Any help will be greatefully appreciated !

Best Regards,
Anupam


 




Filip Hanik - Dev Lists wrote:
> 
> looks like its working, what is it that you don't think is working or 
> would like help with?
> 
> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
> getAllClusterSessions
> ATTENTION: Manager [localhost#/jpetstore], requesting session state from 
> org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 
> 14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 
> -91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, 
> ]. This operation will timeout if no session state has been received 
> within 60 seconds.
> 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
> waitForSendAllSessions
> INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 
> 17:08 received in 112 ms.
> 
> Filip
> 
> Anupam Beri wrote:
>> Hello All ,
>>                        I am a newbie to the Tomcat and Tomcat clustering
>> environment .I was just going through some posts on this forum for
>> reference
>> .
>> I wish to deploy the classic JPetStore application which comes with the
>> Spring framework in the clustered environment involving 2 machines for
>> session replication
>>
>> For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of
>> these
>> machines . I configured mod_jk load balancer for sticky session and
>> deployed
>> JPetStore on either of them .
>> But once I start tomcat and apache on either machine and try to do some
>> transactions , I cannot see any sessions being exchanged between the two
>> members of the cluster.
>>
>> The JPetStore application also uses a database (hsqldb) and its necessary
>> to
>> start one on either machine (it is not a shared one).
>>
>> I was reading some documentation regarding if the session attributes are
>> to
>> be implemented from serializable interface...but I see they already have
>> been in the source code .
>>
>> I will be greateful if anyone could help me out and give a  good insight
>> on
>> where I am going wrong ?
>> I have attached the server.xml , workers.properties and catalina.out for
>> the
>> two nodes in the attached file.
>> Any help is deeply appreciated !
>>
>> Best Regards !!
>> Anupam
>>
>> http://www.nabble.com/file/p20456399/clustering_files.rar
>> clustering_files.rar 
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Session-replication-for-JPetStore-application-in-tomcat-6-tp20456399p20464726.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session replication for JPetStore application in tomcat 6

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
looks like its working, what is it that you don't think is working or 
would like help with?

6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
ATTENTION: Manager [localhost#/jpetstore], requesting session state from 
org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 
14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 
-91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, 
]. This operation will timeout if no session state has been received 
within 60 seconds.
6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager 
waitForSendAllSessions
INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 
17:08 received in 112 ms.

Filip

Anupam Beri wrote:
> Hello All ,
>                        I am a newbie to the Tomcat and Tomcat clustering
> environment .I was just going through some posts on this forum for reference
> .
> I wish to deploy the classic JPetStore application which comes with the
> Spring framework in the clustered environment involving 2 machines for
> session replication
>
> For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of these
> machines . I configured mod_jk load balancer for sticky session and deployed
> JPetStore on either of them .
> But once I start tomcat and apache on either machine and try to do some
> transactions , I cannot see any sessions being exchanged between the two
> members of the cluster.
>
> The JPetStore application also uses a database (hsqldb) and its necessary to
> start one on either machine (it is not a shared one).
>
> I was reading some documentation regarding if the session attributes are to
> be implemented from serializable interface...but I see they already have
> been in the source code .
>
> I will be greateful if anyone could help me out and give a  good insight on
> where I am going wrong ?
> I have attached the server.xml , workers.properties and catalina.out for the
> two nodes in the attached file.
> Any help is deeply appreciated !
>
> Best Regards !!
> Anupam
>
> http://www.nabble.com/file/p20456399/clustering_files.rar
> clustering_files.rar 
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org