You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sp...@gmx.eu on 2013/11/08 20:14:21 UTC

PersistentManager + JdbcStore

Hi,

is it possible to use the PersistentManager + JdbcStore to enable a 100%
failover/cluster solution for sessions?
As far as I can see not, because the session data is written async into the
database and only in a min. interval of 1 s.
Is this right?

Thank you


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


RE: PersistentManager + JdbcStore

Posted by Igor Cicimov <ic...@gmail.com>.
On 09/11/2013 6:41 AM, <sp...@gmx.eu> wrote:
>
> > If you need
> > sessions replicated as changes occur then you'll want to look
> > at a different solution, like the built-in cluster support.
>
> Unfortunately it does not work on AWS, no multicast.
>
Cant you use static membership instead mcast?

> I think I will fix the DynamoDB-Sessionmanager.
>
> Thank you
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

RE: PersistentManager + JdbcStore

Posted by sp...@gmx.eu.
> Given some method of automatic discovery, other than 
> multicast, it sounds like you could still use Tomcat's 
> clustering support.  So perhaps you could write your own 
> membership service?  

Yes, I think with Jgroups + S3 ping this could be solved.
But since both ClusterManagers are based on ManagerBase too and they have to
option for synchronous replication, it should be possible with a central
session store (e.g. JdbcStore) too? But I cannot find the magic to replace
the async background processing with sync. processing... Any idea?

An alternative could be to use a servlet filter to store/load the session
but this sounds a bit strange to me, because I would roll my complete own
session handling solution... 


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


Re: PersistentManager + JdbcStore

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Nov 9, 2013, at 8:42 AM, spring@gmx.eu wrote:

>>>> I think I will fix the DynamoDB-Sessionmanager.
>>> 
>>> Also an option.  
>> 
>> Already in process it seems ;)
>> 
>> https://github.com/aws/aws-dynamodb-session-tomcat/issues/3
>> 
>> I hope they will use the code from tomcat for managing the classloader
>> issues.
> 
> Well, just realized that this Manager is based on PersistentManagerBase.
> So I see no improvement in terms of reliability, because it still writes the
> data async into DynamoDB.
> I even cannot see the reason why they created DynamoDBSessionManager,
> DynamoDBSessionStore would have done the job too then.
> 
> Looking into the Manager interface (public void backgroundProcess()) tells
> me, that it seems to be always async?
> 
> So what is the right stategy to distribute sessions across an arbitrary
> amount of servers with a 100% guarantee that the session will be found at
> any time on any server?

Given some method of automatic discovery, other than multicast, it sounds like you could still use Tomcat's clustering support.  So perhaps you could write your own membership service?  

   http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/MembershipService.java?view=markup

Dan

> 
> Thank you
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


RE: PersistentManager + JdbcStore

Posted by Martin Gainty <mg...@hotmail.com>.
..Quizas..

 

http://kickjava.com/src/com/lutris/appserver/server/sessionContainerAdapter/JmxContainerAdapterSessionManager.java.htm


(Installar como agente JMX)

Saludos Cordiales
Martin 
______________________________________________ 
Porfavor..no altere ni interrumpir esta communication...Gracias

  



> Date: Sat, 9 Nov 2013 16:07:42 -0300
> Subject: Re: PersistentManager + JdbcStore
> From: jbig1782@gmail.com
> To: users@tomcat.apache.org
> 
> Thanks for this post, but the problem that I have is uncertain. My
> application is Java Web and creates a session for the user in Tomcat
> (version apache-tomcat-7.0.29) and an unusual one user captures the user
> session without finding an explanation.
> 
> Could you help me or tell me who to contact to find out how Tomcat creates
> and validates sessions created and if possible capture the session of
> another user from different computers.
> 
> Best Regards
> 
> 
> 2013/11/9 <sp...@gmx.eu>
> 
> > > > > I think I will fix the DynamoDB-Sessionmanager.
> > > >
> > > > Also an option.
> > >
> > > Already in process it seems ;)
> > >
> > > https://github.com/aws/aws-dynamodb-session-tomcat/issues/3
> > >
> > > I hope they will use the code from tomcat for managing the classloader
> > > issues.
> >
> > Well, just realized that this Manager is based on PersistentManagerBase.
> > So I see no improvement in terms of reliability, because it still writes
> > the
> > data async into DynamoDB.
> > I even cannot see the reason why they created DynamoDBSessionManager,
> > DynamoDBSessionStore would have done the job too then.
> >
> > Looking into the Manager interface (public void backgroundProcess()) tells
> > me, that it seems to be always async?
> >
> > So what is the right stategy to distribute sessions across an arbitrary
> > amount of servers with a 100% guarantee that the session will be found at
> > any time on any server?
> >
> > Thank you
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
 		 	   		  

Re: PersistentManager + JdbcStore

Posted by Jose Irrazabal <jb...@gmail.com>.
Thanks for this post, but the problem that I have is uncertain. My
application is Java Web and creates a session for the user in Tomcat
(version apache-tomcat-7.0.29) and an unusual one user captures the user
session without finding an explanation.

Could you help me or tell me who to contact to find out how Tomcat creates
and validates sessions created and if possible capture the session of
another user from different computers.

Best Regards


2013/11/9 <sp...@gmx.eu>

> > > > I think I will fix the DynamoDB-Sessionmanager.
> > >
> > > Also an option.
> >
> > Already in process it seems ;)
> >
> > https://github.com/aws/aws-dynamodb-session-tomcat/issues/3
> >
> > I hope they will use the code from tomcat for managing the classloader
> > issues.
>
> Well, just realized that this Manager is based on PersistentManagerBase.
> So I see no improvement in terms of reliability, because it still writes
> the
> data async into DynamoDB.
> I even cannot see the reason why they created DynamoDBSessionManager,
> DynamoDBSessionStore would have done the job too then.
>
> Looking into the Manager interface (public void backgroundProcess()) tells
> me, that it seems to be always async?
>
> So what is the right stategy to distribute sessions across an arbitrary
> amount of servers with a 100% guarantee that the session will be found at
> any time on any server?
>
> Thank you
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: PersistentManager + JdbcStore

Posted by sp...@gmx.eu.
> > > I think I will fix the DynamoDB-Sessionmanager.
> > 
> > Also an option.  
> 
> Already in process it seems ;)
> 
> https://github.com/aws/aws-dynamodb-session-tomcat/issues/3
> 
> I hope they will use the code from tomcat for managing the classloader
> issues.

Well, just realized that this Manager is based on PersistentManagerBase.
So I see no improvement in terms of reliability, because it still writes the
data async into DynamoDB.
I even cannot see the reason why they created DynamoDBSessionManager,
DynamoDBSessionStore would have done the job too then.

Looking into the Manager interface (public void backgroundProcess()) tells
me, that it seems to be always async?

So what is the right stategy to distribute sessions across an arbitrary
amount of servers with a 100% guarantee that the session will be found at
any time on any server?

Thank you


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


RE: PersistentManager + JdbcStore

Posted by sp...@gmx.eu.
> Multicast is not a requirement, that just defines how Tomcat 
> nodes will locate each other.  Since multicast is not 
> available for you, you could statically list your Tomcat 
> nodes in your configuration.
> 
>    
> https://tomcat.apache.org/tomcat-7.0-doc/config/cluster-interc
> eptor.html#Static_Membership

a) Since instances come up and down occasionally and IPs are not fixed, this
is not an option on AWS.
b) Furthermore DeltaManager is not applicable for large instances counts and
BackupManager is impossible too, because of a).

> > I think I will fix the DynamoDB-Sessionmanager.
> 
> Also an option.  

Already in process it seems ;)

https://github.com/aws/aws-dynamodb-session-tomcat/issues/3

I hope they will use the code from tomcat for managing the classloader
issues.


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


Re: PersistentManager + JdbcStore

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Nov 8, 2013, at 2:41 PM, <sp...@gmx.eu> wrote:

>> If you need 
>> sessions replicated as changes occur then you'll want to look 
>> at a different solution, like the built-in cluster support.
> 
> Unfortunately it does not work on AWS, no multicast.

Multicast is not a requirement, that just defines how Tomcat nodes will locate each other.  Since multicast is not available for you, you could statically list your Tomcat nodes in your configuration.

   https://tomcat.apache.org/tomcat-7.0-doc/config/cluster-interceptor.html#Static_Membership

> 
> I think I will fix the DynamoDB-Sessionmanager.

Also an option.  I think there is a similar items for Redis and MongoDb too.  I've not used any of them though, so I can't comment on their fitness.

Dan

> 
> Thank you
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


RE: PersistentManager + JdbcStore

Posted by sp...@gmx.eu.
> If you need 
> sessions replicated as changes occur then you'll want to look 
> at a different solution, like the built-in cluster support.

Unfortunately it does not work on AWS, no multicast.

I think I will fix the DynamoDB-Sessionmanager.

Thank you


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


Re: PersistentManager + JdbcStore

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Nov 8, 2013, at 2:14 PM, spring@gmx.eu wrote:

> Hi,
> 
> is it possible to use the PersistentManager + JdbcStore to enable a 100%
> failover/cluster solution for sessions?

You could, but I'm not sure that's it's intended purpose.  As I understand it, the PersistentManager is for pushing session data that hasn't been used in a while out of memory, thus allow a Tomcat server to handle more sessions with less memory.

> As far as I can see not, because the session data is written async into the
> database and only in a min. interval of 1 s.
> Is this right?

This is my understanding as well.  Sessions are persisted to the database periodically instead of on-demand.  If you need sessions replicated as changes occur then you'll want to look at a different solution, like the built-in cluster support.

Dan

> 
> Thank you
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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